Advertisement
Guest User

Untitled

a guest
Oct 8th, 2015
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.66 KB | None | 0 0
  1. --Title: TangentLock
  2. --Version: Ver. 4
  3. --Last Revised: 1/6/2012
  4. --Last Revised By: TangentDelta (alias Hydrogen)
  5. --Author: TangentDelta (alias Hydrogen)
  6. --Platform: ComputerCraft LUA Virtual Machine
  7. --Notes: Please don't claim this as your own, give me credit if you use this!
  8.  
  9. right = "elivion"
  10. debug = "debug"
  11. outputface = "right"
  12. protectmode = true
  13. protectside = "left"
  14. opentime = 5
  15. maxtries = 3
  16. tries = 0
  17. hint = "for debugging purposes"
  18. function TangentLock()
  19. password()
  20. if user == debug then
  21. print "Leaving SecureLock. Entering CraftOS"
  22. shell.run"shell"
  23. end
  24. if user == right then
  25. print "Password Correct"
  26. correct()
  27. end
  28. if user == "credits" then
  29. print "TangentLock Version 4.0"
  30. print "A program by TangentDelta"
  31. sleep(10)
  32. TangentLock()
  33. end
  34. if user == "hint" then
  35. print (hint)
  36. sleep(5)
  37. end
  38. if not(user == right) or (user == debug) or (user == "credits") or (user == "hint") then
  39. if tries == maxtries -1 then
  40. if protectmode then
  41. protect()
  42. else
  43. print "Too Many Wrong Tries"
  44. print "Shutting Down Now"
  45. sleep (3)
  46. os.shutdown()
  47. end
  48. else
  49. print "Incorrect Password."
  50. tries = tries+1
  51. print ("Tries Left: ", maxtries - tries)
  52. sleep(5)
  53. TangentLock()
  54. end
  55. end
  56. end
  57. function correct()
  58. sleep(1)
  59. shell.run("clear")
  60. rs.setOutput(outputface, true)
  61. sleep(opentime)
  62. rs.setOutput(outputface, false)
  63. os.shutdown()
  64. end
  65. function protect()
  66. rs.setOutput(protectside, true)
  67. sleep(1)
  68. rs.setOutput(protectside, false)
  69. os.shutdown()
  70. end
  71. function password()
  72. shell.run("clear")
  73. print ("SecureLock 4.0 Running On Computer ", os.getComputerID())
  74. write "Password: "
  75. user=io.read()
  76. end
  77. TangentLock()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement