Advertisement
Ubidibity

brturbine20160722

Jul 22nd, 2016
189
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. -- computer_8, monitor_4, turbine_0, reactor_6, cap3
  8.  
  9. function tscram()
  10. -- a turbine's going to fast, CPO3's yellin' "Shut 'em all down!!"
  11.     turbine1.setActive(false)
  12. --    turbine2.setActive(false)
  13. --    turbine3.setActive(false)
  14. --    turbine4.setActive(false)
  15.     mon.setTextColor(colors.red)
  16.     print("TURBINE SCRAM!!!!  (2 min power down)")
  17.     sleep(120)
  18. end
  19.  
  20. local reactor1 = peripheral.wrap("BigReactors-Reactor_58")
  21. local mon = peripheral.wrap("monitor_86")
  22. local turbine1 = peripheral.wrap("BigReactors-Turbine_48")
  23. --local turbine2 = peripheral.wrap("BigReactors-Turbine_2")
  24. --local turbine3 = peripheral.wrap("BigReactors-Turbine_3")
  25. --local turbine4 = peripheral.wrap("BigReactors-Turbine_4")
  26. local capacitor1 = peripheral.wrap("tile_blockcapacitorbank_name_3")
  27. local tspeed1 = 0
  28. local tspeed2 = 0
  29. local tspeed3 = 0
  30. local tspeed4 = 0
  31.  
  32. -- basic capacitor low, 10k of 100k capacity
  33. local low = 10000
  34. -- turbine high 80k 1000000 capacity
  35. local high = 80000
  36. -- turbine full at 1M
  37. local full = 1000000
  38.  
  39. reactor1.setAllControlRodLevels(64)
  40. -- was 60,60,60,70,70
  41.  
  42. while true do
  43. -- note the rod percentage is dependant upon blades, rotor material, and number of turbines
  44. -- this number is for 1 80 blade turbine with electrum rotors (37\ blocks)
  45.  
  46.   if capacitor1.getEnergyStored() <= low then
  47. --    reactor1.setAllControlRodLevels(85)
  48.     if reactor1.getActive() == false then
  49.       reactor1.setActive(true)
  50.     end
  51.   end
  52.  
  53. -- just turn it off when the turbine is full
  54. --  if turbine1.getEnergyStored() >= full then
  55. --     reactor1.setActive(false)
  56. --  else
  57.     if turbine1.getEnergyStored() >= high then
  58. --      reactor1.setAllControlRodLevels(95)
  59.       reactor1.setActive(false)
  60.     end
  61. --  end
  62.  
  63.   mon.clear()
  64.  
  65.   mon.setTextScale(1)
  66.   mon.setCursorPos(15,19)
  67.   mon.setTextColor(colors.blue)
  68.   mon.write("pooter stat(os)")
  69.  
  70.   mon.setCursorPos(1,1)
  71.   mon.setTextColor(colors.white)
  72.   mon.write("Active: ")
  73.   mon.setTextColor(colors.green)
  74.   mon.write(reactor1.getActive())
  75.    
  76.   mon.setCursorPos(1,2)
  77.   mon.setTextColor(colors.white)
  78.   mon.write("Casing Heat: ")
  79.   mon.setTextColor(colors.green)
  80.   mon.write(math.floor(reactor1.getCasingTemperature()))
  81.  
  82.   mon.setCursorPos(1,3)
  83.   mon.setTextColor(colors.white)
  84.   mon.write("Fuel Heat: ")
  85.   mon.setTextColor(colors.green)
  86.   mon.write(math.floor(reactor1.getFuelTemperature()))
  87.  
  88.   mon.setCursorPos(1,4)
  89.   mon.setTextColor(colors.white)
  90.   mon.write("T1,2,3,4-RF: ")  
  91.   mon.setTextColor(colors.green)
  92.   mon.write(math.floor(turbine1.getEnergyStored())
  93. --,",",
  94.  --           math.floor(turbine2.getEnergyStored()),",",
  95.  --           math.floor(turbine3.getEnergyStored()),",",
  96.  --           math.floor(turbine4.getEnergyStored())
  97.            )
  98.   mon.setCursorPos(1,5)
  99.   mon.setTextColor(colors.white)
  100.   mon.write("C-RF: ")  
  101.   mon.setTextColor(colors.green)
  102.   mon.write(math.floor(capacitor1.getEnergyStored()))
  103.  
  104.   mon.setCursorPos(1,6)
  105.   tspeed1 = math.floor(turbine1.getRotorSpeed())
  106.   if tspeed1>2000 then
  107.     tscram()
  108.   end
  109. --  tspeed2 = math.floor(turbine1.getRotorSpeed())
  110. --  if tspeed2>2000 then
  111. --    tscram()
  112. --  end
  113. --  tspeed3 = math.floor(turbine1.getRotorSpeed())
  114. --  if tspeed3>2000 then
  115. --    tscram()
  116.  -- end
  117. --  tspeed4 = math.floor(turbine1.getRotorSpeed())
  118. --  if tspeed4>2000 then
  119. --    tscram()
  120. --  end
  121.   mon.setCursorPos(1,6)
  122.  
  123.   mon.setTextColor(colors.white)
  124.   turbine1.setActive(true)
  125.  
  126.   mon.write("T1-T4 RPM: ")  
  127.   mon.setTextColor(colors.green)
  128.   mon.write(tspeed1,tspeed2,tspeed3,tspeed4)
  129.  
  130.   mon.setCursorPos(1,7)
  131.   mon.setTextColor(colors.white)
  132.   mon.write("T1-Fin: ")  
  133.   mon.setTextColor(colors.green)
  134.   mon.write(math.floor(turbine1.getInputAmount()))
  135.  
  136.   mon.setCursorPos(1,8)
  137.   mon.setTextColor(colors.white)
  138.   mon.write("T1-Fout: ")  
  139.   mon.setTextColor(colors.green)
  140.   mon.write(math.floor(turbine1.getOutputAmount()))
  141.  
  142.   sleep(10)
  143. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement