Advertisement
ee_ingo

shutdown

Feb 24th, 2023
706
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.43 KB | None | 0 0
  1. rednet.open("top")
  2.  
  3. local autoShutoff = 0
  4. local lastAutoShutoff = 0
  5.  
  6. function HandleReceivedData()
  7.     local sender, message = rednet.receive();
  8.    
  9.     if string.find(message, "<off") then
  10.         rs.setOutput("back", false)
  11.     else
  12.         rs.setOutput("back", true)
  13.     end
  14. end
  15.  
  16. function MainLoop()
  17.     while true do
  18.         HandleReceivedData()
  19.         lastAutoShutoff = autoShutoff
  20.     end
  21. end
  22.  
  23. MainLoop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement