Advertisement
Guest User

log1

a guest
Jun 14th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1.  
  2. os.pullEvent = os.pullEventRaw -- Prevents CTRL+T shortcut
  3.  
  4. term.clear() -- Clears the screen
  5. term.setCursorPos(1, 1) -- This places the print position to the top of screen
  6.  
  7. username = {"user1", "user2", "user3"} -- Here you need to define all usernames available
  8. password = {"pass1", "pass2", "pass3"} -- Here you define what password each user has, remember to put user1's password in the first row and so on.
  9.  
  10. write("Username: ")
  11. user = read()
  12.  
  13. write("Password: ")
  14. pass = read('*') -- This prevents people from reading the password as you put it in
  15.  
  16. for i=1, #username do -- Starts a loop
  17. if user == username[i] and pass == password[i] then
  18. access = true
  19. end
  20. end
  21.  
  22. if access == true then
  23. print("Logging in...")
  24. sleep(1)
  25. print("Welcome "..user)
  26. else
  27. print("Incorrect username and password combination")
  28. sleep(2)
  29. os.reboot()
  30. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement