How to capture this?

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

Re: How to capture this?

Post by Jor'Mox »

Okay, so first rule for debugging triggers, always put that debugging message as the VERY FIRST line in the code, so it will be seen even if there is some bug in the other code. In this case, I realized that I didn't put in anything to ensure that the hit variable existed, so that is a likely cause of issues. I would change hits = hits + 1 to hits = (hits or 0) + 1

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

Re: How to capture this?

Post by Vooku »

Making progress...
Code: [show] | [select all] lua
< 585h/585H 127v/127V |ss +|ap +|ev +|ts +|bs +| |3|2|3|3|2| T: Vokuran TC: excellent E: noble EC:
pretty hurt EP: std P: std > 

[Resetting round...]
An Ashstone noble misses you with his hit.
An Ashstone noble misses you with his hit.
Your massive slash slightly wounds an Ashstone noble.1

Your massive slash slightly wounds an Ashstone noble.2

Your massive slash slightly wounds an Ashstone noble.3

Your massive slash slightly wounds an Ashstone noble.4

Your massive slash slightly wounds an Ashstone noble.5


[Resetting round...]
< 585h/585H 127v/127V |ss +|ap +|ev +|ts +|bs +| |3|2|3|3|2| T: Vokuran TC: excellent E: noble EC:
pretty hurt EP: std P: std > 

[Resetting round...]
An Ashstone noble misses you with his hit.
An Ashstone noble misses you with his hit.
Your massive slash slightly wounds an Ashstone noble.1

Your massive slash badly wounds an Ashstone noble.2

An Ashstone noble dodges your futile attack.
Your massive slash badly wounds an Ashstone noble.3

An Ashstone noble dodges your futile attack.

[Resetting round...]
< 585h/585H 127v/127V |ss +|ap +|ev +|ts +|bs +| |3|2|3|3|2| T: Vokuran TC: excellent E: noble EC:
pretty hurt EP: std P: std > 
How can I get a space between the "." and displayed number?

display(hits) --is what i have atm

Not sure why I'm getting a space between each attack tho.

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

Re: How to capture this?

Post by Jor'Mox »

Instead of using display, use echo, and you won’t get those extra blank lines. To add a space, add it to what you are having it print, like this, echo(“ “ .. hits)

Note that those quotes were typed on my phone, so don’t copy/paste that. Lua is picky about its quotes.

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

Re: How to capture this?

Post by Vooku »

Got it working... thanks for the help! How can I get [] to be around the hits echo? I can get the [ fine, but the ] is giving me issues. :P
Attachments
NonCondensedCounter.JPG

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

Re: How to capture this?

Post by Jor'Mox »

echo(string.format(" [%s]",hits))

Or if you want color to make it stand out, use cecho

cecho(string.format(" [<red>%s<reset>]",hits))

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

Re: How to capture this?

Post by Vooku »

Thanks

I can't get the capture for these to work. (can be slash, pierce, bludgeon)

A woman staggers from your massive slash!
You critically wound A woman with a massive slash!
A woman is nearly slain by the force of your massive slash!

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

Re: How to capture this?

Post by Jor'Mox »

^\.+ staggers from your massive (?:slash|pierce|bludgeon)
^You critically wound \.+ with a massive (?:slash|pierce|bludgeon)
^\.+ is nearly slain by the force of your massive (?:slash|pierce|bludgeon)

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

Re: How to capture this?

Post by Vooku »

For some reason the ^\.+ wouldn't work but ^(.*) does. Not sure why.

Is there a way to modify the capture pattern to capture all of these? There are weapon buffs that aren't always active. I could make a whole new set of captures, but I'm hoping there is a way for one to capture all of them.

Your massive slash barely wounds an Ashstone noble.
Your massive flame-enshrouded slash barely wounds an Ashstone noble.
Your massive greenfire slash badly wounds an Ashstone noble.

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

Re: How to capture this?

Post by Jor'Mox »

Yeah... my brain failed me. .+ would work as I intended, not sure why I put in the slashes when they obviously make it not work (because \. matches '.' whereas . matches anything).

^Your massive(?:[\w-]+)? slash \w+ wounds .+

Post Reply