This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Sparrow_On_MC's profile picture

Need help coding a door lock.

Started by Sparrow_On_MC, 11 May 2013 - 03:12 AM
Sparrow_On_MC #1
Posted 11 May 2013 - 05:12 AM
SOLVED!











I don't know how to code a door lock. :(/>. I am new to Computercraft.

Can someone give me codes please.

It must have
The redstone signal on the left hand side (that's what side the door is).
Must last for 5 seconds.


THANK YOU!
Shnupbups #2
Posted 11 May 2013 - 05:14 AM
You didn't have to make a completely new topic…

Try looking for help/code on the CC Wiki. The link is up the top of the page.
Sparrow_On_MC #3
Posted 11 May 2013 - 05:54 AM
You didn't have to make a completely new topic…

Try looking for help/code on the CC Wiki. The link is up the top of the page.

Why can't you just put one here? You did this sort of thing on my last post but just told me to move it here.
diegodan1893 #4
Posted 11 May 2013 - 06:34 AM
http://www.computercraft.info/wiki/Making_a_Password_Protected_Door
Sparrow_On_MC #5
Posted 11 May 2013 - 07:19 AM
Ok guys I have a code but it doesn't work. Please check it out and fix it!

[sql]while true do
term.clear()
term.setCursorPos(1. 1)
print("Please Enter The Password")
input = read("*")
if input == "Where Password Will Be" then
print("Yay!")
sleep(2)
print("The Password Was Correct! :D/>")
sleep(2)
print("Opening Door For You! Wait 5 seconds")
sleep(5)
redstone.setOutput("left". true)
sleep(5)
redstone.setOutput("left". fales)
else
print("Sorry")
sleep("The Password Was Rong. D:")
sleep(2)
print("Can Not Open Door For You.")
sleep(5)
end
end
[/sql]
AfterLifeLochie #6
Posted 11 May 2013 - 07:28 AM
You need to change your argument separators from fullstops to commas (`"left". true` => `"left", true`) and "fales" to "false".

Please don't create topics with all-capitals titles - in future, please search the Wiki or the Tutorials section.
tonkku107 #7
Posted 11 May 2013 - 07:34 AM
Here's my code: http://www.computercraft.info/forums2/index.php?/topic/12636-my-first-program
Sparrow_On_MC #8
Posted 11 May 2013 - 08:59 AM
You need to change your argument separators from fullstops to commas (`"left". true` => `"left", true`) and "fales" to "false".

Please don't create topics with all-capitals titles - in future, please search the Wiki or the Tutorials section.

Thanks
Sparrow_On_MC #9
Posted 11 May 2013 - 09:09 AM
You need to change your argument separators from fullstops to commas (`"left". true` => `"left", true`) and "fales" to "false".

Please don't create topics with all-capitals titles - in future, please search the Wiki or the Tutorials section.

It didn't work. Here is my new code.

[sql]while true do
term.clear()
term.setCursorPos(1. 1)
print("Please Enter The Password")
input = read("*")
if input == "My Password" then
print("Yay!")
sleep(2)
print("The Password Was Correct! :D/>/>")
sleep(2)
print("Opening Door For You! Wait 5 seconds")
sleep(5)
redstone.setOutput("left", true)
sleep(5)
redstone.setOutput("left", false)
else
print("Sorry")
sleep("The Password Was Rong. D:")
sleep(2)
print("Can Not Open Door For You.")
sleep(5)
end
end[/sql]
tonkku107 #10
Posted 11 May 2013 - 09:11 AM
You need to change your argument separators from fullstops to commas (`"left". true` => `"left", true`) and "fales" to "false".

Please don't create topics with all-capitals titles - in future, please search the Wiki or the Tutorials section.

It didn't work. Here is my new code.

[sql]while true do
term.clear()
term.setCursorPos(1. 1)
print("Please Enter The Password")
input = read("*")
if input == "My Password" then
print("Yay!")
sleep(2)
print("The Password Was Correct! :D/>/>/>")
sleep(2)
print("Opening Door For You! Wait 5 seconds")
sleep(5)
redstone.setOutput("left", true)
sleep(5)
redstone.setOutput("left", false)
else
print("Sorry")
sleep("The Password Was Rong. D:")
sleep(2)
print("Can Not Open Door For You.")
sleep(5)
end
end[/sql]
try

term.setCursorPos(1,1)
and giving the error it says here will help
Sparrow_On_MC #11
Posted 11 May 2013 - 10:26 AM
You need to change your argument separators from fullstops to commas (`"left". true` => `"left", true`) and "fales" to "false".

Please don't create topics with all-capitals titles - in future, please search the Wiki or the Tutorials section.

It didn't work. Here is my new code.

[sql]while true do
term.clear()
term.setCursorPos(1. 1)
print("Please Enter The Password")
input = read("*")
if input == "My Password" then
print("Yay!")
sleep(2)
print("The Password Was Correct! :D/>/>/>/>/>")
sleep(2)
print("Opening Door For You! Wait 5 seconds")
sleep(5)
redstone.setOutput("left", true)
sleep(5)
redstone.setOutput("left", false)
else
print("Sorry")
sleep("The Password Was Rong. D:")
sleep(2)
print("Can Not Open Door For You.")
sleep(5)
end
end[/sql]
try

term.setCursorPos(1,1)
and giving the error it says here will help

THANK YOU! IT WORKS NOW!
Sparrow_On_MC #12
Posted 11 May 2013 - 10:35 AM
New code. 100% working

[sql]while true do
term.clear()
term.setCursorPos(1,1)
print("Please Enter The Password")
input = read("*")
if input == "Choose Your Password" then
print("Yay!")
sleep(2)
print("The Password Was Correct! :D/>/>")
sleep(2)
print("Opening Door For You! Wait 5 seconds")
sleep(5)
redstone.setOutput("left", true)
sleep(5)
redstone.setOutput("left", false)
else
print("Sorry")
sleep(2)
print("The Password Was Rong. D:")
sleep(2)
print("Can Not Open Door For You.")
sleep(5)
end
end
[/sql]
tonkku107 #13
Posted 12 May 2013 - 08:43 AM
You need to change your argument separators from fullstops to commas (`"left". true` => `"left", true`) and "fales" to "false".

Please don't create topics with all-capitals titles - in future, please search the Wiki or the Tutorials section.

It didn't work. Here is my new code.

[sql]while true do
term.clear()
term.setCursorPos(1. 1)
print("Please Enter The Password")
input = read("*")
if input == "My Password" then
print("Yay!")
sleep(2)
print("The Password Was Correct! :D/>/>/>/>/>/>")
sleep(2)
print("Opening Door For You! Wait 5 seconds")
sleep(5)
redstone.setOutput("left", true)
sleep(5)
redstone.setOutput("left", false)
else
print("Sorry")
sleep("The Password Was Rong. D:")
sleep(2)
print("Can Not Open Door For You.")
sleep(5)
end
end[/sql]
try

term.setCursorPos(1,1)
and giving the error it says here will help

THANK YOU! IT WORKS NOW!
no problem!