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 2.15 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.redstone.setBundledOutput(side, 0)
  14. local event, shit, shit2, shit3, message = os.pullEvent("modem_message")
  15. message = tonumber(message)
  16. print(message)
  17. if message == 1 then
  18. if openlist[1] == false then
  19. Working()
  20. openlist[1] = true
  21. redstone.setBundledOutput(side, colors.white)
  22. sleep(7)
  23. Working()
  24. else
  25. Working()
  26. openlist[1] = false
  27. redstone.setBundledOutput(side, colors.lime)
  28. sleep(7)
  29. Working()
  30. end
  31. elseif message == 2 then
  32. if openlist[2] == false then
  33. Working()
  34. openlist[2] = true
  35. redstone.setBundledOutput(side, colors.orange)
  36. sleep(7)
  37. Working()
  38. else
  39. Working()
  40. openlist[2] = false
  41. redstone.setBundledOutput(side, colors.pink)
  42. sleep(7)
  43. Working()
  44. end
  45. elseif message == 3 then
  46. if openlist[3] == false then
  47. Working()
  48. openlist[3] = true
  49. redstone.setBundledOutput(side, colors.magenta)
  50. sleep(7)
  51. Working()
  52. else
  53. Working()
  54. openlist[3] = false
  55. redstone.setBundledOutput(side, colors.gray)
  56. sleep(7)
  57. Working()
  58. end
  59. elseif message == 4 then
  60. if openlist[4] == false then
  61. Working()
  62. openlist[4] = true
  63. redstone.setBundledOutput(side, colors.lightBlue)
  64. sleep(7)
  65. Working()
  66. else
  67. Working()
  68. openlist[4] = false
  69. redstone.setBundledOutput(side, colors.lightGray)
  70. sleep(7)
  71. Working()
  72. end
  73. elseif message == 5 then
  74. if openlist[5] == false then
  75. Working()
  76. openlist[5] = true
  77. redstone.setBundledOutput(side, colors.yellow)
  78. sleep(7)
  79. Working()
  80. else
  81. Working()
  82. openlist[5] = false
  83. redstone.setBundledOutput(side, colors.cyan)
  84. sleep(7)
  85. Working()
  86. end
  87. elseif message == 6 then
  88. Working()
  89. for i=1,5 do
  90. openlist[i] = true
  91. end
  92. redstone.setBundledOutput(side, colors.combine(colors.white,colors.orange,colors.magenta,colors.lightBlue,colors.yellow))
  93. sleep(7)
  94. Working()
  95. else
  96. print("Bigg ass error!")
  97. end
  98. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement