Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function iterate()
- local timer = os.startTimer(5)
- local event = os.pullEvent()
- if event ~= "redstone" and event ~= "timer" then
- return
- end
- if event == "redstone" then
- if not redstone.getInput("bottom") and not redstone.getInput("left") then
- return
- end
- end
- os.cancelTimer(timer)
- print("[cr] caught event")
- sleep(0.1)
- print("[cr] pushing piston")
- redstone.setOutput("right", true)
- sleep(0.1)
- print("[cr] retracting piston")
- redstone.setOutput("right", false)
- sleep(0.3)
- end
- function main()
- print("\n\n-------------------------------")
- print("[cr] starting the program; v1.0")
- print("-------------------------------\n\n");
- while true do
- iterate()
- end
- end
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement