Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function download(url, file)
- local content = http.get(url).readAll();
- if not content then
- error("Could not connect to website");
- end
- f = fs.open(file, "w");
- f.write(content);
- f.close();
- end
- local args = { ... };
- if #args == 0 or #args == 1 then
- print("Call this script like this:");
- print("SCRIPT [URL] [FILENAME]");
- do return end
- end
- if #args >= 2 then
- download(args[1], args[2]);
- do return end
- end
Add Comment
Please, Sign In to add comment