#( "Wow talk about nasty... but it works *shrug* the perl way was much cleaner" ) #( "use the p* aliases to set the path bias, then get on the road and gpath to start" ) #( "spath anytime walking to stop the walking" ) #( "Follow the path, use the gpath alias after using setpath to set directional bias" ) #var @autogopath=0 #var @autotaken=0 #( "This one tries to implement all in powwow, for speed?" ) #( "Set this to the dirs to go in order, e.g. nwe to favor north-western trails" ) #alias setpath={#print ("Setting pathing to: $0");#($path_dir1="$1");#($path_dir2="$2");#($path_dir3="$3");#($path_dir4="$4");#var $path_godir=NONE} #alias path_exit_reset={#var $pNorth=0;#var $pSouth=0;#var $pEast=0;#var $pWest=0} #( "Walk the path_dirs thing and go on a spree!" ) #alias preset=#var @autotaken=0 #alias gpath={#var $path_godir=;find_valid_dir;#if ($pcheckstatus!="0") #($path_godir=$pcheckstatus);#($phist=$phist+$path_godir);#if ($path_godir!="") {#print ("Going " + $path_godir + " (" + %@autogopath + " steps left, " + %@autotaken + " steps taken)");#send ($path_godir)};#else {#print ("End of the line!");#var @autogopath=0};#print ("Hist: " + $phist);#(@autotaken++);#($path_last=$path_godir)} #alias apath={#var $phist=>>>;#if ("$0"!="") #var @autogopath=$0;#else #var @autogopath=1000;gpath} #alias spath={#var @autogopath=0} #( "This loops through all path_dir* to find a valid one, and only checks if a valid one not yet found" ) #alias find_valid_dir={#($pcheckstatus="0");find_dir_stop_xroads;find_dir_nobacktrack;find_dir1;find_dir2;find_dir3;find_dir4} #alias find_dir1={#if ($pcheckstatus=="0") {#($pcheckpath=$path_dir1);path_checkone}} #alias find_dir2={#if ($pcheckstatus=="0") {#($pcheckpath=$path_dir2);path_checkone}} #alias find_dir3={#if ($pcheckstatus=="0") {#($pcheckpath=$path_dir3);path_checkone}} #alias find_dir4={#if ($pcheckstatus=="0") {#($pcheckpath=$path_dir4);path_checkone}} #( "Elminates walking loops (n/s/n/s/n/s/etc)" ) #alias find_dir_nobacktrack={#if ($path_last=="n") #($pSouth="0");#if ($path_last=="s") #($pNorth="0");#if ($path_last=="e") #($pWest="0");#if ($path_last=="w") #($pEast="0")} #( "Stop at crossroads" ) #alias find_dir_stop_xroads={#if ($pNorth=="1" && $pSouth=="1" && $pWest=="1" && $pEast=="1") path_exit_reset} #( "the path to check is in checkpath, it will check p* to see if it's ok and return in checkstatus" ) #alias path_checkone={pathcn;pathcs;pathcw;pathce} #alias pathcn={#if ($pcheckpath=="n" && $pNorth=="1") #($pcheckstatus="n")} #alias pathcs={#if ($pcheckpath=="s" && $pSouth=="1") #($pcheckstatus="s")} #alias pathce={#if ($pcheckpath=="e" && $pEast=="1") #($pcheckstatus="e")} #alias pathcw={#if ($pcheckpath=="w" && $pWest=="1") #($pcheckstatus="w")} #( "These get exits and save the results" ) #action >+path-consume-exits Exits:&1={#print;path_exit_reset;#if (\$1?"=north=") #($pNorth="1");#if (\$1?"=east=") #($pEast="1");#if (\$1?"=south=") #($pSouth="1");#if (\$1?"=west=") #($pWest="1");#if (@autogopath>0) {#(@autogopath--);gpath}} #( "Some path actions from common places" ) #alias pgb={#print Path from GH to Bree;setpath e n s} #alias pbg={#print Path from Bree to GH;setpath w s n} #alias pfb={#print Path from Fornost to Bree;setpath s e w} #alias pbf={#print Path from Bree to Fornost;setpath n e w} #alias pbr={#print Path from South Bree to Rivendell;setpath e s n} #alias prb={#print Path from Rivendell to Bree;setpath w s n} #alias ptb={#print Path from Tharbad to Bree;setpath n w e} #alias pbt={#print Path from Bree to Tharbad;setpath s e w}