Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local internet = require("internet")
- local textutils = require("textutils")
- local fs = require("filesystem")
- local c = require("computer")
- local ccsysurl = "https://ccsystems.dannysmc.com/ccsystems.php"
- local str = ""
- function freeMemory()
- local result = 0
- for i = 1, 10 do
- result = math.max(result, c.freeMemory())
- os.sleep(0)
- end
- return result
- end
- function download(url, post)
- local str = ""
- for chunk in internet.request(url, post) do
- str = str..chunk
- end
- return str
- end
- print("Loading application list.")
- local str = download(ccsysurl, "ccsys="..textutils.urlEncode(tostring("appstore")).."&".."cccmd="..textutils.urlEncode(tostring("list")))
- local appslist = textutils.unserialize(str)
- str = nil
- freeMemory()
- for k, v in ipairs(appslist) do
- print(k..":"..appslist[k][2])
- end
- print("Type in the number of the application you want to download.")
- local str = download(appslist[tonumber(io.read()) or 150][6])
- print("Where do you want to save to?")
- local file = fs.open(io.read(), "w")
- file:write(str)
- file:close()
- print("Done saving.")
Add Comment
Please, Sign In to add comment