Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- This script provides more steam to turbine
- -- if below 1750 rpm until it reaches 1800 rpm,
- -- then reduces steam flow to preset rate that
- -- maintains desired power level.
- -- Also monitors reactor fuel and case temperature
- -- (Reactor control is separate rednet PRC)
- -- Requires wired modems for monitoring reactor
- -- Advance PC w/9x9 advance monitor recommended
- -- by efflandt - rename to 'startup' to auto boot
- local mon = peripheral.wrap("right")
- term.clear()
- mon.setBackgroundColor(colors.black)
- mon.setTextColor(colors.white)
- mon.setTextScale(1)
- mon.clear()
- mon.setCursorPos(1,1)
- mon.write("Decreases steam flow")
- mon.setCursorPos(1,2)
- mon.write("when up to speed")
- mon.setCursorPos(1,3)
- local turbine = peripheral.wrap("back")
- if turbine.getConnected() == true then
- mon.setTextColor(colors.green)
- mon.write("Turbine connected")
- else
- mon.setTextColor(colors.red)
- mon.write("Something wicked happened")
- end
- local reactor = peripheral.wrap("BigReactors-Reactor_0")
- mon.setCursorPos(1,10)
- mon.clearLine()
- if reactor.getConnected() == true then
- mon.write("Reactor connected")
- else
- mon.write("Reactor Com problem")
- end
- local maxSteam = 1860
- local normSteam = 1710
- local maxRPM = 1800
- local minRPM = 1750
- while true do
- local rpm = turbine.getRotorSpeed()
- if rpm > maxRPM then
- turbine.setFluidFlowRateMax(normSteam)
- elseif rpm < minRPM then
- turbine.setFluidFlowRateMax(maxSteam)
- end
- mon.setCursorPos(1,5)
- mon.clearLine()
- mon.setTextColor(colors.red)
- mon.write("Steam mB/t "..turbine.getFluidFlowRate())
- mon.setCursorPos(1,6)
- mon.clearLine()
- mon.setTextColor(colors.lightBlue)
- mon.write("RPM "..rpm)
- mon.setCursorPos(1,7)
- mon.clearLine()
- mon.setTextColor(colors.yellow)
- mon.write("RF/t "..turbine.getEnergyProducedLastTick())
- mon.setCursorPos(1,8)
- mon.clearLine()
- mon.setTextColor(colors.orange)
- mon.write("Buffer RF "..turbine.getEnergyStored())
- mon.setCursorPos(1,12)
- mon.clearLine()
- mon.setTextColor(colors.magenta)
- mon.write("Fuel temp C "..reactor.getFuelTemperature())
- mon.setCursorPos(1,13)
- mon.clearLine()
- mon.setTextColor(colors.cyan)
- mon.write("Case temp C "..reactor.getCasingTemperature())
- sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement