Page 2 of 2

Re: How to capture this?

Posted: Sat Aug 25, 2018 4:27 pm
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

Re: How to capture this?

Posted: Sat Aug 25, 2018 5:46 pm
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.

Re: How to capture this?

Posted: Sat Aug 25, 2018 6:01 pm
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.

Re: How to capture this?

Posted: Sat Aug 25, 2018 7:50 pm
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

Re: How to capture this?

Posted: Sat Aug 25, 2018 7:55 pm
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))

Re: How to capture this?

Posted: Sat Aug 25, 2018 8:27 pm
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!

Re: How to capture this?

Posted: Sat Aug 25, 2018 8:30 pm
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)

Re: How to capture this?

Posted: Sun Aug 26, 2018 5:06 am
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.

Re: How to capture this?

Posted: Sun Aug 26, 2018 11:39 am
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 .+