Register to post in forums, or Log in to your existing account

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » Finished MUD Scripts

Joined: 10 Oct 2000
Posts: 1116
Location: USA

PostPosted: 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))}

Here's the original thread:

Great Script vrsoft!

Reply with quote

Joined: 15 Nov 2000
Posts: 23
Location: USA

PostPosted: Mon Feb 10, 2003 6:38 pm   
Yeah this works pretty good at capturing the room exits. Unless the room exits are non-standard. FOr instance...

[ (closed north) south up ]

The var for current_exits get set as c|s|u

How would one avoid this?
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » Finished MUD Scripts All times are GMT
Page 1 of 1

Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by