Register forum user name Search FAQ

MUSHclient scripting

Description of MUSHclient world function: world.GetAliasOption


Name GetAliasOption
Type Method
Summary Gets the value of a named alias option
Prototype VARIANT GetAliasOption(BSTR AliasName, BSTR OptionName);
Description

Gets the current value of an alias option.

You must specify the name of an existing alias, and an alias option from the list below. These are the same names as used in the XML world files for alias options.

Note that you can neither get or set the "name" field. It is listed below for completeness in viewing aliases copied to the clipboard or in world files and plugins. You already know the name when getting the alias option (it is AliasName), and this function is provided to modify existing aliases, not rename them. To change the name of an alias use ExportXML, modify the XML, and then ImportXML.

The return type is Variant, so the returned value will be the appropriate type for the data (ie. string or number (long)).

If the option name is not known, or is not allowed to be retrieved, a NULL variant is returned.

If the named alias does not exist, EMPTY is returned. If the name given is invalid, NULL is returned. If the option name is not known, EMPTY is returned. (Use "IsEmpty" and "IsNull" to test for these possibilities).

For a detailed description about the meanings of the fields, see AddAlias.

If GetAliasOption is called from within a plugin, the aliases for the current plugin are used, not the "global" MUSHclient aliases.

To find options for other plugins use GetPluginAliasOption.

The various option names are:

"echo_alias": y/n - echo alias itself to output window
"enabled": y/n - alias is enabled
"expand_variables": y/n - expand variables (like @target)
"group": (string - group name)
"ignore_case": y/n - caseless matching
"keep_evaluating": y/n - evaluate next alias in sequence
"match": (string - what to match)
"menu": y/n - add alias to menu that appears if you LH click
"name": (string - name/label of alias)
"omit_from_command_history": y/n - omit alias from the command history
"omit_from_log": y/n - omit alias from log file
"omit_from_output": y/n - omit sent text from the output window
"one_shot": y/n - alias is deleted after firing
"regexp": y/n - regular expression
"script": (string - name of function to call)
"send": (multi-line string - what to send)
"send_to": 0 - 13 - "send to" location (see below)
"sequence": 0 - 10000 - sequence number in which to check - lower first
"user": -2147483647 to 2147483647 - user-defined number
"variable": (string - name of variable to send to)

Boolean options (shown as y/n) are returned as 0 for false (n) or 1 for true (y).

Send-to locations

"0" - send to MUD
"1" - put in command window
"2" - display in output window
"3" - put in status line
"4" - new notepad
"5" - append to notepad
"6" - put in log file
"7" - replace notepad
"8" - queue it
"9" - set a variable
"10" - re-parse as command
"11" - send to MUD as speedwalk
"12" - send to script engine
"13" - send without queuing
"14" - send to script engine - after omitting from output


Note: Available in version 3.29 onwards.


VBscript example
Note GetAliasOption ("myalias", "match")
Jscript example
Note (GetAliasOption ("myalias", "match"));
PerlScript example
$world->Note ($world->GetAliasOption ("myalias", "match"));
Python example
world.Note (world.GetAliasOption ("myalias", "match"))
Lua example
Note (GetAliasOption ("myalias", "match"))
Lua notes
Lua returns nil where applicable instead of an "empty variant" or "null variant".


The "SendTo" field can be looked up using the "sendto" table in the Lua global address space, as follows:

sendto.world = 0
sendto.command = 1
sendto.output = 2
sendto.status = 3
sendto.notepad = 4
sendto.notepadappend = 5
sendto.logfile = 6
sendto.notepadreplace = 7
sendto.commandqueue = 8
sendto.variable = 9
sendto.execute = 10
sendto.speedwalk = 11
sendto.script = 12
sendto.immediate = 13
sendto.scriptafteromit = 14
Returns As described above.
Introduced in version 3.29

See also ...

Function Description
AddAlias Adds an alias
GetAliasInfo Gets details about an alias
GetPluginAliasOption Gets the value of a named alias option for a specified plugin
SetAliasOption Sets the value of a named alias option

Search for script function

Enter a word or phrase in the box below to narrow the list down to those that match.

The function name, prototype, summary, and description are searched.

Search for:   

Leave blank to show all functions.


Return codes

Many functions return a "code" which indicates the success or otherwise of the function.

You can view a list of the return codes


Function prototypes

The "prototype" part of each function description lists exactly how the function is called (what arguments, if any, to pass to it).

You can view a list of the data types used in function prototypes


View all functions

[Back]

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.