Advertisement
Guest User

startup

a guest
Oct 2nd, 2014
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.08 KB | None | 0 0
  1. T = peripheral.wrap('BigReactors-Turbine_0')
  2. R = peripheral.wrap('BigReactors-Reactor_0')
  3. R.setAllControlRodLevels(100)
  4. function CheckTurbine()
  5. Tactive = T.getActive()
  6. TRPM = T.getRotorSpeed()
  7. print("Turbine is active: ", Tactive)
  8. print("Turbine speed: ", TRPM)
  9. if TRPM >= 900 then
  10.     T.setActive(false)
  11.     R.setActive(false)
  12.     R.setAllControlRodLevels(100)
  13. elseif TRPM <= 850 then
  14.     T.setActive(true)
  15. end
  16. end
  17.  
  18. function CheckReactor()
  19. Ractive = R.getActive()
  20. RTempCase = R.getCasingTemperature()
  21. RTempFuel = R.getFuelTemperature()
  22. RRodLevel = R.getControlRodLevel(1)
  23. print("Reactor is active: ", Ractive)
  24. print("Case/Frame Heat: ", RTempCase)
  25. print("Fuel Heat: ", RTempFuel)
  26. print("Control Rod Level: ", RRodLevel)
  27. if (RTempCase >= 1800) or (RTempFuel >= 1800) then
  28.     R.setActive(false)
  29.     R.setAllControlRodLevels(100)
  30.     print("[WARNING] Emergency stop")
  31. elseif (RTempCase <= 1700) and (RTempFuel <= 1700) then
  32.     R.setActive(true)
  33.     R.setAllControlRodLevels(97)
  34. end
  35. end
  36.  
  37. while true do
  38. CheckReactor()
  39. print("")
  40. CheckTurbine()
  41. os.sleep(2)
  42. term.clear()
  43. term.setCursorPos(1,1)
  44. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement