xavierlebel

Untitled

Mar 17th, 2014
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. mon = peripheral.wrap("right")
  2. p = peripheral.wrap("left")
  3.  
  4. function pulse()
  5. redstone.setOutput("left", true)
  6. sleep(2)
  7. redstone.setOutput("left", false)
  8. sleep(2)
  9. end
  10.  
  11. function trains()
  12. mon.setCursorPos(2,2)
  13. mon.write("TRAIN 1 - Water")
  14. mon.setCursorPos(2,3)
  15. mon.write("TRAIN 2 - Oil")
  16. end
  17.  
  18. function cancelled()
  19. mon.setCursorPos(18,2)
  20. mon.write("CANCELLED")
  21. sleep(0.2)
  22. mon.setCursorPos(18,3)
  23. mon.write("CANCELLED")
  24. sleep(0.2)
  25. mon.setCursorPos(18,4)
  26. mon.write("CANCELLED")
  27. sleep(0.2)
  28. end
  29.  
  30. function timer()
  31. p.setFreq(108)
  32. pulse()
  33. p.setFreq(107)
  34. pulse()
  35. p.setFreq(106)
  36. pulse()
  37. p.setFreq(105)
  38. pulse()
  39. p.setFreq(104)
  40. pulse()
  41. p.setFreq(103)
  42. pulse()
  43. mon.setCursorPos(18,4)
  44. mon.write("DEPARTING")
  45. p.setFreq(102)
  46. pulse()
  47. mon.setCursorPos(18,3)
  48. mon.write("DEPARTING")
  49. p.setFreq(101)
  50. pulse()
  51. mon.setCursorPos(18,2)
  52. mon.write("DEPARTING")
  53. end
  54.  
  55. while true do
  56. os.pullEvent("redstone")
  57. function trains()
  58. term.clear()
  59. mon.clear()
  60. if rs.getInput("back") then
  61. mon.setCursorPos(2,8)
  62. mon.write("TRAIN IN EXIT ZONE. CANCELLING DEPARTURES.")
  63. cancelled()
  64. else
  65. mon.setCursorPos(2,8)
  66. mon.write("ZONE CLEAR. RESUMING DEPARTURES. ")
  67. timer()
  68. end
  69. end
  70. end
Advertisement
Add Comment
Please, Sign In to add comment