Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- term.clear()
- term.setCursorPos(1,1)
- local currentVer = "1.1.3"
- local function save(table,name)
- local file = fs.open(name,"w")
- file.write(textutils.serialize(table))
- file.close()
- end
- local function load(name)
- local file = fs.open(name,"r")
- local data = file.readAll()
- file.close()
- return textutils.unserialize(data)
- end
- function LoadVers()
- local config = load("RobcOS_ticket")
- while true do
- if config == nil then
- return "unknown"
- elseif #config < 3 then
- return "old"
- else
- return config[3]
- end
- end
- end
- local function Update()
- fs.delete("RobcOS")
- shell.run("pastebin", "get", "DHuY3Uzi", "RobcOS")
- shell.run("pastebin", "get", "sBSdhnyz", "codes")
- fs.delete("login")
- shell.run("pastebin", "get", "yYq8KmeY", "login")
- fs.delete("setup")
- shell.run("pastebin", "get", "FwBCLcPA", "setup")
- fs.delete("startup")
- shell.run("pastebin", "get", "XkSbSXYL", "startup")
- shell.run("pastebin", "get", "GZZEJeCT", "termlink")
- shell.run("pastebin", "get", "sMbj2VXL", "TextEdit")
- shell.run("pastebin", "get", "5YWfPd8Z", "surface")
- shell.run("pastebin", "get", "86rLt5Yn", "filebrowse")
- shell.run("pastebin", "run", "HnUEXVKt")
- os.sleep(1)
- end
- function UpdateChecker()
- while true do
- if LoadVers() == currentVer then
- term.write("Up to date.")
- os.sleep(1)
- shell.run("RobcOS")
- break
- else
- term.write("Downloading Update...")
- local ticket = load("RobcOS_ticket")
- table.insert(ticket, 3, currentVer)
- save(ticket, "RobcOS_ticket")
- Update()
- term.clear()
- term.setCursorPos(1,1)
- shell.run("RobcOS")
- break
- end
- end
- end
- UpdateChecker()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement