Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local startString = "[-------------------------------------]"
- local firstOff = 0
- local flatCounter = 35
- local fullCounter = 0
- local counterJump = 0
- local characterCount = 36
- function statusBar(loop, duration)
- counterJump = characterCount / duration
- fullCounter = counterJump * loop
- flatCounter = characterCount - counterJump * loop - 1
- if characterCount % duration ~= 0 then
- firstOff = 1
- end
- flatCounter = flatCounter + firstOff
- if loop == duration then
- flatCounter = flatCounter - firstOff
- end
- if loop == 0 then
- print("Progress:")
- print(startString)
- else
- setProgressBar()
- end
- end
- function setProgressBar()
- local text = ""
- for i = 0, fullCounter do
- text = text .. "0"
- end
- for j = 0, flatCounter do
- text = text .. "-"
- end
- fullCounter = fullCounter + counterJump
- flatCounter = flatCounter - counterJump
- print("Progress:")
- print("[" .. text .. "]")
- end
Add Comment
Please, Sign In to add comment