SHARE
TWEET

Startup

a guest Jun 26th, 2019 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local Battery1 = peripheral.wrap("tile_enderio_blockcapacitorbank_name_6")
  2. local Battery2 = peripheral.wrap("tile_enderio_blockcapacitorbank_name_7")
  3. local Turbine11 = peripheral.wrap("BigReactors-Turbine_2")
  4. local Turbine12 = peripheral.wrap("BigReactors-Turbine_3")
  5. local Turbine13 = peripheral.wrap("BigReactors-Turbine_4")
  6. local Turbine21 = peripheral.wrap("BigReactors-Turbine_5")
  7. local Turbine22 = peripheral.wrap("BigReactors-Turbine_6")
  8. local Turbine23 = peripheral.wrap("BigReactors-Turbine_7")
  9. rednet.open("top")
  10.  
  11. Turbine_Speed = Turbine11.getRotorSpeed()
  12. Turbine11.setActive(true)
  13. Turbine12.setActive(true)
  14. Turbine13.setActive(true)
  15. Turbine21.setActive(true)
  16. Turbine22.setActive(true)
  17. Turbine23.setActive(true)
  18.    
  19. while Turbine_Speed < 1800 do
  20.   Turbine_Speed = Turbine11.getRotorSpeed()
  21.   Turbine11.setInductorEngaged(false)
  22.   Turbine11.setFluidFlowRateMax(2000)
  23.   sleep(1)
  24. end
  25. Turbine11.setInductorEngaged(true)
  26. print("Turbine 11 Active")
  27.  
  28. Turbine_Speed = Turbine12.getRotorSpeed()
  29. while Turbine_Speed < 1800 do
  30.   Turbine_Speed = Turbine12.getRotorSpeed()
  31.   Turbine12.setInductorEngaged(false)
  32.   Turbine12.setFluidFlowRateMax(2000)
  33.   sleep(1)
  34. end
  35. Turbine12.setInductorEngaged(true)
  36. print("Turbine 12 Active")
  37.  
  38. Turbine_Speed = Turbine13.getRotorSpeed()
  39. while Turbine_Speed < 1800 do
  40.   Turbine_Speed = Turbine13.getRotorSpeed()
  41.   Turbine13.setInductorEngaged(false)
  42.   Turbine13.setFluidFlowRateMax(2000)
  43.   sleep(1)
  44. end
  45. Turbine13.setInductorEngaged(true)
  46. print("Turbine 13 Active")
  47.  
  48. while Turbine_Speed < 1800 do
  49.   Turbine_Speed = Turbine21.getRotorSpeed()
  50.   Turbine21.setInductorEngaged(false)
  51.   Turbine21.setFluidFlowRateMax(2000)
  52.   sleep(1)
  53. end
  54. Turbine21.setInductorEngaged(true)
  55. print("Turbine 21 Active")
  56.  
  57. Turbine_Speed = Turbine22.getRotorSpeed()
  58. while Turbine_Speed < 1800 do
  59.   Turbine_Speed = Turbine22.getRotorSpeed()
  60.   Turbine22.setInductorEngaged(false)
  61.   Turbine22.setFluidFlowRateMax(2000)
  62.   sleep(1)
  63. end
  64. Turbine22.setInductorEngaged(true)
  65. print("Turbine 22 Active")
  66.  
  67. Turbine_Speed = Turbine23.getRotorSpeed()
  68. while Turbine_Speed < 1800 do
  69.   Turbine_Speed = Turbine23.getRotorSpeed()
  70.   Turbine23.setInductorEngaged(false)
  71.   Turbine23.setFluidFlowRateMax(2000)
  72.   sleep(1)
  73. end
  74. Turbine23.setInductorEngaged(true)
  75. print("Turbine 23 Active")
  76.  
  77.  
  78. while true do
  79.   Stored_Power1 = Battery1.getEnergyStored("west")
  80.   Max_Power1 = Battery1.getMaxEnergyStored("west")
  81.   Power1 = math.floor((Stored_Power1/Max_Power1)*100)
  82.   rednet.send(7,Power1,"tbank7")
  83.  
  84.   Stored_Power2 = Battery2.getEnergyStored("west")
  85.   Max_Power2 = Battery2.getMaxEnergyStored("west")
  86.   Power2 = math.floor((Stored_Power2/Max_Power2)*100)
  87.   rednet.send(7,Power2,"tbank8")
  88.  
  89.   if (Turbine11.getActive() == true) and (Turbine11.getInductorEngaged() == true) then
  90.     rednet.send(7,"Active","tb7one")
  91.   else
  92.     rednet.send(7,"Inactive","tb7one")
  93.   end
  94.  
  95.   if (Turbine12.getActive() == true) and (Turbine12.getInductorEngaged() == true) then
  96.     rednet.send(7,"Active","tb7two")
  97.   else
  98.     rednet.send(7,"Inactive","tb7two")
  99.   end
  100.  
  101.   if (Turbine13.getActive() == true) and (Turbine13.getInductorEngaged() == true) then
  102.     rednet.send(7,"Active","tb7three")
  103.   else
  104.     rednet.send(7,"Inactive","tb7three")
  105.   end
  106.  
  107.  
  108.   if (Turbine21.getActive() == true) and (Turbine21.getInductorEngaged() == true) then
  109.     rednet.send(7,"Active","tb8one")
  110.   else
  111.     rednet.send(7,"Inactive","tb8one")
  112.   end
  113.  
  114.   if (Turbine22.getActive() == true) and (Turbine22.getInductorEngaged() == true) then
  115.     rednet.send(7,"Active","tb8two")
  116.   else
  117.     rednet.send(7,"Inactive","tb8two")
  118.   end
  119.  
  120.   if (Turbine23.getActive() == true) and (Turbine23.getInductorEngaged() == true) then
  121.     rednet.send(7,"Active","tb8three")
  122.   else
  123.     rednet.send(7,"Inactive","tb8three")
  124.   end
  125.  
  126.   if Power1 <= 50 then
  127.     Turbine11.setInductorEngaged(true)
  128.     Turbine12.setInductorEngaged(true)
  129.     Turbine13.setInductorEngaged(true)
  130.     Turbine11.setFluidFlowRateMax(2000)
  131.     Turbine12.setFluidFlowRateMax(2000)
  132.     Turbine13.setFluidFlowRateMax(2000)
  133.   elseif (Power1 > 50) and (Power1 <= 80) then
  134.     Turbine11.setInductorEngaged(true)
  135.     Turbine12.setInductorEngaged(true)
  136.     Turbine13.setInductorEngaged(false)
  137.     Turbine11.setFluidFlowRateMax(2000)
  138.     Turbine12.setFluidFlowRateMax(2000)
  139.     Turbine13.setFluidFlowRateMax(5)
  140.   elseif (Power1 > 80) and (Power1 < 100) then
  141.     Turbine11.setInductorEngaged(true)
  142.     Turbine12.setInductorEngaged(false)
  143.     Turbine13.setInductorEngaged(false)
  144.     Turbine11.setFluidFlowRateMax(2000)
  145.     Turbine12.setFluidFlowRateMax(5)
  146.     Turbine13.setFluidFlowRateMax(5)
  147.   elseif Power1 == 100 then
  148.     Turbine11.setInductorEngaged(false)
  149.     Turbine12.setInductorEngaged(false)
  150.     Turbine13.setInductorEngaged(false)
  151.     Turbine11.setFluidFlowRateMax(5)
  152.     Turbine12.setFluidFlowRateMax(5)
  153.     Turbine12.setFluidFlowRateMax(5)
  154.   end
  155.  
  156.   if Power2 <= 50 then
  157.     Turbine21.setInductorEngaged(true)
  158.     Turbine22.setInductorEngaged(true)
  159.     Turbine23.setInductorEngaged(true)
  160.     Turbine21.setFluidFlowRateMax(2000)
  161.     Turbine22.setFluidFlowRateMax(2000)
  162.     Turbine23.setFluidFlowRateMax(2000)
  163.   elseif (Power2 > 50) and (Power2 <= 80) then
  164.     Turbine21.setInductorEngaged(true)
  165.     Turbine22.setInductorEngaged(true)
  166.     Turbine23.setInductorEngaged(false)
  167.     Turbine21.setFluidFlowRateMax(2000)
  168.     Turbine22.setFluidFlowRateMax(2000)
  169.     Turbine23.setFluidFlowRateMax(5)
  170.   elseif (Power2 > 80) and (Power2 < 100) then
  171.     Turbine21.setInductorEngaged(true)
  172.     Turbine22.setInductorEngaged(false)
  173.     Turbine23.setInductorEngaged(false)
  174.     Turbine21.setFluidFlowRateMax(2000)
  175.     Turbine22.setFluidFlowRateMax(5)
  176.     Turbine23.setFluidFlowRateMax(5)
  177.   elseif Power2 == 100 then
  178.     Turbine21.setInductorEngaged(false)
  179.     Turbine22.setInductorEngaged(false)
  180.     Turbine23.setInductorEngaged(false)
  181.     Turbine21.setFluidFlowRateMax(5)
  182.     Turbine22.setFluidFlowRateMax(5)
  183.     Turbine23.setFluidFlowRateMax(5)
  184.   end
  185.  
  186.   sleep()
  187. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top