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

# Factorio Runtime Docs Version 2.0.77

# LuaGenericOnOffControlBehavior - Runtime Docs

## Class LuaGenericOnOffControlBehavior extends LuaControlBehavior abstract

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

Inherits from LuaControlBehavior
Children LuaAgriculturalTowerControlBehavior LuaArtilleryTurretControlBehavior LuaAssemblingMachineControlBehavior LuaAsteroidCollectorControlBehavior LuaFurnaceControlBehavior LuaInserterControlBehavior LuaLampControlBehavior LuaLoaderControlBehavior LuaMiningDrillControlBehavior LuaPumpControlBehavior LuaTrainStopControlBehavior LuaTransportBeltControlBehavior LuaTurretControlBehavior

## Members

disabled | :: R boolean | If the entity is currently disabled because of the control behavior.
If the entity is currently disabled because of the control behavior.
circuit_enable_disable | :: RW boolean | `true` if this entity enable/disable state is controlled by circuit condition
`true` if this entity enable/disable state is controlled by circuit condition
circuit_condition | :: RW CircuitConditionDefinition? | The circuit condition. [...]
The circuit condition. [...]
connect_to_logistic_network | :: RW boolean | `true` if this should connect to the logistic network.
`true` if this should connect to the logistic network.
logistic_condition | :: RW CircuitConditionDefinition? | The logistic condition. [...]
The logistic condition. [...]

Inherited from LuaControlBehavior

get_circuit_network(wire_connector_id) | → LuaCircuitNetwork? |
type | :: R defines.control_behavior.type | The concrete type of this control behavior.
The concrete type of this control behavior.
entity | :: R LuaEntity | The entity this control behavior belongs to.
The entity this control behavior belongs to.

## Attributes

### disabled :: Read boolean

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

### circuit_enable_disable :: Read|Write boolean

`true` if this entity enable/disable state is controlled by circuit condition

### circuit_condition :: Read|Write CircuitConditionDefinition?

The circuit condition. Writing `nil` clears the circuit condition.

#### Example

    -- Tell an entity to be active (for example a lamp to be lit) when it receives a
    -- circuit signal of more than 4 chain signals.
    a_behavior.circuit_condition = {
      comparator=">",
      first_signal={type="item", name="rail-chain-signal"},
      constant=4
    }

### connect_to_logistic_network :: Read|Write boolean

`true` if this should connect to the logistic network.

### logistic_condition :: Read|Write CircuitConditionDefinition?

The logistic condition. Writing `nil` clears the logistic condition.

#### Example

    -- Tell an entity to be active (for example a lamp to be lit) when the logistics
    -- network it's connected to has more than four chain signals.
    a_behavior.logistic_condition = {
      comparator=">",
      first_signal={type="item", name="rail-chain-signal"},
      constant=4
    }