LuaLogisticNetwork

class LuaLogisticNetwork
get_item_count(item, member) → uint Count given or all items in the network or given members.
get_contents() → dictionary stringuint Get item counts for the entire network.
remove_item(item, members) → uint Remove items from the logistic network.
insert(item, members) → uint Insert items into the logistic network.
find_cell_closest_to(position) → LuaLogisticCell Find logistic cell closest to a given position.
valid :: boolean [R] Is this object valid?
available_logistic_robots :: uint [R] Number of logistic robots available for a job.
all_logistic_robots :: uint [R] The total number of logistic robots in the network (idle and active + in roboports).
available_construction_robots :: uint [R] Number of construction robots available for a job.
all_construction_robots :: uint [R] The total number of construction robots in the network (idle and active + in roboports).
robot_limit :: uint [R] Maximum number of robots the network can work with.
cells :: array of LuaLogisticCell [R] All cells in this network.
providers :: array of LuaEntity [R] All entities that have logistic provider points in this network.
empty_providers :: array of LuaEntity [R] All entities that have empty logistic provider points in this network.
requesters :: array of LuaEntity [R] All entities that have logistic requester points in this network.
full_or_satisfied_requesters :: array of LuaEntity [R] All entities that have full or satisfied logistic requester points in this network.
storages :: array of LuaEntity [R] All entities that have logistic storage points in this network.
logistic_members :: array of LuaEntity [R] All other entities that have logistic points in this network (inserters mostly).

A single logistic network of a given force on a given surface.

get_item_count(item, member) → uint

Count given or all items in the network or given members.

Parameters
item :: string (optional): Item name to count. If not given, gives counts of all items in the network.
member :: string (optional): Logistic members to check, must be either "storage" or "providers". If not given, gives count in the entire network.
get_contents() → dictionary stringuint

Get item counts for the entire network.

Return value
A mapping of item prototype names to the number available in the network.
remove_item(item, members) → uint

Remove items from the logistic network. This will actually remove the items from some logistic chests.

Parameters
item :: SimpleItemStack: What to remove.
members :: string (optional): Which logistic members to remove from. Must be "storage", "passive-provider", or "active-provider". If not specified, removes from the network in the usual order.
Return value
Number of items removed.
insert(item, members) → uint

Insert items into the logistic network. This will actually insert the items into some logistic chests.

Parameters
item :: LuaItemStack: What to insert.
members :: string (optional): 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.
Return value
Number of items actually inserted.
find_cell_closest_to(position) → LuaLogisticCell

Find logistic cell closest to a given position.

Parameters
position :: Position
Return value
May be nil if no cell was found.
valid :: boolean [Read-only]

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.

available_logistic_robots :: uint [Read-only]

Number of logistic robots available for a job.

all_logistic_robots :: uint [Read-only]

The total number of logistic robots in the network (idle and active + in roboports).

available_construction_robots :: uint [Read-only]

Number of construction robots available for a job.

all_construction_robots :: uint [Read-only]

The total number of construction robots in the network (idle and active + in roboports).

robot_limit :: uint [Read-only]

Maximum number of robots the network can work with. Currently only used for the personal roboport.

cells :: array of LuaLogisticCell [Read-only]

All cells in this network.

providers :: array of LuaEntity [Read-only]

All entities that have logistic provider points in this network.

empty_providers :: array of LuaEntity [Read-only]

All entities that have empty logistic provider points in this network.

requesters :: array of LuaEntity [Read-only]

All entities that have logistic requester points in this network.

full_or_satisfied_requesters :: array of LuaEntity [Read-only]

All entities that have full or satisfied logistic requester points in this network.

storages :: array of LuaEntity [Read-only]

All entities that have logistic storage points in this network.

logistic_members :: array of LuaEntity [Read-only]

All other entities that have logistic points in this network (inserters mostly).