Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- reactor = "BigReactors-Reactor_23"
- monitor = "monitor_27"
- logo = "logo"
- rmax = 9999999
- l = paintutils.loadImage(logo)
- r = peripheral.wrap(reactor)
- m = peripheral.wrap(monitor)
- amount = r.getEnergyStored()
- active = r.getActive()
- fuel = r.getFuelAmount()
- fuelmax = r.getFuelAmountMax()
- function printlogo(x,y)
- paintutils.drawImage(l,x,y)
- end
- function resetcolors()
- term.setTextColor(colors.white)
- term.setBackgroundColor(colors.black)
- end
- function activetog()
- term.current()
- active = r.getActive()
- local event, side, xPos, yPos = os.pullEvent("monitor_touch")
- if xPos < 2 and yPos == 1 then
- if active == true then
- r.setActive(false)
- print("Activity off")
- elseif active == false then
- r.setActive(true)
- print("Activity on")
- end
- end
- end
- function looprun()
- while true do
- active = r.getActive()
- amount = r.getEnergyStored()
- fuel = r.getFuelAmount()
- percent = math.ceil((fuel / fuelmax) * 100)
- term.redirect(m) --Sets functions to monitor.
- term.clear()
- if active == true then
- term.setCursorPos(1,1)
- term.setBackgroundColor(colors.green)
- write(" ")
- elseif active == false then
- term.setCursorPos(1,1)
- term.setBackgroundColor(colors.red)
- write(" ")
- end
- printlogo(3,-1)
- resetcolors()
- term.setCursorPos(1,17)
- term.setTextColor(colors.red)
- write("Fuel: ")
- term.setTextColor(colors.green)
- write(fuel)
- term.setCursorPos(15,17)
- term.setTextColor(colors.red)
- write("Percent: ")
- term.setTextColor(colors.green)
- write("%"..percent)
- term.setCursorPos(1,18)
- term.setTextColor(colors.red)
- write("RF:")
- term.setTextColor(colors.green)
- write(amount)
- term.setCursorPos(15,18)
- term.setTextColor(colors.red)
- write("Active: ")
- term.setTextColor(colors.green)
- write(tostring(active))
- resetcolors()
- term.current()
- sleep(0.2)
- end
- end
- while true do
- parallel.waitForAny( looprun, activetog )
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement