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

MUSHclient scripting

Description of MUSHclient world function: world.GetUniqueID


Name GetUniqueID
Type Method
Summary Creates a unique ID for general use, or for making Plugin IDs
Prototype BSTR GetUniqueID();

View list of data type meanings

Description

This uses CreateGUID to get a unique number, and then hashes it, retaining 24 characters (96 bits) of the hash. This generates a nice, unique identifier, like this: "0a96ce42d8e0ede554d3b9ab".

The advantage of using this over CreateGUID is that by hashing the number your network card MAC address is concealed. Conceivably some users might not want their MAC address to be revealed. The number generated here will be used by plugins to uniquely identify themselves.

You could also use it for variable, trigger, timer, alias names, when generated by a script, to ensure uniqueness over multiple sessions. You could also use it as a handy "password generator", as the number sequences are hardly going to be predicable.

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.CreateGUID.

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.GetUniqueID
Jscript example
world.Note (world.GetUniqueID ());
PerlScript example
$world->Note ($world->GetUniqueID ());
Python example
world.Note (world.GetUniqueID )
Lua example
Note (GetUniqueID ())
Returns A 24-character unique identifier.
Introduced in version 3.23

See also ...

Function Description
CreateGUID Creates a GUID - Global Unique Identifier
GetUniqueNumber Returns a unique number
Hash Produces a hash (checksum) of a specified piece of text

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]

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.

[Home]


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]