Advertisement
Guest User

startup

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