Difference between revisions of "Name2Key"

From Second Life Wiki
Jump to navigation Jump to search
m (Replaced <source> with <syntaxhighlight>)
 
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{LSLC|Library}}
{{LSL Header}}{{LSLC|Library}}
 
{{LSL Function/warning|inline=*|Dead Service|The web service this script utilized is no longer available. The URL has been removed as the domain is now being used as a phishing site. This article exists for historical interest.}}


== Black DB Name2Key ==
== Black DB Name2Key ==
After a lot of work in making this work, i finally managed to get the Name2Key search running with Second Life's avatar search.
After a lot of work in making this work, i finally managed to get the Name2Key search running with Second Life's avatar search.
Can also use [http://www.blackclan.net/ Black DB Name2Key Website] and use the Live name search.
Can also use [http://www.blackclan.net/ Black DB Name2Key Website] and use the Live name search.
UPDATED: Very sorry, just tonight i found out that i put llName2Key(name); instead of llName2Key(Name); The lower case `n` originally cause the name2key to search for the users UUID instead of the user who was being searched for.


== llName2Key Script ==
== llName2Key Script ==


<lsl>
<syntaxhighlight lang="lsl2">
string black_db_name2key_service = "http://blackclan.net/name2key/n2k.php?ss=";
string black_db_name2key_service = "";
key QID;
key QID;


Line 45: Line 49:
         }
         }
     }
     }
}</lsl>
}</syntaxhighlight>

Latest revision as of 13:32, 16 January 2023


Emblem-important-red.png Dead Service Warning!

The web service this script utilized is no longer available. The URL has been removed as the domain is now being used as a phishing site. This article exists for historical interest.

Black DB Name2Key

After a lot of work in making this work, i finally managed to get the Name2Key search running with Second Life's avatar search. Can also use Black DB Name2Key Website and use the Live name search.

UPDATED: Very sorry, just tonight i found out that i put llName2Key(name); instead of llName2Key(Name); The lower case `n` originally cause the name2key to search for the users UUID instead of the user who was being searched for.

llName2Key Script

string black_db_name2key_service = "";
key QID;

string Name;
key UUID;

llName2Key(string name)
{
    QID = llHTTPRequest(black_db_name2key_service+llEscapeURL(name), [], "");
}

default
{
    state_entry()
    {
        llListen(0, "", llGetOwner(), "");
    }
    listen(integer channel, string name, key id, string str)
    {
        Name = str;
        llName2Key(Name);
    }
    http_response(key req, integer status, list meta, string body)
    {
        if(req == QID && status == 200)
        {
            UUID = (key)(llStringTrim(body, STRING_TRIM));
            if(UUID == NULL_KEY)
            {
                //None found
            }
            else
            {
                llOwnerSay(Name + "'s UUID Key = "+(string)UUID);
            }
        }
    }
}