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
uviel
Beginner


Joined: 24 Feb 2007
Posts: 12

PostPosted: Sat Feb 24, 2007 9:36 am   

Trigger - how to exclude a grammar sign
 
Hi, I need a little help.

I have a trigger set to capture what weapon I wield and then it sends it to a variable. The problem is that when I wield a weapon the mud outputs:

You wield an ornate silver sword.

The trigger captures the last word which is sword.

It would like to exclude . at the end as it sends the whole thing sword. to the variable and when my next trigger fires which is wield @variable I get wield sword. but the . at the end messes it up as the keyword is only sword not sword.

Any help is appreciated, thanks
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4692
Location: Pensacola, FL, USA

PostPosted: Sat Feb 24, 2007 9:42 am   
 
%p is a predefined variable to capture punctuation
$ will capture the end of the line
But for this example i would just use:

#TR {You wield* (%x).$} {#VAR weapon {%1}}
_________________
Discord: Shalimarwildcat
Reply with quote
uviel
Beginner


Joined: 24 Feb 2007
Posts: 12

PostPosted: Sat Feb 24, 2007 10:11 am   
 
Thanks, tried that but it is not working for me, my trigger is as follows:

You wield (*) %word(%1,%numwords(%1))

As the last weapon word is the keyword. And in value field I have:

@weapon = %2

Thanks
Reply with quote
uviel
Beginner


Joined: 24 Feb 2007
Posts: 12

PostPosted: Sat Feb 24, 2007 10:32 am   
 
Git it, just had to add .$ at the end instead of

You wield (*) %word(%1,%numwords(%1))

should be

You wield (*) %word(%1,%numwords(%1)).$

Thanks for the help
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