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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Acidic
Newbie


Joined: 12 Sep 2004
Posts: 5

PostPosted: Mon Jun 13, 2005 7:00 am   

Substitution and wildcards
 
I want to substitute text for a shorter message, but I'm having difficulty with the wildcards in parenthesis:

Code:
#tr {^{Letting * droop, (%w) suddenly heaves it up at you|With a focused look, (%w) strikes at you with *|With a heavy overhand stroke, (%w) slams * down upon you|With a powerful lunge, (%w) strikes at you with *}. Your ({left|right}) leg is elegantly %w and swept out from under you, knocking you to the ground.$} {#sub {%ansi(gray)%1 strikes you, hitting your %2 leg.}

Using this, the %1 will only work if the first message (Letting * droop, (%2) suddenly heaves it up at you) is displayed from the MUD, whereas %2 will only work for the second message displayed.

Can someone please tell me how I can substitute this successfully? I've tried a few combinations, and all have failed because of the differing messages that can appear. Using &attacker in place of the (%w) in the trigger also doesn't seem to work, since it creates the variable, but doesn't assign a value to it.
Reply with quote
mr_kent
Enchanter


Joined: 10 Oct 2000
Posts: 698

PostPosted: Mon Jun 13, 2005 7:58 am   
 
Create four triggers? I believe four triggers in this case would even improve the speed of your session, since three of them wouldn't need to be checked before firing.
Reply with quote
Acidic
Newbie


Joined: 12 Sep 2004
Posts: 5

PostPosted: Mon Jun 13, 2005 8:11 am   
 
Ah, thank you =) I was unsure which would be faster.
Reply with quote
GaidinBDJ
Wanderer


Joined: 15 Nov 2002
Posts: 52
Location: Las Vegas, Nevada

PostPosted: Mon Jun 13, 2005 12:38 pm   
 
The help file says you can't use patterns inside of the {|} thingy. That could be why none of the rest are firing.
_________________
Barry
Gaidin @ 3k.org
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion 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 Wolfpaw.net