Home mm2k6 Help Files Commands Script ENtities
24 | 01 | 2018
Script ENtities
Article Index
Script ENtities
Actions
Aliases
Arrays
Variables
Macros
Events
Gags
Tablist
Lists
Substitutes
Highlights
All Pages
action alias array
arraycopy assign  
empty eventgag
highlight listsmacro
 substitute tablistvariable

Actions

Format: /action {text pattern} {commands} {group name}

Action tells the client to look for a specific string of text from the mud
and to execute a command or multiple commands when it finds it. Typing
/action by itself will list all of the actions you have defined.

   {text pattern} This is the text to look for to trigger the action. 
   {commands} The commands are the actions you want to take when the action s triggered. 
   {group name} This is an optional parameter. See the user guide for help on groups.

/action {You are hungry.}{take food bag;eat food}
This is the most basic form of an action. It sees the text "You are
hungry." and then sends the commands "take food bag" and "eat food" to
the mud.

/action {^You are hungry.}{take food bag;eat food}
You can 'anchor' an action by starting it with a caret (^). When an action
is anchored the text to search for must be at the beginning of the line.

/action {%0 looks at you.}{say Hi $0}
%0-%9 are substitution variables that you can use in the trigger side of an
action. They work like a wildcard character but store the text the wildcard
represents for your use. If the mud sent the text "Arithon looks at you."
it would send the command "say Hi Arithon" back. You can use up to 10 (0-9)
of these variables to help you match a text pattern.


Aliases

Format: /alias {shortcut} {commands} {group name}

An alias lets you define some "shortcut" text to execute a command or
commands. Your alias list is checked each time you press enter to send some
text to the mud. If the text you typed is found in your alias list the text
from the commands side of the alias is sent instead.  An alias is only
replaced if it is the first text typed on a line.

   {alias name} This is the shortcut text you want to be able to type to execute commands. 
   {commands} The commands to execute when the alias name is typed. 
   {group name} This is an optional parameter. See the user guide on groups for help.

/alias {eat} {take food bag;gobble food}
If you typed "eat" on the input line the commands "take food bag" and
"gobble food" would be sent to the mud instead.

/alias {targ %0} {/var Target $0}
You can also use the variable %0 to represent the text typed after the alias
shortcut. In this case the alias is used to quickly set a targeting variable.
Typing "targ Vecna" would set a variable called "Target" to "Vecna"


Arrays

Format: /array {array name} {rows} {group name}
Format: /array {array name} {rows,columns} {group name}

Array lets you create both single and two dimensional arrays. If you are not
familiar with arrays, you can think of them like a spreadsheet. A single
dimensional array would have only 1 column, and as many rows as you specify.
A two dimensional array would have both rows and columns. Each cell in the
array would be accessed by giving a row and a column number. In the case of
single dimensional array, only a row number is needed. Each cell can hold data
like a variable.

  • {array name} The name of the array. 
  • (rows} When creating a single dimensional array, the number of rows. The number must be between 1 and 100. 
  • {{rows,columns} For creating a two dimensional array. The numbers must be between 1 and 100. 
  • {group name} This is optional, see the user guide for help with groups.

/array {Targets} {3}
This would create an array called Targets. The array can hold up to 3 items.

/array {Grid} {5,5}
This creats a two dimensional array, or a grid. The grid has 5 rows, with 5
columns in each row.

Assign

Format: /assign {array name} {row} {value}
Format: /assign {array name} {row,column} {value}

Assign sets the value of a cell in an array.

  • {array name} The name of the array.
  • {row} For assigning cells in a single dimensional array. The number must be between 1 and the number of rows you created the array with. 
  • {rows,columns} For assigning cells in a two dimensional array. The numbers must be between 1 and the number of rows and columns you created the array with. 
  •  {value} The text or number you want to assign to the cell.

/assign {Targets} {1} {Soth}
This assigns the first cell in the array to hold the text "Soth".

/assign {Grid} {2,4} {16}
This assigns row 2, column 4 of the grid with a value of 16.

ArrayCopy

Format: /arraycopy {ExistingArrayName}{ArrayCopyName}{ArrayCopyGroup}
Format: /arraycopy {ExistingArrayName}{ArrayCopyName}

New in Version 4.1
Makes a new array which is an exact copy of an existing array but with a new name and group.


Empty 

Format: /empty {variable name}

Empty creates a variable with an empty string (a string with no data in it).

   {variable name} The name of the variable to create or set to empty.

Variables 

Format: /variable {variable name} {value}

The variable command adds a variable to your variable list and assigns it a
value. If the variable is already in the list the value is replaced with the
new value.

/var {Target} {orc}
Adds a variable called Target to your list of variables and gives it a value
of "orc".

There are several variables that are defined by the client. The client will
let you if you insist, but you should probably not define variables with these
names. If you do your version of the variable will be found before the system
variable. For a list of system variables see the User Guide.


Macros

Macro help is in the User Guide section


Events

Format: /event {name} {frequency} {event actions} {group}

Event causes some actions to be taken when a certain amount of time has
passed. {frequency} is the amount of time in seconds to pass before firing
the event. You can create as many events as you like.  Duplicate frequencies
are valid; so you could create several events to fire every 10 seconds.

   {name} The name of the event. 
   {frequency} The number of seconds until the event fires. 
   {event actions} The commands to do when the event fires. 
   {group} Optional, see the user guide for help on groups.

Typing /event by itself will list all the events you have defined. When you
list the events you are also shown the time left before the event fires.

001: {Jumper} {F:30} {T:14} {jump}
This is an example of an event listing. This first parameter is the name of
the event.  F: shows you the frequency you have set for the event.  T: shows
how much time is left before the event gets fired. The last part contains the
event actions to be taken when the event is fired.

/event {Jumper} {30} {jump}
This will create an event called Jumper that jumps every 30 seconds.


Gags

Format: /gag {mask}{group name}

Adds a gag to the gag list. Before the client prints a line of text to the
screen it checks the gag list. If {mask} is found in a line of text that line
will not be printed.

  • {mask} This is the text pattern to search for to determine what lines of text to gag. The mask can be defined the same way you define the text pattern for an action-- using %0 through %9.

/gag {Geoff says} {shutup}
Any lines that have the text "Geoff says" in them will not be seen.

/gag {You hear %0 shout} {shutup}
Any lines that have the text "You hear <name> shout" will not be seen.


Tablists

The tablist contains words which you can complete be typing part of a word and hitting tab. Help for tab completion is found in the User Guide


Lists

Lists are collections of strings. See commands related to lists and procedures related to lists.


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.


Highlights

Format: /highlight {mask} {foreground color, back background color}

Adds a highlight to the highlight list. Before the client prints a line of text to the screen it checks the highlight list. If {mask} is found in a line of text the colors for that word or words are changed to colors that you specify. If a wildcard was used in the mask the entire line is highlighted,

  • {mask} This is the text pattern to search for to determine what lines of text to highlight. The mask can be defined the same way you define the text pattern for an action-- using %0 through %9. If the mask does not contain any wildcards (%0 - %9) then just the word is highlighted. If the mask uses a wildcard, the whole line is changed to the color. 
  • {color,back color} The foreground and background color to change the text to.  Valid color names are in the table below. If you don't specify a background color "back black" will be used.

Color Names

   Foreground Colors:
     black, blue, green, cyan, red, magenta, brown, light
     grey, dark grey, light blue, light green, light cyan, light
     red, light magenta, yellow, white

   Background Colors:
     back black, back blue, back green, back cyan, back
     red, back magenta, back brown, back light grey

/highlight {disarms you} {yellow}
Any time you see the text "disarms you" it will appear in yellow.

/highlight {You hear %0 shout} {white,back blue}
Since a wildcard was used in the mask, when the text is found the entire line will be changed to white on blue.