Substitutes

Substitutes will change stuff on your screen for you. You can for example remove spam, or change unplesant words to something else. You can also use this to highlight certain text, making it easier to notice. Substitutes are really a lot like actions so you should really read the part about actions if you are having problems understanding this section. There are really only two differences between actions and substitutes. The first is the easiest to notice - anything you type in commands will not be send to the mud, but instead simply shown on your screen, making it look like the mud send some text different from what it really did. The second thing is something you might want to remember for later, while actions match a pattern ignoring colors and other ANSI codes substitutes do not ignore these. This means that you not only can match colors in substitutes, you also have to match them. One thing to remember is that any alias, action, substitute or other items containing a commands field can be set to change the output type, so you can make a substitute send data to the mud instead of just to your screen which is default. Read more about that here.

Let us take a relatively simple example. I do not want to go into too much details since that has already been covered in the previous pages so let's cut to the chase:

Pattern: This is a Regular Expression match (the Simple Pattern property is disabled) and it will match the character with the hex-value of 7. This might not be obvious, but that is the ASCII value for the BELL character. MonkeyTerm does not have a build in sound for when a bell character is sent from the mud since some people think it's annoying. This default substitute will make the BELL character execute the commands though, letting you define what you want to see or hear when the BELL character is sent.

Commands: Normal text in the commands field in substitutes will be send to the window (and not the mud like aliases and actions) but this can ofcourse be changed with scripting. In this example the script simply calls a method in the MOM called beep which produces a monkey sound.