Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --######################################
- --# LOCAL MONITOR VARS #
- --######################################
- local monitor = peripheral.wrap("right")
- local curLine = 1
- local monitorWidth, monitorHeight = monitor.getSize()
- --######################################
- --# LOCAL REACTOR VARS #
- --######################################
- local reactor = peripheral.wrap("BigReactors-Reactor_2")
- --######################################
- --# FUNCTIONS #
- --######################################
- function clearLine()
- local clear = ""
- for i = 1, monitorWidth, 1 do
- clear = clear.." "
- end
- monitor.write(clear)
- end
- function writeLine(Text)
- monitor.setCursorPos(1,curLine)
- clearLine()
- monitor.setCursorPos(1,curLine)
- monitor.write(Text)
- curLine = curLine + 1
- end
- function writeSeperationLine()
- monitor.setCursorPos(1,curLine)
- local seperatorText = ""
- for i = 1, monitorWidth, 1 do
- seperatorText = seperatorText.."-"
- end
- monitor.write(seperatorText)
- curLine = curLine + 1
- end
- function init()
- monitor.clear()
- writeLine("XXXXX XXXXX XXXXX XXXXX XXXXX")
- writeLine("X X X X X X X ")
- writeLine("XXXXX XXXXX XXXXX X X ")
- writeLine("X X X X X X X ")
- writeLine("X X XXXXX X X XXXXX X ")
- writeLine(" XXX XXX ")
- writeLine(" X X X ")
- writeLine(" X X X ")
- writeLine(" X X X ")
- writeLine(" XXX XXX V. 0.1")
- end
- function writeTime()
- local time = os.time()
- local timeString = textutils.formatTime(time)
- monitor.setCursorPos(1,monitorHeight)
- clearLine()
- monitor.setCursorPos(1,monitorHeight)
- monitor.write(timeString)
- end
- function reactorInfo()
- curLine = 12
- if reactor.getFuelAmount() < 155000 then
- writeLine("!!Reactor needs Fuel!!")
- end
- if reactor.getActive() then
- writeLine("Reactor: Active")
- if reactor.getEnergyStored() > 9000000 then
- reactor.setActive(false)
- end
- else
- writeLine("Reactor: Inactive")
- if reactor.getEnergyStored() == 0 then
- reactor.setActive(true)
- end
- end
- writeLine("Energy-Storage: "..reactor.getEnergyStored())
- writeLine("EnergyProduction: "..reactor.getEnergyProducedLastTick())
- writeLine("Fuel: "..reactor.getFuelAmount().." mb")
- writeLine("")
- writeLine("")
- end
- --######################################
- --# MAIN PROGRAMM #
- --######################################
- init()
- writeSeperationLine()
- while true do
- reactorInfo()
- writeTime()
- sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement