MXP script routines |
---|
This dialog specifies the name of the script routines that are to be called if MXP is active.
Shutdown: Called when MXP closes down. eg.
Opening tag: Called for an opening tag. This should be define as a function that returns a number. If the value (a number) is not zero, then the tag will not be acted on. This lets you customise the way MUSHclient reactions to MXP/Pueblo tags. For example, you might want to omit tags that change the font color, or tags that underline text. See below for an example. It is called in two places: a) For the actual tag which appears in the MUD output; and b) If this tag is a server-defined tag (using <!ELEMENT>) then for each of the "built-in" tags that the server-defined tag calls. For example, if you had this definition: <!ELEMENT foo "<b><i>" > And later on the MUD sent: <foo>Some text</foo> The opening "<foo>" would cause the "MXP start tag" routines to be called for the following *three* tags: i) foo ii) b iii) i In other words, once for the actual tag sent (<foo>), and once each for the tags that are called *by* <foo>. If the routine for "foo" returned true, then "foo" is cancelled and the following text is not set to italic, nor bold. However if "foo" returns false, but "b" returns true and "i" returns false, then the text is merely made italic. Here is an example of how you might write such a function:
Note that if you cancel a tag sent by the server, then you will probably get a "closing tag with no opening tag" warning (warning number 5005). You might want to suppress that if it gets annoying above for how to do that. Closing tag: Called for a closing tag. It is passed two arguments - the name of the tag, and the "text" which is the data that appeared between the opening and closing tags.
Set variable: This is called when a variable is set by MXP. You are passed two arguments, the variable name, and its new contents.
Error: A script routine to be called on an MXP error. If the value (a number) is not zero, then the error message will not be displayed in the message window. This lets you fine-tune the messages that appear there - for example, omitting errors or warnings that you are not interested in. Here is an example: eg.
See Also ... Topics
Dialog ![]() (Help topic: dialog=IDD_MXP_SCRIPTS) |
Enter a search string to find matching documentation.
Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.