Posted 28 August 2013 - 05:36 PM
I am trying to make a piston airlock and I was wondering how to make it so at a certant point it will go back to a place in the command, Here is my script:
When I try to run it it just says the first line and then goes to the normal console. Help?
redstone.setOutput("right", true)
print "Type 'open' or 'close' to Open or close the airlock."
function A()
print ""
write ">"
input = read()
if input == "open" then
print "Opening..."
redstone.setOutput("right", false)
A()
else
print "Command not recognised."
A()
end
if input == "close" then
print "Closing..."
redstone.setOutput("right", true)
A()
else
print "Command not recognised."
A()
end
end
When I try to run it it just says the first line and then goes to the normal console. Help?