Need Assistance with Health Checker Script/Trigger...

Post Reply
Eikel
Posts: 4
Joined: Mon Jul 26, 2021 6:54 am

Need Assistance with Health Checker Script/Trigger...

Post by Eikel »

So for some reason I never seem to be able to wrap my head around Mudlet's support for multi-line triggers... apologies in advance for asking what's probably a very newbie-like question.

So I want to capture/modify output from my MUD which looks like:

Code: Select all

Your group consists of ( 5/30):
( Head)  1206/906   hit,  234/236  move Fongpi
(Front)  6441/3402  hit,  472/484  move a shadow dracolich
(Front)  2810/1911  hit,  486/486  move a blue dracolich
(Front)   886/886   hit,  274/276  move Beltorin
(Front)  1339/1339  hit,  234/236  move Jumosaman
What I'm trying to do is a simple highlight of the name when hitpoints are below a cetrain level, so:

When hitpoints are < 75% highlight the name in Green, when hitpoints are < 50% highlight the name in Yellow, when hitpoints are < 25% highlight the name in Red.

I know from other triggers how to change the highlight, it's the multi-linedness of the trigger that confuses me. I know I need a Group where I have a trigger activating on "Your group consists of", it's the rest of the script that I'm unsure of the structure of.

Any assistance is much appreciated!

--Eikel.

Eikel
Posts: 4
Joined: Mon Jul 26, 2021 6:54 am

Re: Need Assistance with Health Checker Script/Trigger...

Post by Eikel »

So I was a tad brain-drained when I wrote this original post... I later realized I didn't actually NEED a multi-line trigger to do what I accomplished.

I simply used a perl regexp to grab each group output line individually and then performed a quick calculation with some if statements to echo what I needed.

Apologies for a very simple question, I should get some sleep before post.

Post Reply