Advertisement
MrTurtle

Mr Turtle Software Suite Auto Installer

May 26th, 2014
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.41 KB | None | 0 0
  1. --Mr.Turtle Software Suite Auto Installer
  2. --pastebin run hJKx0tvE
  3. function download(name, code)
  4.   print("")
  5.   if not fs.isDir("turtle") then
  6.    fs.makeDir("turtle")
  7.   end
  8.   if fs.exists("turtle/"..name) then
  9.     print(name.." already exists." )
  10.     sleep(1)
  11.     return
  12.   end
  13.   print("Attempting to download "..name.." from pastebin...")
  14.   os.sleep(1)
  15.   local response = http.get("http://pastebin.com/raw.php?i="..textutils.urlEncode(code))
  16.   if response then
  17.      print("Great Success.")    
  18.      local data = response.readAll()
  19.      response.close()
  20.      local file = fs.open("turtle/"..name, "w")
  21.      file.write(data)
  22.      file.close()
  23.      print("Saved to turtle/"..name)
  24.   else
  25.      print("Download failed. Please install "..name.." manually from http://pastebin.com/u/MrTurtle.")
  26.      return
  27.   end
  28. end
  29.  
  30.  
  31. term.clear()
  32. term.setCursorPos(1,1)
  33. print("Welcome Mr. Turtle Software Suite Auto Installer.")
  34.  
  35. download("apiloader","ZxRUcgte")
  36. download("branchmine","D71X9CEP")
  37. download("canyonmaker","xwTWhq6y")
  38. download("haus","nc4GSbZW")
  39. download("junglelumberjack","nYir3AbR")
  40. download("lumberjack","3zq41vRF")
  41. download("minetunnel","AnZCQixu")
  42. download("minestairs","0NQegnwK")
  43. download("obsidianminer","PMQ0WVQi")
  44. download("pyramid","9UUz5Wwf")
  45. download("room","ZaUDaAD7")
  46. download("targetbomber","J17BikR7")
  47. print("")
  48. print("Thank you for downloading!")
  49. print("Please feel free to edit and share!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement