Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function drawProgBar(done, max)
- local value = done / max
- local _, y = term.getCursorPos()
- local wide, _ = term.getSize()
- term.setCursorPos(1,y)
- term.clearLine()
- term.write(("="):rep(math.floor(value * (wide - 6))))
- term.setCursorPos(math.floor(value * (wide - 6))), y)
- term.write(">")
- term.setCursorPos(wide - 6, y)
- term.write("]")
- term.setCursorPos(1, y)
- term.write("[")
- local percent = math.floor(value * 100) .. "%"
- term.setCursorPos(wide - percent:len(),y)
- term.write(percent)
- end
Add Comment
Please, Sign In to add comment