Advertisement
the_lad

ReacotrMaster

Apr 12th, 2023 (edited)
821
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --Variables
  2. slave1 = 12
  3. slave2 = 13
  4. num = 0
  5. --Functions
  6. function Main()
  7. local core = redstone.getAnalogInput("left")
  8. print("Core Charge: " .. core)
  9. print("Iteration: " .. num)
  10. if (core <= 14 and core > 10) then
  11. print("Reactor:1 Online...")
  12. print("Reacort:2 Offline...")
  13. rednet.send(slave1, "", "ON")
  14. rednet.send(slave2, "", "OFF")
  15. num = 10
  16. elseif (core <= 10) then
  17. print("Reactor:1 Online...")
  18. print("Reacotr:2 Online...")
  19. rednet.send(slave1, "", "ON")
  20. rednet.send(slave2, "", "ON")
  21. elseif (core >= 15) then
  22. print("Reactor:1 Offline...")
  23. print("Reactor:2 Offline...")
  24. rednet.send(slave1, "", "OFF")
  25. rednet.send(slave2, "", "OFF")
  26. end
  27. sleep(1)
  28. shell.run("clear")
  29. num = num + 1
  30. Main()
  31. end
  32.  
  33. function Start()
  34.     rednet.open("top")
  35.     if rednet.isOpen("top") then
  36.         print("Rednet Online")
  37.     else
  38.         printError("Rednet Error")
  39.     end
  40.     Main()
  41. end
  42.  
  43. Start()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement