Guest User

Untitled

a guest
Sep 7th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. local password = "System"
  2. local username = "Delta"
  3. term.clear()
  4. term.setCursorPos(1,1)
  5. write("Username: ")
  6. local input = read("[]")
  7. if input == username then -- Checks if the user inputted the correct password/username
  8. term.clear() -- Already explained up top
  9. term.setCursorPos(1,1)
  10. print("Username correct!") -- Prints 'Password correct!' to the screen
  11. else -- Checks if the user didn't input the correct password
  12. term.clear()
  13. term.setCursorPos(1,1)
  14. print("Username incorrect!") -- Prints 'Password incorrect!' to the screen
  15. sleep(2) -- Waits 2 seconds
  16. os.reboot() -- Reboot the computer, reopening the lock
  17. end
  18. write("Password: ")
  19. local passwordin = read("*")
  20. if passwordin == password then -- Checks if the user inputted the correct password/username
  21. term.clear() -- Already explained up top
  22. term.setCursorPos(1,1)
  23. print("Password correct!") -- Prints 'Password correct!' to the screen
  24. else -- Checks if the user didn't input the correct password
  25. term.clear()
  26. term.setCursorPos(1,1)
  27. print("Password incorrect!") -- Prints 'Password incorrect!' to the screen
  28. sleep(2) -- Waits 2 seconds
  29. os.reboot() -- Reboot the computer, reopening the lock
  30. end
Add Comment
Please, Sign In to add comment