|
harley Apprentice
Joined: 05 Apr 2008 Posts: 121
|
Posted: Sat May 31, 2008 6:44 pm
Regex Simple fix, :) |
This is my trigger
Code: |
^\[(\s\d\d)+ ...\]\s+(\a+)\s+(\d+)\/(\d+)\s+((?:-|)\d+)\/(\d+)\s+((?:-|)\d+)\/(\d+)\s+((?:-|)\d+)\s+\d+
|
This is what it triggers off of.
Code: |
[ 44 T+4] CharName 201/201 137/137 174/174 715 557
|
the first number (my level) changes from 1 to 201
atm, i have 3 of these triggers almost identical.. only difference is the \d\d\d vs \s\s\d
And i dont know how to change it.. Any help? |
|
|
|
Dharkael Enchanter
Joined: 05 Mar 2003 Posts: 593 Location: Canada
|
Posted: Sat May 31, 2008 7:31 pm |
Code: |
^\[(\s{0,2}\d{1,3})+ ...\]\s+(\a+)\s+(\d+)\/(\d+)\s+((?:-|)\d+)\/(\d+)\s+((?:-|)\d+)\/(\d+)\s+((?:-|)\d+)\s+\d+ |
|
|
_________________ -Dharkael-
"No matter how subtle the wizard, a knife between the shoulder blades will seriously cramp his style." |
|
|
|
harley Apprentice
Joined: 05 Apr 2008 Posts: 121
|
Posted: Sat May 31, 2008 8:08 pm |
Thank you.
|
|
|
|
harley Apprentice
Joined: 05 Apr 2008 Posts: 121
|
Posted: Sun Jun 01, 2008 4:51 am |
Hmm, This doesnt fire.
Code: |
[ 15 T+4] Joe 2819/2819 1140/1793 1925/1925 2500 4051
|
|
|
|
|
Dharkael Enchanter
Joined: 05 Mar 2003 Posts: 593 Location: Canada
|
Posted: Sun Jun 01, 2008 5:44 am |
When I open a brand new CMUD session and create a regex trigger with that pattern and test the pattern with the line you stated doesn't fire it fires just fine.
It also fires if i actually echo the line. |
|
_________________ -Dharkael-
"No matter how subtle the wizard, a knife between the shoulder blades will seriously cramp his style." |
|
|
|
harley Apprentice
Joined: 05 Apr 2008 Posts: 121
|
Posted: Sun Jun 01, 2008 5:54 am |
Interesting.. I'll do more digging..
Code: |
<trigger name="GroupPopulator" priority="27920" regex="true" id="2792">
<pattern>^\[(\s{0,2}\d{1,3})+ ...\]\s+(\a+)\s+(\d+)\/(\d+)\s+((?:-|)\d+)\/(\d+)\s+((?:-|)\d+)\/(\d+)\s+((?:-|)\d+)\s+\d+ </pattern>
<value>#if (%char = %2) {
#addkey Misc GroupNumber {%eval(@misc.groupnumber + 1)}
#addkey Misc Mylevel {%eval(%1)}
#addkey Misc TLevel {%eval((@Misc.Tier*10)+@misc.mylevel)}
} {
#additem GroupList %2
#addkey Misc GroupNumber {%eval(@misc.groupnumber + 1)}}
#if (@Misc.GroupNumber != 1) {setgrouped 1}</value>
</trigger>
|
I cant get it to fire via the 'test trigger' window or in game..
Notice anything wrong? |
|
|
|
Larkin Wizard
Joined: 25 Mar 2003 Posts: 1113 Location: USA
|
Posted: Sun Jun 01, 2008 11:24 am |
It fires just fine for me, too.
|
|
|
|
harley Apprentice
Joined: 05 Apr 2008 Posts: 121
|
Posted: Sun Jun 01, 2008 7:26 pm |
Sometimes I think i'm retarded..
there was an extra space at the end of the line.. Much appreciated. |
|
|
|
Anaristos Sorcerer
Joined: 17 Jul 2007 Posts: 821 Location: California
|
Posted: Sun Jun 01, 2008 7:35 pm |
This pattern
Code: |
#REGEX {^\[\s*(\d+)(?:[^\]]+\])([^\d]+)(\d+)/(\d+)\s*(\d+)/(\d+)\s*(\d+)/(\d+)\s*(\d+) (\d+)} {}
|
when applied to
Code: |
[ 15 T+4] Joe 2819/2819 1140/1793 1925/1925 2500 4051
|
will return the following:
Code: |
%1 = 15
%2 = Joe (must use %trim(%2) to remove blanks.)
%3 = 2819
%4 = 2819
%5 = 1440
%6 = 1793
%7 = 1925
%8 = 1925
%9 = 2500
%10 = 4051
|
I did test your trigger as you have it and it worked in the pattern test and it fired when I #SHOWed your test data.
I am under the impression that some of the %eval applications you use are not necessary in CMUD, and if you need to force evaluation, using just {data} will usually work. |
|
_________________ Sic itur ad astra. |
|
|
|
|
|