world.GetUniqueNumber

MUSHclient script function (Method)

Returns a unique number

Prototype

long GetUniqueNumber();

Data type meanings

Description

Returns a unique number in the range 0 to 2,147,483,647.

This number will be unique for this session of MUSHclient, across all worlds. You might use it to generate unique labels for one-shot timers, or other similar purposes.

Note that the number will eventually "wrap around" and thus, if you generate a lot of them (ie. 2,147,483,647 of them), they will no longer be unique.

Also note that this number generator is used internally in MUSHclient, and thus the numbers generated will not necessarily be in sequence.

Important - this number is reset for each new MUSHclient session, so these numbers are only unique per session, not indefinitely.

VBscript example

world.note world.GetUniqueNumber

Jscript example

world.note (world.GetUniqueNumber());

PerlScript example

$world->note ($world->GetUniqueNumber());

Python example

world.note (world.GetUniqueNumber)

Lua example

Note (GetUniqueNumber())

Return value

A unique number in the range 0 to 2147483647 as described above.

Related topic

Utilities

See also

FunctionDescription
CreateGUIDCreates a GUID - Global Unique Identifier
GetUniqueIDCreates a unique ID for general use, or for making Plugin IDs