Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.pullEvent = os.pullEventRaw
- username = "koda"
- password = "123456"
- attempt = 0
- function attemptCheck()
- if attempt > 3 then
- term.clear()
- term.setCursorPos(1,1)
- textutils.slowPrint ("Attempt limit reached.")
- sleep(1)
- textutils.slowPrint ("Shutting down...")
- sleep(1)
- os.reboot()
- end
- end
- function login()
- attemptCheck()
- print ("Login attempt: ", attempt)
- write "Username: "
- input = read()
- if input == username then
- write "Password: "
- input = read("*")
- if input == password then
- textutils.slowPrint ("Welcome to your computer, ".. username ..".")
- sleep(2)
- term.clear()
- term.setCursorPos(1,1)
- else
- textutils.slowPrint ("The password was incorrect.")
- sleep(1)
- textutils.slowPrint ("Please attempt again.")
- attempt = attempt + 1
- sleep(1)
- term.clear()
- term.setCursorPos(1,1)
- login()
- end
- else
- textutils.slowPrint ("The username was not recognized.")
- sleep(1)
- textutils.slowPrint ("Please attempt again.")
- attempt = attempt + 1
- sleep(1)
- term.clear()
- term.setCursorPos(1,1)
- login()
- end
- end
- login()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement