Advertisement
TangentDelta

TangentLock Ver. 4

Jan 6th, 2012
5,636
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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 = "password"
  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 TangentLock. 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 (Alias Hydrogen)"
  31.  print "Please don't edit/remove this text right here."
  32.  print "This is my signature on my artwork."
  33.  sleep(10)
  34.  TangentLock()
  35. end
  36. if user == "hint" then
  37.  print (hint)
  38.  sleep(5)
  39. end
  40. if not(user == right) or (user == debug) or (user == "credits") or (user == "hint") then
  41.  if tries == maxtries -1 then
  42.   if protectmode then
  43.    protect()
  44.     else
  45.    print "Too Many Wrong Tries"
  46.    print "Shutting Down Now"
  47.    sleep (3)
  48.    os.shutdown()
  49.   end
  50.    else
  51.   print "Incorrect Password."
  52.   tries = tries+1
  53.   print ("Tries Left: ", maxtries - tries)
  54.   sleep(5)
  55.   TangentLock()
  56.  end
  57. end
  58. end
  59. function correct()
  60.  sleep(1)
  61.  shell.run("clear")
  62.  rs.setOutput(outputface, true)
  63.  sleep(opentime)
  64.  rs.setOutput(outputface, false)
  65.  os.shutdown()
  66. end
  67. function protect()
  68.  rs.setOutput(protectside, true)
  69.  sleep(1)
  70.  rs.setOutput(protectside, false)
  71.  os.shutdown()
  72. end
  73. function password()
  74.  shell.run("clear")
  75.  print ("TangentLock 4.0 Running On Computer ", os.getComputerID())
  76.  print "To view copyright and credits, type ' credits'"
  77.  write "Password: "
  78.  user=io.read()
  79. end
  80. TangentLock()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement