Advertisement
FoxWorn3365

MERDOR_SENZA_FILI

May 29th, 2021
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. rednet.open("top")
  2. while true do
  3. local status = rs.getInput("left")
  4. if status == false then
  5.  sender = "OFF"
  6. else
  7.  sender = "ON"
  8. end
  9.  
  10. to, msg, prtc = rednet.receive()
  11.  if msg == "STATUS" then
  12.    rednet.send(to, sender)
  13.    print("STATUS")
  14.  elseif msg == "OFF" then
  15.    rs.setOutput("left", false)
  16.    print("OFF")
  17.  elseif msg == "ON" then
  18.    rs.setOutput("left", true)
  19.    print("ON")
  20.  end
  21. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement