Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function yN()
- local n=1
- while true do
- local x, y=term.getCursorPos()
- term.clearLine()
- if n==1 then write(">No< Yes") else write (" No >Yes<") end
- term.setCursorPos(x, y)
- a, b=os.pullEvent("key")
- if b==263 and n==2 then n=1 end
- if b==262 and n==1 then n=2 end
- if b==257 then
- print("")
- if n==1 then return true end
- if n==2 then return false end
- end
- end
- end
- if fs.exists("/CB/CustomBiosUpdate") then
- shell.run("delete /CB/CustomBiosUpdate")
- end
- term.setTextColour(colours.green)
- print ("Checking for Update")
- if not fs.exists("/CB/Beta") then
- term.setTextColour(colours.yellow)
- local beta = fs.open("/CB/Beta", "w")
- print("Do you want to use BETAs ?")
- if yN() == false then
- beta.write("true")
- else
- beta.write("false")
- end
- beta.close()
- end
- term.setTextColour(colours.white)
- local beta = fs.open("/CB/Beta", "r")
- if beta[0] == "false" then
- shell.run("pastebin get wccYFDn4 /CB/CustomBiosUpdate")
- else
- shell.run("pastebin get ccbrWFpb /CB/CustomBiosUpdate")
- end
- term.setTextColour(colours.red)
- local update = fs.open("/CB/CustomBiosUpdate", "r")
- local curent = fs.open("/CB/Files/CustomBiosCurrent", "r")
- if not fs.exists("/CB/Files/CustomBiosCurrent") or update[0] ~= curent[0] then
- term.setTextColour(colours.green)
- print("An update is available")
- os.sleep(0.5)
- print("Updating...")
- os.sleep(1)
- if fs.exists("/CB/Files/CustomBiosCurrent") then
- curent.close()
- end
- update.close()
- shell.run("delete /CB/Files/")
- shell.run("mkdir /CB/Files/")
- term.setTextColour(colours.white)
- if beta[0] == "false" then
- shell.run("pastebin get 7fzEVSp0 /CB/Files/CustomBios")
- else
- shell.run("pastebin get rMqkrB8f /CB/Files/CustomBios")
- end
- shell.run("copy /CB/CustomBiosUpdate /CB/Files/CustomBiosCurrent")
- term.setTextColour(colours.green)
- print("Updated.")
- os.sleep(1)
- else
- curent.close()
- update.close()
- end
- shell.run("/CB/Files/CustomBios")
Add Comment
Please, Sign In to add comment