I've tried setting the circuit network to a always true condition (e.g. item = 0). I've tried forcing it to connect to itself. Even with the "currentCodition.fulfilled" as true it doesn't turn on. Interestingly, if I manually connect it to a near by power pole it turns on, however I really want to avoid this.
I couldn't locate a method or function that turns it on/off.
Code: Select all
local currentCondition = data.entity.get_circuit_condition(defines.circuitconditionindex.lamp)
data.entity.connect_neighbour({
wire = defines.circuitconnector.red,
target_entity = data.entity,
source_circuit_id = 1,
target_circuit_id = 1,
})
if currentCondition.condition.comparator ~= "=" then
currentCondition.condition.first_signal = {name = "coal", type="item"}
debugLog(currentCondition.condition.first_signal.name)
debugLog(currentCondition.condition.constant)
currentCondition.condition.constant = 0
debugLog(currentCondition.condition.constant)
debugLog(currentCondition.fulfilled)
data.entity.set_circuit_condition(defines.circuitconditionindex.lamp, {condition={comparator="=",
first_signal={type="item", name="coal"},
constant=0}})
end
currentCondition = data.entity.get_circuit_condition(defines.circuitconditionindex.lamp)
debugLog(currentCondition.fulfilled)