Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- optimalFlow = 1750
- reactor = {}
- reactor[0] = peripheral.wrap("BigReactors-Reactor_0")
- reactor[1] = peripheral.wrap("BigReactors-Turbine_1")
- reactor[2] = peripheral.wrap("BigReactors-Turbine_2")
- reactor[3] = peripheral.wrap("BigReactors-Turbine_3")
- while true do
- flowGlobal = 0
- for i=1, (#reactor) do
- energyPourcent = math.floor(reactor[i].getEnergyStored() / 10000)
- flow = math.floor(optimalFlow * ((100 - energyPourcent)/100))
- flowGlobal = flowGlobal + flow
- reactor[i].setFluidFlowRateMax(flow)
- print("Energy Turbine " .. i .. ": " .. energyPourcent)
- print("Flow Turbine " .. i .. ": " .. flow)
- end
- flowLast = reactor[0].getEnergyProducedLastTick()
- rodLevel = reactor[0].getControlRodLevel(0)
- if flowLast < flowGlobal then
- reactor[0].setAllControlRodLevels(rodLevel - 1)
- else
- reactor[0].setAllControlRodLevels(rodLevel + 1)
- end
- print("RodLevel: " .. rodLevel)
- print("")
- sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement