Advertisement
ndfjay

Racer Installer

Feb 12th, 2013
791
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.89 KB | None | 0 0
  1. --[[Racer by Nitrogen fingers
  2. All rights reserverd
  3. Automatic file downloader by NDFJay ]]--
  4. local w,h = term.getSize()
  5. local progress = {
  6.     "                    ";
  7.     "  ";
  8.     "    ";
  9.     "      ";
  10.     "        ";
  11.     "          ";
  12.     "            ";
  13.     "              ";
  14.     "                ";
  15.     "                  ";
  16.     "                    "
  17. }
  18. function upWrite(path, text)
  19.     local file = assert(io.open(path, "w"))
  20.     file:write(text)
  21.     file:close()
  22. end
  23. term.setTextColor(128)
  24. term.setBackgroundColor(1)
  25. term.clear()
  26. fs.makeDir(".tmp")
  27.  
  28. local file = http.get("http://uploads.ndfjay.co.uk/Racer/.tmp/racerinst") -- Install Progress 60
  29. upWrite(".tmp/racerinst", file.readAll())
  30. file.close()
  31.  
  32. paintutils.drawImage(paintutils.loadImage(".tmp/racerinst"),1,1)
  33. term.setBackgroundColor(1)
  34. term.setCursorPos(math.ceil(w-string.len("Install Location:"))/2, math.floor(h-3))
  35. print("Install Location:")
  36. term.setCursorPos(math.ceil(w-string.len("//root/NitroGames/Racer   "))/2, math.floor(h-2))
  37. write("//root/")
  38. Dir = "/"
  39. term.setBackgroundColor(128)
  40. term.setCursorPos(math.ceil(w-string.len("                    "))/2, math.floor(h))
  41. write(progress[1])
  42. term.setBackgroundColor(8)
  43. term.setCursorPos(math.ceil(w-string.len("                    "))/2, math.floor(h))
  44. write(progress[1])
  45. fs.makeDir(Dir.."/rstub")
  46.  
  47. local file = http.get("http://uploads.ndfjay.co.uk/Racer/rstub/1.nfa")
  48. upWrite(Dir.."/rstub/1.nfa", file.readAll())
  49. file.close()
  50.  
  51. local file = http.get("http://uploads.ndfjay.co.uk/Racer/rstub/2.nfa")
  52. upWrite(Dir.."/rstub/2.nfa", file.readAll())
  53. file.close()
  54.  
  55. local file = http.get("http://uploads.ndfjay.co.uk/Racer/rstub/3.nfa")
  56. upWrite(Dir.."/rstub/3.nfa", file.readAll())
  57. file.close()
  58.  
  59. local file = http.get("http://uploads.ndfjay.co.uk/Racer/rstub/4.nfa")
  60. upWrite(Dir.."/rstub/4.nfa", file.readAll())
  61. file.close()
  62.  
  63. local file = http.get("http://uploads.ndfjay.co.uk/Racer/rstub/5.nfa")
  64. upWrite(Dir.."/rstub/5.nfa", file.readAll())
  65. file.close()
  66.  
  67. local file = http.get("http://uploads.ndfjay.co.uk/Racer/rstub/6.nfa")
  68. upWrite(Dir.."/rstub/6.nfa", file.readAll())
  69. file.close()
  70. sleep(2)
  71. term.setBackgroundColor(8)
  72. term.setCursorPos(math.ceil(w-string.len("                    "))/2, math.floor(h))
  73. write(progress[4])
  74.  
  75. local file = http.get("http://uploads.ndfjay.co.uk/Racer/backgrass.nfa")
  76. upWrite(Dir.."/backgrass.nfa", file.readAll())
  77. file.close()
  78. sleep(0.5)
  79. term.setBackgroundColor(8)
  80. term.setCursorPos(math.ceil(w-string.len("                    "))/2, math.floor(h))
  81. write(progress[5])
  82.  
  83. local file = http.get("http://uploads.ndfjay.co.uk/Racer/gameutils")
  84. upWrite(Dir.."/gameutils", file.readAll())
  85. file.close()
  86. sleep(1)
  87. term.setBackgroundColor(8)
  88. term.setCursorPos(math.ceil(w-string.len("                    "))/2, math.floor(h))
  89. write(progress[6])
  90.  
  91. local file = http.get("http://uploads.ndfjay.co.uk/Racer/racer")
  92. upWrite(Dir.."/racer", file.readAll())
  93. file.close()
  94. sleep(2.5)
  95. term.setBackgroundColor(8)
  96. term.setCursorPos(math.ceil(w-string.len("                    "))/2, math.floor(h))
  97. write(progress[7])
  98.  
  99. local file = http.get("http://uploads.ndfjay.co.uk/Racer/background.nfp")
  100. upWrite(Dir.."/background.nfp", file.readAll())
  101. file.close()
  102. sleep(1)
  103. term.setBackgroundColor(8)
  104. term.setCursorPos(math.ceil(w-string.len("                    "))/2, math.floor(h))
  105. write(progress[9])
  106.  
  107. local file = http.get("http://uploads.ndfjay.co.uk/Racer/road.nfa")
  108. upWrite(Dir.."/road.nfa", file.readAll())
  109. file.close()
  110. sleep(0.7)
  111. term.setBackgroundColor(8)
  112. term.setCursorPos(math.ceil(w-string.len("                    "))/2, math.floor(h))
  113. write(progress[10])
  114.  
  115. local file = http.get("http://uploads.ndfjay.co.uk/Racer/racer.nfa")
  116. upWrite(Dir.."/racer.nfa", file.readAll())
  117. file.close()
  118. sleep(1)
  119. term.setBackgroundColor(8)
  120. term.setCursorPos(math.ceil(w-string.len("                    "))/2, math.floor(h))
  121. write(progress[11])
  122.  
  123. fs.delete(".tmp")
  124.  
  125. shell.run(Dir.."/racer")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement