Home

LuaLogisticNetwork

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

Attributes

network_id

The unique logistic network ID.

custom_name

The custom logistic network name set by the player or by script, if any.

force

The force this logistic network belongs to.

available_logistic_robots

Number of logistic robots available for a job.

all_logistic_robots

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

available_construction_robots

Number of construction robots available for a job.

all_construction_robots

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

robot_limit

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

cells

All cells in this network.

providers

All entities that have logistic provider points in this network.

empty_providers

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

requesters

All entities that have logistic requester points in this network.

storages

All entities that have logistic storage points in this network.

logistic_members

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

provider_points

All things that have provider points in this network.

passive_provider_points

All passive provider points in this network.

active_provider_points

All active provider points in this network.

empty_provider_points

All things that have empty provider points in this network.

requester_points

All things that have requester points in this network.

storage_points

All things that have storage points in this network.

robots

All robots in this logistic network.

construction_robots

All construction robots in this logistic network.

logistic_robots

All logistic robots in this logistic network.

valid

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

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.

Methods

get_item_count

LuaLogisticNetwork.get_item_count(item?: ItemWithQualityID, member?: "storage" | "providers") -> int32

Call As

logisticNetwork.get_item_count()

Call Convention

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

Parameters

Returns

get_contents

LuaLogisticNetwork.get_contents(member?: "storage" | "providers") -> ItemWithQualityCounts

Call As

logisticNetwork.get_contents()

Call Convention

Get item counts for the entire network, similar to how LuaInventory::get_contents does.

Parameters

Returns

remove_item

LuaLogisticNetwork.remove_item(item: ItemStackIdentification, members?: "active-provider" | "passive-provider" | "buffer" | "storage") -> uint32

Call As

logisticNetwork.remove_item(item, members)

Call Convention

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

Parameters

Returns

insert

LuaLogisticNetwork.insert(item: ItemStackIdentification, members?: "storage" | "storage-empty" | "storage-empty-slot" | "requester") -> uint32

Call As

logisticNetwork.insert(item, members)

Call Convention

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

Parameters

Returns

find_cell_closest_to

LuaLogisticNetwork.find_cell_closest_to(position: MapPosition) -> LuaLogisticCell?

Call As

logisticNetwork.find_cell_closest_to(position)

Call Convention

Find logistic cell closest to a given position.

Parameters

Returns

select_pickup_point

LuaLogisticNetwork.select_pickup_point{ name: ItemWithQualityID, position?: MapPosition, include_buffers?: boolean, members?: "active-provider" | "passive-provider" | "buffer" | "storage" } -> LuaLogisticPoint?

Call As

logisticNetwork.select_pickup_point{ name="name" }

Call Convention

Find the 'best' logistic point with this item ID and from the given position or from given chest type.

Parameters

Returns

select_drop_point

LuaLogisticNetwork.select_drop_point{ stack: ItemStackIdentification, members?: "storage" | "storage-empty" | "storage-empty-slot" | "requester" } -> LuaLogisticPoint?

Call As

logisticNetwork.select_drop_point{ stack=stack }

Call Convention

Find a logistic point to drop the specific item stack.

Parameters

Returns

can_satisfy_request

LuaLogisticNetwork.can_satisfy_request(item: ItemWithQualityID, count?: uint32, include_buffers?: boolean) -> boolean

Call As

logisticNetwork.can_satisfy_request(item, count)

Call Convention

Can the network satisfy a request for a given item and count.

Parameters

Returns

get_supply_counts

LuaLogisticNetwork.get_supply_counts(item: ItemWithQualityID) -> LogisticsNetworkSupplyCounts

Call As

logisticNetwork.get_supply_counts(item)

Call Convention

Get the amount of items of the given type indexed by the storage member.

Parameters

Returns

get_supply_points

LuaLogisticNetwork.get_supply_points(item: ItemWithQualityID) -> LogisticsNetworkSupplyPoints

Call As

logisticNetwork.get_supply_points(item)

Call Convention

Gets the logistic points with of the given type indexed by the storage member.

Parameters

Returns