Posted 18 February 2014 - 11:33 AM
Hello, I'm trying to make a program which opens a door if the password is correct. Also when the password is incorrect the door opens, but if you step on a pressure plate the computer sends redstone signal to the dispenser which shoots arrows. But how do I make the computer send a signal to the left, while it's sending a signal to the door on its right? I have also tried parallel.waitForAll, but it doesn't work
The code looks like this:
The code looks like this:
password = "123"
while true do
term.clear()
term.setCursorPos(1,1)
write("Password: ")
local input = read("*")
if input == password then
term.clear()
term.setCursorPos(1,1)
print("Password correct!")
rs.setOutput("right", true)
sleep(3)
rs.setOutput("right", false)
elseif input ~= password then
term.clear()
term.setCursorPos(1,1)
print("Password correct!")
rs.setOutput("right", true)
while sleep(3) == true do
if rs.getInput("back") then
rs.setOutput("left")
end
end
rs.setOutput("right", false)
end
end