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 ➜ Example triggers needed.

Example triggers needed.

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


Posted by Heikki   (1 post)  Bio
Date Fri 01 Dec 2006 02:51 PM (UTC)
Message
Hi,

I've been trying to come up with a set of filter triggers that replace some of the excessively verbose event descriptions on a mud with shorter coloured descriptions of mine. The problem is that if I check the 'omit from output' box the ColourNotes I use don't show up at all and if I use plain text sent to output they do show but always in bright blue colour.

This is example of one of the triggers. I'd like to see it block the line it matches from output alltogether.

</trigger>
<trigger
enabled="y"
match="You purge every drop of venom from your bloodstream\.$"
regexp="y"
send_to="12"
sequence="100"
>
<send>ColourNote ("brown", "black", "Venom purged")</send>


Also, an example of an trigger that disables and enables an entire group of triggers at a matching phrase would be appriciated. I remember trying to get this to work with no luck at all. Individual triggers I can manage.

Thanks in advance.
Top

Posted by Malek   USA  (27 posts)  Bio
Date Reply #1 on Sat 02 Dec 2006 01:00 AM (UTC)
Message
Send these to script instead of output.. this should work allowing your colour reports to come through

Tod ist gweiss, Lebens est nicht.
Top

Posted by Malek   USA  (27 posts)  Bio
Date Reply #2 on Sat 02 Dec 2006 01:02 AM (UTC)
Message
here's an example I have that works

<triggers>
<trigger
custom_colour="7"
colour_change_type="1"
group="pk"
match="^You follow (.*?) (.*?)$"
regexp="y"
send_to="12"
sequence="100"
>
<send>ColourTell ("yellow", "black", "You sTaLk ")
ColourTell ("white", "black", "%1")
ColourTell ("yellow", "black", "................................................") ColourNote ("red", "black", "( %2 )")</send>
</trigger>
</triggers>


Tod ist gweiss, Lebens est nicht.
Top

Posted by Nick Gammon   Australia  (23,140 posts)  Bio   Forum Administrator
Date Reply #3 on Sat 02 Dec 2006 05:26 AM (UTC)
Message
It is a feature, if I may call it that, that MUSHclient omits from output anything also sent inside a script in the way you are doing it.

The way to do it is to use a script file, and put the function name in the script box for the trigger.

What happens in this case is that the call to the script function is deferred until after the omitting from output is done, and thus the lines will appear the way you want.

I can give a more comprehensive example if I haven't fully explained it.

There are forum posts about it, see (amongst others):

http://www.gammon.com.au/forum/?id=5142
http://www.gammon.com.au/forum/?id=4832
http://www.gammon.com.au/forum/?id=7142
http://www.gammon.com.au/forum/?id=4161


- 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.


13,400 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.