Cardwell

Alarm

Apr 11th, 2021 (edited)
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. --ALARM
  2. rednet.open("left")
  3. local mottafra = 3
  4. local output = "bottom"
  5. while true do
  6. id, msg = rednet.receive()
  7. print("")
  8. print("Fra "..id)
  9. print(msg)
  10.  
  11. if id == mottafra and msg == "ALARM_ON" then
  12. print("Alarm er på!")
  13. rs.setOutput(output, true)
  14. end
  15.  
  16. if id == mottafra and msg == "ALARM_OFF" then
  17. print("Alarm er av!")
  18. rs.setOutput(output, false)
  19. end
  20. end
Add Comment
Please, Sign In to add comment