Advertisement
devomaa

I hate this so much - colorful lamp host

Jun 5th, 2021
1,408
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.72 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] == "on" 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. while true do
  16. data = {rednet.receive()}
  17. if data[2] == "off" then
  18.     for i, v in pairs(peripheral.getNames()) do
  19.         if peripheral.getType(v) == "colorful_lamp" then
  20.             local obj = peripheral.wrap(v)
  21.             obj.setLampColor(0)
  22.             end
  23.          end
  24.       end
  25.   end
  26. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement