Advertisement
devomaa

Colorful Lamp Host

Jun 5th, 2021
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. rednet.open("top")
  2. print("RedNet Open, Poggers!")
  3. local id = os.computerID()
  4. print("Send CODE to", id, "to open")
  5.  
  6. while true do
  7. data = {rednet.receive()}
  8. if data[2] == "true" then
  9. for i, v in pairs(peripheral.getNames()) do
  10. if peripheral.getType(v) == "colorful_lamp" then
  11. local obj = peripheral.wrap(v)
  12. obj.setLampColor(32767)
  13. end
  14. end
  15. data = {rednet.receive()}
  16. if data[2] == "false" then
  17. for i, v in pairs(peripheral.getNames()) do
  18. if peripheral.getType(v) == "colorful_lamp" then
  19. local obj = peripheral.wrap(v)
  20. obj.setLampColor(0)
  21. end
  22. end
  23. end
  24. end
  25. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement