iljhar GURU
Joined: 10 Oct 2000 Posts: 1116 Location: USA
|
Posted: Thu Aug 23, 2001 2:36 am
vrsoft's automapper and fleeing script |
I don't think vrsoft will mind if I post his script here since he posted it in the General Discussion forum. I know there are questions on how to get the automapper to know where you've fled and vrsoft came up with a solution that works on the Dark Mists Mud. I'm sure you can tweak it to fit your mud. I edited the original text so that all you'd have to do is cut-n-paste each part into the command line, so here it is:
#CLASS {System|AutomapperAll|Flee}
#VARIABLE current_exits {}
#VARIABLE curline {}
#VARIABLE roomdesc {}
#VARIABLE roomname {}
#VARIABLE roomdesc_map {}
#VARIABLE found {}
#VARIABLE found_dir {}
#VARIABLE exits_map {}
#TRIGGER {~[Exits: (*)~]$} {#IF ("%1" == "none") {current_exits = %1} {current_exits=%replace(%1, " ", "|");#FORALL @current_exits {current_exits = %sort(%replace(@current_exits, %i, %left(%i, 1)))}}} "" {case}
#TRIGGER {You flee from combat!$} {roomdesc = %concat( @roomdesc, "|"%char( 10));found = 0;#FORALL %roomexit() {roomdesc_map = %replace(%roomdesc(%roomlink( ,%i)), %char(13), "|");exits_map = %sort(%roomexit(%roomlink( ,%i)));#IF ((@roomname==%roomname(%roomlink( ,%i))) and (@roomdesc==@roomdesc_map) and (@current_exits==@exits_map)) {found_dir = %i;#MATH found (@found+1)}};#IF (@found == 0) {#SAY %ansi( 13)--> ~[ABORT~] No room matches found.;#ABORT 1};#IF (@found > 1) {#SAY %ansi( 13)--> ~[ABORT~] @found room matches found.;#ABORT 1};#TELEPORT %roomlink( ,@found_dir)} "" {case}
#TRIGGER {You choose a direction at random and begin to run...$(%*)$(%*)$} {roomname = "%1";curline = "%2";roomdesc = %concat( @curline|%char( 10))}
#TRIGGER {{@curline}$(%*)$} {curline = "%1";roomdesc = %concat( @roomdesc, "%1|"%char( 10))}
#CLASS 0
Here's the original thread: http://www.zuggsoft.com/forum/topic.asp?TOPIC_ID=2165&FORUM_ID=7&CAT_ID=1&Topic_Title=%5BAutomapper+%26+Fleeing%5D++How+can+I+capture+a+desc%3F&Forum_Title=zMUD+General+Discussion
Great Script vrsoft!
Iljhar |
|