 |
fawkespause Newbie
Joined: 17 Oct 2009 Posts: 2
|
Posted: Sat Oct 17, 2009 3:09 am
Patterns fooled by brackets? |
I am using the following pattern, to report for variables: Health &HPVAR/&MHPVAR
The text I am looking for it to fetch is: Health [ 30/30 ]
The problem is, the variables are showing up as [ 30 and 30 ] respectively. Is there any way for me to have the pattern searcher ignore the brackets and only report the numbers? Thanks!
Edit: Placing a blue underlined space after MHPVAR makes it not report a bracket, but it can only be done with the last one, not the first one. |
|
|
|
 |
charneus Wizard

Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Sat Oct 17, 2009 3:28 am |
The trigger should be:
#TRIGGER {Health ~[%s(%d)/(%d)%s~]} {whatever}
Keep in mind that this trigger assumes that there will be a space before and after the numbers even in triple digits. If not, you'll need to change it a little.
Charneus |
|
Last edited by charneus on Sat Oct 17, 2009 3:53 am; edited 1 time in total |
|
|
 |
fawkespause Newbie
Joined: 17 Oct 2009 Posts: 2
|
Posted: Sat Oct 17, 2009 3:40 am |
With a little more hunting on the forums, and some more experimentation, I got this to work:
Health ~[ &HpVar/&MHpVar ~]
But thanks anyways! |
|
|
|
 |
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Sat Oct 17, 2009 7:16 pm |
The syntax for direct assignment is as follows:
& -- denotes direct assignment
%? -- denotes the type of wildcard (%d, %x, %a, %w, %n, etc)
varname -- name of the variable
Like any other trigger pattern, the more specific you can make it the faster it can fail and therefore the faster CMud will execute (keeping in mind that CMud is fast enough that you probably won't notice the difference). |
|
_________________ EDIT: I didn't like my old signature |
|
|
 |
|
|
|