Difference between revisions of "Who"

From Second Life Wiki
Jump to navigation Jump to search
m (Added {{LSL Header}} for good measure...)
 
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{LSL Header}}
A simple '[[llKey2Name]]' user-function supporting [[Viewer URI Name Space]].
A simple '[[llKey2Name]]' user-function supporting [[Viewer URI Name Space]].


== Function ==
== Function ==


<lsl>
<syntaxhighlight lang="lsl2">
string Who(key id)
string Who(key id)
{
{
     return "secondlife:///app/agent/" + (string)id + "/inspect";
     return "secondlife:///app/agent/" + (string)id + "/inspect";
}
}
</lsl>
</syntaxhighlight>


== Example ==
== Example ==


<lsl>
<syntaxhighlight lang="lsl2">
string Who(key id)
string Who(key id)
{
{
Line 20: Line 22:
default
default
{
{
     touch_start(integer n)
     touch_start(integer num)
     {
     {
         llSay("Touched by " + Who(llDetectedKey(n)) + ".");
         llSay(0, "Touched by " + Who(llDetectedKey(0)) + "." );
     }
     }
}
}
</lsl>
</syntaxhighlight>


[[Category:LSL Examples]]
[[Category:LSL Examples]]

Latest revision as of 13:37, 9 March 2023

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

Function

string Who(key id)
{
    return "secondlife:///app/agent/" + (string)id + "/inspect";
}

Example

string Who(key id)
{
    return "secondlife:///app/agent/" + (string)id + "/inspect";
}

default
{
    touch_start(integer num)
    {
        llSay(0, "Touched by " + Who(llDetectedKey(0)) + "." );
    }
}