|
uviel Beginner
Joined: 24 Feb 2007 Posts: 12
|
Posted: 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 |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4692 Location: Pensacola, FL, USA
|
Posted: 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 |
|
|
|
uviel Beginner
Joined: 24 Feb 2007 Posts: 12
|
Posted: 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 |
|
|
|
uviel Beginner
Joined: 24 Feb 2007 Posts: 12
|
Posted: 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 |
|
|
|
|
|