Guest User

startup

a guest
Aug 2nd, 2021
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.44 KB | None | 0 0
  1. rednet.open("left")
  2.  
  3. rs.setOutput("right", false)
  4.  
  5. while true do
  6. local id, msg, ptrc = rednet.receive()
  7. inp = rs.getInput("right")
  8. if msg == "status" then
  9.   print("SATTUS")
  10.     if inp == false then
  11.     rednet.send(id, "ON")
  12.   elseif inp == true then
  13.     rednet.send(id, "OFF")
  14.   else
  15.     rednet.send(id, "ERROR")
  16.   end
  17. elseif msg == "ON" then
  18.   rs.setOutput("right", false)
  19. else
  20.   rs.setOutput("right", true)
  21. end
  22. sleep(0.1)
  23. end
Advertisement
Add Comment
Please, Sign In to add comment