Advertisement
BasketMC

ComputerCraft Startup S01E04

Dec 17th, 2015
20
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. shell.run("rm", "startup2")
  2. shell.run("rm", "scripts/startup2")
  3.  
  4. function generateURL(filename, branch)
  5.     return "https://bitbucket.org/basketmc/computercraft/raw/" .. branch .. "/" .. filename .. ".lua"
  6. end
  7.  
  8. function download(filename, branch)
  9.     print("Downloading " .. filename)
  10.     local data = http.get(generateURL(filename, branch))
  11.     if data then
  12.         print(filename .. " downloaded")
  13.         local file = fs.open(filename, "w")
  14.         file.write(data.readAll())
  15.         file.close()
  16.         return true
  17.     end
  18. end
  19.  
  20. shell.run("mkdir", "scripts")
  21.  
  22. download("scripts/startup2", "S01E04")
  23.  
  24. shell.run("scripts/startup2")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement