Advertisement
Guest User

startup

a guest
Nov 16th, 2017
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.46 KB | None | 0 0
  1. os.pullEvent = os.pullEventRaw
  2. username = "-Zoru"
  3. password = "ZainabHeartsKevin"
  4. secretuser = "KevinHeartsZainab"
  5. attempt = 1
  6.  
  7. function attemptCheck()
  8. if attempt > 2 then
  9. term.clear()
  10. term.setCursorPos(1,1)
  11. textutils.slowPrint("Non authorized user detected..")
  12. textutils.slowPrint("Please enter your backup password if authorized")
  13. auth = read("*")
  14. special = "KevinxZainab"
  15. if(auth == special) then
  16. textutils.slowPrint("You have been authorized successfully")
  17. else
  18. textutils.slowPrint("NON AUTHORIZED USER DETECTED... SENDING WARNING")
  19. sleep(60)
  20. os.reboot()
  21. end
  22. end
  23. end
  24. function login()
  25. attemptCheck()
  26. term.clear()
  27. textutils.slowPrint("Attempt #" ..attempt)
  28. textutils.slowPrint("Username: ")
  29. input = read("*")
  30. if input == secretuser then
  31. textutils.slowPrint("---")
  32. textutils.slowPrint("Logging in...")
  33. else
  34. if input == username then
  35. textutils.slowPrint("Password: ")
  36. input = read("*")
  37. if input == password then
  38. textutils.slowPrint ("You have been authorized successfully")
  39. rs.setOutput("bottom", true)
  40. sleep(2)
  41. rs.setOutput("bottom", false)
  42. term.setCursorPos(1,1)
  43. login()
  44. else
  45. textutils.slowPrint ("Incorrect Password")
  46. sleep(1)
  47. textutils.slowPrint ("Try again")
  48. attempt = attempt + 1
  49. sleep(1)
  50. term.clear()
  51. term.setCursorPos(1,1)
  52. login()
  53. end
  54. else
  55. textutils.slowPrint ("Invalid Username")
  56. sleep(1)
  57. textutils.slowPrint ("Try again")
  58. attempt = attempt + 1
  59. sleep(1)
  60. term.clear()
  61. term.setCursorPos(1,1)
  62. login()
  63. end
  64. end
  65. end
  66.  
  67. login()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement