A notification trigger

Posted by Davidchapman on Thu 20 Aug 2009 10:01 PM — 8 posts, 25,230 views.

#0
Hi folks,

So let's say I have three notifications that come from the mud following my character's attack sequence.


You have recovered balance on your legs.
You have recovered balance on your right arm.
You have recovered balance on your left arm.


They don't all arrive at once, there's a delay between them, and sometimes the left arm and right arm notifications are swapped.

I'd like to design a trigger that will wait for all three to be sent from the mud and then alert me with a ColourNote. Something like:

ColourNote("white","black"," Balance Recovered ")


Any hints, tips, or suggestions on how to start designing such a trigger would help.

Thanks

Using Mushclient 4.3
Australia Forum Administrator #1
What message do you see to tell you that you have lost balance in the first place?
#2
There is no such message per se.
Australia Forum Administrator #3
Well, is this Achaea? A quick search for that message reveals this log:


You have recovered balance on your right arm.
You have recovered balance on your legs.
You have recovered balance on your left arm.
2652h, 2837m, 14312e, 16664w cexkdb*~*~ You have Equilibrium


Can't you just check for "You have Equilibrium"?
USA #4
That looks like a custom prompt (gagged and modified client-side), Nick; a standard prompt will only match this regex:

(?:\d+h,? )(?:\d+m,? )?(?:\d+e,? )?(?:\d+w,? )?(?:\d{1,3}\%,? )?c?e?x?k?d?b?@?(?: Vote)?-


It sounds like he's of the Monk class to me; most Monk punches or kicks will lose balance on an arm and both legs, so you can pull off two punches and a kick (a classic Monk combo). And you can tell if you've lost equilibrium or balance by looking at the 'e' and 'x' respectively; if it's there, you have it, otherwise you don't. So lets see, for his purposes he'd want this trigger:

(?:\d+h,? )(?:\d+m,? )?(?:\d+e,? )?(?:\d+w,? )?(?:\d{1,3}\%,? )?c?(?P<e>e)?(?P<x>x)?k?d?b?@?(?: Vote)?-


That'd make the 'e' and 'x' matches available with %<e> and %<x>, right?
Australia Forum Administrator #5
I'm hoping the flags come in a set order. :)

Well, in that case, the prompt still tells you when you have balance back, right?
USA #6
They do - cexkdb - and right. I guess conceivably he could match the prompt every time, and if it's suddenly missing the 'x', he'd know he was off balance.
Australia Forum Administrator #7
Yes, exactly. If you check, in each prompt, if the 'x' is there, you can save in a variable "off_balance" true/false.

Then, if the 'x' comes back, and the variable was previously false (in other words, you transition from off balance to on-balance) you can put out the message.