Example triggers needed.

Posted by Heikki on Fri 01 Dec 2006 02:51 PM — 4 posts, 17,833 views.

#0
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.
USA #1
Send these to script instead of output.. this should work allowing your colour reports to come through
USA #2
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>

Australia Forum Administrator #3
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