genUUID

From Second Life Wiki
Revision as of 16:54, 9 May 2010 by Ugleh Ulrik (talk | contribs) (Created page with '{{LSL_Function |func=GenUUID |mode=user |return_type=string |return_text=that is a clone look of a uuid, these keys are not registered within SL. |func_footnote= See also: [[Stri...')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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

<lsl>string genUUID() { list characters = ["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]; string emp; integer p;

   do{
      emp += llList2String(characters, llRound(llFrand(llGetListLength(characters) - 0 + 1 )));
   }
   while(34 > ++p);
   return llGetSubString(emp,0,7) + "-" + llGetSubString(emp,8,11)+ "-" + llGetSubString(emp,12,15)+ "-" + llGetSubString(emp,16,19)+ "-" + llGetSubString(emp,20,31);

}

</lsl>

Examples

<lsl> default {

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

}

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