OsAvatarName2Key

From OpenSimulator

Revision as of 01:58, 7 March 2024 by Manni (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
key osAvatarName2Key(string FirstName, string LastName)
Returns an avatar's key, based on his/her first and last name.
Threat Level Low
Permissions ${OSSL|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
Extra Delay 0 seconds
Example(s)
//
// osAvatarName2Key Script Exemple
// Author: djphil
// 
 
// Define the first and last names of the avatar
string FirstName = "John";
string LastName = "Smith";
 
default
{
    state_entry()
    {
        // Display a message prompting users to touch the object to see how osAvatarName2Key is used
        llSay(PUBLIC_CHANNEL, "Touch to see osAvatarName2Key usage.");
    }
 
    touch_start(integer number)
    {
        // Concatenate the first and last names to form the full avatar name
        string AvatarName = FirstName + " " + LastName;
 
        // Call osAvatarName2Key function to get the key of the avatar based on first and last names
        key AvatarKey = osAvatarName2Key(FirstName, LastName);
 
        // Display the avatar name and key
        llSay(PUBLIC_CHANNEL, "The avatar name is " + AvatarName);   
        llSay(PUBLIC_CHANNEL, "The avatar key is " + (string)AvatarKey);    
    }
}
//
// osAvatarName2Key Script Exemple
// Author: djphil
// 
 
default
{
    state_entry()
    {
        // Display a message prompting users to touch the object to see how osAvatarName2Key is used
        llSay(PUBLIC_CHANNEL, "Touch to see osAvatarName2Key usage.");
    }
 
    touch_start(integer number)
    {
        // Get the name of the avatar who touched the object
        string AvatarName = llDetectedName(0);
 
        // Parse the avatar name to extract first and last names
        list buffer = llParseString2List(AvatarName, [" "], []);
        string FirstName = llList2String(buffer, 0);
        string LastName = llList2String(buffer, 1);
 
        // Call osAvatarName2Key function to get the key of the avatar based on first and last names
        key AvatarKey = osAvatarName2Key(FirstName, LastName);
 
        // Display the avatar name and key
        llSay(PUBLIC_CHANNEL, "Your avatar name is " + AvatarName);   
        llSay(PUBLIC_CHANNEL, "Your avatar key is " + (string)AvatarKey);    
    }
}


See Also

Personal tools
General
About This Wiki