Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local INPUT_SIDE = "left" -- change based on where your lever is
- local OUTPUT_SIDE = "right" -- change based on where your output side is
- local IDLE_TIME = 30 -- time (in sec) for cc to wait, rec 30, allows timer to survive reboot
- --start an infini8te loop
- --hold CTRL+T to stop the program
- while true do
- --wait for lever to be thrown, or check if red is already active after IDLE_TIME
- parallel.waitForAny(function() e = os.pullEvent("redstone"); return true end, function() sleep(IDLE_TIME); return true end)
- --pulse the output
- while rs.getInput(INPUT_SIDE) do--while lever is ON
- write(".") --print a dot each time we pulse
- rs.setOutput(OUTPUT_SIDE,true)--turn output on
- sleep(.2) --wait 0.1 sec
- rs.setOutput(OUTPUT_SIDE,false)--turn output off
- sleep(IDLE_TIME) --wait 0.9 sec
- end --rinse, repeat
- end --rinse, repeat
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement