Advertisement
SirBaconBitz

Zeppelin DL

May 24th, 2014
264
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.72 KB | None | 0 0
  1. --[[
  2. All the hipsters have multiple files 'n downloaders 'n shit.
  3. So now I have one too :3
  4. ]]--
  5. local files = {
  6. [1] = {link="http://ccpost.esy.es/omnimover/setup.lua",fileloc="setup"},
  7. [2] = {link="http://ccpost.esy.es/omnimover/startup.lua",fileloc="startup"},
  8. [3] = {link="http://ccpost.esy.es/omnimover/zeppelinapi.lua",fileloc="zeppelinapi"}
  9. }
  10.  
  11. existing = {}
  12.  
  13. for k,v in pairs(files) do
  14.   if fs.exists(v.fileloc) then
  15.     table.insert(existing, v.fileloc)
  16.   end
  17. end
  18.  
  19. for k,v in pairs(existing) do
  20.   fs.delete(v)
  21. end
  22.  
  23. for k,v in pairs(files) do
  24.   response = http.get(v.link)
  25.   file = response.readAll()
  26.   handle = fs.open(v.fileloc, "w")
  27.   handle.write(file)
  28.   handle.close()
  29. end
  30. shell.run("setup")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement