Guest User

install

a guest
May 7th, 2014
1,068
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.38 KB | None | 0 0
  1. --Installs World Of Tanks--
  2.  
  3. w,h = term.getSize()
  4.  
  5. folders = {
  6. "Tanks"
  7. }
  8.  
  9. files = {
  10. "Tanks/player.info",
  11. "Tanks/player.stat",
  12. "Tanks/intro",
  13. "Tanks/singleplayer",
  14. "Tanks/custom",
  15. "Tanks/stats",
  16. "Tanks/spcam",
  17. "Tanks/spwaves",
  18. "Tanks/bgt",
  19. "Tanks/bgtw"
  20. }
  21.  
  22. httpUrl = {
  23. "https://sites.google.com/site/dayrider10official/gamesdownload/player.info",
  24. "https://sites.google.com/site/dayrider10official/gamesdownload/player.stat",
  25. "https://sites.google.com/site/dayrider10official/gamesdownload/intro",
  26. "https://sites.google.com/site/dayrider10official/gamesdownload/singleplayer",
  27. "https://sites.google.com/site/dayrider10official/gamesdownload/custom",
  28. "https://sites.google.com/site/dayrider10official/gamesdownload/stats",
  29. "https://sites.google.com/site/dayrider10official/gamesdownload/spcam",
  30. "https://sites.google.com/site/dayrider10official/gamesdownload/spwaves",
  31. "https://sites.google.com/site/dayrider10official/gamesdownload/bgt",
  32. "https://sites.google.com/site/dayrider10official/gamesdownload/bgtw"
  33. }
  34.  
  35. for i, v in pairs(folders) do
  36.     fs.makeDir(v)
  37. end
  38.  
  39. function install()
  40. for i,v in pairs(files) do
  41.   download = http.get(httpUrl[i])
  42.   h = fs.open(v, "w")
  43.   h.write(download.readAll())
  44.   h.flush()
  45.   h.close()
  46. end
  47. end
  48.  
  49. function clearLine()
  50. sleep(0.5)
  51. term.setCursorPos(w/2 - 12, 6)
  52. term.clearLine()
  53. end
  54.  
  55. function gatherFiles()
  56.     createBg()
  57.     term.setCursorPos(w/2 - 12, 6)
  58.     print("Gathering: Tanks/bgt")
  59.     clearLine()
  60.     term.setCursorPos(w/2 - 12, 6)
  61.     print("Gathering: Tanks/bgtw")
  62.     clearLine()
  63.     term.setCursorPos(w/2 - 12, 6)
  64.     print("Gathering: Tanks/intro")
  65.     clearLine()
  66.     term.setCursorPos(w/2 - 12, 6)
  67.     print("Gathering: Tanks/player.stat")
  68.     clearLine()
  69.     term.setCursorPos(w/2 - 12, 6)
  70.     print("Gathering: Tanks/player.info")
  71.     clearLine()
  72.     term.setCursorPos(w/2 - 12, 6)
  73.     print("Gathering: Tanks/custom")
  74.     clearLine()
  75.     term.setCursorPos(w/2 - 12, 6)
  76.     print("Gathering: Tanks/singleplayer")
  77.     clearLine()
  78.     term.setCursorPos(w/2 - 12, 6)
  79.     print("Gathering: Tanks/spcam")
  80.     clearLine()
  81.     term.setCursorPos(w/2 - 12, 6)
  82.     print("Gathering: Tanks/spwaves")
  83.     clearLine()
  84.     term.setCursorPos(w/2 - 12, 6)
  85.     print("Gathering: Tanks/stats")
  86.     clearLine()
  87. end
  88.  
  89. function createBg()
  90.     term.clear()
  91.     term.setBackgroundColor(colors.lightBlue)
  92.     term.clear()
  93.     term.setCursorPos(w/2 - 4, 1)
  94.     print("Install")
  95.     term.setCursorPos(w/2 - 10, 4)
  96.     print("Preparing To Install...")
  97.     term.setCursorPos(w/2 - 12, 6)
  98.     print("Gathering: Tanks/bgt")
  99.     clearLine()
  100.     term.setCursorPos(w/2 - 12, 6)
  101.     print("Gathering: Tanks/bgtw")
  102.     clearLine()
  103.     term.setCursorPos(w/2 - 12, 6)
  104.     print("Gathering: Tanks/intro")
  105.     clearLine()
  106.     term.setCursorPos(w/2 - 12, 6)
  107.     print("Gathering: Tanks/player.stat")
  108.     clearLine()
  109.     term.setCursorPos(w/2 - 12, 6)
  110.     print("Gathering: Tanks/player.info")
  111.     clearLine()
  112.     term.setCursorPos(w/2 - 12, 6)
  113.     print("Gathering: Tanks/custom")
  114.     clearLine()
  115.     term.setCursorPos(w/2 - 12, 6)
  116.     print("Gathering: Tanks/singleplayer")
  117.     clearLine()
  118.     term.setCursorPos(w/2 - 12, 6)
  119.     print("Gathering: Tanks/spcam")
  120.     clearLine()
  121.     term.setCursorPos(w/2 - 12, 6)
  122.     print("Gathering: Tanks/spwaves")
  123.     clearLine()
  124.     term.setCursorPos(w/2 - 12, 6)
  125.     print("Gathering: Tanks/stats")
  126.     clearLine()
  127.     term.setCursorPos(w/2 - 10, 4)
  128.     term.clearLine()
  129.     print("Installing...")
  130.     install()
  131.     term.setCursorPos(1,1)
  132.     term.setBackgroundColor(colors.black)
  133.     term.clear()
  134. end
  135.  
  136. createBg()
Advertisement
Add Comment
Please, Sign In to add comment