Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while true do
- -- REACTOR
- local reactor = peripheral.wrap("BigReactors-Reactor_1")
- local low = 1000000
- local high = 8000000
- if reactor.getEnergyStored() >= high then
- reactor.setAllControlRodLevels(100)
- term.setCursorPos(1,1)
- term.clear()
- term.setCursorPos(1,1)
- print("Powered! [ ]")
- sleep(1)
- term.clear()
- term.setCursorPos(1,1)
- print("Powered! [. ]")
- sleep(1)
- term.clear()
- term.setCursorPos(1,1)
- print("Powered! [.. ]")
- sleep(1)
- term.clear()
- term.setCursorPos(1,1)
- print("Powered! [...]")
- else
- reactor.setAllControlRodLevels(0)
- term.setCursorPos(1,1)
- term.clear()
- print("Powering Up!")
- term.clear()
- sleep(1)
- end
- -- MONITOR --
- local mon = peripheral.wrap("monitor_0")
- local power = reactor.getEnergyStored()
- local powerProduced = reactor.powerProducedLastTick()
- local controlRodLevel = reactor.controlRodLevel(all)
- -- Monitor Coordinates
- local reactorActiveCoords = 2,2
- local powerCoords = 2,4
- local percentPowerStoredCoords = 2,5
- local energyProducedLastTickCoords = 2,6
- local controlRodLevelCoords = 2,7
- -- Monitor Colors
- local backgroundColor = colors.black
- local reactorActiveColor = colors.blue
- local powerColor = colors.blue
- local percentPowerStoredColor = colors.blue
- local energyProducedLastTickColor = colors.blue
- local controlRodLevelColor = colors.blue
- --[[
- local mX, mY = mon.getSize()
- function monWriteCen(text, y)
- mon.setCursorPos((#text-mX)/2, y)
- mon.write(text)
- end
- --]]
- mon.setBackgroundColor(backgroundColor)
- mon.clear() --for mon.setBackgroundColor(color.blue) to work
- mon.setTextScale(2) -- Text scale
- -- Loading screen, to make sure the monitor is online
- mon.setCursorPos(1,1)
- mon.clear()
- mon.write("[ ]")
- sleep(1)
- mon.clear()
- mon.setCursorPos(1,1)
- mon.write("[. ]")
- sleep(1)
- mon.clear()
- mon.setCursorPos(1,1)
- mon.write("[.. ]")
- sleep(1)
- mon.clear()
- mon.setCursorPos(1,1)
- mon.write("[...]")
- --sleep(1) -- added to the end code
- -- Reactor Active
- mon.setCursorPos(reactorActiveCoords)
- mon.setTextColor(reactorActiveColor)
- mon.write("Reactor is: ")
- if reactor.getActive(true) then
- mon.setTextColor(colors.green)
- mon.write("Online")
- else
- mon.setTextColor(colors.red)
- mon.write("Offline")
- end
- -- Power Stored
- mon.setCursorPos(powerStoredCoords)
- mon.setTextColor(powerStoredColor)
- mon.write("Power/1k: ")
- if power >= 2000000
- mon.setTextColor(colors.green)
- else
- mon.set TextColor(colors.red)
- end
- mon.write(math.abs(power/1000))
- mon.write("K RF")
- -- Percent Power Stored
- mon.setCursorPos(percentPowerStoredCoords)
- mon.setTextColor(percentPowerStoredColor)
- mon.write("Reactor is ")
- if power >= 2000000
- mon.setTextColor(colors.green)
- else
- mon.set TextColor(colors.red)
- end
- mon.write(power/10000000)
- mon.write("% Full of Energy")
- -- Energy Produced Last Tick
- mon.setCursorPos(energyProducedLastTickCoords)
- mon.setTextColor(energyProducedLastTickColor)
- mon.write("Power Produced: ")
- if powerProduced >= 0
- mon.setTextColor(colors.green)
- else
- mon.set TextColor(colors.red)
- end
- mon.write(powerProduced)
- mon.write(" RF")
- -- Control Rod Level
- mon.setCursorPos(controlRodLevelCoords)
- mon.setTextColor(controlRodLevelColor)
- mon.write("Control Rod: ")
- if controlRodLevel >= 100
- mon.setTextColor(colors.green)
- else
- mon.set TextColor(colors.red)
- end
- mon.write(controlRodLevel)
- mon.write("% Extended")
- sleep(1) -- Rate at which the monitor updates
- end
- --[[
- getActive
- getEnergyStored
- getEnergyProducedLastTick
- getControlRodLevel(all)?
- getFuelAmount,getFuelAmountMax,getFuelConsumedLastTick
- getWasteAmount
- getFuelTemperature
- getCasingTemperature
- getFuelReactivity
- setActive
- setAllControlRodLevels
- doEjectWaste
- doEjectFuel
- --]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement