Advertisement
Alakazard12

Dolphin Installer

May 3rd, 2013
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.17 KB | None | 0 0
  1. HttpEnabled = false
  2. if http then
  3.   HttpEnabled = true
  4. end
  5.  
  6. if fs.exists("/.Dolphin") then
  7.     fs.delete("/.Dolphin")
  8. end
  9.  
  10. if fs.exists("/dolphin") then
  11.     fs.delete("/dolphin")
  12. end
  13.  
  14. fs.makeDir("/.Dolphin")
  15. fs.makeDir("/.Dolphin/APIs")
  16. fs.makeDir("/.Dolphin/Resources")
  17. fs.makeDir("/.Dolphin/Pages")
  18.  
  19. local git = "https://raw.github.com/alakazard12/Dolphin/master/"
  20.  
  21. local items = {
  22.     ["/dolphin"] = "dolphin";
  23.     ["/.Dolphin/APIs/agui"] = ".Dolphin/APIs/agui";
  24.     ["/.Dolphin/Resources/Main"] = ".Dolphin/Resources/Main";
  25.     ["/.Dolphin/Pages/Home"] = ".Dolphin/Pages/Home";
  26.     ["/.Dolphin/Pages/Search"] = ".Dolphin/Pages/Search";
  27.     ["/.Dolphin/Pages/Server"] = ".Dolphin/Pages/Server";
  28. }
  29.  
  30. local function Download(Link)
  31.   if HttpEnabled == false then
  32.         return
  33.     end
  34.     local File = http.get(Link)
  35.     if not File then
  36.         return
  37.     else
  38.         local ToR = File.readAll()
  39.         File.close()
  40.         return ToR
  41.     end
  42. end
  43.  
  44. for i,v in pairs(items) do
  45.     print("Downloading " .. i)
  46.     local ret = Download(git .. "/" .. v)
  47.     if not ret then
  48.         print("Installation failed")
  49.         break
  50.     else
  51.         print("Installing " .. i)
  52.         local fl = fs.open(i, "w")
  53.         fl.write(ret)
  54.         fl.close()
  55.     end
  56. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement