Advertisement
Guest User

ComputerCraft Door Lock

a guest
Oct 23rd, 2012
2,459
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.68 KB | None | 0 0
  1. --Title: TangentLock
  2. --Version: Ver. 3
  3. --Last Revised: 12/26/2011
  4. --Last Revised By: Streetstar5 / FuzzyPurp187
  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. code = "minecraft" --the password to "unlock" it
  10. debug = "debug" --password to enter the terminal
  11. output = "left" --the side that will send out the "unlock" signal
  12. tries = 5 --how many times you can guess before it ends your session
  13. pulsout = 5 --how long you want the redstone to be on for. I think it's in seconds.
  14. hax = true --set to true if you want it to send out a redstone signal if password is wrong
  15. haxout = "right" --side that you want the "incorrect password" signal to be on
  16.  
  17. print "Norton Security System Initialized"
  18. write "Password: "
  19. for triescnt = 1,tries,1 do
  20. password = read()
  21. if password == debug then
  22. print "Debug Mode Activated"
  23. break
  24. end
  25. if password == (code) then
  26. print "Access Granted!"
  27. redstone.setOutput(output, true)
  28. sleep(pulsout)
  29. redstone.setOutput(output, false)
  30. os.shutdown()
  31. else
  32. if hax then
  33. print "Acces Denied! \nLaunching Anti-Grief Security.."
  34. print "Stand still.. This won't hurt : )"
  35. redstone.setOutput(haxout, true)
  36. sleep(pulsout)
  37. redstone.setOutput(haxout, false)
  38. os.shutdown()
  39. else
  40. print ("Access Denied. Attempts left: ",tries-triescnt)
  41. write "Password: "
  42. end
  43. end
  44. if triescnt == tries then
  45. print "Maximum Attempts Reached. \nJust who the fuck are you?"
  46. sleep(2)
  47. print "System is shutting down.."
  48. sleep(1)
  49. os.shutdown()
  50. else
  51. end
  52. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement