|
Gimli Beginner
Joined: 16 Oct 2005 Posts: 22 Location: Canada
|
Posted: Sun Dec 12, 2010 8:07 pm
Matching Whitespace or not |
Having troubles matching in CMUD...
Hits : 45 ( 93)
Though it can also look like
Hits : 124 (455)
as well..
I tried
Hits ~: &%d{HP} ~( &%d{HPmax}~)
Which works if there is a space, but when I go to use %s like
Hits ~: &%d{HP} ~(%s?&%d{HPmax}~)
but it doesn't seem to work.. tried to make it so I that I dont have to worry about how many whitespaces there are in my trigger.
What am I doing wrong? |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Sun Dec 12, 2010 8:21 pm |
Use a range (and, yes, you will not be able to use the &varname syntax).
&%dHP ~(([%s%d])~)
In the code, use %trim() to get rid of any whitespace and assign the result to your variable: HPmax = %trim(%2). |
|
_________________ EDIT: I didn't like my old signature |
|
|
|
Gimli Beginner
Joined: 16 Oct 2005 Posts: 22 Location: Canada
|
Posted: Sun Dec 12, 2010 8:50 pm |
So how do I set that up with the Trigger itself?
Do I do it in the CMD line, or do I use the Script portion in the Trigger?
so
#TRIGGER &%dHP ~(([%s%d])~)
#VAR HPmax %trim(%2)
Sort of thing? |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Sun Dec 12, 2010 9:18 pm |
If the trigger is already created, it's probably easier to just use the Package Editor instead of the command line. Anything with wildcards goes in the pattern box, anything that uses commands or the %1...%99 variables goes in the code box.
|
|
_________________ EDIT: I didn't like my old signature |
|
|
|
|
|