If you remove the roboport then yes, they head to the nearest logistic network and are lost to the player.Zavian wrote:Not sure what would happen to the players construction bots that are already flying when you disable the player's roboports, but I think it's likely that they would start heading to the nearest available roboport, in which case disabling the roboport with bots out is problematic. (You could always simply tell players "Don't do that", but at least with the placeholder method the problems aren't any worse than current vanilla if bots launch before you remember to turn your roboport off).mrvn wrote:But what about bots currently outside the inventory? Or bots you pick up while the roboport is off? I think there is an event for inventory changes so it might be possible to catch those.
Even if the event isn't practical, you should be able to check the players inventory once per tick to catch any the player picks up. (Yes, I know a lua call every tick gets expensive, so the event would be preferable).
But the idea was to remove the bots, not the roboport. Any bots outside the inventory would remain functional and keep working. Only when they are idle and return to the inventory they would get replaced too. Unless there is some API to find all active bots of a player?