Page 1 of 1
May I ask how to clean items held by a robotic arm
Posted: Thu Feb 06, 2025 10:41 am
by sdgmlj
I am currently writing a mod for entity cloning, but there will be some residue after the cloning is completed, such as the handheld items of the robotic arm being copied together. How can I clean it up? thank you
The robotic arm I'm referring to is the 'inserter'. I couldn't find any instructions for cleaning. Can you help me?
Re: May I ask how to clean items held by a robotic arm
Posted: Thu Feb 06, 2025 11:38 am
by sdgmlj
Code: Select all
if entity.type == "inserter" then
local stack = entity.held_stack
if stack.valid_for_read
then stack.clear()
end
end
if entity.has_items_inside()
then entity.clear_items_inside()
end
if entity.get_fluid_count() > 0
then entity.clear_fluid_inside()
end
Why are there still a small amount of residual items?
Re: May I ask how to clean items held by a robotic arm
Posted: Thu Feb 06, 2025 1:04 pm
by sdgmlj
I understand the reason now. It's not a problem with the robotic arm, it's the machine that has ongoing work and is still working after cloning. So, how can we make the machine cancel the ongoing work?
Re: May I ask how to clean items held by a robotic arm
Posted: Thu Feb 06, 2025 1:52 pm
by Natha
Re: May I ask how to clean items held by a robotic arm
Posted: Thu Feb 06, 2025 4:06 pm
by sdgmlj
Thank you, friend. This works, but what about the stove?