LuaLogisticNetwork
A single logistic network of a given force on a given surface.
LuaLogisticNetwork
Count given or all items in the network or given members.
Get item counts for the entire network, similar to how LuaInventory::get_contents does.
Remove items from the logistic network.
Find logistic cell closest to a given position.
Find the 'best' logistic point with this item ID and from the given position or from given chest type.
Find a logistic point to drop the specific item stack.
Can the network satisfy a request for a given item and count.
Get the amount of items of the given type indexed by the storage member.
Gets the logistic points with of the given type indexed by the storage member.
Number of logistic robots available for a job.
The total number of logistic robots in the network (idle and active + in roboports).
Number of construction robots available for a job.
The total number of construction robots in the network (idle and active + in roboports).
Maximum number of robots the network can work with.
All cells in this network.
All entities that have empty logistic provider points in this network.
All entities that have logistic requester points in this network.
All other entities that have logistic points in this network (inserters mostly).
All things that have provider points in this network.
All passive provider points in this network.
All active provider points in this network.
All things that have empty provider points in this network.
All things that have requester points in this network.
All things that have storage points in this network.
All construction robots in this logistic network.
All logistic robots in this logistic network.
The class name of this object.
get_item_count(item?,
member?)
→
int
get_contents()
→
dictionary[string → uint]
Get item counts for the entire network, similar to how LuaInventory::get_contents does.
remove_item(item,
members?)
→
uint
Remove items from the logistic network. This will actually remove the items from some logistic chests.
What to remove.
Which logistic members to remove from. Must be "storage"
, "passive-provider"
, "buffer"
, or "active-provider"
. If not specified, removes from the network in the usual order.
Number of items removed.
insert(item,
members?)
→
uint
Insert items into the logistic network. This will actually insert the items into some logistic chests.
What to insert.
Which logistic members to insert the items to. Must be "storage"
, "storage-empty"
(storage chests that are completely empty), "storage-empty-slot"
(storage chests that have an empty slot), or "requester"
. If not specified, inserts items into the logistic network in the usual order.
Number of items actually inserted.
find_cell_closest_to(position)
→
LuaLogisticCell?
Find logistic cell closest to a given position.
nil
if no cell was found.
select_pickup_point{name=…,
position?=…,
include_buffers?=…,
members?=…}
→
LuaLogisticPoint?
Find the 'best' logistic point with this item ID and from the given position or from given chest type.
Name of the item to select.
When given, it will find the storage 'best' storage point from this position.
Whether to consider buffer chests or not. Defaults to false. Only considered if selecting with position.
When given, it will find from only the specific type of member. Must be "storage"
, "passive-provider"
, "buffer"
or "active-provider"
. If not specified, selects with normal priorities. Not considered if position is specified.
nil
if no point was found.
select_drop_point{stack=…,
members?=…}
→
LuaLogisticPoint?
Find a logistic point to drop the specific item stack.
Name of the item to select.
When given, it will find from only the specific type of member. Must be "storage"
, "storage-empty"
, "storage-empty-slot"
or "requester"
. If not specified, selects with normal priorities.
nil
if no point was found.
can_satisfy_request(item,
count?,
include_buffers?)
→
boolean
Can the network satisfy a request for a given item and count.
Item name to check.
Count to check. Defaults to 1.
Should buffers be considered? Defaults to false.
Whether the network can satisfy the request.
get_supply_points(item)
→
dictionary[string → array[LuaLogisticPoint]]
Gets the logistic points with of the given type indexed by the storage member.
Item name to check.
A mapping of member types ("storage", "passive-provider", "buffer", "active-provider") to an array of LuaLogisticPoint.
help()
→
string
All methods and properties that this object supports.
force
:: LuaForce
[Read]
The force this logistic network belongs to.
available_logistic_robots
:: uint
[Read]
Number of logistic robots available for a job.
all_logistic_robots
:: uint
[Read]
The total number of logistic robots in the network (idle and active + in roboports).
available_construction_robots
:: uint
[Read]
Number of construction robots available for a job.
all_construction_robots
:: uint
[Read]
The total number of construction robots in the network (idle and active + in roboports).
robot_limit
:: uint
[Read]
Maximum number of robots the network can work with. Currently only used for the personal roboport.
cells
:: array[LuaLogisticCell]
[Read]
All cells in this network.
providers
:: array[LuaEntity]
[Read]
All entities that have logistic provider points in this network.
empty_providers
:: array[LuaEntity]
[Read]
All entities that have empty logistic provider points in this network.
requesters
:: array[LuaEntity]
[Read]
All entities that have logistic requester points in this network.
storages
:: array[LuaEntity]
[Read]
All entities that have logistic storage points in this network.
logistic_members
:: array[LuaEntity]
[Read]
All other entities that have logistic points in this network (inserters mostly).
provider_points
:: array[LuaLogisticPoint]
[Read]
All things that have provider points in this network.
passive_provider_points
:: array[LuaLogisticPoint]
[Read]
All passive provider points in this network.
active_provider_points
:: array[LuaLogisticPoint]
[Read]
All active provider points in this network.
empty_provider_points
:: array[LuaLogisticPoint]
[Read]
All things that have empty provider points in this network.
requester_points
:: array[LuaLogisticPoint]
[Read]
All things that have requester points in this network.
storage_points
:: array[LuaLogisticPoint]
[Read]
All things that have storage points in this network.
robots
:: array[LuaEntity]
[Read]
All robots in this logistic network.
construction_robots
:: array[LuaEntity]
[Read]
All construction robots in this logistic network.
logistic_robots
:: array[LuaEntity]
[Read]
All logistic robots in this logistic network.
valid
:: boolean
[Read]
Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be false
. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access.
object_name
:: string
[Read]
The class name of this object. Available even when valid
is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct.