Advertisement
jared314

Elevator Control - Current

Jul 11th, 2014
423
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.06 KB | None | 0 0
  1. function default()
  2. m = peripheral.wrap("right")
  3. m.clear()
  4. m.setTextColor(colors.blue)
  5. m.setCursorPos(1,1)
  6. m.write("Floor Button:")
  7. m.setTextColor(colors.white)
  8. m.setCursorPos(1,2)
  9. m.write("  5th  ")
  10. m.setCursorPos(1,4)
  11. m.write("  4th  ")
  12. m.setCursorPos(1,6)
  13. m.write("  3rd - Squid")
  14. m.setCursorPos(1,8)
  15. m.write("  2nd - Multifarm")
  16. m.setCursorPos(1,10)
  17. m.write("  Lobby ")
  18. m.setCursorPos(1,12)
  19. m.write("  B - Wither Trap")
  20. end
  21.  
  22. while true do
  23. default()
  24.   event,side,x,y = os.pullEvent()
  25.   if event == "monitor_touch" then
  26.         if y == 2 then
  27.                 rednet.open("back")
  28.                 rednet.broadcast("5")
  29.                 m.setCursorPos(1,2)
  30.                 m.setTextColor(colors.red)
  31.                 m.write("  5th  ")
  32.                 sleep(2)
  33.         else if y == 4 then
  34.                 rednet.open("back")
  35.                 rednet.broadcast("4")
  36.                 m.setCursorPos(1,4)
  37.                 m.setTextColor(colors.red)
  38.                 m.write("  4th  ")
  39.                 sleep(2)
  40.         else if y == 6 then
  41.                 rednet.open("back")
  42.                 rednet.broadcast("3")
  43.                 m.setCursorPos(1,6)
  44.                 m.setTextColor(colors.red)
  45.                 m.write("  3rd - Squid")
  46.                 sleep(2)
  47.         else if y == 8 then
  48.                 rednet.open("back")
  49.                 rednet.broadcast("2")
  50.                 m.setCursorPos(1,8)
  51.                 m.setTextColor(colors.red)
  52.                 m.write("  2nd - Multifarm")
  53.                 sleep(2)
  54.         else if y == 10 then
  55.                 rednet.open("back")
  56.                 rednet.broadcast("L")
  57.                 m.setCursorPos(1,10)
  58.                 m.setTextColor(colors.red)
  59.                 m.write("  Lobby ")
  60.                 sleep(2)
  61.         else if y == 12 then
  62.                 rednet.open("back")
  63.                 rednet.broadcast("B")
  64.                 m.setCursorPos(1,12)
  65.                 m.setTextColor(colors.red)
  66.                 m.write("  B - Wither Trap")
  67.                 sleep(2)
  68.     end
  69.     end
  70.     end
  71.     end
  72.     end
  73.     end
  74.     end
  75. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement