Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local component = require("component")
- local thread = require("thread")
- local reactor = component.nc_fission_reactor
- local functions = {}
- function functions.checkState() end
- --Will return true if the reactor is processing(on) or false if it is not processing(off)
- --This function returns a boolean value (true or false)
- function functions.checkEnergyLevel() end
- --Will return the current energy level of the reactor
- --This function returns a double (0.0100000)
- function functions.checkHeatLevel() end
- --Will return the current heat level of the reactor
- --This function returns a double (0.0100000)
- function functions.checkMaxHeatLevel() end
- --Will return the maximum heat level of the reactor
- function functions.checkEnergyChange() end
- --Returns the power change
- function functions.checkProcessHeat() end
- --Returns the reactor's heat output in negative or positive
- function functions.powerOutput() end
- --Returns the power output of the reactor
- function functions.currentStoredPower() end
- --Returns the currently stored power
- function functions.currentHeatLevel() end
- --Returns the current heat level
- function functions.fuelName() end
- --Returns the name of the current fuel being processed
- function functions.remainingProcessTime() end
- --Returns the remaining processing time for the current fuel type
- function functions.efficiency() end
- --Returns the efficiency of the current reactor setup
- function functions.changeReactorState() end
- --Will switch the reactor's active state
- function functions.auto() end
- --Will automate the reactor temperature and energy level monitoring
- function functions.autoWithoutMainUI() end
- --Will run the automation processes except that it will also display a very primitive UI
- function functions.main() end
- --This function should only be called if you do not want the primary GUI system.
- function functions.checkState()
- return reactor.isProcessing()
- end --end checkState
- function functions.checkEnergyLevel()
- return reactor.getEnergyStored() / reactor.getMaxEnergyStored()
- end --end checkEnergyLevel
- function functions.checkHeatLevel()
- return reactor.getHeatLevel() / reactor.getMaxHeatLevel()
- end --end cheackHeatLevel
- function functions.checkMaxHeatLevel()
- return reactor.getMaxHeatLevel()
- end --end checkMaxHeatLevel
- function functions.checkEnergyChange()
- return reactor.getEnergyChange()
- end --end checkEnergyChange
- function functions.checkProcessHeat()
- return reactor.getReactorProcessHeat()
- end --end checkProcessHeat
- function functions.powerOutput()
- return reactor.getReactorProcessPower()
- end --end powerOutput
- function functions.currentStoredPower()
- return reactor.getEnergyStored()
- end --end currentStoredPower
- function functions.currentHeatLevel()
- return reactor.getHeatLevel()
- end --end currentHeatLevel
- function functions.fuelName()
- return reactor.getFissionFuelName()
- end --end fuelName
- function functions.remainingProcessTime()
- return (reactor.getFissionFuelTime() - reactor.getCurrentProcessTime())
- end --end remainingProcessTime
- function functions.efficiency()
- return reactor.getEfficiency()
- end --end efficiency
- function functions.changeReactorState()
- if functions.checkState() then
- reactor.deactivate()
- else
- reactor.activate()
- end
- end --end changeReactorState
- function functions.auto()
- if (functions.checkState() == false) and (functions.checkEnergyLevel() <= 0.20) and (functions.checkHeatLevel() <= 0.20)then
- functions.changeReactorState() --turn on reactor
- elseif (functions.checkState()) and ((functions.checkEnergyLevel() >= 0.80) or (functions.checkHeatLevel() >= 0.80)) then
- functions.changeReactorState() --turn off reactor
- end
- end --end auto
- function functions.autoWithoutMainUI()
- functions.auto()
- print("Estado:", functions.checkState(), "; Nivel de energia:", functions.checkEnergyLevel() * 100, "%", "; ", "Nivel de calor:" , functions.checkHeatLevel() * 100, "%")
- print("-------------------------------------------------------------------------------------------------------------------------------------------")
- end --end autoWithoutMainUI
- function functions.main()
- functions.autoWithoutMainUI()
- return functions.main()
- end --end main
- return functions
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement