Advertisement
Ubidibity

BigReactor-20151107

Nov 7th, 2015
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- credits to:
  2. -- https://youtu.be/sHN-KQKUkaY
  3.  
  4. -- for an api reference, I use and recommend:
  5. -- http://ftbwiki.org/Reactor_Computer_Port
  6. -- http://ftbwiki.org/Turbine_Computer_Port
  7.  
  8.  
  9. local reactor1 = peripheral.wrap("BigReactors-Reactor_0")
  10. local mon = peripheral.wrap("monitor_0")
  11. local turbine1 = peripheral.wrap("BigReactors-Turbine_0")
  12. local capacitor1 = peripheral.wrap("tile_blockcapacitorbank_name_0")
  13. local tspeed = 0
  14.  
  15. -- basic capacitor low, 10k of 100k capacity
  16. local low = 10000
  17. -- turbine high 800k 1000000 capacity
  18. local high = 800000
  19. -- turbine full at 1M
  20. local full = 1000000
  21.  
  22. reactor1.setAllControlRodLevels(99)
  23.  
  24. while true do
  25. -- note the rod percentage is dependant upon blades, rotor material, and number of turbines
  26. -- this number is for 1 80 blade turbine with electrum rotors (37 blocks)
  27.  
  28.   if capacitor1.getEnergyStored() <= low then
  29.     reactor1.setAllControlRodLevels(85)
  30.     if reactor1.getActive() == false then
  31.       reactor1.setActive(true)
  32.     end
  33.   end
  34.  
  35.   if reactor1.getEnergyStored() == full then
  36.      reactor1.setActive(false)
  37.   else
  38.     if reactor1.getEnergyStored() >= high then
  39.       reactor1.setAllControlRodLevels(95)
  40.       reactor1.setActive(true)
  41.     end
  42.   end
  43.  
  44.   mon.clear()
  45.  
  46.   mon.setTextScale(1)
  47.   mon.setCursorPos(15,20)
  48.   mon.setTextColor(colors.blue)
  49.   mon.write("pooter stat(os)")
  50.  
  51.   mon.setCursorPos(1,1)
  52.   mon.setTextColor(colors.white)
  53.   mon.write("Active: ")
  54.   mon.setTextColor(colors.green)
  55.   mon.write(reactor1.getActive())
  56.    
  57.   mon.setCursorPos(1,2)
  58.   mon.setTextColor(colors.white)
  59.   mon.write("Casing Heat: ")
  60.   mon.setTextColor(colors.green)
  61.   mon.write(math.floor(reactor1.getCasingTemperature()))
  62.  
  63.   mon.setCursorPos(1,3)
  64.   mon.setTextColor(colors.white)
  65.   mon.write("Fuel Heat: ")
  66.   mon.setTextColor(colors.green)
  67.   mon.write(math.floor(reactor1.getFuelTemperature()))
  68.  
  69.   mon.setCursorPos(1,4)
  70.   mon.setTextColor(colors.white)
  71.   mon.write("T-RF: ")  
  72.   mon.setTextColor(colors.green)
  73.   mon.write(math.floor(turbine1.getEnergyStored()))
  74.  
  75.   mon.setCursorPos(1,5)
  76.   mon.setTextColor(colors.white)
  77.   mon.write("C-RF: ")  
  78.   mon.setTextColor(colors.green)
  79.   mon.write(math.floor(capacitor1.getEnergyStored()))
  80.  
  81.   tspeed = math.floor(turbine1.getRotorSpeed())
  82.   mon.setCursorPos(1,6)
  83.   if tspeed>2000 then
  84.     turbine1.setActive(false)
  85.     mon.setTextColor(colors.red)
  86.     sleep(120)
  87.   else
  88.     mon.setTextColor(colors.white)
  89.     turbine1.setActive(true)
  90.   end
  91.   mon.write("T-RPM: ")  
  92.   mon.setTextColor(colors.green)
  93.   mon.write(tspeed)
  94.  
  95.   mon.setCursorPos(1,7)
  96.   mon.setTextColor(colors.white)
  97.   mon.write("T-Fin: ")  
  98.   mon.setTextColor(colors.green)
  99.   mon.write(math.floor(turbine1.getInputAmount()))
  100.  
  101.   mon.setCursorPos(1,8)
  102.   mon.setTextColor(colors.white)
  103.   mon.write("T-Fout: ")  
  104.   mon.setTextColor(colors.green)
  105.   mon.write(math.floor(turbine1.getOutputAmount()))
  106.  
  107.   sleep(10)
  108. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement