Hello
Is it possible in the same program to have two passwords to control a door?
I find this in the archive and I wanted the modified but without success.
Quote
local component=require("component")
local r=component.redstone
local gpu=component.gpu
local term=require("term")
---- config section
local password="1234"
local delay=5 --time the door stays open
local side=5 --side of the door, test this
-----
local wrong=false
while true do
term.clear()
gpu.set(1,1,"Please enter the password")
if wrong then
gpu.set(1,1,"Password was wrong, try again")
wrong=false
end
term.setCursor(1,2)
local input=io.read()
if input==password then
r.setOutput(side,15) -- check if this is the correct function
os.sleep(delay)
r.setOutput(side,0) -- same here
else
wrong=true
end
end
You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
Hello Is it possible in the same program to have two passwords to control a door? I find this in the archive and I wanted the modified but without success.
Thanks for your answers
Link to post
Share on other sites