Scorpionfien

DocEleve

Jul 27th, 2015
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.15 KB | None | 0 0
  1. mon1 = peripheral.wrap("top")
  2. mon2 = peripheral.wrap("monitor_48")
  3. mon3 = peripheral.wrap("monitor_")
  4.  
  5. --Setup
  6. function clear()
  7. mon1.clear()
  8. mon2.clear()
  9. mon3.clear()
  10. mon1.setCursorPos(1,1)
  11. mon1.write("Elevator")
  12. mon2.setCursorPos(1,1)
  13. mon2.write("Elevator")
  14. mon2.setCursorPos(2,2)
  15. mon2.write("[UP] [CALL]")
  16. mon2.setCursorPos(2,3)
  17. mon2.write("Designed By Scorp")
  18. mon3.setCursorPos(1,1)
  19. mon3.write("Elevator")
  20. mon3.setCursorPos(2,2)
  21. mon3.write("[CALL] [DOWN]")
  22. mon3.setCursorPos(1,3)
  23. mon3.write("Designed By Scorp")
  24.  
  25. clear()
  26.  
  27. --Elevator
  28. function up()
  29. rs.setBundledOutput("left", colors.combine(rs.getBundledOutput("left"), colors.orange))
  30. sleep(1)
  31. rs.setBundledOutput("left", colors.subtract(rs.getBundledOutput("left"), colors.orange))
  32. sleep(1)
  33. rs.setBundledOutput("left", colors.combine(rs.getBundledOutput("left"), colors.orange))
  34. sleep(1)
  35. rs.setBundledOutput("left", colors.subtract(rs.getBundledOutput("left"), colors.orange))
  36. sleep(1)
  37. rs.setBundledOutput("left", colors.combine(rs.getBundledOutput("left"), colors.orange))
  38. sleep(1)
  39. rs.setBundledOutput("left", colors.subtract(rs.getBundledOutput("left"), colors.orange))
  40. sleep(1)
  41. rs.setBundledOutput("left", colors.combine(rs.getBundledOutput("left"), colors.orange))
  42. sleep(1)
  43. rs.setBundledOutput("left", colors.subtract(rs.getBundledOutput("left"), colors.orange))
  44. sleep(1)
  45. rs.setBundledOutput("left", colors.combine(rs.getBundledOutput("left"), colors.orange))
  46. sleep(1)
  47. rs.setBundledOutput("left", colors.subtract(rs.getBundledOutput("left"), colors.orange))
  48. sleep(1)
  49. rs.setBundledOutput("left", colors.combine(rs.getBundledOutput("left"), colors.orange))
  50. sleep(1)
  51. rs.setBundledOutput("left", colors.subtract(rs.getBundledOutput("left"), colors.orange))
  52. sleep(1)
  53. rs.setBundledOutput("left", colors.combine(rs.getBundledOutput("left"), colors.orange))
  54. sleep(1)
  55. rs.setBundledOutput("left", colors.subtract(rs.getBundledOutput("left"), colors.orange))
  56. sleep(1)
  57. rs.setBundledOutput("left", colors.combine(rs.getBundledOutput("left"), colors.orange))
  58. sleep(1)
  59. rs.setBundledOutput("left", colors.subtract(rs.getBundledOutput("left"), colors.orange))
  60. sleep(1)
  61. end
  62.  
  63. function down()
  64. rs.setBundledOutput("left", colors.combine(rs.getBundledOutput("left"), colors.white))
  65. sleep(1)
  66. rs.setBundledOutput("left", colors.subtract(rs.getBundledOutput("left"), colors.white))
  67. sleep(1)
  68. rs.setBundledOutput("left", colors.combine(rs.getBundledOutput("left"), colors.white))
  69. sleep(1)
  70. rs.setBundledOutput("left", colors.subtract(rs.getBundledOutput("left"), colors.white))
  71. sleep(1)
  72. rs.setBundledOutput("left", colors.combine(rs.getBundledOutput("left"), colors.white))
  73. sleep(1)
  74. rs.setBundledOutput("left", colors.subtract(rs.getBundledOutput("left"), colors.white))
  75. sleep(1)
  76. rs.setBundledOutput("left", colors.combine(rs.getBundledOutput("left"), colors.white))
  77. sleep(1)
  78. rs.setBundledOutput("left", colors.subtract(rs.getBundledOutput("left"), colors.white))
  79. sleep(1)
  80. rs.setBundledOutput("left", colors.combine(rs.getBundledOutput("left"), colors.white))
  81. sleep(1)
  82. rs.setBundledOutput("left", colors.subtract(rs.getBundledOutput("left"), colors.white))
  83. sleep(1)
  84. rs.setBundledOutput("left", colors.combine(rs.getBundledOutput("left"), colors.white))
  85. sleep(1)
  86. rs.setBundledOutput("left", colors.subtract(rs.getBundledOutput("left"), colors.white))
  87. sleep(1)
  88. rs.setBundledOutput("left", colors.combine(rs.getBundledOutput("left"), colors.white))
  89. sleep(1)
  90. rs.setBundledOutput("left", colors.subtract(rs.getBundledOutput("left"), colors.white))
  91. sleep(1)
  92. rs.setBundledOutput("left", colors.combine(rs.getBundledOutput("left"), colors.white))
  93. sleep(1)
  94. rs.setBundledOutput("left", colors.subtract(rs.getBundledOutput("left"), colors.white))
  95. sleep(1)
  96. end
  97.  
  98. while true do
  99.  
  100. local event, x, y = os.pullEvent()
  101. if (event == "monitor_touch") then
  102. if x > 2 and x < 6 and y == 2 then
  103. up()
  104. end
  105. if x > 8 and x < 12 and y == 2 then
  106. down()
  107. end
  108. sleep(0.5)
  109. end
Advertisement
Add Comment
Please, Sign In to add comment