Advertisement
Guest User

Untitled

a guest
Mar 1st, 2016
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 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. if access == true then
  27. print("Logging in...")
  28. sleep(1)
  29. print("Welcome "..user)
  30. else
  31. print("Incorrect username and password combination")
  32. sleep(2)
  33. os.reboot()
  34. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement