Board Thread:Questions and Answers/@comment-80.39.208.137-20131221105326/@comment-68.204.182.249-20140102172041

I would use a ComputerCraft computer. They are much cheaper and easier to use. First, make a piston door. After that, you can either learn LUA or copy the code that I've typed out below. If you use the code below, you will have to edit some things to make it work for you.

1) Hook a computer up to redstone that controls your piston door.

2) In the computer, type "edit startup" to open the editor.

3) Write some code to open the door.

Example code (Between the curly brackets) (Not tested in-game):

{

side = "left" -- This is the side of the computer that will send a redstone signal. Possible sides are left, right, front, back, bottom, and top.

password = "1234" -- This is the password that you will use to open the door.

time =  5 -- This is the time that the redstone signal will be on.

os.pullEvent = os.pullEventRaw -- This prevents people from pressing CTRL+T to terminate the program and unlock the door without the password.

print("Password:") -- Tell the user that you want a password.

input = read("*") -- Store the password the user types and hide it with star symbols as they type.

if input == password then -- If the password they entered is correct, then execute the code below.

redstone.setOutput(side, true) -- Turn the redstone on.

sleep(time) -- Wait for the previously set amount of time.

redstone.setOutput(side, false) -- Turn the redstone off.

os.shutdown -- Turn the computer off.

else -- If the password is not correct, then execute the code below.

print("Incorrect password!") -- Tell the user that they got the password wrong.

sleep(15) -- Make them wait 15 seconds.

os.shutdown -- Turn the computer off.

end

}

4) Save and exit the program.

5) Type "shutdown" to turn off the computer.