The problem is getting out again after it has closed. So I tried to make it that a button, placed on the inside, would activate the door, but this doesn't work and I have no idea why.
I tried several versions of a fix, among them, the os.pullEvent but that made the program unable to detect a password since it would stop until it detected a redstone input.
Any clue on how to make this work would be fantastic!
while true do
term.clear()
term.setCursorPos(1,1)
print("Loading OS")
sleep(1)
term.clear()
term.setCursorPos(1,1)
print("Loaded")
sleep(1)
term.clear()
term.setCursorPos(1,1)
password = "100%"
print("Insert Password")
input = read()
if
rs.getInput("right",true)
then
rs.setOutput("back",false)
sleep(1)
rs.setOutput("back",true)
sleep(1)
rs.setOutput("back",false)
sleep(10)
rs.setOutput("back",true)
sleep(1)
rs.setOutput("back",false)
sleep(8)
elseif
input == password
then
term.clear()
term.setCursorPos(1,1)
print("Access Granted")
print("Confirmed")
sleep(1)
print()
write("Status: ")
textutils.slowWrite("You in, brotha'")
rs.setOutput("back",false)
sleep(1)
rs.setOutput("back",true)
sleep(1)
rs.setOutput("back",false)
sleep(10)
rs.setOutput("back",true)
sleep(1)
rs.setOutput("back",false)
sleep(8)
else
term.clear()
term.setCursorPos(1,1)
print("Access denied")
rs.setOutput("back",false)
sleep(1)
print()
write("Status: ")
textutils.slowWrite("Dissed, punk")
sleep(2)
end
end