How to capture this?

Vooku
Posts: 72
Joined: Sun Aug 21, 2016 2:42 pm

How to capture this?

Post by Vooku »

Trying to collect melee data for statistical analysis. How would I go about collecting the number of hits per "round" from the data below? I round is defined from one prompt (hp/maxhp moves/maxmoves...) to the next prompt below.

So the first 'round' would collect 3 hits, the 2nd round 5 hits, the 3rd round 4 hits and the 4th round 5 hits. I would want the code to keep track of the number of each # of hits. For example I'd call a 3 hit round "3hits", 4 hits in a round "4hits", etc. So in the data below I'd have 1 3hits, 1 4hits and 2 5hits. I'd keep this tally going until I'd use an alias to 'reset' the data. I got a most of the data calculations done, just need help collecting the 'Xhits' per round.

This part of the prompt should remain the same for every class/character. "< xxxh/XXXH yyyv/YYYV"

Thanks in advance!
Code: [show] | [select all] lua
< 754h/1038H 125v/125V |bds +|ts +|ss +|ap +|ev +|bs +| |3|0|3|2|1| T: Jooku TC: few wounds E: noble
EC: nasty wounds EP: std P: std > 

Your massive slash slightly wounds an Ashstone noble.
An Ashstone noble dodges your futile attack.
Your massive slash slightly wounds an Ashstone noble.
You score a CRITICAL HIT!
Your massive slash severely wounds an Ashstone noble.
An Ashstone noble badly wounds you with his awesome hit.
An Ashstone noble severely wounds you with his massive hit.

< 659h/1038H 125v/125V |bds +|ts +|ss +|ap +|ev +|bs +| |3|0|3|2|1| T: Jooku TC: few wounds E: noble
EC: pretty hurt EP: std P: std > 

An Ashstone noble dodges your futile attack.
Your massive bludgeon barely wounds an Ashstone noble.
Your massive slash barely wounds an Ashstone noble.
Your mighty bludgeon barely wounds an Ashstone noble.
Your massive slash barely wounds an Ashstone noble.
You score a CRITICAL HIT!
Your massive slash badly wounds an Ashstone noble.
An Ashstone noble misses you with his hit.

< 678h/1038H 125v/125V |bds +|ts +|ss +|ap +|ev +|bs +| |3|0|3|2|1| T: Jooku TC: few wounds E: noble
EC: pretty hurt EP: std P: std > 

Your massive slash badly wounds an Ashstone noble.
Your massive slash badly wounds an Ashstone noble.
An Ashstone noble dodges your futile attack.
Your massive slash badly wounds an Ashstone noble.
Your massive slash badly wounds an Ashstone noble.
An Ashstone noble severely wounds you with his massive hit.

< 640h/1038H 125v/125V |bds +|ts +|ss +|ap +|ev +|bs +| |3|0|3|2|1| T: Jooku TC: few wounds E: noble
EC: pretty hurt EP: std P: std > 

You score a CRITICAL HIT!
Your massive bludgeon badly wounds an Ashstone noble.
Your massive bludgeon barely wounds an Ashstone noble.
Your awesome slash badly wounds an Ashstone noble.
Your powerful slash slightly wounds an Ashstone noble.
Your massive slash badly wounds an Ashstone noble.
An Ashstone noble severely wounds you with his massive hit.
An Ashstone noble misses you with his hit.

< 607h/1038H 125v/125V |bds +|ts +|ss +|ap +|ev +|bs +| |3|0|3|2|1| T: Jooku TC: few wounds E: noble
EC: pretty hurt EP: std P: std >

SoulSpirit
Posts: 17
Joined: Wed Aug 22, 2018 1:16 pm

Re: How to capture this?

Post by SoulSpirit »

The trigger to catch you attacks shoul look like:

Code: Select all

^Your (?:massive|mighty|powerful|awesome) (?:slash|bludgeon) (?:barely|slightly|severely|badly) wounds .+\.$
In it, you should save a global variable like:

Code: Select all

gRound = true
No need to check the prompt, you can use blank lines to detect the end of a round: create another trigger like this:

Code: Select all

^$
and check if the preceding lines where a combat round or not:

Code: Select all

if gRound then
	--do whatever you want with your collected data
else
	--ignore
end
gRound = false --round registered, ready for a new round

Vooku
Posts: 72
Joined: Sun Aug 21, 2016 2:42 pm

Re: How to capture this?

Post by Vooku »

Thanks! I'll give it a try. There is a condensed option I use at times to cut down on scroll lag. Could the trigger capture be easily modified for this? The attack line would look like this...

Your massive slash badly wounds an Ashstone noble. (x2)

So if two identical lines are next to each other only one gets shown (with an xY) and the other(s) get gagged.

Vooku
Posts: 72
Joined: Sun Aug 21, 2016 2:42 pm

Re: How to capture this?

Post by Vooku »

Question: how do assign the data collected to a specific variable? If the trigger 'sees' 4 hits in that round, how do I assign it to "fourattacks" and have it add 1 to it each time it sees a round with 4 hits?

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

Re: How to capture this?

Post by Jor'Mox »

Personally, if I wanted to track something like that, I would use a table that tracked how often different numbers of hits occurred, rather than using specific numbers of hits happened each with its own variable. So if, for example, the number of hits that round was held in matches[3], then storing it would look like this:
Code: [show] | [select all] lua
hit_count = hit_count or {}
hit_count[matches[3]] = (hit_count[matches[3]] or 0) + 1

Vooku
Posts: 72
Joined: Sun Aug 21, 2016 2:42 pm

Re: How to capture this?

Post by Vooku »

A table makes sense, but how would matches[3] be collecting it? I want the trigger pattern to 'count' how many hits landed in that round and then add 1 to a variable like "fourhits". If five hits landed in that round then add 1 to a variable named "fivehits".

I haven't been able to get the above pattern to work.

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

Re: How to capture this?

Post by Jor'Mox »

Are you trying to do this with the condensed version or the normal version? Also, if you landed four hits in a particular round, did you want to increment JUST the variable tracking how often you land four hits, or ALSO the ones tracking how often you land one, two, and three hits?

As far as the pattern goes, can you post a screenshot of the trigger you are using? Sometimes there is some little important detail that is messing things up.

Vooku
Posts: 72
Joined: Sun Aug 21, 2016 2:42 pm

Re: How to capture this?

Post by Vooku »

Just going to use normal version for now. I may tackle the condensed later on, but not for now.

I just want to track the number of hits that land in a round and add that to the corresponding variable. Like 4 hits land so the 'fourhits' variable get incremented by 1. If 6 hits land in a round, then the 'sixhits' would have 1 added to it.

So after a bunch of data collection I might have this data:

singlehits = 29
twohits = 35
threehits = 78
fourhits = 88
...etc...

Here is the trigger pattern I'm using. The part that is confusing me is how to relate what this trigger pattern is capturing to the number of times it sees that pattern in a round. Like SoulSpirit stated, I think I need a trigger to 'reset' the round, like the blank line he suggested.
Code: [show] | [select all] lua
^Your (?:massive|mighty|powerful|awesome) (?:slash|bludgeon) (?:barely|slightly|severely|badly) wounds .+\.$
Using the mud condensed mode it displays hits like this...

"You attack A burly bouncer, landing five hits."

Then I...

fiveattacks = fiveattacks + 1

So it keeps a running tally of how many 'five-hit' rounds I had. The problem with this is there are some items in the game that proc extra attacks, and they don't get displayed in the condensed format (...landing XXXX hits.). They get displayed normally, so I'm not collecting that data.

Here is another snippet of two rounds of attack...
Code: [show] | [select all] lua
< 600h/600H 127v/127V |ss +|ap +|ev +|ts +|bs 1| |3|1|2|1|2| T: Vokuran TC: excellent E: bouncer EC:
small wounds EP: std P: std > 

Your mighty slash barely wounds A burly bouncer.
Your massive slash barely wounds A burly bouncer.
Your powerful slash barely wounds A burly bouncer.
Your massive slash barely wounds A burly bouncer.
Your massive slash barely wounds A burly bouncer.
A burly bouncer misses you with his hit.
A burly bouncer misses you with his hit.

< 600h/600H 127v/127V |ss +|ap +|ev +|ts +|bs 1| |3|1|2|1|2| T: Vokuran TC: excellent E: bouncer EC:
small wounds EP: std P: std > 

Your icy casing melts.

< 600h/600H 127v/127V |ss +|ap +|ev +|ts +|bs +| |3|1|2|1|2| T: Vokuran TC: excellent E: bouncer EC:
small wounds EP: std P: std > 
Your awesome slash barely wounds A burly bouncer.
Your massive slash barely wounds A burly bouncer.
You miss A burly bouncer with your slash.
Your massive slash barely wounds A burly bouncer.
A burly bouncer misses you with his hit.
A burly bouncer misses you with his hit.

< 600h/600H 127v/127V |ss +|ap +|ev +|ts +|bs +| |3|1|2|1|2| T: Vokuran TC: excellent E: bouncer EC:
small wounds EP: std P: std > 
So the first round I landed 5 hits, and landed 3 hits in the second round. So I would need to 'reset' the round, collect the 5 hits and add 1 to the fivehits variable, reset the round 'counter', collect the 3 hits in the 2nd round and add 1 to the 'threehits' variable, reset the round counter and so on.

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

Re: How to capture this?

Post by Jor'Mox »

I figured that you were using the trigger pattern recommended above, but I asked for a screenshot of it because you said it still wasn't working, even though it should. Presumably there is something not quite right about the trigger other than the pattern (I'm assuming here you have the pattern type set to "perl regex").

As far as hit counting using the normal display version, I would do it this way. The trigger that detects a hit would just increment a basic variable that tracks hits. So, something like: hits = hits + 1

Then, I would use a trigger to snag your prompt (you could probably just use this as a pattern: ^< \d+h), and when that trigger fired, that would be when you counted how many hits were in the round and reset things for the next time around, which I would do like this:
Code: [show] | [select all] lua
if hits ~= 0 then
    hit_count = hit_count or {}
    hit_count[hits] = (hit_count[hits] or 0) + 1
    hits = 0
end
Using a table means you don't have to worry about having a new variable for each possible number of hits in a round, and it will be easier to use if you want to see the data at some point.

Vooku
Posts: 72
Joined: Sun Aug 21, 2016 2:42 pm

Re: How to capture this?

Post by Vooku »

Thanks. I'll give it a try.

Here's a screenie of my capture pattern/trigger.
Attachments
CaptureHits.JPG

Post Reply