LuaTransportLine

One line on a transport belt.

class LuaTransportLine - sort
clear() Remove all items from this transport line.
get_item_count(item) → uint Count some or all items on this line.
remove_item(items) → uint Remove some items from this line.
can_insert_at(position) → boolean Can an item be inserted at a given position?
can_insert_at_back() → boolean Can an item be inserted at the back of this line?
insert_at(position, items) → boolean Insert items at a given position.
insert_at_back(items) → boolean Insert items at the back of this line.
get_contents() → dictionary[stringuint] Get counts of all items on this line.
line_equals(other) → boolean Returns whether the associated internal transport line of this line is the same as the others associated internal transport line.
operator # :: uint [R] Get the number of items on this transport line.
owner :: LuaEntity [R] The entity this transport line belongs to.
output_lines :: array[LuaTransportLine] [R] The transport lines that this transport line outputs items to or an empty table if none.
input_lines :: array[LuaTransportLine] [R] The transport lines that this transport line is fed by or an empty table if none.
operator [] :: LuaItemStack [R] The indexing operator.
valid :: boolean [R] Is this object valid?
object_name :: string [R] The class name of this object.
help() → string All methods and properties that this object supports.
clear()

Remove all items from this transport line.

get_item_count(item) → uint

Count some or all items on this line.

Parameters
item :: string (optional): Prototype name of the item to count. If not specified, count all items.
remove_item(items) → uint

Remove some items from this line.

Parameters
items :: ItemStackIdentification: Items to remove.
Return value
Number of items actually removed.
can_insert_at(position) → boolean

Can an item be inserted at a given position?

Parameters
position :: float: Where to insert an item.
can_insert_at_back() → boolean

Can an item be inserted at the back of this line?

insert_at(position, items) → boolean

Insert items at a given position.

Parameters
position :: float: Where on the line to insert the items.
items :: ItemStackIdentification: Items to insert.
Return value
Were the items inserted successfully?
insert_at_back(items) → boolean

Insert items at the back of this line.

Parameters
Return value
Were the items inserted successfully?
get_contents() → dictionary[stringuint]

Get counts of all items on this line.

Return value
The counts, indexed by item names.
line_equals(other) → boolean

Returns whether the associated internal transport line of this line is the same as the others associated internal transport line.

Parameters
Note: This can return true even when the LuaTransportLine::owners are different (so this == other is false), because the internal transport lines can span multiple tiles.
operator # :: uint [Read-only]

Get the number of items on this transport line.

owner :: LuaEntity [Read-only]

The entity this transport line belongs to.

output_lines :: array[LuaTransportLine] [Read-only]

The transport lines that this transport line outputs items to or an empty table if none.

input_lines :: array[LuaTransportLine] [Read-only]

The transport lines that this transport line is fed by or an empty table if none.

operator [] :: LuaItemStack [Read-only]

The indexing operator.