Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local component = require("component")
- local term = require("term")
- local sides = require("sides")
- local reactor = component.nc_fission_reactor
- local rs = component.redstone
- local max_energy_perc = 95
- local min_energy_perc = 20
- local max_heat_perc = 80
- local y = 1
- reactor.activate()
- local function distacco(carattere)
- gpu = component.gpu
- local a,b = gpu.getResolution()
- math.floor(a)
- for i=1,a do
- io.write(carattere)
- end
- end
- term.clear()
- term.setCursor(1, y)
- distacco("-")
- print("Lunghezza X: " .. reactor.getLengthX())
- print("Lunghezza Y: " .. reactor.getLengthY())
- print("Lunghezza Z: " .. reactor.getLengthZ())
- distacco("-")
- print("Moltiplicatore calore: " .. math.floor(reactor.getHeatMultiplier()*1)*1 .. "%")
- print("Celle: " .. reactor.getNumberOfCells())
- print("Massimo energia settata: " .. max_energy_perc .. "%")
- print("Minimo energia settata: " .. min_energy_perc .. "%")
- print("Massimo calore settato: " .. max_heat_perc .. "%")
- distacco("-")
- print("Combustibile: " .. reactor.getFissionFuelName())
- print("Energia combustibile: " .. reactor.getFissionFuelPower() .. " FE/t")
- print("Produzione reattore: " .. reactor.getReactorProcessPower() .. " FE/t")
- print("Tempo di decadimento combustibile base: " .. math.floor((reactor.getFissionFuelTime() / 1200)*100)/100 .. " min")
- print("Effettivo tempo di decadimento combustibile: " .. math.floor((reactor.getReactorProcessTime() / 1200)*100)/100 .. " min")
- print("Efficienza: " .. math.floor(reactor.getEfficiency()*10)/10 .. "%")
- local c = 0
- c,y = term.getCursor()
- while y<17 do
- y = y + 1
- end
- while true do
- heat_perc = reactor.getHeatLevel() * 100 / reactor.getMaxHeatLevel()
- energy_perc = reactor.getEnergyStored() * 100 / reactor.getMaxEnergyStored()
- energy_indicator = math.floor((reactor.getEnergyStored() * 11 / reactor.getMaxEnergyStored())*1)*1
- rs.setOutput(sides.east, energy_indicator)
- term.setCursor(1, y)
- print("Combustibile rimasto: " .. math.floor((100 - (100 * (reactor.getCurrentProcessTime() / reactor.getFissionFuelTime())))* 10) / 10 .. "% ")
- print("Livello di calore attuale: " .. reactor.getHeatLevel()/1000 .. " kH / " .. reactor.getMaxHeatLevel()/1000 .. " kH / " .. math.floor(heat_perc*10)/10 .. "% ")
- print("Livello di energia attuale: " .. reactor.getEnergyStored()/1000 .. " kFE / " .. reactor.getMaxEnergyStored()/1000 .. " kFE / " .. math.floor(energy_perc*10)/10 .. "% ")
- if reactor.isProcessing() == true then
- print("Reattore ON ")
- else
- print("Reattore OFF ")
- end
- if rs.getInput(sides.top) == 0 then
- reactor.deactivate()
- break
- end
- if heat_perc == 0 then
- if energy_perc > max_energy_perc then
- reactor.deactivate()
- forc = true
- end
- if energy_perc < min_energy_perc then
- reactor.activate()
- forc = false
- end
- elseif heat_perc > max_heat_perc then
- reactor.deactivate()
- end
- os.sleep(0.5)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement