Home mm2k6 Help Files Commands Script ENtities - Substitutes
24 | 01 | 2018
Script ENtities - Substitutes
Article Index
Script ENtities
Actions
Aliases
Arrays
Variables
Macros
Events
Gags
Tablist
Lists
Substitutes
Highlights
All Pages

Substitutes

Format: /substitute {text pattern} {replacement text} {group name}

A substitute looks for text patterns in the same way that an action does.
When it finds a match it substitutes the text in the pattern with the
replacement text.  For exampler /substitute {Town}{Empire}{myStuff} would replace the word Town with the word Empire in every line displayed.

The text pattern can include token wildcard markers and the associated matching variables can be used in the replacement text Variables and procedures can also be used in the replacement text if token markers are in the text pattern. 
For example /subs {[%0] <%1>}{[$0] <$1> -=$RoomName =-}{myStuff} might change [sfmpqvw] <897/1000hp 1024/1000m 610/610mv> into
[sfmpqvw] <897/1000hp 1024/1000m 610/610mv> -=A Dark Chamber=-

If substitutedepth is greater than 1 then MudMaster 2k6 will attempt to apply substitutes to the text after a substitution has been made.