Locks
Comments77
46pages on
this wiki
this wiki

Added by Block46Locks are computer programs used to lock doors (usually iron doors to prevent forced entry). The most common lock programs require a password in order to gain entry.
The most common lock code is this (Thanks to Hydrogen on Minecraft Forums) :
- --Title: TangentLockLite
- --Version: 1
- --Last Revised: N/A
- --Last Revised By: N/A
- --Author: TangentDelta (alias Hydrogen)
- --Platform: ComputerCraft LUA Virtual Machine
- --Notes: Please don't claim this as yours, give me credit!
- password = "hello" --this is your password to "unlock" the door
- print "TangentLockLite Ver. 1" --tells you what version it is
- write "Password: " --puts a pretty "Password: " on the screen, so you know what you're doing
- input = read("*") --make a prompt where you can type stuff in, and stores it to the "input" variable EDIT: By DJZ07728. I made it so text you type is hidden.
- if input == password then --if what you type in is equal to your password, it does the following
- redstone.setOutput ("back", true) --makes the back of the computer turn on a redstone pulse
- sleep (5) --pause for 5 seconds
- os.shutdown() --makes the computer turn off
- else --but if the password isn't correct
- print "Incorrect Password" --let's you know that the password is wrong
- sleep (2) --pause for 2 seconds
- os.shutdown() --makes the computer turn off
end --the end of the program