Advertisement
Guest User

startup

a guest
Feb 27th, 2016
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.93 KB | None | 0 0
  1. os.pullEvent = os.pullEventRaw
  2. -- Made By derekseitz
  3. -- feel free to edit anything red between the
  4. -- two green lines
  5. --------------------------------------------------
  6.  
  7. -- first user login info
  8. un1 = "derekseitz" -- change the word admin to what you
  9. -- want the username to be
  10.  
  11. cPass1 = "TheDivinity1017" -- change the word admin to what
  12. -- you want the password to be
  13.  
  14. -- start and welcome messages
  15. startMsg = "Welcome, Please Enter Your Username And Password To Login."
  16. welcomeMsg = ("Correct! Welcome "..un1)
  17. -- put "--" infront of
  18. -- "os.pullEvent = os.pullEventRaw" to enable
  19. -- using (CTRL + T) to terminate the password lock
  20.  
  21.  os.pullEvent = os.pullEventRaw
  22.  
  23. --------------------------------------------------
  24.  
  25. function start()
  26. term.clear()
  27. term.setCursorPos(1, 1)
  28. print(startMsg)
  29. sleep(1)
  30. print()
  31. print()
  32. print("Username:")
  33. print("Password:")
  34. sleep(0.5)
  35. term.setCursorPos(10, 5)
  36. sleep(0.3)
  37. --username code below
  38.  
  39.    ui = read()
  40.      if ui == un1 then
  41.        term.setCursorPos(10, 6)
  42.      else
  43.        term.setCursorPos(1, 7)
  44.        print("That user does not exist!")
  45.        sleep(2)
  46.        start()
  47.      end
  48.  
  49. --password code below
  50.  
  51.    passi = read("*")
  52.      if passi == cPass1 then
  53.        term.setCursorPos(1, 7)
  54.        print(welcomeMsg)
  55.        sleep(1)
  56.        if cPass1 == "admin" then
  57.          print()
  58.          print()
  59.          print("I see you have not changed password.")
  60.          print("Did you know that you can type")
  61.          print("'edit disk/startup' and change the username")
  62.          print("and password?")
  63.          print("you should try it to make your computer")
  64.          print("even more secure.")
  65.          sleep(6)
  66.        end
  67.        term.clear()
  68.        
  69.      else
  70.        term.setCursorPos(1, 7)
  71.        print("Incorrect Password! Please try again!")
  72.        sleep(2)
  73.        start()
  74.      end
  75.      
  76. end
  77. -- end of start function!
  78. start()
  79. sleep(1)
  80. term.setCursorPos(1, 1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement