Difference between revisions of "Who"

From Second Life Wiki
Jump to navigation Jump to search
(Created page with "<lsl> // Who() user-function supporting Viewer URI Name Space // http://wiki.secondlife.com/wiki/Viewer_URI_Name_Space string Who(key id) { return "secondlife:///app/agent/" …")
 
Line 1: Line 1:
A simple '[[llKey2Name]]' user-function supporting [[Viewer URI Name Space]].
== Function ==
<lsl>
<lsl>
// Who() user-function supporting Viewer URI Name Space
// http://wiki.secondlife.com/wiki/Viewer_URI_Name_Space
string Who(key id)
string Who(key id)
{
{
Line 7: Line 9:
}
}
</lsl>
</lsl>
== Example ==
<lsl>
string Who(key id)
{
    return "secondlife:///app/agent/" + (string)id + "/inspect";
}
default
{
    touch_start(integer n)
    {
        llSay("Touched by " + Who(llDetectedKey(n)) + ".");
    }
}
</lsl>
[[Category:LSL Examples]]
[[Category:LSL Examples]]

Revision as of 15:36, 6 January 2013

A simple 'llKey2Name' user-function supporting Viewer URI Name Space.

Function

<lsl> string Who(key id) {

   return "secondlife:///app/agent/" + (string)id + "/inspect";

} </lsl>

Example

<lsl> string Who(key id) {

   return "secondlife:///app/agent/" + (string)id + "/inspect";

}

default {

   touch_start(integer n)
   {
       llSay("Touched by " + Who(llDetectedKey(n)) + ".");
   }

} </lsl>