Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local comp = require("component")
- local term = require("term")
- local sides = require("sides")
- local reactor = comp.nc_fission_reactor
- local rs = comp.redstone
- local max_energy_perc = 95
- local min_energy_perc = 20
- local max_heat_perc = 80
- local y = 1
- reactor.activate()
- term.clear()
- term.setCursor(1, y)
- print("---------------------------")
- print("Length X: " .. reactor.getLengthX())
- print("Length Y: " .. reactor.getLengthY())
- print("Length Z: " .. reactor.getLengthZ())
- print("---------------------------")
- print("Heat Multiplier: " .. math.floor(reactor.getHeatMultiplier()*1)*1 .. "%")
- print("Cells: " .. reactor.getNumberOfCells())
- print("Max energy range: " .. max_energy_perc .. "%")
- print("Min energy range: " .. min_energy_perc .. "%")
- print("Max heat range: " .. max_heat_perc .. "%")
- print("---------------------------")
- print("Fuel: " .. reactor.getFissionFuelName())
- print("Fuel energy: " .. reactor.getFissionFuelPower() .. " FE/t")
- print("Reactor production: " .. reactor.getReactorProcessPower() .. " FE/t")
- print("Fuel depletion time: " .. math.floor((reactor.getFissionFuelTime() / 1200)*100)/100 .. " min")
- print("Actual fuel depletion time: " .. math.floor((reactor.getReactorProcessTime() / 1200)*100)/100 .. " min")
- print("Efficiency: " .. math.floor(reactor.getEfficiency()*10)/10 .. "%")
- y = y + 17
- while true do
- heat_perc = reactor.getHeatLevel() * 100 / reactor.getMaxHeatLevel()
- energy_perc = reactor.getEnergyStored() * 100 / reactor.getMaxEnergyStored()
- term.setCursor(1, y)
- term.clearLine()
- print("Fuel remaining: " .. math.floor((100 - (100 * (reactor.getCurrentProcessTime() / reactor.getFissionFuelTime())))* 10) / 10 .. "%")
- term.clearLine()
- print("Current heat level: " .. reactor.getHeatLevel()/1000 .. " / " .. reactor.getMaxHeatLevel()/1000 .. " kH" .. " / " .. math.floor(heat_perc*10)/10 .. "%")
- term.clearLine()
- print("Current energy level: " .. reactor.getEnergyStored()/1000 .. " / " .. reactor.getMaxEnergyStored()/1000 .. " kFE" .. " / " .. math.floor(energy_perc*10)/10 .. "%")
- if rs.getInput(sides.top) ~= 0 then
- reactor.deactivate()
- break
- end
- if heat_perc == 0 then
- if reactor.isProcessing() == true then
- term.clearLine()
- print("Reactor ON")
- else
- term.clearLine()
- print("Reactor OFF")
- end
- if energy_perc > max_energy_perc then
- reactor.deactivate()
- end
- if energy_perc < min_energy_perc then
- reactor.activate()
- end
- elseif heat_perc > max_heat_perc then
- reactor.deactivate()
- end
- os.sleep(0.5)
- end
Add Comment
Please, Sign In to add comment