Advertisement
Guest User

startup

a guest
Apr 26th, 2015
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.90 KB | None | 0 0
  1. -- feel free to edit anything red between the
  2. -- two green lines
  3. --------------------------------------------------
  4.  
  5. -- first user login info
  6. un1 = "bob" -- change the word admin to what you
  7. -- want the username to be
  8.  
  9. cPass1 = "bob" -- change the word admin to what
  10. -- you want the password to be
  11.  
  12. -- start and welcome messages
  13. startMsg = "Welcome To Reactor Control,Please enter your username and password."
  14. welcomeMsg = ("Correct! Welcome "..un1)
  15. -- put "--" infront of
  16. -- "os.pullEvent = os.pullEventRaw" to enable
  17. -- using (CTRL + T) to terminate the password lock
  18.  
  19.  os.pullEvent = os.pullEventRaw
  20.  
  21. --------------------------------------------------
  22.  
  23. function start()
  24. term.clear()
  25. term.setCursorPos(1, 1)
  26. print(startMsg)
  27. sleep(1)
  28. print()
  29. print()
  30. print("Username:")
  31. print("Password:")
  32. sleep(0.5)
  33. term.setCursorPos(10, 4)
  34. sleep(0.3)
  35. --username code below
  36.  
  37.    ui = read()
  38.      if ui == un1 then
  39.        term.setCursorPos(10, 5)
  40.      else
  41.        term.setCursorPos(1, 7)
  42.        print("That user does not exist!")
  43.        sleep(2)
  44.        start()
  45.      end
  46.  
  47. --password code below
  48.  
  49.    passi = read("*")
  50.      if passi == cPass1 then
  51.        term.setCursorPos(1, 7)
  52.        print(welcomeMsg)
  53.        sleep(1)
  54.        
  55.        
  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)
  81. shell.run("nuclear")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement