How to get and set item-request-proxy slots
How to get and set item-request-proxy slots
How do you get and set the items in the item request proxy entites?
- Attachments
-
- Image1.jpg (139.11 KiB) Viewed 1354 times
Re: How to get and set item-request-proxy slots
Hi can,
use http://lua-api.factorio.com/latest/LuaE ... m_requests
To get the items use something like this:
To update the items it requests, you have to set the item_requests, not update it:
To create a proxy for an entity, you have to specify the target and the modules, see also viewtopic.php?f=25&t=40570:
use http://lua-api.factorio.com/latest/LuaE ... m_requests
To get the items use something like this:
Code: Select all
/c local p,s=game.player,game.player.selected for w,a in pairs(s.item_requests) do p.print(w .. \": \" .. a) end
Code: Select all
/c local p,s=game.player,game.player.selected s.item_requests={["speed-module"] = 2} for w,a in pairs(s.item_requests) do p.print(w .. \": \" .. a) end
Code: Select all
/c local p,s=game.player,game.player.selected p.surface.create_entity{name="item-request-proxy",target=s,force=s.force,position=s.position,modules={{item="speed-module",count=1}}}