[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  A notification trigger

A notification trigger

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


Posted by Davidchapman   (7 posts)  [Biography] 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
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] 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
[Go to top] top

Posted by Davidchapman   (7 posts)  [Biography] bio
Date Reply #2 on Fri 21 Aug 2009 01:47 AM (UTC)
Message
There is no such message per se.
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] 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
[Go to top] top

Posted by Twisol   USA  (2,257 posts)  [Biography] 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
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] 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
[Go to top] top

Posted by Twisol   USA  (2,257 posts)  [Biography] 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
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] 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
[Go to top] 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.


15,237 views.

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

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

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

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]