Difference between revisions of "Digiline HV reactor monitor"
Jump to navigation
Jump to search
Line 17: | Line 17: | ||
end | end | ||
− | if event.type == "digiline" then | + | if event.type == "digiline" and event.channel == "sensor" then |
if event.msg == "technic:hv_nuclear_reactor_core_active" then | if event.msg == "technic:hv_nuclear_reactor_core_active" then | ||
port.a = false | port.a = false |
Revision as of 17:18, 20 September 2019
Overview
Howto for a Digiline controlled HV Reactor monitor. Polls a Node detector periodically and sets a green or red lightstone if the reactor is on or off.
Lua Controller
if event.type == "interrupt" then
digiline_send("sensor", "GET")
interrupt(5)
end
if event.type == "program" then
interrupt(1)
end
if event.type == "digiline" and event.channel == "sensor" then
if event.msg == "technic:hv_nuclear_reactor_core_active" then
port.a = false
port.c = true
else
port.a = true
port.c = false
end
end
Setup
The Node detector has a range of 3 blocks and listens on the channel "sensor"