Page 1 of 1

Personal roboport blacklist

Posted: Wed Mar 27, 2019 2:54 am
by SmotPokin42000
Ok, so I'm trying to make a mod to keep construction bots from grabbing items from chests marked for deconstruction, but I'm new to this and I'm not sure how to make this work.

Code: Select all

script.on_event({defines.events.on_robot_pre_mined},
   function
      game.print("A bot is about to mine an entity"..event.tick)
      if event.entity = ("container", "logistic-container")
         then event.robot 
      end
   end
)
So I have an idea of how to find decon'ed chests, but not how differentiate those from ones in range of the player or ones in range of a fixed roboport. I also no idea on how to stop the robot in question.
Any help would be appreciated.