Advertisement
Guest User

startup

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