Advertisement
Guest User

doorlock

a guest
Mar 2nd, 2015
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. -- Login System
  2. -- Written by Brainless243
  3. -- Posted to The Tekkit Wiki on 10/24/2012
  4.  
  5. -- Edited by Marumaru352
  6.  
  7. os.pullEvent = os.pullEventRaw -- Prevents CTRL+T shortcut
  8.  
  9. term.clear() -- Clears the screen
  10. term.setCursorPos(1, 1) -- This places the print position to the top of screen
  11.  
  12. username = {"user1", "user2", "user3"} -- Here you need to define all usernames available
  13. 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.
  14.  
  15. write("Username: ")
  16. user = read()
  17.  
  18. write("Password: ")
  19. pass = read('*') -- This prevents people from reading the password as you put it in
  20.  
  21. for i=1, #username do -- Starts a loop
  22. if user == username[i] and pass == password[i] then
  23. access = true
  24. end
  25. end
  26.  
  27. if access == true then
  28. print("Logging in...")
  29. sleep(1)
  30. print("Welcome "..user)
  31. rs.setOutput (back,true)
  32. sleep (5)
  33. rs.setOutput (back,false)
  34. else
  35. print("Incorrect username and password combination")
  36. sleep(2)
  37. os.reboot()
  38. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement