Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- userName = ("IzzLucas") -- Username.
- passWord = ("2110") -- Password.
- debugPassword = ("dmpass") -- Password for getting in to debug mode.
- triesSecure = true -- Change to false if you want unlimited tries to open the system.
- triesMax = 3 -- How many tries a user got before the system will close.
- destination = "program" -- Program that will start if username and password is correct.
- sleepTime = 100 -- For how long a user is locked out of the system if he/she keeps ketting password or username wrong. This is in seconds.
- triesUsed = 0 -- Do not change this!
- unlocked = false -- Do not change this!
- version = "1.0" -- Do not change this!
- function authVerify()
- if triesSecure == true then
- if unlocked == false and triesUsed < triesMax then
- write("Username: ")
- userNameInput = read()
- if userNameInput == debugPassword then
- shell.run"clear"
- shell.run"shell"
- else
- write("Password: ")
- passWordInput = read("*")
- if passWordInput == passWord and userNameInput == userName then
- unlocked = true
- correct()
- else
- triesUsed = triesUsed + 1
- textutils.slowPrint("Username or password was not correct.")
- textutils.slowPrint("You have " .. triesMax - triesUsed .. " tries left.")
- authVerify()
- end
- end
- end
- if triesUsed == triesMax or triesUsed > triesMax then
- incorrect()
- end
- end
- if triesSecure == false and unlocked == false then
- write("Username: ")
- userNameInput = read()
- if userNameInput == debugPassword then
- shell.run"clear"
- shell.run"shell"
- else
- write("Password: ")
- passWordInput = read("*")
- if passWordInput == passWord and userNameInput == userName then
- unlocked = true
- correct()
- else
- textutils.slowPrint("Username or password was not correct.")
- authVerify()
- end
- end
- end
- end
- function correct()
- textutils.slowPrint("Password and username was correct, welcome.")
- textutils.slowPrint(userNameInput)
- print("")
- textutils.slowPrint("Signed in as:")
- textutils.slowPrint(userNameInput)
- sleep(1)
- shell.run(destination)
- end
- function incorrect()
- textutils.slowPrint("Due to multiple tries, you have been locked")
- textutils.slowPrint(" out from the system.")
- sleep(sleepTime)
- triesUsed = 0
- authVerify()
- end
- textutils.slowPrint("You need to be logged in:")
- authVerify()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement