Game address: materiamagica.com port 23 or 4000

Moongate Client Help Guide

Table of Contents

Introduction

The Moongate Client is a Java-based, cross-platform web applet created to enhance your Materia Magica gameplay. While use of this client is not required to play Materia Magica (Using normal telnet - or MUD-specific clients - you may connect at any time to materiamagica.com, port 23, 4000, 6666, 8000, or 9000), the Moongate Client has a lot of server-supported custom functionality.

Client Features

  • Cross-platform, browser-based Java applet
  • Full ANSI color support
  • Selection of fantasy-related graphic backgrounds
  • Separate command entry window/history scroll
  • Resizable window can stretch or be maximized to fit your screen
  • Allows in-game movement by using numeric keypad
  • Separate Tell/Whisper/Clantalk communication window with customizable buffer length
  • User-definable Alias support
  • Eight user-definable easy-access buttons
  • User-definable Key Bindings support
  • User-definable Variables support
  • User-definable, regular-expression-based Triggers
  • Configurable main window scrollback size
  • Configurable command history buffer
  • "Stackable" command ability with delay character
  • Visual Hit Point, Spell Point, Stamina display
  • Panic button for the nervously employed
  • Experience Points/Archon Points-to-next-level display
  • Current combat Enemy Name and Hit Point display
  • In-game Time and Date display
  • Client settings are saved directly to the game server

System Requirements

You must have the Java runtime engine 1.6 or greater installed to use this applet. click here to check your Java version, or click here to download Java.

Client Location

The Moongate Client can be found here: http://www.materiamagica.com/play/web/moongate-client.

Getting Started

Moongate Client Login

The Main Output Window

Right-Clicking with the mouse in the Input Window will display a dropdown menu with the options to COPY and CLEAR HISTORY. To select text for copying, hold down the left mouse key and drag the pointer until the text you want is selected. You can then hit CTRL-C to copy the text into a temporary buffer, or right click and select COPY from the dropdown menu. Selecting CLEAR HISTORY will clear the entire Output Window buffer.

The Main Input Window

When you type a command in the Moongate Client and push ENTER, the command is sent to the game server. The command also remains on the current line, so if you want to enter the same command again, just push ENTER again. To clear the current command while it is highlighted, use the BACKSPACE, the DELETE key, or begin typing your next command to the game.

You can use the arrow keys to scroll up and down your previous command history.

Holding the SHIFT key down and pushing PAGE UP or HOME will highlight the entire line. Hitting DELETE or BACKSPACE while the line is highlighted will clear the entire line. The HOME key returns you to the beginning of the command line, whereas the END key positions the cursor at the end of the command line.

The numeric keypad, if NUMLOCK is ON, can be used to navigate within the game. Each numeric key acts as if you had typed in that direction and pushed ENTER (NOVICE mode must be OFF within the game to use this feature). The numeric keypad will send the directions N, S, E, W, NW, SW, NE, and SE depending on which key is selected.

7
NW
8
N
9
NE
4
W
5 6
E
1
SW
2
S
3
SE

Figure 1: Numeric Keypad numbers and directions correspondence

You may stack commands by using the carat (^) or using CTRL-R between commands. CTRL-R will insert a "carriage return" character and doesn't cause a delay between commands, whereas using the carat will cause a 0.25 second delay. The carat is stackable, so stringing multiple carats together can give you longer delays (e.g., SAY HELLO^^^^SAY GOODBYE would send "SAY HELLO", then delay for 1-second, then send "SAY GOODBYE").

Right-Clicking with the mouse in the Input Window will cause a popup menu to appear with the options to COPY, CUT, PASTE, CLEAR, and CLEAR HISTORY. To select text for copying, hold down the left mouse key and drag the pointer until the text you want is selected. You can then hit CTRL-C to copy the text into a temporary buffer, or right click within the Input Window and select COPY from the dropdown menu. To paste the text, you may hit CTRL-V, or right click within the Input Window and select PASTE from the dropdown menu. Selecting CLEAR will clear the current command line. Selecting CLEAR HISTORY will clear the entire Input Window buffer.

General Options

Settings - Options Tab

The Options Tab can be found by clicking on the "Settings" icon on the upper client window, and then selecting the "Options" tab if it is not already selected. This screen displays information about your current connection to the game, client version and copyright information, and lets you configure some basic client settings, as follows:

Font Size

- This setting adjusts the font size used in the main output window and the input window. Default is 12 points.

Main Window Scrollback

- This setting adjusts how much scrollback the main window will store. Default is 500 lines. Increasing this or any of the buffer settings will also increase the amount of memory the client uses, which may cause it to run slower on some computers.

Command Window Scrollback

- This setting adjusts how many commands the Command Window will store in its history buffer. Default is 20 commands.

Tell History Scrollback

- This setting adjusts how many lines the Tell History Window will store. Default is 50 lines.

Terminal Background

- This lets you select from an assortment of backgrounds to display in the terminal window. If you don't want a background, choose "Jet Black". The default background is "Hydra".

Enhanced Gameplay

Variables

The Variables Tab can be found by clicking on the "Settings" icon on the upper client window, and then selecting the "Variables" tab if it is not already selected.

Variables are referenced within a $[] format, such as: $[variable] (e.g., get $[varFood] from $[varBag]). Variable substitution occurs before alias checking. Variables can be used in alias actions, trigger actions, and key binding actions.

Variable usage can be turned ON or OFF by selecting or de-selecting the "Use Variables" checkbox in the Variables Tab.

For more information on variables, see the "Using Variables and Triggers" Appendix.

Aliases

Settings - Aliases

The Aliases Tab can be found by clicking on the "Settings" icon on the upper client window, and then selecting the "Aliases" tab if it is not already selected. This screen lets you define and delete aliases for use within the Moongate Client. An alias can be as simple as another name for a command, or more complex as a longer command or a string of commands.

To define an alias, enter the alias keyword in the "Alias" text box, and what it will do in the "Action" text box. To stack multiple commands in the "Action" box, use the \r command or the delay carat (^) to separate the commands. In order to avoid endless loops, you cannot call an alias from within another alias.

To delete an alias, select the alias in the display box (it should highlight the line and display the alias text in the input boxes) and click the DELETE button.

Once an alias has been defined, it can be used in the input window, in key binding actions, or in trigger actions. To call aliases in any of those locations the alias must be preceeded with a forward slash (/). (e.g., If you had created an alias with the name of "crylots" and wanted to use it within the input window, you would type: /crylots)

Aliases can be turned ON or OFF by selecting or de-selecting the "Use Aliases" checkbox in the Alias Tab.

Triggers

The Triggers Tab can be found by clicking on the "Settings" icon on the upper client window, and then selecting the "Triggers" tab if it is not already selected. Triggers allow you to respond to certain occurences within the game, based on matching text patterns. Use of Triggers is recommended for advanced players only.

Triggers are specified using a matching syntax known as "Regular Expressions". You can find out more about these in Appendix B. To add a trigger, enter the trigger matching expression in the "Trigger" text box, and the trigger action in the "Action" text box. Trigger Actions can make use of Aliases and Variables.

To delete a Trigger, select the Trigger (the line should be highlighted) and click the Delete button.

Triggers can be turned ON or OFF by selecting or de-selecting the "Use Triggers" checkbox in the Triggers Tab, or by clicking on the "Triggers" icon in the upper Moongate Client window.

Here is an example of a trigger:

Trigger: A few|small pile|pile|large pile gold coins is|are here.
Action: get gold

Key Bindings

Settings - Key Bindings

The Key Bindings Tab can be found by clicking on the "Settings" icon on the upper client window, and then selecting the "Key Bindings" tab if it is not already selected. This screen lets you define keys that can be bound to specific actions. A selection of keys has already been bound for you - this is what allows you to use the numeric keypad to move around the game, although even these keys can be redefined if you wish.

The key bindings system supports only specific keys, with specific identifier names (labels). These are as follows:

  • Labels "f1" through "f12" indicate the function keys.
  • Integers 1-9 indicate the keys on the numeric keypad (with NUMLOCK turned ON). By default, these send commands for the compass directions (N, S, E, W, NE, SE, NW, SW).
  • Letters a-z indicate CTRL+ the letter indicated. Note that some commands, like CTRL+C and CTRL+V, already have meanings (Copy and Paste, respectively) and thus should be avoided.

All these identifiers are in lower case only and are case-sensitive.

Key Bindings can be turned ON or OFF by selecting or de-selecting the "Use Key Bindings" checkbox in the Key Bindings Tab.

Buttons

Settings - Buttons

The Buttons Tab can be found by clicking on the "Settings" icon on the upper client window, and then selecting the "Buttons" tab if it is not already selected. This screen allows you to define the name and actions of one of eight easy-access buttons displayed in the Moongate Client window.

To define a button, enter the button label in the "Label" text field and the action in the "Action" text field. Aliases can be used in button actions, as well as stacked/delayed commands.

Appendix A: The SETCLIENT command

SETCLIENT Command Protocol

Because an applet does not install on the client PC like a normal program, the settings for the Moongate Client cannot be saved locally between user sessions. All the settings have to be stored on the server, under the name of the particular user.

The settings are transmitted in both directions using the SETCLIENT command. These may be generated by the applet itself, when the user changes the settings using the interface; may be typed by the user into the command window, in which case the settings are both change in the applet and saved on the server; or sent from the server to the applet upon user login, which allows the applet to load the settings from the user's last session.

SETCLIENT commands are information used in the user settings of the applet - screen size, aliases, and so on. SETCLIENT commands go in both directions; from the applet to the server and vice versa.

All SETCLIENT commands are formatted as follows:

  • SETCLIENT [identifier] [arg1] [arg2] ?

Different commands may support different numbers of identifiers. All commands use spaces to separate the arguments, but certain commands support the use of "double-quotes" to create a single argument from text which contains spaces. Commands which support this will have it indicated in the definition: "[variable]"

Variables

  • SETCLIENT VARIABLE $[varname] "[value]"

Note that the first argument, the variable name, may be preceded by a $, as a variable must be when used in a command. The $ is not required by the SETCLIENT command, however.

If the [value] variable is missing, that indicates that the variable specified in [varname] has been deleted and should be removed.

Aliases

  • SETCLIENT ALIAS /[aname] "[value]"

Note that the first argument, the variable name, may be preceded by a /, as a variable must be when used in a command. The / is not required by the SETCLIENT command, however.

The [value] may include spaces if it's surrounded by quotes. The value may include semicolons to indicate a pause in the command, and a \r to indicate a carriage return. A semicolon DOES NOT trigger a carriage return. The \r should be used to separate multiple commands in the same alias.

If the [value] variable is missing, that indicates that the alias specified in [aname] has been deleted and should be removed.

Triggers

  • SETCLIENT TRIGGER "[tname]" "[value]"

The first parameter is the pattern being searched for. This pattern must be defined using the Java Regexp rules and format. The value is the command sent when the trigger is found. This may include another SETCLIENT command, and allows for multiple separate commands using \r to separate lines.

If the [value] variable is missing, that indicates that the trigger specified in [tname] has been deleted and should be removed.

Key Bindings

  • SETCLIENT KBIND [kbname] "[value]"

The Key Bindings system supports only specific keys, with specific identifier names. These are as follows:

Labels "f1" through "f12" indicate the function keys.
Integers 1-9 indicate the keys on the keypad, if NumLock is on. By default, these send commands for the cardinal compass directions. With most keyboard settings, the key bindings work regardless of whether NumLock or ScrollLock is on.
Letters a-z indicate Ctrl+ the letter indicated. Note that some commands, like Ctrl+C and Ctrl+V, already have meanings (Copy and Paste, respectively) and thus should be avoided.

All these identifiers are in lower case only.

If the [value] variable is missing, that indicates that the key binding specified in [kbname] has been deleted and should be removed.

The manual entry of key bindings in the applet's Settings window works the same way. To identify the key binding, enter the correct label code, e.g. "f1", "3", "g", etc., and then enter the proper command in the Command text field.

Screen Size

  • SETCLIENT HSIZE [var1]
  • SETCLIENT VSIZE [var1]

This pair of commands indicates the total screen size, in pixels, by height and width. Note that var1 must be an integer; if it isn't, the command will be disregarded.

Buffers

  • SETCLIENT MAINBUF [var1]
  • SETCLIENT COMBUF [var1]
  • SETCLIENT TALKBUF [var1]

These commands set the buffer size (scrollback) for the main window, command window, and talk window. Note that var1 must be an integer; if it isn't, the command will be disregarded. The applet filters these to make sure they aren't outside the legal bounds; if they are, the buffer is set to the maximum or minimum as appropriate.

Font Size

  • SETCLIENT FONT [var1]

This sets the preferred font size, which applies to the main window, the command window, and the talk window. Note that var1 must be an integer; if it isn't, the command will be disregarded.

Buttons

  • SETCLIENT BUTTON [id] "[label]" "[command]"

This command stores the 8 user-programmable buttons. The [id] is a single-digit integer denoting which particular button. The [label] is the text displayed on the button. The [command] is the command sent when the button is pressed. Both [label] and [command] allow spaces if surrounded by "double-quotes."

Background

  • SETCLIENT BG [id]

The background image for the main screen is selected from a pre-packaged list. These are identified in order, by a single-digit integer.

Checkbox Toggles

  • SETCLIENT USETRIGS [Boolean]
  • SETCLIENT USEKBS [Boolean]
  • SETCLIENT USEALS [Boolean]
  • SETCLIENT USEVARS [Boolean]

These four commands relate to the checkbox toggle switches that control whether the system uses the Triggers, Key Bindings, Aliases, or Variables. The [Boolean] variable must be either "true" or "false", corresponding to the checkbox being checked or not.

The SETCLIENT command may also be called from aliases or triggers.

Appendix B: Aliases and Variables Tutorial

Okay many in game tasks can be simplified by the use of variables. Why do you ask? Because who wants to go change every trigger they have when they get a new item. By the use of variables you only have to change one thing and all your triggers continue to work as needed. For this tutorial we will begin by creating a simple variable for your container. There are two ways to do this. First is the standard way:

  • Click Settings
  • Click Variables
  • You will see two boxes labeled variable and value.
  • Click inside the Variable box you will see a blinking cursor appear
  • Type bag
  • NOTE: These variables are case sensitive so how you type it here is how it must be anywhere you want to use it
  • Click inside the Value Box
  • Type trunk
  • Click the top Save Button.
  • You should see the variable show up in the box below.
  • Click the Save button at the bottom of the page

You have now created a variable called bag.

The advanced way is to simply type SETCLIENT VARIABLE BAG trunk and hit enter in the command line.

You will often find especially if you are a mage that you are often removing and storing things in your bags. It maybe something like spell books, sextants, or weapons in general. By creating the above variable we can now move on to using it. For this we will want to create an alias. An alias is a shortcut for common commands that must be preceeded by a forward slash "/", like "/drink". This is similar to the CT command for clan talk. It's just a shorter way to do the same action. So let's take a common task from the game. Let's create one for something as simple as taking a drink.

Normally, you would have to type:

  • Get waterskin trunk
  • Drink waterskin
  • Put waterskin trunk

With aliases this can be simplified. We will be able to do all those things simply by typing /drink and here is how:

  • Click Settings
  • Click Aliases
  • Once again you will see two boxes one labeled Alias the other Action
  • In the Alias Box type drink
  • In the action box we will need to type a specific set of commands to use our variable we created.
  • get skin $[bag]^drink skin^put skin $[bag]

$[bag] is how you use variables in aliases and triggers both. This will replace it with the variable you defined The ^ symbol is a .25 second delay between commands.

  • Click Top save Button
  • Click Bottom save Button

Now to test the alias type /drink and hit enter. This should take the item from your container, drink from it and replace it after you are done.

Now we can even take this one step further and use triggers to fill ourselves with sustenance. What this means is when Materia Magica tells you:

Your throat feels parched.

You can actually call the alias that we created above to do all those things for you.

Creating Triggers

  • Click Settings
  • Click Triggers
  • In the Trigger Box put: Your throat feels parched.
  • In the Command Box put /drink (This is what we type to use our alias).
  • Click the Top Save button
  • Click the Bottom Save button.

Now, every time you are thirsty it will drink for you. This is just a small example of what can be done.

Appendix C: Using Regular Expressions

Construct Matches
x The character x
\\ The backslash character
\0n The character with octal value 0n (0 <= n <= 7)
\0nn The character with octal value 0nn (0 <= n <= 7)
\0mnn The character with octal value 0mnn (0 <= m <= 3, 0 <= n <= 7)
\xhh The character with hexadecimal value 0xhh
\uhhhh The character with hexadecimal value 0xhhhh
\t The tab character ('\u0009')
\n The newline (line feed) character ('\u000A')
\r The carriage-return character ('\u000D')
\f The form-feed character ('\u000C')
\a The alert (bell) character ('\u0007')
\e The escape character ('\u001B')
\cx The control character corresponding to x
Character classes
[abc] a, b, or c (simple class)
[^abc] Any character except a, b, or c (negation)
[a-zA-Z] a through z or A through Z, inclusive (range)
[a-d[m-p]] a through d, or m through p: [a-dm-p] (union)
[a-z&&[def]] d, e, or f (intersection)
[a-z&&[^bc]] a through z, except for b and c: [ad-z] (subtraction)
[a-z&&[^m-p]] a through z, and not m through p: [a-lq-z](subtraction)
Predefined character classes
. Any character (may or may not match line terminators)
\d A digit: [0-9]
\D A non-digit: [^0-9]
\s A whitespace character: [ \t\n\x0B\f\r]
\S A non-whitespace character: [^\s]
\w A word character: [a-zA-Z_0-9]
\W A non-word character: [^\w]
POSIX Character classes
\p{Lower} A lower-case alphabetic character: [a-z]
\p{Upper} An upper-case alphabetic character:[A-Z]
\p{ASCII} All ASCII:[\x00-\x7F]
\p{Alpha} An alphabetic character:[\p{Lower}\p{Upper}]
\p{Digit} A decimal digit: [0-9]
\p{Alnum} An alphanumeric character:[\p{Alpha}\p{Digit}]
\p{Punct} Punctuation: One of !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~
\p{Graph} A visible character: [\p{Alnum}\p{Punct}]
\p{Print} A printable character: [\p{Graph}]
\p{Blank} A space or a tab: [ \t]
\p{Cntrl} A control character: [\x00-\x1F\x7F]
\p{XDigit} A hexadecimal digit: [0-9a-fA-F]
\p{Space} A whitespace character: [ \t\n\x0B\f\r]
Boundary matchers
^ The beginning of a line
$ The end of a line
\b A word boundary
\B A non-word boundary
\A The beginning of the input
\G The end of the previous match
\Z The end of the input but for the final terminator, if any
\z The end of the input
Greedy quantifiers
X? X, once or not at all
X* X, zero or more times
X+ X, one or more times
X{n} X, exactly n times
X{n,} X, at least n times
X{n,m} X, at least n but not more than m times
Reluctant quantifiers
X?? X, once or not at all
X*? X, zero or more times
X+? X, one or more times
X{n}? X, exactly n times
X{n,}? X, at least n times
X{n,m}? X, at least n but not more than m times
Possessive quantifiers
X?+ X, once or not at all
X*+ X, zero or more times
X++ X, one or more times
X{n}+ X, exactly n times
X{n,}+ X, at least n times
X{n,m}+ X, at least n but not more than m times
Logical operators
XY X followed by Y
X|Y Either X or Y
(X) X, as a capturing group
Back references
\n Whatever the nth capturing group matched
Quotation
\ Nothing, but quotes the following character
\Q Nothing, but quotes all characters until \E
\E Nothing, but ends quoting started by \Q
Special constructs (non-capturing)
(?:X) X, as a non-capturing group
(?idmsux-idmsux) Nothing, but turns match flags on - off
(?idmsux-idmsux:X) X, as a non-capturing group with the given flags on - off
(?=X) X, via zero-width positive lookahead
(?!X) X, via zero-width negative lookahead
(?<=X) X, via zero-width positive lookbehind
(?<!X) X, via zero-width negative lookbehind
(?>X) X, as an independent, non-capturing group

Backslashes, escapes, and quoting

The backslash character ('\') serves to introduce escaped constructs, as defined in the table above, as well as to quote characters that otherwise would be interpreted as unescaped constructs. Thus the expression \\ matches a single backslash and \{ matches a left brace.

It is an error to use a backslash prior to any alphabetic character that does not denote an escaped construct; these are reserved for future extensions to the regular-expression language. A backslash may be used prior to a non-alphabetic character regardless of whether that character is part of an unescaped construct.

Backslashes within string literals in Java source code are interpreted as required by the Java Language Specification as either Unicode escapes or other character escapes. It is therefore necessary to double backslashes in string literals that represent regular expressions to protect them from interpretation by the Java bytecode compiler. The string literal "\b", for example, matches a single backspace character when interpreted as a regular expression, while "\\b" matches a word boundary. The string literal "\(hello\)" is illegal and leads to a compile-time error; in order to match the string (hello) the string literal "\\(hello\\)" must be used.

Character Classes

Character classes may appear within other character classes, and may be composed by the union operator (implicit) and the intersection operator (&&). The union operator denotes a class that contains every character that is in at least one of its operand classes. The intersection operator denotes a class that contains every character that is in both of its operand classes.

The precedence of character-class operators is as follows, from highest to lowest:

  • Literal escape \x
  • Grouping [...]
  • Range a-z
  • Union [a-e][i-u]
  • Intersection [a-z&&[aeiou]]

Note that a different set of metacharacters are in effect inside a character class than outside a character class. For instance, the regular expression . loses its special meaning inside a character class, while the expression - becomes a range forming metacharacter.

Line terminators

A line terminator is a one- or two-character sequence that marks the end of a line of the input character sequence. The following are recognized as line terminators:

  • A newline (line feed) character ('\n')
  • A carriage-return character followed immediately by a newline character ("\r\n")
  • A standalone carriage-return character ('\r')

Groups and capturing

Capturing groups are numbered by counting their opening parentheses from left to right. In the expression ((A)(B(C))), for example, there are four such groups:

  • ((A)(B(C)))
  • (A)
  • (B(C))
  • (C)

Group zero always stands for the entire expression.

Capturing groups are so named because, during a match, each subsequence of the input sequence that matches such a group is saved. The captured subsequence may be used later in the expression, via a back reference, and may also be retrieved from the matcher once the match operation is complete.

The captured input associated with a group is always the subsequence that the group most recently matched. If a group is evaluated a second time because of quantification then its previously-captured value, if any, will be retained if the second evaluation fails. Matching the string "aba" against the expression (a(b)?)+, for example, leaves group two set to "b". All captured input is discarded at the beginning of each match.

Groups beginning with (? are pure, non-capturing groups that do not capture text and do not count towards the group total.

For further reference: Java Regular Expressions.