Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Turbine Control v1.0
- lT = Large Turbine
- sT = Small Turbine
- Displays power output and auto adjusts turbine speed
- --]]
- lT1 = BigReactors-Turbine_5
- lT2 = BigReactors-Turbine_15
- lT3 = BigReactors-Turbine_16
- lT4 = BigReactors-Turbine_4
- lT5 = BigReactors-Turbine_17
- lT6 = BigReactors-Turbine_18
- lT7 = BigReactors-Turbine_6
- lT8 = BigReactors-Turbine_19
- sT1 = BigReactors-Turbine_7
- sT2 = BigReactors-Turbine_8
- sT3 = BigReactors-Turbine_9
- sT4 = BigReactors-Turbine_10
- sT5 = BigReactors-Turbine_11
- sT6 = BigReactors-Turbine_12
- sT7 = BigReactors-Turbine_13
- sT8 = BigReactors-Turbine_14
- local lPower = 0
- local sPower = 0
- local oPower = 0
- while true do
- --Gather the power production levels
- lPower = lT1.getEnergyProducedLastTick + lT1.getEnergyProducedLastTick + lT1.getEnergyProducedLastTick + lT1.getEnergyProducedLastTick + lT1.getEnergyProducedLastTick + lT1.getEnergyProducedLastTick + lT1.getEnergyProducedLastTick + lT1.getEnergyProducedLastTick
- sPower = sT1.getEnergyProducedLastTick + sT1.getEnergyProducedLastTick + sT1.getEnergyProducedLastTick + sT1.getEnergyProducedLastTick + sT1.getEnergyProducedLastTick + sT1.getEnergyProducedLastTick + sT1.getEnergyProducedLastTick + sT1.getEnergyProducedLastTick
- oPower = lPower + sPower
- --Display the power production and turbine status
- function display()
- term.clear()
- term.setCursorPos(1,1)
- print("Large Turbine Power Output - " ..lPower "RF/t")
- print("Small Turbine Power Output - " ..Spower "RF/t")
- print("Overall Power Output - " ..oPower "RF/t")
- print("Large Turbine 1 Active - " ..lT1.getActive())
- print("Large Turbine 2 Active - " ..lT2.getActive())
- print("Large Turbine 3 Active - " ..lT3.getActive())
- print("Large Turbine 4 Active - " ..lT4.getActive())
- print("Large Turbine 5 Active - " ..lT5.getActive())
- print("Large Turbine 6 Active - " ..lT6.getActive())
- print("Large Turbine 7 Active - " ..lT7.getActive())
- print("Large Turbine 8 Active - " ..lT8.getActive())
- print("Small Turbine 1 Active - " ..sT1.getActive())
- print("Small Turbine 2 Active - " ..sT2.getActive())
- print("Small Turbine 3 Active - " ..sT3.getActive())
- print("Small Turbine 4 Active - " ..sT4.getActive())
- print("Small Turbine 5 Active - " ..sT5.getActive())
- print("Small Turbine 6 Active - " ..sT6.getActive())
- print("Small Turbine 7 Active - " ..sT7.getActive())
- print("Small Turbine 8 Active - " ..sT8.getActive())
- end
- --Stops and starts the turbines based on internal storage levels
- if lT1getEnergyStored >= 980000 then
- lT1.setActive(false)
- else
- lT1.setActive(true)
- end
- --Auto adjust of the Large turbines
- function lSpeed()
- if lT1.getRotorSpeed >= 1820 then
- lT1.setFluidFlowRateMax = lT1setFluidFlowRateMax - 1
- end
- if lT1.getRotorSpeed <= 1800 then
- lT1.setFluidFlowRateMax = lT1setFluidFlowRateMax + 1
- end
- end
- --Auto adjust of the Small turbines
- function sSpeed()
- if sT1.getRotorSpeed >= 920 then
- sT1.setFluidFlowRateMax = lT1setFluidFlowRateMax - 1
- end
- if sT1.getRotorSpeed <= 900 then
- sT1.setFluidFlowRateMax = lT1setFluidFlowRateMax + 1
- end
- end
- display()
- sleep(5)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement