genUUID

From Second Life Wiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Summary

Function: string GenUUID( );

Returns a string that is a clone look of a uuid, these keys are not registered within SL.

See also: String

Specification

string  genUUID() {
    string characters = "0123456789abcdefghijklmnopqrstuvwxyz";
    float len = (float)llStringLength(characters);
    string emp;
    integer i = 32;
    integer p;
    do
       emp += llGetSubString(characters, p = (integer)llFrand(len), p);
    while(--i);
    return llGetSubString(emp,0,7) + "-" + llGetSubString(emp,8,11)+ "-" + llGetSubString(emp,12,15)+ "-" + llGetSubString(emp,16,19)+ "-" + llGetSubString(emp,20,31);
}

Examples

default
{
    touch_start(integer total_number)
    {
        llSay(0, genUUID());
    }
}

//Says something like  4kwlhahj-ilpw-df7v-wv8i-3i7m9gx6309