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

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Example triggers needed.
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Example triggers needed.

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


Posted by Heikki   (1 post)  [Biography] 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.
[Go to top] top

Posted by Malek   USA  (27 posts)  [Biography] 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.
[Go to top] top

Posted by Malek   USA  (27 posts)  [Biography] 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.
[Go to top] top

Posted by Nick Gammon   Australia  (21,607 posts)  [Biography] 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
[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.


2,667 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 FutureQuest]