i search for a easy way to get the Condition of a Lamp.
So i mean if it has a Green/Red Wire

Greetz,
Luzifer
There i cant get a easy way to read the signalaubergine18 wrote:The source code for this mod will show you how - look at the on_tick handler in particular.
https://mods.factorio.com/mods/theRusty ... ork-switch
That is for getting every Signal that this entity gets, but not for reading the Condition of a Lamp, so with Singal is set in the Lamp. ^^aubergine18 wrote:Ah, I thought you just wanted to know which color wires were attached.
GotLag's old Wireless mod should show simple example of reading values: https://mods.factorio.com/mods/GotLag/W ... 20Networks
Code: Select all
get_or_create_control_behavior() → LuaControlBehavior
Gets (and or creates if needed) the control behavior of the entity.
Return value
The control behavior or nil.
Code: Select all
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