Difference between revisions of "Key2Name"
Jump to navigation
Jump to search
Kireji Haiku (talk | contribs) m (→llName2Key Script: 0 >> PUBLIC_CHANNEL) |
|||
Line 20: | Line 20: | ||
state_entry() | state_entry() | ||
{ | { | ||
llListen( | llListen(PUBLIC_CHANNEL, "", llGetOwner(), ""); | ||
} | } | ||
listen(integer channel, string name, key id, string str) | listen(integer channel, string name, key id, string str) | ||
Line 32: | Line 32: | ||
{ | { | ||
Name = llStringTrim(body, STRING_TRIM); | Name = llStringTrim(body, STRING_TRIM); | ||
if(llStringLength(Name) | if(!llStringLength(Name))// if the length is zero | ||
{ | { | ||
//None found | //None found | ||
Line 43: | Line 43: | ||
} | } | ||
}</lsl> | }</lsl> | ||
==See Also== | ==See Also== | ||
* {{LSLGC|Avatar/Name}} - Name related functions. | * {{LSLGC|Avatar/Name}} - Name related functions. | ||
* [[Who]] | * [[Who]] |
Revision as of 02:08, 8 October 2013
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
llName2Key Script
<lsl> string black_db_key2name_service = ""; key QID;
string Name; key UUID;
llGetKey2Name(key UUID) {
QID = llHTTPRequest(black_db_key2name_service+llEscapeURL((string)UUID), [], "");
}
default {
state_entry() { llListen(PUBLIC_CHANNEL, "", llGetOwner(), ""); } listen(integer channel, string name, key id, string str) { UUID = id; llGetKey2Name(UUID); } http_response(key req, integer status, list meta, string body) { if(req == QID && status == 200) { Name = llStringTrim(body, STRING_TRIM); if(!llStringLength(Name))// if the length is zero { //None found } else { llOwnerSay((string)UUID + "'s name = "+Name); } } }
}</lsl>
See Also
- Avatar/Name - Name related functions.
- Who