Alright, I just decided that I will make a serious attempt at switching to MC from zMUD (after nine years of using that client). To learn the how MC works, what's better than to start a little project of my own? I chose to make a module for highlighting and validating channels.
The first problem I ran into was that I do not know in what order MC processes the triggers. It seems to sort them all in alphabetic order, so how can I tell what will react first and so? Also - will substitution (if supported by MC) disable further parsing of triggers with the same pattern? And can you match ANSI, using regexp?
The format of channels on the MUD i play (IRE - Imperian) looks like this:
Easy enough to highlight. The problem is that the Rapture engine (IRE-engine for all its MUDs) breaks the lines if they exceed 80 chars. I solved this in zMUD by enabling a class with a trigger that fired on everything, and colored it for me. In that class I also had a prompt-trigger, which closed the class. Quite effective (besides some zMUD-specific bugs). How can this be achieved in MUSHclient?
The validation I want for this module is to check if the line(s) is of a certain color. This can be configured, and will be used as a protection from illusions (I'm overly paranoid when it comes to that). When it's verified, I want the "(Channel):"-part in one specific color (defined by the channelname, located in an array or something) and the rest in plain white color.
Furthermore, if I wanted to make this into a module/script (set of triggers/aliases/variables/whatever), how should I go about doing that? I'm not all clear on what seperates triggers/aliases/variables/whatever from scripts. Is it that scripts are in external files, which are called from triggers and such? The thing is that I want to be able to share this module in just one file, a feature I've been missing with zMUD for nine years.
EDIT: Putting in what I have so far. Regexp looks -really- powerful, and not all too hard to learn.
The first problem I ran into was that I do not know in what order MC processes the triggers. It seems to sort them all in alphabetic order, so how can I tell what will react first and so? Also - will substitution (if supported by MC) disable further parsing of triggers with the same pattern? And can you match ANSI, using regexp?
The format of channels on the MUD i play (IRE - Imperian) looks like this:
(Channel): Crox says, "Looking to learn MUSHclient."
(Channel): You say, "Looking to learn MUSHclient."
<<Channel>>: Crox says, "Looking to learn MUSHclient."
<<Channel>>: You say, "Looking to learn MUSHclient."Easy enough to highlight. The problem is that the Rapture engine (IRE-engine for all its MUDs) breaks the lines if they exceed 80 chars. I solved this in zMUD by enabling a class with a trigger that fired on everything, and colored it for me. In that class I also had a prompt-trigger, which closed the class. Quite effective (besides some zMUD-specific bugs). How can this be achieved in MUSHclient?
The validation I want for this module is to check if the line(s) is of a certain color. This can be configured, and will be used as a protection from illusions (I'm overly paranoid when it comes to that). When it's verified, I want the "(Channel):"-part in one specific color (defined by the channelname, located in an array or something) and the rest in plain white color.
Furthermore, if I wanted to make this into a module/script (set of triggers/aliases/variables/whatever), how should I go about doing that? I'm not all clear on what seperates triggers/aliases/variables/whatever from scripts. Is it that scripts are in external files, which are called from triggers and such? The thing is that I want to be able to share this module in just one file, a feature I've been missing with zMUD for nine years.
EDIT: Putting in what I have so far. Regexp looks -really- powerful, and not all too hard to learn.
<triggers>
<trigger
custom_colour="1"
enabled="y"
match="^(\(|\<\<)[[:alpha:]]*(\>\>|\))\: *"
regexp="y"
sequence="100"
>
</trigger>
</triggers>