Advertisement
SirBaconBitz

Loading Screen

Apr 9th, 2014
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.07 KB | None | 0 0
  1. --width = 532 on 1600 x 900 display
  2. messages = {[1]="640K ought to be enough for anybody",
  3. [2]="the architects are still drafting",
  4. [3]="the bits are breeding",
  5. [4]="it's still faster than you could draw it",
  6. [5]="would you prefer chicken, steak, or tofu?",
  7. [6]="pay no attention to the man behind the curtain",
  8. [7]="and enjoy the elevator music",
  9. [8]="the bits are flowing slowly today",
  10. [9]="a few bits tried to escape, but we caught them",
  11. [10]="and dream of faster computers",
  12. [11]="would you like fries with that?",
  13. [12]="checking the gravitational constant in your locale",
  14. [13]="go ahead -- hold your breath",
  15. [14]="at least you're not on hold",
  16. [15]="hum something loud while others stare",
  17. [16]="you're not in Kansas any more",
  18. [17]="the server is powered by a lemon and two electrodes",
  19. [18]="we love you just the way you are",
  20. [19]="while a larger software vendor in Seattle takes over the world",
  21. [20]="we're testing your patience",
  22. [21]="as if you had any other choice",
  23. [22]="why don't you order a sandwich?",
  24. [23]="don't think of purple hippos",
  25. [24]="loading useless information ",
  26. [25]="loading velious textures ",
  27. [26]="does anyone read this ",
  28. [27]="oiling clockworks ",
  29. [28]="looking For Graphics",
  30. [29]="creating randomly generated feature",
  31. [30]="randomly misspelled text ",
  32. [31]="loading, don't wait if you don't want to ",
  33. [32]="don't think of purple hippos",
  34. [33]="discombobulating the server",
  35. [34]="deleting system32"
  36. }
  37. bridge = peripheral.wrap("left")
  38. local function loadbar()
  39.   liquid = bridge.addLiquid(4,12,1,6,"cryotheum")
  40.     for i = 1, 262 do
  41.       liquid.setWidth(i * 2)
  42.       sleep(0.05)
  43.       if i == 200 then
  44.         if fs.exists(".itemdb") then
  45.           fs.delete(".itemdb")
  46.         end
  47.         stored = {}
  48.         response = http.post("http://www.ccpost.esy.es/ae/getdb.php", "HELLL NAH")
  49.         resp = response.readAll()
  50.         for item in resp:gmatch('[^%|]+') do
  51.           for id in item:gmatch('[^%:]+') do
  52.             if id:find("~") then
  53.               for article in id:gmatch('[^%~]+') do
  54.               dmg = name
  55.               name = article
  56.               end
  57.             else
  58.               itemid = id
  59.             end
  60.           end
  61.           print(itemid.." : "..dmg.." : "..name)
  62.           table.insert(stored, {id=itemid,dmg=dmg,name=name})
  63.           local handle = assert(fs.open(".itemdb", "w"), "Couldn't save vars")
  64.           handle.write(textutils.serialize(stored))
  65.           handle.close()
  66.         end
  67.        
  68.       end        
  69.     end
  70. end
  71.  
  72. local function message()
  73.   while true do
  74.     message = messages[math.random(1,#messages)]
  75.     messagetext.setText("Please wait ... "..message)
  76.     sleep(3)
  77.   end
  78. end
  79.  
  80. bridge.clear()
  81. loadingtop = bridge.addBox(2,10,528,2,0x00CCFF,0.5)
  82. loadingbot = bridge.addBox(2,18,528,2,0x00CCFF,0.5)
  83. loadingleft = bridge.addBox(2,12,2,6,0x00CCFF,0.5)
  84. loadingright = bridge.addBox(528,12,2,6,0x00CCFF,0.5)
  85. messagetext = bridge.addText(10,25,"Please wait...",0xFF0000)
  86. glasses = bridge.addIcon(0,-150,5311,0)
  87. glasses.setScale(33.4)
  88. parallel.waitForAny(message, loadbar)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement