Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- count = 0
- -- Settings
- globalpassword = "Global"
- retrys = 5 -- Trys before the timeout kicks in.
- timeout = 20 --timeout-time if you have entered a wrong password too often
- verifieduser = false -- Set to true to deactivate the lock
- function openProtection()
- print("Login successful")
- end
- while verifieduser == false do -- Loop of the Passwordverfication
- shell.run("clear")
- skipPasswordcheck = false
- io.write("Hello User. Please enter the up-to-date password in Order to continue.")
- print()
- if count >= retrys then
- print("You have failed "..retrys.." times already. Please wait "..timeout.." seconds before trying again")
- skipPasswordcheck =true
- sleep(timeout)
- count = 0
- elseif skipPasswordcheck == false then
- if globalpassword == io.read() then
- verifieduser = true
- else
- verifieduser = false
- count = count+1
- end --verification of the Password
- end --exit Var: Count Check
- end --exit of the loop
- openProtection() -- Release the lock
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement