LuaControlBehavior

class LuaControlBehavior
get_circuit_network(wire, circuit_connector) → LuaCircuitNetwork
type :: defines.control_behavior.type [R] The concrete type of this control behavior.
entity :: LuaEntity [R] The entity this control behavior belongs to.
class LuaAccumulatorControlBehavior extends LuaControlBehavior
valid :: boolean [R] Is this object valid?
Inherited from LuaControlBehavior: get_circuit_network, type, entity
class LuaCombinatorControlBehavior extends LuaControlBehavior
get_signal_last_tick(signal) Gets the value of a specific signal sent by this combinator behavior last tick or nil if the signal didn't exist.
signals_last_tick :: array of Signal [R] The circuit network signals sent by this combinator last tick.
class LuaConstantCombinatorControlBehavior extends LuaControlBehavior
parameters :: ConstantCombinatorParameters [RW] The constant combinator parameters
enabled :: boolean [RW] Turns this constant combinator on and off.
valid :: boolean [R] Is this object valid?
Inherited from LuaControlBehavior: get_circuit_network, type, entity
class LuaContainerControlBehavior extends LuaControlBehavior
valid :: boolean [R] Is this object valid?
Inherited from LuaControlBehavior: get_circuit_network, type, entity
class LuaGenericOnOffControlBehavior extends LuaControlBehavior
disabled :: boolean [R] If the entity is currently disabled because of the control behavior.
circuit_condition :: CircuitConditionSpecification [RW] The circuit condition.
logistic_condition :: CircuitConditionSpecification [RW] The logistic condition.
connect_to_logistic_network :: boolean [RW] true if this should connect to the logitic network.
valid :: boolean [R] Is this object valid?
Inherited from LuaControlBehavior: get_circuit_network, type, entity
class LuaLogisticContainerControlBehavior extends LuaControlBehavior
circuit_mode_of_operation :: defines.control_behavior.logistic_container.circuit_mode_of_operation [RW] The circuit mode of operations for the logistic container.
valid :: boolean [R] Is this object valid?
Inherited from LuaControlBehavior: get_circuit_network, type, entity
class LuaRailSignalControlBehavior extends LuaControlBehavior
valid :: boolean [R] Is this object valid?
Inherited from LuaControlBehavior: get_circuit_network, type, entity
class LuaRoboportControlBehavior extends LuaControlBehavior
mode_of_operations :: defines.control_behavior.roboport.circuit_mode_of_operation [RW]
available_logistic_output_signal :: SignalID [RW]
total_logistic_output_signal :: SignalID [RW]
available_construction_output_signal :: SignalID [RW]
total_construction_output_signal :: SignalID [RW]
valid :: boolean [R] Is this object valid?
Inherited from LuaControlBehavior: get_circuit_network, type, entity
class LuaStorageTankControlBehavior extends LuaControlBehavior
valid :: boolean [R] Is this object valid?
Inherited from LuaControlBehavior: get_circuit_network, type, entity
class LuaTrainStopControlBehavior extends LuaControlBehavior
send_to_train :: boolean [RW] true if the train stop should send the circuit network contents to the train to use.
valid :: boolean [R] Is this object valid?
Inherited from LuaControlBehavior: get_circuit_network, type, entity
class LuaWallControlBehavior extends LuaControlBehavior
circuit_condition :: CircuitConditionSpecification [RW] The circuit condition.
valid :: boolean [R] Is this object valid?
Inherited from LuaControlBehavior: get_circuit_network, type, entity
class LuaArithmeticCombinatorControlBehavior extends LuaCombinatorControlBehavior
parameters :: ArithmeticCombinatorParameters [RW] The arithmetic combinator parameters.
valid :: boolean [R] Is this object valid?
Inherited from LuaControlBehavior: get_circuit_network, type, entity
Inherited from LuaCombinatorControlBehavior: get_signal_last_tick, signals_last_tick
class LuaDeciderCombinatorControlBehavior extends LuaCombinatorControlBehavior
parameters :: DeciderCombinatorParameters [RW] The decider combinator parameters
valid :: boolean [R] Is this object valid?
Inherited from LuaControlBehavior: get_circuit_network, type, entity
Inherited from LuaCombinatorControlBehavior: get_signal_last_tick, signals_last_tick
class LuaInserterControlBehavior extends LuaGenericOnOffControlBehavior
circuit_read_hand_contents :: boolean [RW] true if the contents of the inserter hand should be sent to the circuit network
circuit_mode_of_operation :: defines.control_behavior.inserter.circuit_mode_of_operation [RW] The circuit mode of operations for the inserter.
circuit_hand_read_mode :: defines.control_behavior.inserter.hand_read_mode [RW] The hand read mode for the inserter.
valid :: boolean [R] Is this object valid?
Inherited from LuaControlBehavior: get_circuit_network, type, entity
Inherited from LuaGenericOnOffControlBehavior: disabled, circuit_condition, logistic_condition, connect_to_logistic_network
class LuaLampControlBehavior extends LuaGenericOnOffControlBehavior
use_colors :: boolean [RW] true if the lamp should set the color from the circuit network signals.
valid :: boolean [R] Is this object valid?
Inherited from LuaControlBehavior: get_circuit_network, type, entity
Inherited from LuaGenericOnOffControlBehavior: disabled, circuit_condition, logistic_condition, connect_to_logistic_network
class LuaTransportBeltControlBehavior extends LuaGenericOnOffControlBehavior
valid :: boolean [R] Is this object valid?
Inherited from LuaControlBehavior: get_circuit_network, type, entity
Inherited from LuaGenericOnOffControlBehavior: disabled, circuit_condition, logistic_condition, connect_to_logistic_network

LuaControlBehavior

The control behavior for an entity. Inserters have logistic network and circuit network behavior logic, lamps have circuit logic and so on. This is an abstract base class that concrete control behaviors inherit.

Note: An control reference becomes invalid once the control behavior is removed or the entity (see LuaEntity) it resides in is destroyed.
get_circuit_network(wire, circuit_connector) → LuaCircuitNetwork

Parameters
wire :: defines.wire_type: Wire colour of the network connected to this entity.
circuit_connector :: defines.circuit_connector_id (optional): The connector to get circuit network for. Must be specified for entities with more than one circuit network connector.
Return value
The circuit network or nil.
type :: defines.control_behavior.type [Read-only]

The concrete type of this control behavior.

entity :: LuaEntity [Read-only]

The entity this control behavior belongs to.

LuaAccumulatorControlBehavior

Control behavior for accumulators.

LuaCombinatorControlBehavior

get_signal_last_tick(signal)

Gets the value of a specific signal sent by this combinator behavior last tick or nil if the signal didn't exist.

The value or nil if none.

Parameters
signal :: SignalID: The signal to get
signals_last_tick :: array of Signal [Read-only]

The circuit network signals sent by this combinator last tick.

LuaConstantCombinatorControlBehavior

Control behavior for constant combinators.

parameters :: ConstantCombinatorParameters [Read-Write]

The constant combinator parameters

Note: parameters may be nil in order to clear the parameters.
enabled :: boolean [Read-Write]

Turns this constant combinator on and off.

LuaContainerControlBehavior

Control behavior for container entities -- smart chests.

LuaGenericOnOffControlBehavior

An abstract base class for behaviors that support switching the entity on or off based on some condition.

disabled :: boolean [Read-only]

If the entity is currently disabled because of the control behavior.

circuit_condition :: CircuitConditionSpecification [Read-Write]

The circuit condition.

Note: condition may be nil in order to clear the circuit condition.
Example
Tell an entity to be active (e.g. a lamp to be lit) when it receives a circuit signal of more than 4 chain signals.
a_behavior.circuit_condition = {condition={comparator=">",
                                           first_signal={type="item", name="rail-chain-signal"},
                                           constant=4}}
logistic_condition :: CircuitConditionSpecification [Read-Write]

The logistic condition.

Note: condition may be nil in order to clear the logistic condition.
Example
Tell an entity to be active (e.g. a lamp to be lit) when the logistics network it's connected to has more than 4 chain signals.
a_behavior.logistic_condition = {condition={comparator=">",
                                            first_signal={type="item", name="rail-chain-signal"},
                                            constant=4}}
connect_to_logistic_network :: boolean [Read-Write]

true if this should connect to the logitic network.

LuaLogisticContainerControlBehavior

Control behavior for logistic chests.

The circuit mode of operations for the logistic container.

LuaRailSignalControlBehavior

Control behavior for rail signals.

LuaRoboportControlBehavior

Control behavior for roboports.

available_logistic_output_signal :: SignalID [Read-Write]

total_logistic_output_signal :: SignalID [Read-Write]

available_construction_output_signal :: SignalID [Read-Write]

total_construction_output_signal :: SignalID [Read-Write]

LuaStorageTankControlBehavior

Control behavior for storage tanks.

LuaTrainStopControlBehavior

Control behavior for train stops.

send_to_train :: boolean [Read-Write]

true if the train stop should send the circuit network contents to the train to use.

LuaWallControlBehavior

Control behavior for walls.

circuit_condition :: CircuitConditionSpecification [Read-Write]

The circuit condition.

LuaArithmeticCombinatorControlBehavior

Control behavior for arithmetic combinators.

parameters :: ArithmeticCombinatorParameters [Read-Write]

The arithmetic combinator parameters.

Note: parameters may be nil in order to clear the parameters.

LuaDeciderCombinatorControlBehavior

Control behavior for decider combinators.

parameters :: DeciderCombinatorParameters [Read-Write]

The decider combinator parameters

Note: parameters may be nil in order to clear the parameters.

LuaInserterControlBehavior

Control behavior for smart inserters.

circuit_read_hand_contents :: boolean [Read-Write]

true if the contents of the inserter hand should be sent to the circuit network

circuit_mode_of_operation :: defines.control_behavior.inserter.circuit_mode_of_operation [Read-Write]

The circuit mode of operations for the inserter.

circuit_hand_read_mode :: defines.control_behavior.inserter.hand_read_mode [Read-Write]

The hand read mode for the inserter.

LuaLampControlBehavior

Control behavior for lamps.

use_colors :: boolean [Read-Write]

true if the lamp should set the color from the circuit network signals.

LuaTransportBeltControlBehavior

Control behavior for transport belts.