Advertisement
CelticCoder

testdownload

Jul 1st, 2024 (edited)
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.64 KB | None | 0 0
  1. local url = "https://github.com/bartek18887/ComputerCraft-FlappyBird/raw/main/main.lua"
  2. local fileName = "flappybird.lua"
  3.  
  4. -- Download the script
  5. local function download(url, fileName)
  6.     if http then
  7.         local response = http.get(url)
  8.         if response then
  9.             local file = fs.open(fileName, "w")
  10.             file.write(response.readAll())
  11.             file.close()
  12.             print("Downloaded " .. fileName)
  13.         else
  14.             print("Failed to download " .. url)
  15.         end
  16.     else
  17.         print("HTTP not enabled")
  18.     end
  19. end
  20.  
  21. -- Download and run the script
  22. download(url, fileName)
  23. shell.run(fileName)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement