Advertisement
Guest User

newfile.lua

a guest
Feb 20th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.69 KB | None | 0 0
  1. local component = require( "component" )
  2. local gpu = component.gpu
  3. local power = component.mekanism_machine
  4. local event =require( "event" )
  5.  
  6. local oldW, oldH = gpu.getResolution()
  7. gpu.setResolution( 80, 11 )
  8.  
  9. function clearScreen()
  10.   local oldColor = gpu.getBackground( false )
  11.   local w,h = gpu.getResolution()
  12.   gpu.setBackground( 0x000000, false )
  13.   gpu fill( 1, 1, w, h, " " )
  14.   gpu.setBackground( oldColor, false )
  15. end
  16.  
  17. function progressBar( label, y, value, maxVal, color, show, unit )
  18.   local oldColor = gpu.getBackground( false )
  19.   gpu.setBackground(0x000000, false)
  20.   gpu.fill( 3, y, 75, 2, " " )
  21.   w = math.foor( value * (75 / maxVal) )
  22.   p = math.floor( (w/75)*100)
  23.   gpu.set(3,y,label..":"..
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement