Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- s = 0
- while true do
- if rs.getInput("front") == true then
- --System On
- print("got a signal")
- if s == 0 then --door is closed
- s = 1
- rs.setOutput("right",true)
- sleep(9)
- rs.setOutput("back",true)
- elseif s == 1 then --door is opened
- s = 0
- rs.setOutput("back",false)
- rs.setOutput("right",false)
- sleep(2)
- end
- else
- -- Waiting for signal
- print("Waiting for signal")
- sleep(1)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement