Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Usernames
- user1 = "Sluethen"
- user2 = "Admin"
- user3 = "Dev"
- --Passwords
- pass1 = "Sluethen"
- pass2 = "Admin"
- pass3 = "Dev"
- --End of Passwords
- function Verify(user,pass)
- allowed = false
- if user == user1 then
- if pass == pass1 then
- allowed = true
- end
- elseif user == user2 then
- if pass == pass2 then
- allowed = true
- end
- elseif user == user3 then
- if pass == pass3 then
- allowed = true
- end
- end
- end
- --Main program
- term.clear()
- term.setCursorPos(20,1)
- print("Security Lock")
- term.setCursorPos(15,2)
- print("Please enter your username")
- term.setCursorPos(15,5)
- write("Username:")
- username = read()
- term.setCursorPos(15,7)
- write("Password:")
- password = read("*")
- Verify(username,password)
- if allowed == true then
- term.clear()
- term.setCursorPos(1,1)
- shell.run("cd users/"..username)
- else
- term.setCursorPos(15,10)
- print("Access denied!")
- print("Rebooting...")
- sleep(1)
- shell.run("lock")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement