Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local component = require( "component" )
- local gpu = component.gpu
- local event = require( "event" )
- local filesystem = require("filesystem")
- local oldW, oldH = gpu.getResolution()
- gpu.setResolution( 160, 50 )
- local artofmana = 0
- local braderz = 0
- local english = 0
- local write = 0
- function clearScreen()
- local oldColor = gpu.getBackground( false )
- local w,h = gpu.getResolution()
- gpu.setBackground( 0x000000, false )
- gpu.fill( 1, 1, w, h, " " )
- gpu.setBackground( oldColor, false )
- end
- function progressBar( label, y, value, maxVal, color, show, unit )
- local oldColor = gpu.getBackground( false )
- gpu.setBackground(0x000000, false)
- gpu.fill( 3, y, 75, 2, " " )
- w = math.floor( value * (75 / maxVal) )
- p = math.floor( (w / 75) * 100 )
- gpu.set( 3, y, label .. ": " .. tostring( p ) .. "%" )
- gpu.setBackground( 0x222222, false )
- gpu.fill( 3, y+1, 75, 1, " " )
- gpu.setBackground( color, false )
- gpu.fill( 3, y+1, w, 1, " " )
- gpu.setBackground( oldColor, false )
- if show then
- local valStr = formatBig( value ) .. unit
- local n = string.len( valStr )
- gpu.set( 78 - n, y, valStr )
- end
- end
- clearScreen()
- local max = 10000
- local cur = 0
- while true do
- local _,_,x,y = event.pull( 1, "touch" )
- if x and y then goto quit end
- progressBar( "ArtofMana", 2, artofmana, 15, 0xff0000, false, "Points" )
- progressBar( "BraderzBuilds", 5, braderz, 15, 0xff0000, false, "Points" )
- progressBar( "EnglishMystery", 8, english, 15, 0xff0000, false, "Points" )
- progressBar( "WriteEscape", 11, write, 15, 0xff0000, false, "Points" )
- os.sleep(0.25)
- end
- ::quit::
- gpu.setResolution( oldW, oldH )
- clearScreen()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement