An93l0fD3ath

Reactor Control

Jul 12th, 2018
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.73 KB | None | 0 0
  1. local component = require("component")
  2. local rs = component.redstone
  3. local colors = require("colors")
  4. local sides = require("sides")
  5. local Reactor_1 = component.proxy(component.get("3b99"))
  6.  
  7.  
  8. local MaxHeat = Reactor_1.getMaxHeat()
  9. local Safe = MaxHeat/2
  10. local Heat = Reactor_1.getHeat()
  11. print(MaxHeat)
  12. print(Safe)
  13.  
  14. local function Reactor_Off()
  15. rs.setOutput(sides.up, 0)
  16. os.sleep(1)
  17. print("Reactor_Off")
  18. end
  19.  
  20. local function Reactor_1Check()
  21. while Heat > Safe do
  22. print(Heat)
  23. os.sleep(1)
  24. Reactor_On()
  25. end
  26. end
  27.  
  28. local function Reactor_On()
  29. if Heat > Safe then
  30. rs.setOutput(sides.up, 253)
  31. os.sleep(1)
  32. print("Reactor_On")
  33. os.sleep(1)
  34. Reactor_1Check() <--- Problem Area
  35. else
  36. Reactor_Off()
  37. end
  38. end
  39.  
  40. Reactor_On()
Advertisement
Add Comment
Please, Sign In to add comment