Factorio.com|Forums|Wiki|Mod Portal|API Docs

# Factorio Runtime Docs Version 2.0.77

# LuaLogisticSection - Runtime Docs

## Class LuaLogisticSection

Logistic section of a particular LuaLogisticPoint or LuaConstantCombinatorControlBehavior.

## Members

set_slot(slot_index, filter) | → LogisticFilterIndex? | Sets logistic request and auto-trash slot to the given value. [...]
Sets logistic request and auto-trash slot to the given value. [...]
get_slot(slot_index) | → LogisticFilter | Gets current settings of logistic request and auto-trash from the given slot.
Gets current settings of logistic request and auto-trash from the given slot.
clear_slot(slot_index) |  | Clears the logistic request and auto-trash from the given slot. [...]
Clears the logistic request and auto-trash from the given slot. [...]
owner | :: R LuaEntity | The LuaEntity owner of this LuaLogisticSection.
The LuaEntity owner of this LuaLogisticSection.
index | :: R uint32 | The section index of this section.
The section index of this section.
filters | :: RW array[LogisticFilter] | The logistic filters for this section. [...]
The logistic filters for this section. [...]
filters_count | :: R uint32 | Amount of filters this section has
Amount of filters this section has
group | :: RW string | The group this section belongs to. [...]
The group this section belongs to. [...]
type | :: R defines.logistic_section_type | The type of this logistic section. [...]
The type of this logistic section. [...]
is_manual | :: R boolean | Shortcut to check whether LuaLogisticSection::type is equal to manual.
Shortcut to check whether LuaLogisticSection::type is equal to manual.
active | :: RW boolean | Whether this section is active. [...]
Whether this section is active. [...]
multiplier | :: RW float | Multiplier applied to all filters before they are used by game. [...]
Multiplier applied to all filters before they are used by game. [...]
valid | :: R boolean | Is this object valid? [...]
Is this object valid? [...]
object_name | :: R string | The class name of this object. [...]
The class name of this object. [...]

## Methods

### set_slot(slot_index, filter) → LogisticFilterIndex?

Sets logistic request and auto-trash slot to the given value.

This will silently fail if personal logistics are not researched yet.

This can only be called when the section is manual.

#### Parameters

slot_index | :: LogisticFilterIndex | Index of a slot to set.
Index of a slot to set.
filter | :: LogisticFilter | The details of the filter to set.
The details of the filter to set.

#### Return values

→ LogisticFilterIndex? | The existing index for the given filter or nil if the filter was successfully set.

#### Raised events

on_entity_logistic_slot_changed? instantly | Raised if setting of logistic slot was successful.

### get_slot(slot_index) → LogisticFilter

Gets current settings of logistic request and auto-trash from the given slot.

#### Parameters

slot_index | :: LogisticFilterIndex | Index of a slot to read.
Index of a slot to read.

### clear_slot(slot_index)

Clears the logistic request and auto-trash from the given slot.

This can only be called when the section is manual.

#### Parameters

slot_index | :: LogisticFilterIndex | Index of a slot to clear.
Index of a slot to clear.

## Attributes

### owner :: Read LuaEntity

The LuaEntity owner of this LuaLogisticSection.

### index :: Read uint32

The section index of this section.

### filters :: Read|Write array[LogisticFilter]

The logistic filters for this section.

This can only be written to when the section is manual.

### filters_count :: Read uint32

Amount of filters this section has

### group :: Read|Write string

The group this section belongs to.

An empty string when in no group.

This can only be written to when the section is manual.

### type :: Read defines.logistic_section_type

The type of this logistic section. Sections that are not manual are controlled by game itself and may not be allowed to be changed by script.

### is_manual :: Read boolean

Shortcut to check whether LuaLogisticSection::type is equal to manual.

### active :: Read|Write boolean

Whether this section is active. This can only be written to when the section is manual.

### multiplier :: Read|Write float

Multiplier applied to all filters before they are used by game. This can only be written to when the section is manual.

### valid :: Read boolean

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 :: Read string

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.

Class used in

- LuaConstantCombinatorControlBehavior::add_section()
- LuaConstantCombinatorControlBehavior::get_section()
- LuaConstantCombinatorControlBehavior::sections
- LuaLogisticPoint::add_section()
- LuaLogisticPoint::get_section()
- LuaLogisticPoint::sections
- LuaLogisticSections::add_section()
- LuaLogisticSections::get_section()
- LuaLogisticSections::sections
- LogisticGroup
- RegistrationTarget
- on_entity_logistic_slot_changed