Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- redstone.setOutput("right",true)
- redstone.setOutput("back",false)
- local close = false
- while close == false do
- local event, param = os.pullEvent()
- if event == "redstone" then
- local param1 = redstone.getInput("bottom")
- if param1 == true then
- print("Train detected")
- redstone.setOutput("right",false)
- sleep(3)
- print("Letting train go")
- redstone.setOutput("back",true)
- sleep(0.01)
- redstone.setOutput("back",false)
- sleep(2)
- redstone.setOutput("right",true)
- end
- else
- if param == "q" then
- close = true
- end
- end
- end
- redstone.setOutput("back",true)
Advertisement
Add Comment
Please, Sign In to add comment