Page 1 of 1

help with capture trigger

Posted: Tue Dec 24, 2019 11:30 pm
by rayotuir
I'm a newbie to mudlet and have used zmud for many years.

I'm trying to recreate my own status bars to track my hp/sp/ep variables.

The prompt example is:

HP: [352/352], SP: [137/421], EP: [327/385]

I'd like to capture these numbers as the following variables - currenthp/maxhp, currentsp/maxsp, etc.

I've tried using (\d+) and matches[2] but this doesn't work. Any help would be appreciated. Thanks!

Re: help with capture trigger

Posted: Wed Dec 25, 2019 7:07 am
by stridera
^HP: \[(\d+)\/(/d+)\], SP: \[(\d+)\/(/d+)\], EP: \[(\d+)\/(/d+)\]$

Re: help with capture trigger

Posted: Wed Dec 25, 2019 7:21 am
by stridera
Removed accidental duplicate post.

Re: help with capture trigger

Posted: Thu Dec 26, 2019 6:59 pm
by rayotuir
It still won't fire for me. :( It looks like it would work?

Re: help with capture trigger

Posted: Sat Dec 28, 2019 3:34 am
by stridera
What you can do is turn on highlighting. Then go through and add things one part at a time. Tweak it until it highlights and then move on.

Re: help with capture trigger

Posted: Tue Jan 14, 2020 9:27 am
by tarkenton

Code: Select all

^HP: \[(\d+)\/(\d+)\], SP: \[(\d+)\/(\d+)\], EP: \[(\d+)\/(\d+)\]$
would be correct. Looks like you flipped the slashes on the second d+ of each pair stridera. Have done it approx. 1.7 billion times myself, so don't feel bad.

rayotuir, take a look at https://regex101.com/r/QpGuZn/1

That will show you which matches[x] is which field. But, for mudlet, what they show as Group 1 is actually matches[2], etc.

Re: help with capture trigger

Posted: Sun Feb 23, 2020 10:26 am
by SlySven
Yeah, matches[1] is the whole line IIRC and changing it now would break everything...