Regex problem for dmg

Post Reply
noblestone
Posts: 154
Joined: Sun Jul 29, 2012 6:50 am

Regex problem for dmg

Post by noblestone »

Your attack strikes a pet devil 3 times, with **EVISCERATING** intensity!

Your attack strikes an Unseelie 1 time, with *MAIMING* intensity!

Now to pick up only damage to feed in the damage counter script I have...

I did this...

^Your attack strikes a (.*) (\d+) times, with (.*) (.*)!
^Your attack strikes an (.*) (\d+) time, with (.*) (.*)!

CritCounter:AddCrit(matches[4])

Why wasnt it feeding the damage into my script?

Jor'Mox
Posts: 1146
Joined: Wed Apr 03, 2013 2:19 am

Re: Regex problem for dmg

Post by Jor'Mox »

Well, you can cover that with just one pattern, FYI:

^Your attack strikes a[n]? (.*) (\d+) time[s]?, with (.*) (.*)!

As for why, have you checked to see what is actually matching in your pattern? Try putting display(matches) before you add it to the crit counter, to see if you are capturing what you expect to capture.

noblestone
Posts: 154
Joined: Sun Jul 29, 2012 6:50 am

Re: Regex problem for dmg

Post by noblestone »

That improved a lot, however theres mobs which comes with 3 words like nightmarish sea serpent, it wont fire, or 2 words. Any idea how to fix that one? Thanks

noblestone
Posts: 154
Joined: Sun Jul 29, 2012 6:50 am

Re: Regex problem for dmg

Post by noblestone »

Asden is killing be.

$[1514/1885][0/0][603/794][1017][-/-][Kills:1265][XP:101328]
You start fighting an aggressive displacer beast.
Your attacks strike an aggressive displacer beast 2 times, with ***DISMEMBERING***
strength!{
"Your attack"
}
An aggressive displacer beast has some small wounds and bruises.

$[1514/1885][0/0][603/794][1017][-/-][Kills:1265][XP:101328]
An aggressive displacer beast's attacks strike you 2 times, with **DECIMATING** intensity!
Your attack strikes an aggressive displacer beast 1 time, with ***EVISCERATING***
intensity!{
"Your attack strikes an aggressive displacer beast 1 time, with ***EVISCERATING***
intensity!",
"aggressive displacer beast",
"1",
"***EVISCERATING***",
"intensity"
}
An aggressive displacer beast has quite a few wounds.

$[1461/1885][0/0][603/794][1017][-/-][Kills:1265][XP:101328]
You do the best you can!
An aggressive displacer beast has quite a few wounds.

$[1461/1885][0/0][603/794][1017][-/-][Kills:1265][XP:101328]
An aggressive displacer beast's attack strikes you 1 time, with MAULING intensity.
Your attacks strike an aggressive displacer beast 3 times, with **MASSACRING** power!{
"Your attack"
}
An aggressive displacer beast has some big nasty wounds and scratches.

$[1437/1885][0/0][603/794][1017][-/-][Kills:1265][XP:101328]
An aggressive displacer beast's attacks strike you 2 times, with PULVERIZING intensity!
Your attacks strike an aggressive displacer beast 2 times, with ***DISMEMBERING***
brutality!{
"Your attack"
}
An aggressive displacer beast is in awful condition.

$[1343/1885][0/0][603/794][1017][-/-][Kills:1265][XP:101328]
Dragonscale stops using a glowing ivory dagger.
Dragonscale puts a large dwarven shield in their offhand.
An aggressive displacer beast is in awful condition.

$[1343/1885][0/0][603/794][1017][-/-][Kills:1265][XP:101328]
An aggressive displacer beast's attacks strike you 2 times, with ***DEVASTATING***
intensity!
Dragonscale's tail whacks an aggressive displacer beast in the head! They are stunned.
Your attack strikes an aggressive displacer beast 1 time, with terminal brutality!{
"Your attack strikes an aggressive displacer beast 1 time, with terminal brutality!",
"aggressive displacer beast",
"1",
"terminal",
"brutality"
}
An aggressive displacer beast is DEAD!!
Your bonus for this round was 11 percent.
You receive 32 experience points.
Your pain resistance is refreshed by victory!
An aggressive displacer beast collapses, leaving a pool of blood on the ground.
Corpse of an aggressive displacer beast liquifies into nothing.

Silvine
Posts: 142
Joined: Sat Oct 23, 2010 2:36 pm

Re: Regex problem for dmg

Post by Silvine »

You need to account for
attacks
as well as
attack
same method will work
[s]?
Mapper of Bedlam

Jor'Mox
Posts: 1146
Joined: Wed Apr 03, 2013 2:19 am

Re: Regex problem for dmg

Post by Jor'Mox »

^Your attack[s]? strike[s]? a[n]? (.*) (\d+) time[s]?, with (.*) (.*)!

That should work.

noblestone
Posts: 154
Joined: Sun Jul 29, 2012 6:50 am

Re: Regex problem for dmg

Post by noblestone »

Yes! Worked! Now this goes back to my post http://forums.mudlet.org/viewtopic.php?f=9&t=4391

This fired ok with terminal as damage - LUA OK script Damage Trigger (Trigger193) ran without errors

As for other damages still comes up as - LUA: ERROR running script Damage Trigger (Trigger193) ERROR:[string "if not CritCounter then...
"]:180: attempt to perform arithmetic on field '?' (a nil value)

Post Reply