Difference between revisions of "Name2Key"

From Second Life Wiki
Jump to navigation Jump to search
(Created page with "== 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 [http://www.b…")
 
m
Line 1: Line 1:
{{LSLC|Library}}
== 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.

Revision as of 16:27, 20 May 2011


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.

llName2Key Script

<lsl> string black_db_name2key_service = "http://blackclan.net/name2key/n2k.php?ss="; 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);
           }
       }
   }

}</lsl>