help with capture trigger

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

help with capture trigger

Post by rayotuir » Tue Dec 24, 2019 11:30 pm

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 » Wed Dec 25, 2019 7:07 am

^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 » Wed Dec 25, 2019 7:21 am

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 » Thu Dec 26, 2019 6:59 pm

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 » Sat Dec 28, 2019 3:34 am

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 » Tue Jan 14, 2020 9:27 am

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests