LuaControlBehavior

class LuaControlBehavior - sort
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 - sort
output_signal :: SignalID [RW]
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaCombinatorControlBehavior extends LuaControlBehavior - sort
get_signal_last_tick(signal) → int 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 - sort
set_signal(index, ConstantCombiantorSignal) Sets the signal at the given index
get_signal(index) Gets the signal at the given index or nil if there is none.
parameters :: ConstantCombinatorParameters [RW] The constant combinator parameters
enabled :: boolean [RW] Turns this constant combinator on and off.
signals_count :: uint [R] The number of signals this constant combinator supports
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaContainerControlBehavior extends LuaControlBehavior - sort
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaGenericOnOffControlBehavior extends LuaControlBehavior - sort
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?
help() → string All methods, and properties that this object supports.
class LuaLogisticContainerControlBehavior extends LuaControlBehavior - sort
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?
help() → string All methods, and properties that this object supports.
class LuaProgrammableSpeakerControlBehavior extends LuaControlBehavior - sort
circuit_parameters :: ProgrammableSpeakerCircuitParameters [RW]
circuit_condition :: CircuitConditionSpecification [RW]
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaRailSignalControlBehavior extends LuaControlBehavior - sort
red_signal :: SignalID [RW]
orange_signal :: SignalID [RW]
green_signal :: SignalID [RW]
close_signal :: boolean [RW] If this will close the rail signal based off the circuit condition.
read_signal :: boolean [RW] If this will read the rail signal state.
circuit_condition :: CircuitConditionSpecification [RW] The circuit condition when controlling the signal through the circuit network.
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaRoboportControlBehavior extends LuaControlBehavior - sort
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?
help() → string All methods, and properties that this object supports.
class LuaStorageTankControlBehavior extends LuaControlBehavior - sort
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaWallControlBehavior extends LuaControlBehavior - sort
circuit_condition :: CircuitConditionSpecification [RW] The circuit condition.
open_gate :: boolean [RW]
read_sensor :: boolean [RW]
output_signal :: SignalID [RW]
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaArithmeticCombinatorControlBehavior extends LuaCombinatorControlBehavior - sort
parameters :: ArithmeticCombinatorParameters [RW] The arithmetic combinator parameters.
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaDeciderCombinatorControlBehavior extends LuaCombinatorControlBehavior - sort
parameters :: DeciderCombinatorParameters [RW] The decider combinator parameters
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaInserterControlBehavior extends LuaGenericOnOffControlBehavior - sort
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.
circuit_set_stack_size :: boolean [RW] If the the stack size of the inserter is set through the circuit network or not.
circuit_stack_control_signal :: SignalID [RW] The signal used to set the stack size of the inserter.
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaLampControlBehavior extends LuaGenericOnOffControlBehavior - sort
use_colors :: boolean [RW] true if the lamp should set the color from the circuit network signals.
color :: Color [R] The color the lamp is showing or nil if not using any color.
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaMiningDrillControlBehavior extends LuaGenericOnOffControlBehavior - sort
circuit_enable_disable :: boolean [RW] true if this drill is enabled or disabled using the logistics or circuit condition.
circuit_read_resources :: boolean [RW] true if this drill should send the resources in the field to the circuit network.
resource_read_mode :: defines.control_behavior.mining_drill.resource_read_mode [RW] If the mining drill should send just the resources in its area or the entire field it's on to the circuit network.
resource_read_targets :: array of LuaEntity [R] The resource entities that the mining drill will send information about to the circuit network or an empty array.
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaTrainStopControlBehavior extends LuaGenericOnOffControlBehavior - sort
send_to_train :: boolean [RW] true if the train stop should send the circuit network contents to the train to use.
read_from_train :: boolean [RW] true if the train stop should send the train contents to the circuit network.
read_stopped_train :: boolean [RW] true if the train stop should send the stopped train id to the circuit network.
enable_disable :: boolean [RW] true if the train stop is enabled/disabled through the circuit network.
stopped_train_signal :: SignalID [RW] The signal that will be sent when using the send-train-id option.
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaTransportBeltControlBehavior extends LuaGenericOnOffControlBehavior - sort
enable_disable :: boolean [RW] If the belt will be enabled/disabled based off the circuit network.
read_contents :: boolean [RW] If the belt will read the contents and send them to the circuit network.
read_contents_mode :: defines.control_behavior.transport_belt.content_read_mode [RW] The read mode for the belt.
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.

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.

output_signal :: SignalID [Read-Write]

LuaCombinatorControlBehavior

get_signal_last_tick(signal) → int

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

Parameters
signal :: SignalID: The signal to get
Return value
The value or nil if none.
signals_last_tick :: array of Signal [Read-only]

The circuit network signals sent by this combinator last tick.

LuaConstantCombinatorControlBehavior

Control behavior for constant combinators.

set_signal(index, ConstantCombiantorSignal)

Sets the signal at the given index

Parameters
index :: uint
get_signal(index)

Gets the signal at the given index or nil if there is none.

Parameters
index :: uint
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.

signals_count :: uint [Read-only]

The number of signals this constant combinator supports

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.

LuaProgrammableSpeakerControlBehavior

Control behavior for programmable speakers.

circuit_parameters :: ProgrammableSpeakerCircuitParameters [Read-Write]

circuit_condition :: CircuitConditionSpecification [Read-Write]

LuaRailSignalControlBehavior

Control behavior for rail signals.

red_signal :: SignalID [Read-Write]

orange_signal :: SignalID [Read-Write]

green_signal :: SignalID [Read-Write]

close_signal :: boolean [Read-Write]

If this will close the rail signal based off the circuit condition.

read_signal :: boolean [Read-Write]

If this will read the rail signal state.

circuit_condition :: CircuitConditionSpecification [Read-Write]

The circuit condition when controlling the signal through the circuit network.

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.

LuaWallControlBehavior

Control behavior for walls.

circuit_condition :: CircuitConditionSpecification [Read-Write]

The circuit condition.

open_gate :: boolean [Read-Write]

read_sensor :: boolean [Read-Write]

output_signal :: SignalID [Read-Write]

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.

circuit_set_stack_size :: boolean [Read-Write]

If the the stack size of the inserter is set through the circuit network or not.

circuit_stack_control_signal :: SignalID [Read-Write]

The signal used to set the stack size of 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.

color :: Color [Read-only]

The color the lamp is showing or nil if not using any color.

LuaMiningDrillControlBehavior

Control behavior for mining drills.

circuit_enable_disable :: boolean [Read-Write]

true if this drill is enabled or disabled using the logistics or circuit condition.

circuit_read_resources :: boolean [Read-Write]

true if this drill should send the resources in the field to the circuit network. Which resources depends on LuaMiningDrillControlBehavior::resource_read_mode

If the mining drill should send just the resources in its area or the entire field it's on to the circuit network.

resource_read_targets :: array of LuaEntity [Read-only]

The resource entities that the mining drill will send information about to the circuit network or an empty array.

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.

read_from_train :: boolean [Read-Write]

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

read_stopped_train :: boolean [Read-Write]

true if the train stop should send the stopped train id to the circuit network.

enable_disable :: boolean [Read-Write]

true if the train stop is enabled/disabled through the circuit network.

stopped_train_signal :: SignalID [Read-Write]

The signal that will be sent when using the send-train-id option.

LuaTransportBeltControlBehavior

Control behavior for transport belts.

enable_disable :: boolean [Read-Write]

If the belt will be enabled/disabled based off the circuit network.

read_contents :: boolean [Read-Write]

If the belt will read the contents and send them to the circuit network.

The read mode for the belt.