Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- monitor = peripheral.wrap("right")
- reactor = peripheral.wrap("BigReactors-Reactor_0")
- function stringer(input, count)
- output = ""
- for i=1,count,1 do
- output = output .. input
- end
- return output
- end
- lastVal = 0
- monitor.clear()
- function reactorf()
- monitor.setTextScale(1.5)
- monitor.setCursorPos(1,1)
- if (reactor.getActive() == true) then
- monitor.blit("Reactor is online ", stringer("f",26), stringer("d",26))
- else
- monitor.blit("Reactor is offline ", stringer("f",26), stringer("e",26))
- end
- monitor.setCursorPos(1,3)
- info = tostring(reactor.getEnergyStored())
- monitor.blit("Energy stored:" .. stringer(" ", 9 - string.len(info)) .. info .. " RF", stringer("4",15) .. stringer("0",9) .. "44", stringer("f", 26))
- calcs = math.floor(reactor.getEnergyStored() - lastVal)
- pnc = "e"
- if calcs > 0 then
- calcs = "+" .. calcs
- pnc = "d"
- end
- monitor.setCursorPos(1,6)
- if (math.floor(reactor.getEnergyStored() - lastVal)) ~= 0 then
- monitor.blit(stringer(" ", 20 - string.len(calcs)) .. calcs .. " RF/t ", stringer("f", 20 - string.len(calcs)) .. pnc .. stringer("0", string.len(calcs) - 1) .. stringer("4", 6), stringer("f", 26))
- end
- lastVal = reactor.getEnergyStored()
- monitor.setCursorPos(1,5)
- bar = reactor.getEnergyStored() / 10000000
- barwidth = bar * 24
- barwidth = math.floor(barwidth)
- perc = math.floor(bar * 100)
- perclen = string.len(tostring(perc))
- last = math.floor(reactor.getEnergyProducedLastTick())
- lastlen = string.len(last)
- monitor.blit(stringer(" ", 24 - perclen) .. perc .. "% ", "f" .. stringer("f", barwidth) .. stringer("0", 24 - barwidth) .. "f", "f" .. stringer("1", barwidth) .. stringer("7", 24 - barwidth) .. "f")
- monitor.setCursorPos(1,7)
- bar = math.floor( reactor.getEnergyProducedLastTick() / 300 * 24 )
- monitor.blit(" " .. last .. " RF/t" .. stringer(" ", 20 - lastlen), stringer("f", 26), " " .. stringer("5", bar) .. stringer("7", 24 - bar) .. "f")
- info = tostring(reactor.getFuelAmount())
- yellow = reactor.getFuelAmount()
- blue = reactor.getWasteAmount()
- total = reactor.getFuelAmountMax()
- black = total - yellow - blue
- yellowbar = yellow / total
- bluebar = blue / total
- blackbar = black / total
- yellowD = yellowbar * 24
- if (yellowD - math.floor(yellowbar * 24)) >= 0.5 then
- yellowD = yellowD + 1
- end
- blueD = bluebar * 24
- if (blueD - math.floor(bluebar * 24)) > 0.5 then
- blueD = blueD + 1
- end
- blackD = blackbar * 24
- if (blackD - math.floor(blackbar * 24)) > 0.5 then
- blackD = blackD + 1
- end
- yellowD = math.floor(yellowD)
- blueD = math.floor(blueD)
- blackD = math.floor(blackD)
- monitor.setCursorPos(1,9)
- monitor.blit(stringer(" ", 26), stringer("f", 26), " " .. stringer("4", yellowD) .. stringer("b", blueD) .. stringer("7", blackD) .. "f")
- monitor.setCursorPos(1,11)
- monitor.blit("Fuel stored:" .. stringer(" ", 11 - string.len(info)) .. info .. " mB", stringer("4",14) .. stringer("0",10) .. "44", stringer("f", 26))
- info = reactor.getWasteAmount()
- info = math.floor(info)
- monitor.setCursorPos(1,12)
- monitor.blit("Waste stored:" .. stringer(" ", 10 - string.len(info)) .. info .. " mB", stringer("b", 15) .. stringer("0", 9) .. "44", stringer("f", 26))
- info = black
- monitor.setCursorPos(1,13)
- monitor.blit("Empty:" .. stringer(" ", 17 - string.len(info)) .. info .. " mB", stringer("8", 6) .. stringer("0", 18) .. "88", stringer("f", 26))
- end
- while true do
- reactorf()
- sleep(1/20)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement