Answer
It looks like the API docs are incorrect, it does indeed accept a SimpleItemStack, so the below code should work as I had expected.Original Question
As far as I can tell, LuaLogisticNetwork.insert(item,members) requires as its first parameter a LuaItemStack.Also a LuaItemStack can't be instantiated as a new object via Lua, it can only be retrieved by acquiring one from some other object, usually representing a portion of an inventory somewhere, so manipulating the LuaItemStack will also manipulate the inventory that you acquired the object from.
This suggests that it isn't possible to, for example:
Code: Select all
local function add_10_iron-plate_to_logistic_network(logistic_network)
logistic_network.insert({ name="iron-plate", count=10 })
end
- iterate over all of the storage chests in the network
- find one with free space
- stick the items I want to add into that storage chest
Edit: indent code sample
Edit: add answer