Advertisement
Guest User

lua_light_control

a guest
Mar 29th, 2020
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. -- Lighting Controller (1)
  2. rednet.open("front")
  3. while true do
  4. sendid, message = os.pullEvent()
  5. if sendid == 26 then
  6. if message == "light_on" then
  7. rs.setOutput("right", true)
  8. rednet.send(sendid,"on true")
  9. end
  10. if message == "light_off" then
  11. rs.setOutput("right", false)
  12. rednet.send(sendid,"off true")
  13. end
  14. end
  15. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement