Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local fileName = "OS/.password"
- local line
- if fs.exists(fileName) then
- local hRead = fs.open(fileName, "r")
- line = hRead.readLine()
- hRead.close()
- else
- line = "temppass"
- end
- local function clear()
- term.clear()
- term.setCursorPos(1,1)
- end
- os.pullEvent = os.pullEventRaw
- local tries = 3
- while tries > 0 do
- clear()
- textutils.slowPrint("Please enter password:")
- print("")
- write("> ")
- local input = read("*")
- if input == line then
- textutils.slowPrint("Password Accepted.")
- textutils.slowPrint("Now Logging In.")
- sleep(1)
- clear()
- shell.run("OS/.computer")
- else
- textutils.slowPrint("Password Rejected. Access Denied!!!")
- tries = tries - 1
- print(tries.." tries remaining.")
- sleep(1)
- end
- end
- local sec = 10
- while sec ~= 0 do
- clear()
- print("Please try again in "..sec.." seconds.")
- sec = sec - 1
- sleep(1)
- end
- os.shutdown()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement