 |
chamenas Wizard

Joined: 26 Mar 2008 Posts: 1547
|
Posted: Thu May 01, 2008 1:25 am
Hrmm... pattern getting really complex... |
| Code: |
^(?:\[ .* Coliseum \])?(?!Your)(?:[\w']+) (@attack_type)(?: does)? (@damage_type)(?: things to)?(?: a|the|A|The)? (?!you)(.+)[!.]
|
supposed to match something like:
[ The Center of the Coliseum ] Brianne's blizzard MUTILATES a wild bear!
But it doesn't. :/
What am I doing wrong? |
|
|
|
 |
chamenas Wizard

Joined: 26 Mar 2008 Posts: 1547
|
Posted: Thu May 01, 2008 1:50 am |
Also, why am I getting weird matches like:
A large grey stone fountain, fed from a nearby stream is here. ( ) dmg
???
And...
Several sleeping pads made of willow fronds, invite you to rest. ( ) dmg |
|
|
|
 |
Fang Xianfu GURU

Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Thu May 01, 2008 10:24 am |
You have no space between \])? and (?!Your. Anything other than that isn't readily obvious; post again later and I'll have a look when I'm home.
|
|
|
|
 |
Fang Xianfu GURU

Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Thu May 01, 2008 11:15 am |
On second thoughts, post a bunch of lines that this is supposed to match and I'll take a look. That pattern looks massively complex for what it's doing. I'm guessing the solution will be just to rip out all those optional sections, but we'll see.
|
|
|
|
 |
chamenas Wizard

Joined: 26 Mar 2008 Posts: 1547
|
Posted: Thu May 01, 2008 11:30 am |
| Fang Xianfu wrote: |
| On second thoughts, post a bunch of lines that this is supposed to match and I'll take a look. That pattern looks massively complex for what it's doing. I'm guessing the solution will be just to rip out all those optional sections, but we'll see. |
Well, the lines I posted are the only few I may be able to grab that have the [ western coliseum wall ] or whatever in them, as that event doesn't happen every night. But that specific pattern grabs the damage from other players, not done by me. We'd worked on it, and it worked, and then I added the stuff for the coliseum and it died.
Unfortunately, the adding of the coliseum part has made it so none of the lines work, including:
Dmg
Your beating decimates a gnome stone excavator!
EDmg
A gnome stone excavator's slash misses you.
PeDmg
A spirit's slash DISMEMBERS a gnome stone excavator!
OPDmg
[ The Center of the Coliseum ] Brianne's blizzard MUTILATES a wild bear!
[ Northern Coliseum Wall ] Vetter's lightning injures him.
[ Northern Coliseum Wall ] Someone's fireball MANGLES Vetter!
[ Eastern Coliseum Wall ] Vetter's gore mauls Vantok.
[ Eastern Coliseum Wall ] Vantok's magic misses Vetter.
[ Eastern Coliseum Wall ] Vantok's magic misses Vetter.
[ Eastern Coliseum Wall ] Vetter's magic misses Vantok.
[ Eastern Coliseum Wall ] Vantok's fireball *** DEMOLISHES *** Vetter!
| Code: |
#regex Damage_Convert {^(?:\[ (Eastern|Western|Northern|Southern|The Center of The) Coliseum(?: Wall)? \] )?Your (@attack_type)(?: does)? (@damage_type)(?: things to)?(?: a|the|A|The)? (.+)[!\.]$}
{ $Dmg_Val=%2
$Dmg=" "
#switch ($Dmg_Val)
("misses") {$Dmg=0}
("scratches") {$Dmg=2.5}
("grazes") {$Dmg=6.5}
("hits") {$Dmg=10.5}
("injures") {$Dmg=14.5}
("wounds") {$Dmg=18.5}
("mauls") {$Dmg=22.5}
("decimates") {$Dmg=26.5}
("devastates") {$Dmg=30.5}
("maims") {$Dmg=34.5}
("MUTILATES") {$Dmg=38.5}
("DISEMBOWELS") {$Dmg=42.5}
("DISMEMBERS") {$Dmg=46.5}
("MASSACRES") {$Dmg=50.5}
("MANGLES") {$Dmg=54.5}
("*** DEMOLISHES ***") {$Dmg=58.5}
("*** DEVASTATES ***") {$Dmg=68}
("=== OBLITERATES ===") {$Dmg=88}
(">>> ANNIHILATES <<<") {$Dmg= 112}
("<<< ERADICATES >>>") {$Dmg=136}
("GHASTLY") {$Dmg=163}
("HORRID") {$Dmg=188}
("DREADFUL") {$Dmg=228}
("HIDEOUS") {$Dmg=238}
("INDESCRIBABLE") {$Dmg=263}
("UNSPEAKABLE") {$Dmg=280}
#switch ($Dmg <= 34.5) {#sayadd { <color #CCCCCC>~(</color><color @Pcolor1>$Dmg</color><color #CCCCCC>~) dmg </color>}}
(($Dmg > 34.5) AND ($Dmg <= 54.5)) {#sayadd { <color #CCCCCC>~(</color><color @Pcolor2>$Dmg</color><color #CCCCCC>~) dmg </color>}}
(($Dmg > 54.5) AND ($Dmg <= 136)) {#sayadd { <color #CCCCCC>~(</color><color @Pcolor3>$Dmg</color><color #CCCCCC>~) dmg </color>}}
(($Dmg >= 163) AND ($Dmg <= 280)) {#sayadd { %ansi(blink)<color #CCCCCC>~(</color><color @Pcolor3>$Dmg</color><color #CCCCCC>~) dmg </color>%ansi(none)}}
} {General Triggers|Damage Calculator}
#regex PeDamage_Convert {^(?:\[ (Eastern|Western|Northern|Southern|The Center of The) Coliseum(?: Wall)? \] )?.* (@attack_type)(?: does)? (@damage_type)(?: things to)?(?: a|the|A|The)? (.+)[!\.]}
{
$PeDmg_Val=%2
$PeDmg=" "
#switch ($PeDmg_Val)
("misses") {$PeDmg=0}
("scratches") {$PeDmg=2.5}
("grazes") {$PeDmg=6.5}
("hits") {$PeDmg=10.5}
("injures") {$PeDmg=14.5}
("wounds") {$PeDmg=18.5}
("mauls") {$PeDmg=22.5}
("decimates") {$PeDmg=26.5}
("devastates") {$PeDmg=30.5}
("maims") {$PeDmg=34.5}
("MUTILATES") {$PeDmg=38.5}
("DISEMBOWELS") {$PeDmg=42.5}
("DISMEMBERS") {$PeDmg=46.5}
("MASSACRES") {$PeDmg=50.5}
("MANGLES") {$PeDmg=54.5}
("*** DEMOLISHES ***") {$PeDmg=58.5}
("*** DEVASTATES ***") {$PeDmg=68}
("=== OBLITERATES ===") {$PeDmg=88}
(">>> ANNIHILATES <<<") {$PeDmg= 112}
("<<< ERADICATES >>>") {$PeDmg=136}
("GHASTLY") {$PeDmg=163}
("HORRID") {$PeDmg=188}
("DREADFUL") {$PeDmg=228}
("HIDEOUS") {$PeDmg=238}
("INDESCRIBABLE") {$PeDmg=263}
("UNSPEAKABLE") {$PeDmg=280}
#switch ($PeDmg <= 34.5) {#sayadd { <color #CCCCCC>~(</color><color @Pcolor1>$PeDmg</color><color #CCCCCC>~) dmg </color>}}
(($PeDmg > 34.5) AND ($PeDmg <= 54.5)) {#sayadd { <color #CCCCCC>~(</color><color @Pcolor2>$PeDmg</color><color #CCCCCC>~) dmg </color>}}
(($PeDmg > 54.5) AND ($PeDmg <= 136)) {#sayadd { <color #CCCCCC>~(</color><color @Pcolor3>$PeDmg</color><color #CCCCCC>~) dmg </color>}}
(($PeDmg >= 163) AND ($PeDmg <= 280)) {#sayadd { %ansi(blink)<color #CCCCCC>~(</color><color @Pcolor3>$PeDmg</color><color #CCCCCC>~) dmg </color>%ansi(none)}}
} {General Triggers|Damage Calculator}
#regex OPDamage_Convert {^(?:\[ (Eastern|Western|Northern|Southern|The Center of The) Coliseum(?: Wall)? \] )?(?!Your)(?:[\w']+) (@attack_type)(?: does)? (@damage_type)(?: things to)?(?: a|the|A|The)? (?!you)(.+)[!.] }
{
$OPDmg_Val=%2
$OPDmg=" "
#switch ($OPDmg_Val)
("misses") {$OPDmg=0}
("scratches") {$OPDmg=2.5}
("grazes") {$OPDmg=6.5}
("hits") {$OPDmg=10.5}
("injures") {$OPDmg=14.5}
("wounds") {$OPDmg=18.5}
("mauls") {$OPDmg=22.5}
("decimates") {$OPDmg=26.5}
("devastates") {$OPDmg=30.5}
("maims") {$OPDmg=34.5}
("MUTILATES") {$OPDmg=38.5}
("DISEMBOWELS") {$OPDmg=42.5}
("DISMEMBERS") {$OPDmg=46.5}
("MASSACRES") {$OPDmg=50.5}
("MANGLES") {$OPDmg=54.5}
("*** DEMOLISHES ***") {$OPDmg=58.5}
("*** DEVASTATES ***") {$OPDmg=68}
("=== OBLITERATES ===") {$OPDmg=88}
(">>> ANNIHILATES <<<") {$OPDmg= 112}
("<<< ERADICATES >>>") {$OPDmg=136}
("GHASTLY") {$OPDmg=163}
("HORRID") {$OPDmg=188}
("DREADFUL") {$OPDmg=228}
("HIDEOUS") {$OPDmg=238}
("INDESCRIBABLE") {$OPDmg=263}
("UNSPEAKABLE") {$OPDmg=280}
#switch ($OPDmg <= 34.5) {#sayadd { <color #CCCCCC>~(</color><color @Pcolor1>$OPDmg</color><color #CCCCCC>~) dmg </color>}}
(($OPDmg > 34.5) AND ($OPDmg <= 54.5)) {#sayadd { <color #CCCCCC>~(</color><color @Pcolor2>$OPDmg</color><color #CCCCCC>~) dmg </color>}}
(($OPDmg > 54.5) AND ($OPDmg <= 136)) {#sayadd { <color #CCCCCC>~(</color><color @Pcolor3>$OPDmg</color><color #CCCCCC>~) dmg </color>}}
(($OPDmg >= 163) AND ($OPDmg <= 280)) {#sayadd { %ansi(blink)<color #CCCCCC>~(</color><color @Pcolor3>$OPDmg</color><color #CCCCCC>~) dmg </color>%ansi(none)}}
} {General Triggers|Damage Calculator}
#regex EDamage_Convert {^(?:\[ (Eastern|Western|Northern|Southern|The Center of The) Coliseum(?: Wall)? \] )?(?:A|The)? .* (@attack_type)(?: does)? (@damage_type)(?: things to) you[!\.]$}
{ $EDmg_Val=%2
$EDmg=" "
#switch ($EDmg_Val)
("misses") {$EDmg=0}
("scratches") {$EDmg=2.5}
("grazes") {$EDmg=6.5}
("hits") {$EDmg=10.5}
("injures") {$EDmg=14.5}
("wounds") {$EDmg=18.5}
("mauls") {$EDmg=22.5}
("decimates") {$EDmg=26.5}
("devastates") {$EDmg=30.5}
("maims") {$EDmg=34.5}
("MUTILATES") {$EDmg=38.5}
("DISEMBOWELS") {$EDmg=42.5}
("DISMEMBERS") {$EDmg=46.5}
("MASSACRES") {$EDmg=50.5}
("MANGLES") {$EDmg=54.5}
("*** DEMOLISHES ***") {$EDmg=58.5}
("*** DEVASTATES ***") {$EDmg=68}
("=== OBLITERATES ===") {$EDmg=88}
(">>> ANNIHILATES <<<") {$EDmg= 112}
("<<< ERADICATES >>>") {$EDmg=136}
("GHASTLY") {$EDmg=163}
("HORRID") {$EDmg=188}
("DREADFUL") {$EDmg=228}
("HIDEOUS") {$EDmg=238}
("INDESCRIBABLE") {$EDmg=263}
("UNSPEAKABLE") {$EDmg=280}
#switch ($EDmg <= 34.5) {#sayadd { <color #CCCCCC>~(</color><color @Pcolor1>$EDmg</color><color #CCCCCC>~) dmg </color>}}
(($EDmg > 34.5) AND ($EDmg <= 54.5)) {#sayadd { <color #CCCCCC>~(</color><color @Pcolor2>$EDmg</color><color #CCCCCC>~) dmg </color>}}
(($EDmg > 54.5) AND ($EDmg <= 136)) {#sayadd { <color #CCCCCC>~(</color><color @Pcolor3>$EDmg</color><color #CCCCCC>~) dmg </color>}}
(($EDmg >= 163) AND ($EDmg <= 280)) {#sayadd { %ansi(blink)<color #CCCCCC>~(</color><color @Pcolor3>$EDmg</color><color #CCCCCC>~) dmg </color>%ansi(none)}}
} {General Triggers|Damage Calculator}
|
|
|
Last edited by chamenas on Thu May 01, 2008 4:05 pm; edited 2 times in total |
|
|
 |
oldguy2 Wizard
Joined: 17 Jun 2006 Posts: 1201
|
Posted: Thu May 01, 2008 1:21 pm |
For one thing, you are creating another backreference so it isn't going to work now unless you change that.
| Code: |
| #regex EDamage_Convert {^(?:\[ (Eastern|Western|Northern|Southern|The Center of The) Coliseum(?: Wall)? \] )?(?:A|The)? .* (@attack_type)(?: does)? (@damage_type)(?: things to) you[!\.]$} |
The (Eastern|Western|Northern|Southern|The Center of The) is now %1, (@attack_type) is now %2, and (@damage_type) is now %3.
Plus you have, "The Center of The" when in your example it is "The Center of the".
Also for the "Coliseum" matching part just do this:
|
|
|
|
 |
chamenas Wizard

Joined: 26 Mar 2008 Posts: 1547
|
Posted: Thu May 01, 2008 1:23 pm |
Doesn't the greedy modifier make it slower?
And here's what I have now. Each pattern is basically the same with slight variations:
| Code: |
^(?:\[ (?:Eastern|Western|Northern|Southern|The Center of the) Coliseum(?: Wall)? \] )?(?:A|The)? .* (@attack_type)(?: does)? (@damage_type)(?: things to) you[!\.]$
|
Interesting. I got the OP damage to work, E damage doesn't work yet. Testing the others... |
|
|
|
 |
Fang Xianfu GURU

Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Thu May 01, 2008 1:39 pm |
Not really, no, since he's using a range to limit what it can match. It should actually be very quick to get to the closing bracket in this case, because that'll be the first character it won't match. The atomic group will then stop it backtracking back into those square brackets (because we know they're right already). In short, greedy dot = bad. Greedy range = good. Greedy range + atomic group = great.
|
|
|
|
 |
chamenas Wizard

Joined: 26 Mar 2008 Posts: 1547
|
Posted: Thu May 01, 2008 1:48 pm |
alright...
[ Eastern Coliseum Wall ] Vantok's magic misses Vetter.
pattern does not match
| Code: |
#regex OPDamage_Convert {^(?:\[ (?:\(?>\[[^\]]*\] )?(?!Your)(?:[\w']+) (@attack_type)(?: does)? (@damage_type)(?: things to)?(?: a|the|A|The)? (?!you)(.+)[!.] }
{
$OPDmg_Val=%2
$OPDmg=" "
#switch ($OPDmg_Val)
("misses") {$OPDmg=0}
("scratches") {$OPDmg=2.5}
("grazes") {$OPDmg=6.5}
("hits") {$OPDmg=10.5}
("injures") {$OPDmg=14.5}
("wounds") {$OPDmg=18.5}
("mauls") {$OPDmg=22.5}
("decimates") {$OPDmg=26.5}
("devastates") {$OPDmg=30.5}
("maims") {$OPDmg=34.5}
("MUTILATES") {$OPDmg=38.5}
("DISEMBOWELS") {$OPDmg=42.5}
("DISMEMBERS") {$OPDmg=46.5}
("MASSACRES") {$OPDmg=50.5}
("MANGLES") {$OPDmg=54.5}
("*** DEMOLISHES ***") {$OPDmg=58.5}
("*** DEVASTATES ***") {$OPDmg=68}
("=== OBLITERATES ===") {$OPDmg=88}
(">>> ANNIHILATES <<<") {$OPDmg= 112}
("<<< ERADICATES >>>") {$OPDmg=136}
("GHASTLY") {$OPDmg=163}
("HORRID") {$OPDmg=188}
("DREADFUL") {$OPDmg=228}
("HIDEOUS") {$OPDmg=238}
("INDESCRIBABLE") {$OPDmg=263}
("UNSPEAKABLE") {$OPDmg=280}
#switch ($OPDmg <= 34.5) {#sayadd { <color #CCCCCC>~(</color><color @Pcolor1>$OPDmg</color><color #CCCCCC>~) dmg </color>}}
(($OPDmg > 34.5) AND ($OPDmg <= 54.5)) {#sayadd { <color #CCCCCC>~(</color><color @Pcolor2>$OPDmg</color><color #CCCCCC>~) dmg </color>}}
(($OPDmg > 54.5) AND ($OPDmg <= 136)) {#sayadd { <color #CCCCCC>~(</color><color @Pcolor3>$OPDmg</color><color #CCCCCC>~) dmg </color>}}
(($OPDmg >= 163) AND ($OPDmg <= 280)) {#sayadd { %ansi(blink)<color #CCCCCC>~(</color><color @Pcolor3>$OPDmg</color><color #CCCCCC>~) dmg </color>%ansi(none)}}
} {General Triggers|Damage Calculator}
|
|
|
|
|
 |
oldguy2 Wizard
Joined: 17 Jun 2006 Posts: 1201
|
Posted: Thu May 01, 2008 3:03 pm |
How did you go from what I posted,
To what you just posted.
| Code: |
| ^(?:\[ (?:\(?>\[[^\]]*\] )? |
Of course it isn't going to work.
By the way, on this part,
it would be much easier to do this.
|
|
|
|
 |
Fang Xianfu GURU

Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Thu May 01, 2008 3:22 pm |
The regex should actually be case insensitive by default, anyway, so you don't need that last bit.
|
|
|
|
 |
chamenas Wizard

Joined: 26 Mar 2008 Posts: 1547
|
Posted: Thu May 01, 2008 3:39 pm |
Alright, I'll work on it and get back to you.
@Oldguy - Must have been a screw up when I copied and pasted. But I added the space at the end because there should be a space in between [ something ] and something |
|
|
|
 |
chamenas Wizard

Joined: 26 Mar 2008 Posts: 1547
|
Posted: Thu May 01, 2008 4:10 pm |
Alright, all of them seem to work (though I havent put them to a live test yet) except:
A gnome stone excavator's slash misses you.
pattern:
| Code: |
| ^(?>\[[^\]]*\] )?(?:A|The)? .* (@attack_type)(?: does)? (@damage_type)(?: things to) you[!\.]$ |
Actually, some works, but it all shows double, so two of the mare triggering at the same time...
Your beating decimates a gnome stone excavator! (26.5) dmg (26.5) dmg
Your beating decimates a gnome stone excavator! (26.5) dmg (26.5) dmg
Your beating *** DEVASTATES *** a gnome stone excavator! (68) dmg (68) dmg
Your beating *** DEVASTATES *** a gnome stone excavator! (68) dmg (68) dmg
Your beating *** DEVASTATES *** a gnome stone excavator! (68) dmg (68) dmg
Your beating *** DEVASTATES *** a gnome stone excavator! (68) dmg (68) dmg
Your beating *** DEVASTATES *** a gnome stone excavator! (68) dmg (68) dmg
This works:
[ Eastern Coliseum Wall ] Vantok's magic misses Vetter. (0) dmg (0) dmg
But this doesn't:
[ Eastern Coliseum Wall ] Vantok's fireball *** DEMOLISHES *** Vetter!
[ Eastern Coliseum Wall ] Vantok's fireball *** DEMOLISHES *** Vetter! |
|
|
|
 |
oldguy2 Wizard
Joined: 17 Jun 2006 Posts: 1201
|
Posted: Thu May 01, 2008 4:39 pm |
You are not looking at your patterns closely and just writing it in. Look at that pattern closely and you will see why (hint: start at "things to").
Also you probably have two firing at the same time because you made the patterns that way. In fact you could probably make one pattern for all 3. As far as the spaces in between the [ and ] that doesn't matter with the way you have it now it will match everything including the spaces between them. |
|
|
|
 |
chamenas Wizard

Joined: 26 Mar 2008 Posts: 1547
|
Posted: Thu May 01, 2008 5:05 pm |
oh! Well... there's 4 of them. I'd like to make them all one pattern, but I would need to find a way to do that and yet calculate all of the damage separately.
|
|
|
|
 |
oldguy2 Wizard
Joined: 17 Jun 2006 Posts: 1201
|
Posted: Thu May 01, 2008 6:05 pm |
Why you have 4 is what I don't understand. The attack types and damage types are the same for all of them and so are the damage amounts. Whether it be you doing the damage, someone damaging you, or someone damaging someone else it is always the same right? Therefore, you should be able to simply just make a single trigger to cover all circumstances. You would just need to make your pattern work for each circumstance.
|
|
|
|
 |
chamenas Wizard

Joined: 26 Mar 2008 Posts: 1547
|
Posted: Thu May 01, 2008 6:27 pm |
I know, but when I add in the parts separating damage by the person doing damage, the person taking damage, and the attack type, I'm struggling to find a way to make it all work in one trigger.
|
|
|
|
 |
oldguy2 Wizard
Joined: 17 Jun 2006 Posts: 1201
|
Posted: Thu May 01, 2008 7:18 pm |
Well post examples of all the variations you get...NOT the patterns you have but the lines you get from the Mud. I'm sure we can help you.
|
|
|
|
 |
chamenas Wizard

Joined: 26 Mar 2008 Posts: 1547
|
Posted: Thu May 01, 2008 7:35 pm |
| chamenas wrote: |
| I know, but when I add in the parts separating damage by the person doing damage, the person taking damage, and the attack type, I'm struggling to find a way to make it all work in one trigger. |
From Pets or other mobs:
A water elemental's chill === OBLITERATES === a viper fish! (88) dmg
A wild bear's shock >>> ANNIHILATES <<< a viper fish! (112) dmg
A wild bear's shock >>> ANNIHILATES <<< a viper fish! (112) dmg
other mobs:
A viper fish's pierce misses a water elemental. (0) dmg
A viper fish's pierce misses a water elemental. (0) dmg
Me:
Your shock MASSACRES a viper fish! (50.5) dmg
Your shock decimates a viper fish! (26.5) dmg
Other Players:
Vetter's gore mauls Vantok.
Vantok's magic misses Vetter.
Vantok's magic misses Vetter.
Vetter's magic misses Vantok.
And there may be various things in front of them. Only one I can recall right now is:
[ Eastern Coliseum Wall ]
[ Northern Coliseum Wall ]
[ Western Coliseum Wall ]
[ Sotuhern Coliseum Wall ]
[ The Center of the Coliseum ]
I would love the help, but I want to make sure I understand everything I get so I can edit.
As I said, what I want to capture is:
- Who is doing the damage
- How they are doing the damage
- Number of hits
- How much damage they are doing
- Who they are doing the damage to
-- How much damage everything takes and from whom
so output when you type a command (an alias) would be
<creature> dealt <dmg> with <attack type> in <number of hits> for <avg dmg> to <creature2>
<dmg> with <attack type> in <number of hits> for <avg dmg> to <creature2>
<dmg> with <attack type> in <number of hits> for <avg dmg> to <creature2>
<creature2> dealt <dmg> with <attack type> in <number of hits> for <avg dmg> to <creature>
<dmg> with <attack type> in <number of hits> for <avg dmg> to <creature>
<dmg> with <attack type> in <number of hits> for <avg dmg> to <creature>
etc... |
|
|
|
 |
|
|
|