Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Vars-------------------------------------------------------------------
- os.pullEvent = os.pullEventRaw
- local w,h = term.getSize()
- local run = true
- local Ulist = fs.list("os/users")
- local User = nil
- local conf = nil
- local bufBoot = buf.createBuffer()
- --------------------------------------------------------------------------
- local function dsFirst()
- buf.bc(colors.blue)
- buf.clsB(bufBoot)
- buf.drawImage(bufBoot,1,1,"os/images/boot")
- ---------
- buf.tc(colors.blue)
- buf.pos(21,6)
- buf.bc(colors.black)
- buf.bWriteL(bufBoot,"User:")
- buf.pos(21,8)
- buf.bWriteL(bufBoot,"Pass:")
- end
- local function ds()
- buf.drawBuffer(bufBoot)
- term.setBackgroundColor(colors.black)
- term.setTextColor(colors.blue)
- end
- local function user()
- term.setCursorPos(26,6)
- local I = io.read()
- for v,k in ipairs(Ulist) do
- if I==k then
- User = k
- A.LoadConf(User)
- conf = A.getT(A.RCpath())
- return true
- end
- end
- return false
- end
- local function pass()
- term.setCursorPos(26,8)
- local pass = conf["PW"]
- local I = read("*")
- if I==pass then
- return true
- else
- return false
- end
- end
- local function userin()
- local times = 0
- local run = true
- while run do
- local s = user()
- if s == true then
- run = falses
- buf.pos(26,6)
- buf.bWriteL(bufBoot,User)
- else
- ds()
- end
- end
- run = true
- sleep(.05)
- while run do
- if times<3 then
- local s = pass()
- if s==true then
- break
- else
- times = times+1
- end
- else
- os.reboot()
- end
- ds()
- end
- return true
- end
- local function loadBufs()
- A.createbufs(file)
- end
- --------------------------------------------------------------------------
- local function main()
- dsFirst()
- ds()
- userin()
- loadBufs()
- return true
- end
- local ok, err = pcall(main)
- if not ok then
- A.Error(err)
- else
- if User == "Admin" then
- shell.run("os/APIS/manage")
- else
- shell.run("os/os")
- end
- end
Add Comment
Please, Sign In to add comment