Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- shell.setDir("")
- shell.run("pastebin", "get", "iCNTY7iH", "&SYS&tlf/temp")
- shell.run("pastebin", "get", "DbZapvu3", "&SYS&tlf/temp2")
- if not fs.exists("&SYS&tlf/versions") then
- network.download("iCNTY7iH", "&SYS&tlf/versions")
- end
- term.clear()
- term.setCursorPos(1,1)
- local temp = nil
- local fTemp = io.open("&SYS&tlf/temp", "r")
- local fTemp2 = io.open("&SYS&tlf/temp2", "r")
- local fLocal = io.open("&SYS&tlf/versions", "r")
- local tTempPBFC = {}
- local tTempVersions = {}
- for line in fTemp2:lines() do
- for name, pbid, filepath in string.gmatch(line, "(.+):(.+):(.+)") do
- tTempPBFC[name] = {pbid, filepath}
- end
- end
- for line in fTemp:lines() do
- for name, version in string.gmatch(line, "(.+):(.+)") do
- tTempVersions[name] = version
- end
- end
- for line in fLocal:lines() do
- for name, version in string.gmatch(line, "(.+):(.+)") do
- if tonumber(tTempVersions[name]) > tonumber(version) then
- print(name.." v"..tTempVersions[name].." avalible (local version: "..version..")")
- print("Updating "..name)
- temp = tTempPBFC[name]
- pbid = temp[1]
- filepath = temp[2]
- temp = nil
- fs.delete(filepath..name)
- shell.run("pastebin", "get", pbid, filepath..name)
- print(name.." has been updated to version "..tTempVersions[name])
- end
- end
- end
- fTemp:close()
- fTemp2:close()
- fLocal:close()
- fs.delete("&SYS&tlf/temp")
- fs.delete("&SYS&tlf/temp2")
- fs.delete("&SYS&tlf/versions")
- network.download("iCNTY7iH", "&SYS&tlf/versions")
Advertisement
Add Comment
Please, Sign In to add comment