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

A Simple Password Pretected Door

Started by Foxxman, 03 September 2012 - 02:18 AM
Foxxman #1
Posted 03 September 2012 - 04:19 AM
Well, hey guys. So I had recently just learned about CC and was watching some tutorials on YouTube how to make a password protected door. I made one correctly for my own house, and it works perfectly fine.I was making a second one for someone else's house, and I copied my first code almost word for word. (Except write("Blah blah") and print("Blah blah").) Anyway, it doesn't work for some reason. It says: bios:206: [string "Door"]:13: '=' expected Keep in mind that I am a noob to all of this, so I'm going to give you my code and hoefully someone will help me. Thanks! *The craft OS is 1.3

correctpass = "Blah Blah"

write("Please insert password: ")

pass = read()


if pass == (correctpass) then
write("Blah blah")
redstone.setOutput("left", true)
sleep(3)
os.shutdown


else
write("Blah blah")
redstone.setOutput("top", true)
sleep(1)
os.shutdown
end


There is only 1 space between os.shutdown & end. (BTW)
cant_delete_account #2
Posted 03 September 2012 - 05:50 AM
Fixed code:

local cpass = "Blah Blah"
write("Please insert password: ")
local pass = read()
if pass == cpass then
write("Blah blah")
redstone.setOutput("left", true)
sleep(3)
os.shutdown()
else
write("Blah blah")
redstone.setOutput("top", true)
sleep(1)
os.shutdown()
end
Foxxman #3
Posted 03 September 2012 - 06:30 AM
@Pro Coder,
Thanks bro, it worked!
sjele #4
Posted 06 September 2012 - 07:08 PM
@Pro Coder,
Thanks bro, it worked!
@Pro Coder,
Thanks bro, it worked!

His name is thebros The name is shown in the blue box/line above post. Pro coder is rank depending on posts
Tiin57 #5
Posted 07 September 2012 - 11:52 AM
Need I say Ask A Pro? How did you think this belonged in APIs?