Advertisement
Guest User

lua_light_node

a guest
Mar 29th, 2020
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.44 KB | None | 0 0
  1. -- Lighting Node (1)
  2. rednet.open("right")
  3. args = {...}
  4. command = args[1]
  5. if command == 'on' do
  6.   rednet.broadcast("light_on")
  7.   message = rednet.receive()
  8.   if message == "on true" do
  9.     print("Lights Turned On")
  10.   else
  11.     print("Error")
  12.   end
  13. end
  14.  
  15. if command == 'off' do
  16.   rednet.broadcast("light_off")
  17.   message = rednet.receive()
  18.   if message == "off true" do
  19.     print("Lights Turned Off")
  20.   else
  21.     print("Error")
  22.   end
  23. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement