|
Fraust Newbie
Joined: 24 Aug 2007 Posts: 1
|
Posted: Fri Aug 24, 2007 1:06 am
A Newbie Question |
I've been reading the documentation portion of the Cmud website. I'm trying to populate a couple of variables but can't seem to get it working. Here is what I have so far...
Hp: 1010(1010) Gp: 1025(1025) Xp: 1617129(33000000) is the mud output...
#TRIGGER {Hp: &{HPvar}(1010) Gp: &{GPvar}(1025) Xp: &{XPvar}(33000000)} is how I have it defined..
I use #SHOW @HPvar and I get nothing...
I'm sure it's something silly. Any help? |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Fri Aug 24, 2007 1:19 am |
The problem is that the trigger pattern doesn't match the text. The brackets () are special characters in CMUD pattern syntax - you need to tell CMUD that you don't intend for them to be used as special characters - you do this by putting a tilde ~ in front of them. This pattern matches your text:
Hp: &{HPvar}~(1010~) Gp: &{GPvar}~(1025~) Xp: &{XPvar}~(33000000~)
However, if the numbers in brackets ever change, you'll have to manually recreate the trigger. You can circumvent this by using real wildcards in the pattern rather than the variable-capture syntax. %d will match those numbers, so something like:
Hp: &{HPvar}~(%d~) Gp: &{GPvar}~(%d~) Xp: &{XPvar}~(%d~)
might work better.
In CMUD 2 it'll be much easier to check this sort of problem - triggers will have a new "Test Pattern" tab, where you can paste the text you think should fire the trigger and CMUD will tell you whether or not the trigger matches the text. |
|
|
|
|
|