Skip to content

Text Substitution (sub and gag)

Avi Kelman edited this page May 25, 2017 · 3 revisions

(aard_text_substitution.xml)

Allows you to replace text with other text to leave yourself persistent notes or give your friends funny names.

How do I use it?

The plugin has built-in documentation covering several advanced features such as capture patterns and external script calls.

Type #sub help to display it.

Can you give some examples of when and how you use it, for reference?

Example 1

Let's say I really dislike a player for some reason, but I hate using the game's ignore feature because I don't like completely hiding messages and it doesn't work on channel history anyway. So instead of hiding messages from that player, I would rather change their name to something really mean for a little private laugh.

I would do that with a command like this:

#sub {Lasher} {PoopFace} #nocase #alone

(This example is fictitious. I do not actually change Lasher's name to PoopFace.)

I use the #nocase option here to make sure that it works on all capitalizations of his name, but I also use the #alone option to make sure that it doesn't also catch other similar words like "slasher" or "flasher".

Example 2

I like to know when my name is mentioned, because it might mean that someone needs technical assistance. So this next #sub command will highlight my name in bright red any time it appears on the screen, for easy visibility.

#sub {(Fiendish)} {@R%1$C} #nocase

I combine parentheses around my username with the #nocase option and %1 in the replacement field to tell the system in one line that I want it to work for all capitalizations of my name while preserving those capitalizations. It means I can be less specific in my replacement pattern and get the username highlighting effect effect without changing what it otherwise looks like and without needing to make dozens of different patterns for every possible combination of uppercase and lowercase lettering.

Color codes work just like they do on Aardwolf channels, so @R means switch to bright red, and $C resets the color back, so that only my name changes color and not also everything after it.

Example 3

I also like to leave myself notes about friends or other players. If I learn that a player is visually impaired, for example, I might leave myself a note about it to help me remember that I should try to avoid using unhelpful visual directions when giving tech assistance.

To accomplish that I can do:

#sub {PlayerName} {PlayerName (V.I.)}

Then every time PlayerName shows up on the screen it will be followed by a little reminder, making it look to me like PlayerName (V.I.).

I see that the plugin also does gags. Why? Can't MUSHclient already omit lines from output based on trigger pattern matches?

MUSHclient can do that for things in the main output, but it can't also do it for your plugins without some kind of coordination. Using this plugin's #gag command will make it so that other plugins can cooperatively ask this plugin to filter their messages before displaying them. This is how the Communication log window plugin is able to also reflect your #subs and #gags.

Clone this wiki locally