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

Password Protected Door *Video*

Started by dextert88, 18 December 2013 - 01:19 PM
dextert88 #1
Posted 18 December 2013 - 02:19 PM
Hey guys its Dexter here,
I made a tutorial on how to create a basic password protected door, I really hope this helps y'all out and if it did leave some feedback!

[media]http://www.youtube.com/watch?v=ldgXEB9yz00[/media]

Hope this helped!

Dexter, out!
Lyqyd #2
Posted 18 December 2013 - 03:58 PM
Tutorials require a writeup. Moved to Media.
dextert88 #3
Posted 18 December 2013 - 04:09 PM
Tutorials require a writeup. Moved to Media.

Dammit! Sorry, as you can see by my rank Im new to the forum thanks for letting me know!
Trey2.k #4
Posted 18 December 2013 - 04:43 PM
you know if you used pass = read("*") if would make it so every thing you type will come out with a *
here is the way i would code that
local pass = "pass"
local side = "left"
rs.setOutput(side, false)
while true do
os.pullEvent = os.pullEventRaw
term.clear()
term.setCursorPos(1,1)
print("This door is locked!")
write("Password: ")
password = read("*")
if password == pass then
print("Access Granted!")
rs.setOutput(side, true)
sleep(3)
rs.setOutput(side, false)
else
print("Access Denide!")
sleep(2)
end
end
sorry if there are any errors wrote off the top of my head :)/>
Edited on 18 December 2013 - 03:55 PM
Trey2.k #5
Posted 18 December 2013 - 05:16 PM
Btw the = thing is one = is say I want this to mean this the 2 = is asking is it = to this
awsmazinggenius #6
Posted 18 December 2013 - 08:38 PM
You can also have things like hashed passwords on disk, timeouts after too many attempts, random biolock/player detector/rfid/mag strip card checks (from Gopher's Peripherals/MiscPeripherals/immibis's Peripherals/immibis's Peripherals respectively, and access to different doors based on passwords. For a unique tutorial (therefore more subs and likes etc.) I would make it different from the rest.
Alice #7
Posted 18 December 2013 - 08:58 PM
Btw the = thing is one = is say I want this to mean this the 2 = is asking is it = to this

To clarify to those who speak English,
The single equal sign says "Hey, let's set this value to that value"

x = y --This sets X equal to Y
The double equal sign says "Hey, are these two equal to each other?"

if 2 == "2" then --It asks if it's equal
The triple equal sign says "Hey, are these two EXACTLY the same?"

if 2 === "2" then --This is false
if "2" === "2" then --This is true
if 2 === 2 then -- This is also true.
Edited on 18 December 2013 - 07:58 PM
theoriginalbit #8
Posted 18 December 2013 - 09:11 PM
The triple equal sign says "Hey, are these two EXACTLY the same?"

if 2 === "2" then --This is false
if "2" === "2" then --This is true
if 2 === 2 then -- This is also true.
there is no strict comparison operator in Lua. if you try to it will error with "unexpected symbol".
Alice #9
Posted 18 December 2013 - 09:16 PM
The triple equal sign says "Hey, are these two EXACTLY the same?"

if 2 === "2" then --This is false
if "2" === "2" then --This is true
if 2 === 2 then -- This is also true.
there is no strict comparison operator in Lua. if you try to it will error with "unexpected symbol".
Sorry about that. I'm trying to learn JavaScript at the same time, it's messing with my head :P/>
Trey2.k #10
Posted 18 December 2013 - 09:17 PM
Btw the = thing is one = is say I want this to mean this the 2 = is asking is it = to this

To clarify to those who speak English,
The single equal sign says "Hey, let's set this value to that value"

x = y --This sets X equal to Y
The double equal sign says "Hey, are these two equal to each other?"

if 2 == "2" then --It asks if it's equal
The triple equal sign says "Hey, are these two EXACTLY the same?"

if 2 === "2" then --This is false
if "2" === "2" then --This is true
if 2 === 2 then -- This is also true.
lol thanks
dextert88 #11
Posted 19 December 2013 - 02:40 PM
You can also have things like hashed passwords on disk, timeouts after too many attempts, random biolock/player detector/rfid/mag strip card checks (from Gopher's Peripherals/MiscPeripherals/immibis's Peripherals/immibis's Peripherals respectively, and access to different doors based on passwords. For a unique tutorial (therefore more subs and likes etc.) I would make it different from the rest.

Yeah I love doing stuff like that, this was a tutorial just for the basics, y'know?
Trey2.k #12
Posted 19 December 2013 - 05:16 PM
You can also have things like hashed passwords on disk, timeouts after too many attempts, random biolock/player detector/rfid/mag strip card checks (from Gopher's Peripherals/MiscPeripherals/immibis's Peripherals/immibis's Peripherals respectively, and access to different doors based on passwords. For a unique tutorial (therefore more subs and likes etc.) I would make it different from the rest.

Yeah I love doing stuff like that, this was a tutorial just for the basics, y'know?
well new people should know about the
os.pullEnent = os.pullEventRaw and input = read("*")
Alice #13
Posted 19 December 2013 - 06:16 PM
You can also have things like hashed passwords on disk, timeouts after too many attempts, random biolock/player detector/rfid/mag strip card checks (from Gopher's Peripherals/MiscPeripherals/immibis's Peripherals/immibis's Peripherals respectively, and access to different doors based on passwords. For a unique tutorial (therefore more subs and likes etc.) I would make it different from the rest.

Yeah I love doing stuff like that, this was a tutorial just for the basics, y'know?
well new people should know about the
os.pullEnent = os.pullEventRaw and input = read("*")
I didn't until I found a tutorial
Trey2.k #14
Posted 19 December 2013 - 08:35 PM
You can also have things like hashed passwords on disk, timeouts after too many attempts, random biolock/player detector/rfid/mag strip card checks (from Gopher's Peripherals/MiscPeripherals/immibis's Peripherals/immibis's Peripherals respectively, and access to different doors based on passwords. For a unique tutorial (therefore more subs and likes etc.) I would make it different from the rest.

Yeah I love doing stuff like that, this was a tutorial just for the basics, y'know?
well new people should know about the
os.pullEnent = os.pullEventRaw and input = read("*")
I didn't until I found a tutorial
no I mean that they should be Taught that stuff
awsmazinggenius #15
Posted 19 December 2013 - 09:30 PM
You can also have things like hashed passwords on disk, timeouts after too many attempts, random biolock/player detector/rfid/mag strip card checks (from Gopher's Peripherals/MiscPeripherals/immibis's Peripherals/immibis's Peripherals respectively, and access to different doors based on passwords. For a unique tutorial (therefore more subs and likes etc.) I would make it different from the rest.

Yeah I love doing stuff like that, this was a tutorial just for the basics, y'know?
well new people should know about the
os.pullEnent = os.pullEventRaw and input = read("*")
I didn't until I found a tutorial
Thanks Death. Make this video the tutorial that they learn the os.pullEvent = os.pullEventRaw and read("*")
Jim #16
Posted 02 January 2014 - 07:46 AM
Hm, this is kind of my version, which has worked out pretty well.


os.pullEvent = os.pullEventRaw
term.clear()
term.setCursorPos(1, 1)
print("Welcome to the laboratory access point.")
print("Password is required: ")

local password = "bacon"
local input = password
password = read("*")

while input ~= password do
   write("Access Denied. Try again: ")
   password = read("*")
end

print("Access Granted. Welcome to the Lab, Jim!")
rs.setOutput("left", true)
sleep(3)
rs.setOutput("left", false)
os.reboot()
Edited on 04 January 2014 - 04:07 AM
wieselkatze #17
Posted 02 January 2014 - 02:57 PM
There is a symbol in the editor (looks like <>), but also you can do it like this:

this is
your code
<- But without spaces in the square brackets
awsmazinggenius #18
Posted 03 January 2014 - 01:02 PM
That, and a post in all bold looks super ugly.
If it hurts to look at, don't post it.
LBPHacker #19
Posted 05 January 2014 - 11:09 AM
-snip-
One thing. The code would make more sense if input was the variable that gets assigned to the user input and password was the variable that gets assigned to the actual password :D/>
Edited on 05 January 2014 - 10:09 AM
Jim #20
Posted 06 January 2014 - 03:19 PM
Umm.. Probs.. This was an old version of this program or mine so yeah, it was a bit messed up.
Edited on 12 January 2014 - 01:20 AM