Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --By Wardes
- url = ""
- mPath = "buffer"
- if url ~= "" then
- local res = http.get(url)
- if res then
- if fs.exists(mPath) then
- shell.run("rm", mPath)
- end
- local file = fs.open( mPath, "w" )
- file.write(res.readAll())
- file.close()
- res.close()
- term.setTextColor (colors.green)
- print("Downloaded as " .. mPath)
- term.setTextColor(colors.white)
- shell.run("clear")
- shell.run(mPath)
- else
- term.setTextColor(colors.red)
- print("No data detected")
- end
- else
- term.setTextColor(colors.red)
- print("No url detected")
- end
- term.setTextColor(colors.white)
Add Comment
Please, Sign In to add comment