User Tools

Site Tools


touchbound_system:prisoner_id_generator

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
touchbound_system:prisoner_id_generator [2022/01/31 18:54] – created kyrahabattoirtouchbound_system:prisoner_id_generator [2022/01/31 19:03] (current) – forgot the character string. kyrahabattoir
Line 1: Line 1:
-This is the function that my prison cells use to generate semi-unique prisoner ID numbers that are unique for each avatar.+This is the function that my prison cells use to generate semi-unique prisoner ID numbers that are permanent for each avatar.
 I am releasing this code to make it easy for other creators & people running roleplay locations to generate matching prisoner IDs across multiple systems. I am releasing this code to make it easy for other creators & people running roleplay locations to generate matching prisoner IDs across multiple systems.
  
-Feel free to make the code more efficient and adapt it to your needs, but please do not modify how IDs are generated, to keep everything compatible.+Feel free to make the code more efficient and/or adapt it to your needs, all I am asking is that you do not modify how IDs are generated, to keep everything compatible.
  
 <code> <code>
Line 13: Line 13:
     {     {
         integer iChar = (integer)("0x"+llGetSubString(sRaw,1,4)) % 26;         integer iChar = (integer)("0x"+llGetSubString(sRaw,1,4)) % 26;
-        string sResult = llGetSubString(CHARS,iChar,iChar);+        string sResult = llGetSubString("ABCDEFGHIJKLMNOPQRSTUVWXYZ",iChar,iChar);
         return sResult + llGetSubString((string)((integer)("0x"+llGetSubString(sRaw,9,13)) + 10000),1,4);         return sResult + llGetSubString((string)((integer)("0x"+llGetSubString(sRaw,9,13)) + 10000),1,4);
     }     }
touchbound_system/prisoner_id_generator.1643655284.txt.gz · Last modified: 2022/01/31 18:54 by kyrahabattoir