Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rs.setOutput("top", true)
- local exitTime = 10 -- change to whatever you want
- while true do
- if rs.getAnalogInput("front")<15 then
- print (rs.getAnalogInput("front"))
- local timer = os.startTimer(exitTime) -- starts the timer
- while true do
- local evt, arg = os.pullEvent() -- wait for an event
- if evt == "timer" then
- if arg == timer then -- check if it's the correct timer
- -- print ("timer stoped")
- break -- break the loop
- end
- elseif (evt == "redstone" and rs.getInput("left")) then
- -- print ("timer restart")
- timer = os.startTimer(exitTime) -- restarts the timer
- end
- end
- rs.setOutput("top", false)
- sleep(0.2)
- rs.setOutput("top", true)
- end
- sleep(0.5)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement