Advertisement
BlueMond

lightClient

Feb 8th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.42 KB | None | 0 0
  1. --client
  2.  
  3. local channel = 1
  4.  
  5. local modem = peripheral.wrap("front")
  6. modem.open(channel)
  7.  
  8. while true do
  9.     local event, side, freq, rfreq, msg = os.pullEvent()
  10.    
  11.     if event == "modem_message" then
  12.    
  13.         if msg == "on" then
  14.             if not rs.getOutput("top") then
  15.                 rs.setOutput("top", true)
  16.             end
  17.         elseif msg == "off" then
  18.             if rs.getOutput("top") then
  19.                 rs.setOutput("top", false)
  20.             end
  21.         end
  22.        
  23.     end
  24. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement