Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- core = peripheral.wrap("draconic_storage_1")
- mon = peripheral.wrap("left")
- max = 2140000000000
- monX, monY = mon.getSize()
- function clear()
- mon.setBackgroundColor(colors.black)
- mon.clear()
- mon.setCursorPos(1,1)
- end
- function drawText(x, y, text, color_txt, color_bg)
- mon.setTextColor(color_txt)
- mon.setBackgroundColor(color_bg)
- mon.setCursorPos(x,y)
- mon.write(text)
- end
- function drawLine(x, y, length, size, color_bar)
- for yPos = y, y+size-1 do
- mon.setBackgroundColor(color_bar)
- mon.setCursorPos(x, yPos)
- mon.write(string.rep(" ", length))
- end
- end
- function drawProg(x, y, name, length, size, minVal, maxVal, color_bar, color_bg)
- drawLine(x, y, length, size, color_bg)
- local barSize = math.floor((minVal/maxVal)*length)
- drawLine(x, y, barSize, size, color_bar)
- local text = name .." ".. math.floor((minVal/maxVal)*100) .."%"
- drawText(monX/2-#text/2, y+size/2, text, colors.black, colors.green)
- end
- while true do
- local power = core.getEnergyStored()
- local percent = math.floor((power/max)*100)
- term.clear()
- term.setCursorPos(1,1)
- print("Receiving Energy Core Information")
- mon.getSize()
- mon.setCursorPos(1,1)
- mon.setTextColor(colors.white)
- mon.setTextScale(1)
- mon.write("Current Power: " .. .." RF")
- drawProg(2, 5, "Core at ", monX-2, 3, percent, 100, colors.green, colors.red)
- sleep(.2)
- clear()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement