Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --bar API
- --BgColor = bar unused
- --BColor = Bar Color
- --Percent = Percentage that needs to be filled
- --CX, Cursor X pos
- --CY, Cursor Y pos
- --
- -- Made By SteamPunk_Devil -- CCfourm Name Makeme -- Ingame Name SteamPunk_Angel
- function Percentage(current,total) --returns One number as a percentage of the second one --TBD Round to a Decimal place
- local No1 = current
- local No2 = total
- local Percent = (No1 / No2) * 100
- return Percent
- end
- function Round(num, idp)
- local mult = 10^(idp or 0)
- return math.floor(num * mult + 0.5) / mult
- end
- function PercentBar(CursorX, CursorY, InActiveColor, ActiveColor, TextColor, n, Mon)
- local n10 = n/10
- local BarCursX = CursorX
- local BarCursY = CursorY
- local FormdN = Round(n10, 0)
- local i = 0
- local Paste = Mon or term
- Paste.setCursorPos(CursorX, CursorY)
- Paste.setBackgroundColor(InActiveColor)
- Paste.write(" ")
- Paste.setCursorPos(CursorX, CursorY)
- Paste.setBackgroundColor(ActiveColor)
- Paste.setTextColor(TextColor)
- Paste.write(string.rep("/",formdN))
- BarCursX = BarCursX + FormdN
- end
Advertisement
Add Comment
Please, Sign In to add comment