Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mon = peripheral.wrap("right")
- p = peripheral.wrap("left")
- function pulse()
- redstone.setOutput("left", true)
- sleep(2)
- redstone.setOutput("left", false)
- sleep(2)
- end
- function trains()
- mon.setCursorPos(2,2)
- mon.write("TRAIN 1 - Water")
- mon.setCursorPos(2,3)
- mon.write("TRAIN 2 - Oil")
- end
- function cancelled()
- mon.setCursorPos(18,2)
- mon.write("CANCELLED")
- sleep(0.2)
- mon.setCursorPos(18,3)
- mon.write("CANCELLED")
- sleep(0.2)
- mon.setCursorPos(18,4)
- mon.write("CANCELLED")
- sleep(0.2)
- end
- function timer()
- p.setFreq(108)
- pulse()
- p.setFreq(107)
- pulse()
- p.setFreq(106)
- pulse()
- p.setFreq(105)
- pulse()
- p.setFreq(104)
- pulse()
- p.setFreq(103)
- pulse()
- mon.setCursorPos(18,4)
- mon.write("DEPARTING")
- p.setFreq(102)
- pulse()
- mon.setCursorPos(18,3)
- mon.write("DEPARTING")
- p.setFreq(101)
- pulse()
- mon.setCursorPos(18,2)
- mon.write("DEPARTING")
- end
- while true do
- os.pullEvent("redstone")
- function trains()
- term.clear()
- mon.clear()
- if rs.getInput("back") then
- mon.setCursorPos(2,8)
- mon.write("TRAIN IN EXIT ZONE. CANCELLING DEPARTURES.")
- cancelled()
- else
- mon.setCursorPos(2,8)
- mon.write("ZONE CLEAR. RESUMING DEPARTURES. ")
- timer()
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment