Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while true do
- local r = peripheral.wrap("BigReactors-Reactor_0")
- local mon = peripheral.wrap("monitor_0")
- local reactorOnline = r.getActive()
- local energyProduction = r.getEnergyProducedLastTick()
- local energyStored = r.getEnergyStored()
- mon.clear()
- --Reactor Online
- mon.setCursorPos(1,1)
- mon.setTextColor(colors.white)
- mon.write("Active: ")
- if reactorOnline then
- mon.setTextColor(colors.lime)
- else
- mon.setTextColor(colors.red)
- end
- if reactorOnline then
- mon.write("True")
- else
- mon.write("False")
- end
- --RF/t Production
- mon.setCursorPos(1,2)
- mon.setTextColor(colors.white)
- mon.write("RF/t: ")
- if energyProduction <= 0 then
- mon.setTextColor(colors.red)
- else
- mon.setTextColor(colors.lime)
- end
- mon.write(math.floor(energyProduction).." RF/t")
- --Energy Stored
- mon.setCursorPos(1,3)
- mon.setTextColor(colors.white)
- mon.write("Energy Stored: ")
- if energyStored < 1000000 then
- mon.setTextColor(colors.red)
- else
- mon.setTextColor(colors.lime)
- end
- mon.write(math.floor(energyStored).." RF")
- --Activation Button Display
- if reactorOnline then
- mon.setCursorPos(19,1)
- mon.setTextColor(colors.red)
- else
- mon.setCursorPos(22,1)
- mon.setTextColor(colors.lime)
- end
- if reactorOnline then
- mon.write("De-Activate")
- else
- mon.write("Activate")
- end
- --Button Timer
- local myTimer = os.startTimer(.05)
- local event, side, x, y = os.pullEvent("monitor_touch")
- if y == 1 and x < 30 and x > 19 and reactorOnline then
- r.setActive(false)
- elseif y == 1 and x < 30 and x > 22 then
- r.setActive(true)
- else
- os.cancelTimer(myTimer)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment