Advertisement
Guest User

Untitled

a guest
May 21st, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.97 KB | None | 0 0
  1. modem = peripheral.wrap("top")
  2. modem.open(697)
  3. modem.open(666)
  4.  
  5. function Working()
  6. modem.transmit(666,666,"hi")
  7. end
  8.  
  9. local openlist = {false, false, false, false, false}
  10. local side = "left"
  11.  
  12. while true do
  13. redstone.setBundledOutput(side, 0)
  14. local event, shit, shit2, shit3, message = os.pullEvent("modem_message")
  15. tonumber(message)
  16. if message == 1 then
  17. if openlist[1] == false then
  18. Working()
  19. openlist[1] = true
  20. setBundledOutput(side, colors.white)
  21. sleep(7)
  22. Working()
  23. else
  24. Working()
  25. openlist[1] = false
  26. setBundledOutput(side, colors.lime)
  27. sleep(7)
  28. Working()
  29. end
  30. elseif message == 2 then
  31. if openlist[2] == false then
  32. Working()
  33. openlist[2] = true
  34. setBundledOutput(side, colors.orange)
  35. sleep(7)
  36. Working()
  37. else
  38. Working()
  39. openlist[2] = false
  40. setBundledOutput(side, colors.pink)
  41. sleep(7)
  42. Working()
  43. end
  44. elseif message == 3 then
  45. if openlist[3] == false then
  46. Working()
  47. openlist[3] = true
  48. setBundledOutput(side, colors.magenta)
  49. sleep(7)
  50. Working()
  51. else
  52. Working()
  53. openlist[3] = false
  54. setBundledOutput(side, colors.gray)
  55. sleep(7)
  56. Working()
  57. end
  58. elseif message == 4 then
  59. if openlist[4] == false then
  60. Working()
  61. openlist[4] = true
  62. setBundledOutput(side, colors.lightBlue)
  63. sleep(7)
  64. Working()
  65. else
  66. Working()
  67. openlist[4] = false
  68. setBundledOutput(side, colors.lightGray)
  69. sleep(7)
  70. Working()
  71. elseif message == 5 then
  72. if openlist[5] == false then
  73. Working()
  74. openlist[5] = true
  75. setBundledOutput(side, colors.yellow)
  76. sleep(7)
  77. Working()
  78. else
  79. Working()
  80. openlist[5] = false
  81. setBundledOutput(side, colors.cyan)
  82. sleep(7)
  83. Working()
  84. end
  85. elseif message == 6 then
  86. Working()
  87. for i=1,5 do
  88. openlist[i] = true
  89. end
  90. setBundledOutput(side, colors.combine(colors.white,colors.orange,colors.magenta,colors.lightBlue,colors.yellow)
  91. sleep(7)
  92. Working()
  93. end
  94. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement