-- download at MT.QZX.COM (clock.lua) local o = "a" -- output local i = "c" -- lever local th = 60 -- on for 60s local tl = 600 -- off for 600s if event.type == "on" and pin[i] then port[o] = true interrupt(th, "lo") elseif pin[i] then if event.iid == "hi" then port[o] = true interrupt(th, "lo") else port[o] = false interrupt(tl, "hi") end elseif event.type == "off" then port[o] = false end