Advertisement
theoriginalbit

Loading API: Example — ASCII

Jan 13th, 2013
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.96 KB | None | 0 0
  1. os.loadAPI( "/load")
  2.  
  3. local logo = {
  4.     "7   7              7     7        77 3   3 3  ",
  5.     "7   7                              7 3     3  ",
  6.     "777 777 777 777 77 7 777 7 777 777 7 333 3 333",
  7.     "7   7 7 7 7 7 7 7  7 7 7 7 7 7 7 7 7 3 3 3 3  ",
  8.     "7   7 7 777 7 7 7  7 777 7 7 7 777 7 3 3 3 3  ",
  9.     "7   7 7 7   7 7 7  7   7 7 7 7 7 7 7 3 3 3 3  ",
  10.     " 77 7 7 777 777 7  7 777 7 7 7 7 7 7 333 3  33",
  11. }
  12.  
  13. local bar = load.init( load.ASCII, logo, 10, 30, 14, nil, "Starting up...", "Load Screen Example", "By TheOriginalBIT" )
  14.  
  15. local function dostuff()
  16.     bar:setMessage( "Downloading...")
  17.     for i = 1, 9 do
  18.         sleep(1) -- normally something would be done here, please for the love of ___ don't just sleep it, this api isn't designed for fake loading screens
  19.         bar:triggerUpdate( "Downloading ("..( bar:getCurrentProgress() + 1 ).."/10)..." )
  20.     end
  21.    
  22.     bar:triggerUpdate( "Done!" )
  23. end
  24.  
  25. local function dobar()
  26.     bar:run( true )
  27. end
  28.  
  29. parallel.waitForAll( dobar, dostuff )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement