Difference between revisions of "Profile Picture"
Jump to navigation
Jump to search
m (<lsl> tag to <source>) |
|||
Line 6: | Line 6: | ||
---- | ---- | ||
< | <source lang="lsl2"> | ||
key DefaultTexture = "9d45f95d-5bb5-0f01-7b3c-29c5297ce67e"; | key DefaultTexture = "9d45f95d-5bb5-0f01-7b3c-29c5297ce67e"; | ||
string URL_RESIDENT = "http://world.secondlife.com/resident/"; | string URL_RESIDENT = "http://world.secondlife.com/resident/"; | ||
Line 31: | Line 31: | ||
} | } | ||
} | } | ||
</ | </source> | ||
--- | --- |
Revision as of 08:37, 25 January 2015
Use this script to get user's profile picture UUID and diplay it in-world.
Usage
Create a box, add the code and click.
- Note that the string uuid is set on touch.
key DefaultTexture = "9d45f95d-5bb5-0f01-7b3c-29c5297ce67e";
string URL_RESIDENT = "http://world.secondlife.com/resident/";
string uuid;
string meta_find = "<meta name=\"imageid\" content=\"";
default
{
on_rez(integer r) { llResetScript(); }
state_entry() {
llSetTexture(DefaultTexture,2);
}
touch_start(integer n) {
uuid = llDetectedKey(0);
llHTTPRequest( URL_RESIDENT + uuid,[HTTP_METHOD,"GET"],"");
}
http_response(key req,integer stat, list met, string body)
{
integer meta_pos = llSubStringIndex(body, meta_find) + llStringLength(meta_find);
string texture = llGetSubString(body, meta_pos, meta_pos + 35);
llSetTexture(texture, ALL_SIDES);
}
}
---