Register forum user name Search FAQ

MUSHclient scripting

Description of MUSHclient world function: world.CreateGUID


Name CreateGUID
Type Method
Summary Creates a GUID - Global Unique Identifier
Prototype BSTR CreateGUID();
Description

This generates a unique GUID (Global Unique Identifier). This is almost certain to be unique throughout the world, and at any time (ie. completely and utterly unique).

The GUID will look like this: 6B29FC40-CA47-1067-B31D-00DD010662DA

The purpose of this is to give you a way of having a unique identifier (eg. for a variable). If you were to use it for that purpose you would have to add a letter to the front, as variables must start with a letter, not a number, and change hyphens to underscores. eg.

dim uniqueid
uniqueid = "X" & world.replace (world.createguid, "-", "_", true)

These numbers may seem cumbersome, but at least if you use them you are guaranteed of a unique identifier.

Contrast this to "GetUniqueNumber" which only returns a unique number for this session of MUSHclient. Thus, the numbers (from "GetUniqueNumber") will not be unique over multiple sessions.

See also the new script function world.GetUniqueID.

Also, using random number generation for unique identifiers has a chance of returning the same number, depending on a) the seed given to the generator; and b) the way the generator must eventually recyle and regenerate the same sequence.


Note: Available in version 3.23 onwards.


VBscript example
world.Note world.CreateGUID
Jscript example
world.Note (world.CreateGUID ());
PerlScript example
$world->Note ($world->CreateGUID ());
Python example
world.Note (world.CreateGUID )
Lua example
Note (CreateGUID ())
Returns A 36-character GUID.
Introduced in version 3.23

See also ...

Function Description
GetUniqueID Creates a unique ID for general use, or for making Plugin IDs
GetUniqueNumber Returns a unique number

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.