help with capture trigger

Post Reply
rayotuir
Posts: 2
Joined: Tue Dec 24, 2019 11:23 pm

help with capture trigger

Post 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!

stridera
Posts: 3
Joined: Mon Sep 02, 2019 3:50 am

Re: help with capture trigger

Post by stridera »

^HP: \[(\d+)\/(/d+)\], SP: \[(\d+)\/(/d+)\], EP: \[(\d+)\/(/d+)\]$

stridera
Posts: 3
Joined: Mon Sep 02, 2019 3:50 am

Re: help with capture trigger

Post by stridera »

Removed accidental duplicate post.
Last edited by stridera on Sat Dec 28, 2019 3:33 am, edited 1 time in total.

rayotuir
Posts: 2
Joined: Tue Dec 24, 2019 11:23 pm

Re: help with capture trigger

Post by rayotuir »

It still won't fire for me. :( It looks like it would work?

stridera
Posts: 3
Joined: Mon Sep 02, 2019 3:50 am

Re: help with capture trigger

Post 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.

tarkenton
Posts: 30
Joined: Thu Feb 07, 2013 7:33 am

Re: help with capture trigger

Post 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.

User avatar
SlySven
Posts: 964
Joined: Mon Mar 04, 2013 3:40 pm
Location: Deepest Wiltshire, UK
Discord: SlySven#2703

Re: help with capture trigger

Post by SlySven »

Yeah, matches[1] is the whole line IIRC and changing it now would break everything...

Post Reply