Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ General ➜ A notification trigger

A notification trigger

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Davidchapman   (7 posts)  Bio
Date Thu 20 Aug 2009 10:01 PM (UTC)
Message
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
Top

Posted by Nick Gammon   Australia  (23,162 posts)  Bio   Forum Administrator
Date Reply #1 on Thu 20 Aug 2009 10:24 PM (UTC)
Message
What message do you see to tell you that you have lost balance in the first place?

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Davidchapman   (7 posts)  Bio
Date Reply #2 on Fri 21 Aug 2009 01:47 AM (UTC)
Message
There is no such message per se.
Top

Posted by Nick Gammon   Australia  (23,162 posts)  Bio   Forum Administrator
Date Reply #3 on Fri 21 Aug 2009 01:52 AM (UTC)
Message
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"?

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Twisol   USA  (2,257 posts)  Bio
Date Reply #4 on Fri 21 Aug 2009 02:25 AM (UTC)
Message
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?

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
Top

Posted by Nick Gammon   Australia  (23,162 posts)  Bio   Forum Administrator
Date Reply #5 on Fri 21 Aug 2009 02:40 AM (UTC)
Message
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?

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Twisol   USA  (2,257 posts)  Bio
Date Reply #6 on Fri 21 Aug 2009 03:17 AM (UTC)
Message
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.

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
Top

Posted by Nick Gammon   Australia  (23,162 posts)  Bio   Forum Administrator
Date Reply #7 on Fri 21 Aug 2009 04:22 AM (UTC)
Message
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.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


20,009 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.