Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tArgs = { ... }
- if #tArgs < 2 then
- print(fs.getName(shell.getRunningProgram()).." <code> <path>")
- return
- end
- if not fs.exists(tArgs[2]) then
- -- Download
- local response = http.get("http://pastebin.com/download.php?i="..tArgs[1])
- if response then
- print("Success.")
- local data = response.readAll()
- local f = fs.open(tArgs[2], "w")
- f.write(data)
- f.close()
- print(tArgs[1].." has been saved to "..tArgs[2])
- else
- print("Failure to download.")
- end
- else
- print("File exists.")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement