world.ExportXML

MUSHclient script function (Method) — introduced in version 3.41

Exports a world item in XML format

Prototype

BSTR ExportXML(short Type, BSTR Name);

Data type meanings

Description

This lets you export one trigger, timer, alias, macro, keypad item or variable in XML format. This is symmetrical with the ImportXML function - a trigger exported with ExportXML will be syntactically correct for importing with ImportXML. However, it may not actually import if, say, there is a clash where two triggers both have the same label.

This would let you send triggers etc. from one world to another in an automated way, or from one client to another if you built some chat scripting around these functions.

The various types of things are numbered:

0 = trigger
1 = alias
2 = timer
3 = macro
4 = variable
5 = keypad

VBscript example

world.Note world.ExportXML (0, "mytrigger")

Jscript example

world.Note (world.ExportXML (0, "mytrigger"));

PerlScript example

Note (ExportXML (0, "mytrigger"));

Python example

world.Note (world.ExportXML (0, "mytrigger"));

Lua example

Note (ExportXML (0, "mytrigger"))

Return value

The XML text of the nominated item. If the "type" is not valid, or the item cannot be found, then the return value is the empty string.

Related topic

Utilities

See also

FunctionDescription
ImportXMLImports configuration data in XML format