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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
miischi
Beginner


Joined: 04 Jan 2009
Posts: 20

PostPosted: Mon Jan 26, 2009 2:56 am   

[2.37] Another Alias Problem
 
me again :P i just can't get the stuff working as i'd like it to be.

#TRIGGER { %1 *LOCATION} {LOCATIONVAR = %1;#GAG}


#ALIAS ALIASNAME {enter portal;mantra @LOCATIONVAR}


the word that is captured by %1 changes, hence the paramater. my problem is that it also captured the spaces behind that word.
i tried to avoid that by using *LOCATION with one fixed space behind the paramater. sadly the parameters don't always consist of the
same length as words, so the number of spaces behind them varies, too.

short example:


Code:
 montinommmon     Air Temple, south crossing

#TRIGGER { %1 *Air Temple, south crossing} {airtemple = %1;#GAG}
#ALIAS ptemple {enter portal;mantra @airtemple}

it will fire

"enter portal;mantra montinommmon     "




either of you can help me with my problem?
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Mon Jan 26, 2009 3:52 am   
 
Never use %1 in a trigger pattern. That's only asking for trouble. If it's always going to be a word, then use (%w), which will match one word only.

If it can be more than one word, or have an apostrophe in it, then we have to come up with something else.

Charneus
Reply with quote
miischi
Beginner


Joined: 04 Jan 2009
Posts: 20

PostPosted: Mon Jan 26, 2009 7:26 am   
 
i'll check it out with the %w . i just need to replace the %1 with %w ? in the actual trigger pattern and the value?
Reply with quote
miischi
Beginner


Joined: 04 Jan 2009
Posts: 20

PostPosted: Mon Jan 26, 2009 7:29 am   
 
woop woop, works. big thanks :D
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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