Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --This is intended for private use with ComputerCraft computers.
- -- pastebin get wgXrQK9E pip
- IP = ""
- port = ""
- function download(file, path)
- local http = http.get("http://"..IP..":"..port.."/ComputerCraft/"..file..".txt") --Get contents of page
- content = (http.readAll()) --Read and print contents of page
- http.close() --Just in case
- local file = fs.open(path,"w")
- file.write(content)
- file.close()
- end
- args = {...}
- fs.makeDir("downloads")
- if (#args < 1) then
- print("update, install")
- elseif args[1] == "update" then
- download("pip", "pip")
- print("Updated pip console!")
- elseif args[1] == "install" then
- if (#args < 2) then
- print("Please specify filename")
- else
- download(args[2], "downloads/"..args[2])
- print("Downloaded file '"..args[2].."'!")
- end
- end
Add Comment
Please, Sign In to add comment