Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Title: TangentLock
- --Version: Ver. 3
- --Last Revised: 12/26/2011
- --Last Revised By: TangentDelta (alias Hydrogen)
- --Author: TangentDelta (alias Hydrogen)
- --Platform: ComputerCraft LUA Virtual Machine
- --Notes: Please don't claim this as your own, give me credit if you use this!
- code = "password" --the password to "unlock" it
- debug = "debug" --password to enter the terminal
- output = "left" --the side that will send out the "unlock" signal
- tries = 5 --how many times you can guess before it ends your session
- pulsout = 5 --how long you want the redstone to be on for. I think it's in seconds.
- hax = true --set to true if you want it to send out a redstone signal if password is wrong
- haxout = "right" --side that you want the "incorrect password" signal to be on
- print "TangentLock Ver. 3 Initialized" --please don't edit/remove this. I put alot of time into this lock, and this is my signature on it.
- write "Password: "
- for triescnt = 1,tries,1 do
- password = read()
- if password == debug then
- print "Debug Activated"
- break
- end
- if password == (code) then
- print "Password Correct. Ending Session"
- redstone.setOutput(output, true)
- sleep(pulsout)
- redstone.setOutput(output, false)
- os.shutdown()
- else
- if hax then
- print "Incorrect Password!"
- redstone.setOutput(haxout, true)
- sleep(pulsout)
- redstone.setOutput(haxout, false)
- os.shutdown()
- else
- print ("Password Incorrect. Tries left: ",tries-triescnt)
- write "Password: "
- end
- end
- if triescnt == tries then
- print "Maximum Tries Reached."
- sleep(2)
- print "shutting Down"
- sleep(1)
- os.shutdown()
- else
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement