Page 1 of 1

limit inserters / bots to certain items

Posted: Tue Mar 13, 2018 3:39 pm
by nosports
Is it possible to limit (new, modded) inserters/bots to certain items/categorys ?

I did not find anything that will look like a payload category, only think is payload-size, but i think its more of numer of items to carry

Re: limit inserters / bots to certain items

Posted: Tue Mar 13, 2018 4:12 pm
by mrvn
For inserters there are filter inserters. You can set the filter from lua and hide the gui so users can't change it.

Re: limit inserters / bots to certain items

Posted: Tue Mar 13, 2018 5:13 pm
by eradicator
Inserter filters are hard-limited to a maximum of 5 filters though. So if you need more there's not any good solution. For bots there is no possibility at all.

Re: limit inserters / bots to certain items

Posted: Wed Mar 14, 2018 11:09 am
by nosports
mrvn wrote:For inserters there are filter inserters. You can set the filter from lua and hide the gui so users can't change it.
That were a way to go.....

as i am not a very avid lua-user - do you have some guides or examples for such inserters

Re: limit inserters / bots to certain items

Posted: Wed Mar 14, 2018 11:26 am
by darkfrei

Re: limit inserters / bots to certain items

Posted: Wed Mar 14, 2018 11:43 am
by eradicator
For disallowing the gui of an entity you need something like:

[code]script.on_event(defines.events.on_gui_opened,function(e)
if e.entity and e.entity.name == 'myentity' then
game.players[e.player_index].opened = nil
end
end)[/code]

Code: Select all

script.on_event(defines.events.on_built_entity,function(e)
  if e.created_entity.name == 'myentity' then
    e.created_entity.operable = false
    end
  end)

Re: limit inserters / bots to certain items

Posted: Wed Mar 14, 2018 11:48 am
by darkfrei
GUI disabling is easy by data stage:

Code: Select all

enable_gui = false
See https://mods.factorio.com/mods/darkfrei/RITEG

Or by control stage
http://lua-api.factorio.com/latest/LuaE ... y.operable

Re: limit inserters / bots to certain items

Posted: Wed Mar 14, 2018 1:00 pm
by eradicator
Oh right. Totally forgot about .operable. enable_gui is exclusive to the electric_energy_interface however and will have no effect on anything else. (Previous posts code has been updated)