#( "Handy door stuffs" )
#alias auto-open+=#var $autoopen=1
#alias auto-open-=#var $autoopen=0
auto-open-

#alias d1={#if ("$0"!="") {#var $door1=$0;#print ("D1 set to: >> " +$door1+ " <<")}; #else activedoor 1}
#alias d2={#if ("$0"!="") {#var $door2=$0;#print ("D2 set to: >> " +$door2+ " <<")}; #else activedoor 2}
#alias d3={#if ("$0"!="") {#var $door3=$0;#print ("D3 set to: >> " +$door3+ " <<")}; #else activedoor 3}
#alias d4={#if ("$0"!="") {#var $door4=$0;#print ("D4 set to: >> " +$door4+ " <<")}; #else activedoor 4}

d1 exit
d2 exit
d3 exit
d4 exit

#( "this is the default door number to use" )
#alias activedoor=#var $doornum=$1
activedoor 1

#alias door={resolvedoor;#print ("Active door is d${doornum} - " + $door)}

#( "these can take a number, like dopen 3 to use the door3 instead of active door" )
#alias resolvedoor={#if ("$1"=="") #var $tmpdoor=${doornum}; #else #var $tmpdoor=$1;#exe ("#( $door=$door" + $tmpdoor + ")")}
#alias dopen={resolvedoor $1;#send ("open " + $door)}
#alias dclose={resolvedoor $1;#send ("close " + $door)}
#alias dpick={resolvedoor $1;#send ("pick " + $door)}
#alias dlock={resolvedoor $1;#send ("lock " + $door)}
#alias dunlock={resolvedoor $1;#send ("unlock " + $door)}

#( "D4 is the action door" )
#action >auto-door The $1 seems to be close={#print;d4 $1;#if ($autoopen=="1") {open $1}}
#action >auto-open-open The $1 is open.={#print;d4 $1;}
#action >auto-open-closed The $1 is closed.={#print;d4 $1}

#alias ope=open exit $0
#alias clo=close exit $0
#alias unl=unlock exit $0
#alias loc=lock exit $0
#alias pic=pick exit $0
