world.DeleteAlias

MUSHclient script function (Method)

Deletes an alias

Prototype

long DeleteAlias(BSTR AliasName);

Data type meanings

Description

Deletes the named alias from the list of aliases.

WARNING - if the alias is executing a script it cannot be deleted. For example, an alias cannot delete itself.

If you need to delete an alias from within itself use DoAfterSpecial to delete it after a short delay. You might also want to use EnableGroup to disable it first.

VBscript example

world.DeleteAlias "my_alias"

Jscript example

world.DeleteAlias("my_alias");

PerlScript example

$world->DeleteAlias("my_alias");

Python example

world.DeleteAlias("my_alias")

Lua example

DeleteAlias("my_alias")

Return value

eInvalidObjectLabel: The alias name is not valid
eAliasNotFound: The named alias does not exist
eItemInUse: Cannot delete trigger/alias/timer because it is executing a script
eOK: deleted OK

Return code meanings

Related topic

Aliases

See also

FunctionDescription
AddAliasAdds an alias
DeleteAliasGroupDeletes a group of aliases
DoAfterSpecialAdds a one-shot, temporary, timer to carry out some special action
EnableAliasEnables or disables an alias
GetAliasGets details about an alias
GetAliasInfoGets details about an alias
GetAliasListGets the list of aliases
IsAliasTests to see if an alias exists