Advertisement
SirBaconBitz

Gordon Ramsbot Installer

May 1st, 2015
348
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.71 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.  
  6. local files = {
  7.     [1] = {link="https://bitbucket.org/api/1.0/repositories/expert700/gordon-ramsbot/raw/ComputerCraft/gr.lua", fileloc="gr/gr.lua"},
  8.     [2] = {link="https://bitbucket.org/api/1.0/repositories/expert700/gordon-ramsbot/raw/ComputerCraft/installer.lua", fileloc="gr/installer.lua"}
  9. }
  10.  
  11. for k,v in pairs(files) do
  12.     if fs.exists(v.fileloc) then
  13.         fs.delete(v.fileloc)
  14.     end
  15. end
  16.  
  17. for k,v in pairs(files) do
  18.     local response = http.get(v.link)
  19.     local file = response.readAll()
  20.     local handle = fs.open(v.fileloc, "w")
  21.     handle.write(file)
  22.     handle.close()
  23. end
  24.  
  25. os.reboot()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement