Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Apis = {
- [1]={name="OS Utils",path="/sys/apis/osutils"},
- [2]={name="OS Power API",path="/sys/apis/ospower"}
- }
- local w,h = term.getSize()
- local function redrawLogonMenu()
- term.setBackgroundColor(colors.blue)
- term.setTextColor(colors.white)
- term.clear()
- term.setCursorPos(1, 1)
- paintutils.drawLine(1,1,w,1,colors.white)
- paintutils.drawLine(1,h,w,h,colors.white)
- term.setBackgroundColor(colors.blue)
- term.setTextColor(colors.white)
- term.setCursorPos(1,2)
- end
- local path = shell.path()
- shell.setPath(path..":/sys/apps")
- for i=1,#Apis do
- print("Loading "..Apis[i].name)
- local loaded = os.loadAPI(Apis[i].path)
- local err = false
- if not fs.exists(Apis[i].path) then
- printError(Apis[i].path.." is missing!")
- err = true
- elseif not loaded then
- printError(Apis[i].path.." is corrupt!")
- err = true
- end
- if err then
- os.pullEvent("key")
- os.reboot()
- else
- print("Loaded "..Apis[i].name)
- end
- end
- sleep(2)
- redrawLogonMenu()
- shell.run("/sys/oslogon")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement