 |
acusick007 Newbie
Joined: 09 Jan 2009 Posts: 5
|
Posted: Sat Jun 18, 2011 3:24 pm
[3.34] Trigger Help |
Hi, I am having trouble getting a trigger setup. The line I would like to capture is as follows.
Code: |
PROT: ON BARK: ON VEST: ON GXP%: [30.440%] CL: [*89.12%] |
My current trigger loosk like this.
Code: |
PROT: (%w) BARK: (%w) VEST: (%w) GXP~%: ~[&%f{gxp}~%~] |
As you can see the CL: and everything that follows is not captured. There are 2 states to the CL: part.
First is:
and
Is there a way to use one trigger to capture both states and keep a record as to weather or not the * is present?
Thank you for the help. |
|
|
 |
shalimar GURU

Joined: 04 Aug 2002 Posts: 4772 Location: Pensacola, FL, USA
|
Posted: Sat Jun 18, 2011 9:58 pm |
there is no %f
use %d.%d
though since you are naming the variable in the pattern you may need to use *
Code: |
PROT: (%w) BARK: (%w) VEST: (%w) GXP~%: ~[({~*|})&[%d.]{gxp}~%~] |
#IF (%4="*") {blah} |
|
_________________ Discord: Shalimarwildcat |
|
|
 |
Daern Sorcerer
Joined: 15 Apr 2011 Posts: 809
|
Posted: Tue Jun 21, 2011 11:18 pm |
Sure there's a %f, it matches floating point numbers.
|
|
|
 |
shalimar GURU

Joined: 04 Aug 2002 Posts: 4772 Location: Pensacola, FL, USA
|
|
_________________ Discord: Shalimarwildcat |
|
|
 |
Fizgar Magician
Joined: 07 Feb 2002 Posts: 333 Location: Central Virginia
|
Posted: Wed Jun 22, 2011 4:53 pm |
There is indeed a %f it might not be documented but it's there and works. Remember documentation isn't always up to date.
Assuming that both the GXP and CL percentages show in the prompt every time, the pattern in the trigger below should work. It's a regex but that will allow the trigger to match whether the * is present before the CL percentage or not. The GXP variable is populated just as your original trigger was trying to do, %5 will contain the * if it's present and %6 will be the actual value of CL. All parameters are printed out for debugging purposes so you don't have to refer back to this post when testing it out. Hope this helps.
Code: |
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
<trigger priority="290" regex="true" copy="yes">
<pattern>PROT: (\a+) BARK: (\a+) VEST: (\a+) GXP\%: \[(?gxp:[+-]?[0-9,]*\.?[0-9]*)\%\] CL: \[(\*)?([+-]?[0-9,]*\.?[0-9]*)\%\]</pattern>
<value>#print ~%1 = %1
#print ~%2 = %2
#print ~%3 = %3
#print ~%4 = %4
#print ~%5 = %5
#print ~%6 = %6</value>
</trigger>
</cmud> |
|
|
_________________ Windows Vista Home Premium SP2 32-bit
AMD Athlon Dual Core 4400+ 2.31 GHz
3 GB RAM
CMUD 3.34 |
|
|
 |
|
|