Advertisement
djgaven588

Rednet Power Controller

Dec 10th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. p = peripheral.wrap("bottom")
  2. rednet.open("bottom")
  3.  
  4. --Program Decor
  5. term.setTextColor(colors.blue)
  6. term.clear()
  7. term.setCursorPos(1,1)
  8. print("Djgaven588's Rednet Power Manager")
  9. print(" ")
  10. print("Managment Started On Day: "..os.day())
  11. term.setTextColor(colors.white)
  12.  
  13. --Wait for a message on protocall PowerManagement
  14. --Then do action
  15. while true do
  16. senderId, msg, protocall = rednet.receive()
  17. if protocall == "PowerManagement" then
  18. print("Day: "..os.day().." Time: "..os.time())
  19. print("Message: "..msg)
  20. print(" ")
  21. if msg == "PowerFull" then
  22. rednet.broadcast("DAll", "Reactor")
  23. end
  24.  
  25. if msg == "Power98" then
  26. rednet.broadcast("E1", "Reactor")
  27. end
  28.  
  29. if msg == "Power96" then
  30. rednet.broadcast("E2", "Reactor")
  31. end
  32.  
  33. if msg == "Power94" then
  34. rednet.broadcast("E3", "Reactor")
  35. end
  36.  
  37. if msg == "PowerFalling" then
  38. rednet.broadcast("E4", "Reactor")
  39. end
  40. end
  41. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement