Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Vars-------------------------------------------------------------------
- os.pullEvent = os.pullEventRaw
- local w,h = term.getSize()
- local checkUpdate = true --change to true befor uploading
- local bufBoot = buf.createBuffer()
- local bufbar = nil
- -------------------------------------------------------------------------
- local function check()
- for i=0,100,5 do
- buf.increnetLoadbar(bufbar,i,true)
- sleep(.01)
- end
- end
- local function preLoad()
- buf.bc(colors.blue)
- buf.clsB(bufBoot)
- buf.pos(math.floor((w/2)-3),math.floor(h/2-1))
- buf.drawImageASCII(bufBoot,5,4,"os/images/AsciiArt",colors.blue,colors.grey)
- bufbar = buf.createLoadbar(bufBoot,5,math.floor(h/2+2),math.floor(w-4),math.floor(h/2+3),colors.gray,colors.green,0)
- local up = nil
- if checkUpdate then
- up = A.checkupdate()
- else
- up = false
- end
- if up then
- local up2 = A.check2()
- if up2 then
- term.setBackgroundColor(colors.black)
- term.setTextColor(colors.white)
- term.clear()
- local function cT(t,l)
- term.setCursorPos((math.floor(w/2-t:len()/2 +.5)),l)
- write(t)
- end
- cT("Updating OS",1)
- print(string.rep("=",51))
- if fs.exists("os/APIS/update") then
- fs.delete("os/APIS/update")
- end
- A.pastebin("BqUbtktC","os/APIS/update")
- shell.run("os/APIS/update")
- end
- end
- buf.drawLoadbar(bufbar)
- buf.drawBuffer(bufBoot)
- check()
- return true
- end
- -------------------------------------------------------------------------
- local function main()
- preLoad()
- return true
- end
- local ok, err = pcall(main)
- if not ok then
- if err == "A:393: L2xbGSm5" or "A:396: L2xbGSm5" then
- checkUpdate = false
- local ok, err = pcall(main)
- if not ok then
- A.Error(err)
- else
- shell.run("os/login")
- end
- else
- A.Error(err)
- end
- else
- shell.run("os/login")
- end
Add Comment
Please, Sign In to add comment