-- download at MT.QZX.COM (reset-node-detector.lua) local c = "" -- node detector channel local i = "d" -- input signal local s = "default:stone_with_gold" -- node name to scan for local tc = 5 -- clear detector if input high for 5s local tr = 2 -- restore after 2s if (event.type == "on" and string.lower(event.pin.name) == i) or (event.iid == "repeat" and port[i]) then -- input on, start timer interrupt(tc, "clear") mem.s = 1 elseif event.type == "off" and string.lower(event.pin.name) == i then -- input off, clear timer mem.s = 0 elseif event.iid == "clear" and mem.s == 1 then digiline_send(c, {scanname="x"}) interrupt(tr, "restore") elseif event.iid == "restore" then digiline_send(c, {scanname=s}) interrupt(tc, "repeat") end