[Home] [Downloads] [Search] [Help/forum]

MUSHclient scripting

Description of MUSHclient world function: world.ErrorDesc

Name ErrorDesc
Type Method
Summary Converts a MUSHclient script error code into an human-readable description
Prototype BSTR ErrorDesc(long Code);

View list of data type meanings


This function converts a return code (such as 30008) into a human-readable form ("The name of this object is invalid").

The purpose is to allow scripts which fail to detect the reason and display it in human-readable form.

eg. (in VBscript)

result = SetVariable ("***", "abc")

if result <> 0 then
Note ErrorDesc (result)
end if

Note: Available in version 3.68 onwards.

VBscript example
result = SetVariable ("***", "abc")

if result <> 0 then
  Note ErrorDesc (result)
end if
Jscript example
result = SetVariable ("***", "abc");

if (result != 0)
  Note (ErrorDesc (result))
Lua example
result = SetVariable ("***", "abc");

if result ~= 0 then
  Note (ErrorDesc (result))
end -- if
Lua notes
In Lua, it is simpler to use the error_desc table, which is available in earlier versions of MUSHclient also.


result = SetVariable ("***", "abc");

if result ~= 0 then
  Note (error_desc [result])
end -- if

This is simply a table-lookup in Lua, rather than a call to a MUSHclient function.
Returns A string containing the code converted to human-readable form, or the supplied argument converted to a string if the code is not in MUSHclient's internal list of error codes. At present, the range of codes that will be converted is 0, and 30001 to 30062.
Introduced in version 3.68

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


Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

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


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]