Avatar Scanner

default
{
    touch_start(integer total_number)
    {
        llSensor("", NULL_KEY, AGENT, 96, PI); 
        // Scan for all avatars (AGENT) with any name ("") and any id (NULL_KEY) within 96 metres (the maximum scan range) in all directions (PI). If any avatars are detected create an indexed list of them and raise a sensor() event.
    }
 
    sensor(integer total_number) 
    // The sensor event is raised when avatars are detected. The number of detected avatars is passed to the script below in the parameter total_number.
 
    {
        llWhisper(0, (string)total_number + " avatar(s) detected" );
        // The following 'for' loop  works through the indexed list created by the llsensor() function and the outputs the name and key of each detected avatar on ch0 in turn.
 
        integer i;
        for (i = 0; i < total_number; i++)
        {
            llWhisper(0, "Avatar name: " + llDetectedName(i) + " Avatar Key: " + (string)(llDetectedKey(i)));
 
        //Given an avatar's detected object number the llDetectedName function gets the avatar's name and the llDetectedKey function gets the avatar's key.  
 
        }
    }
}
 
// End of code;

 

Flash Scratch to SL - Your Scripting Tool

Script ImageNeed to write a LSL script and don't know how to script?  I know I hate trying to get my head around LSLS when I an in a time crunch. So why not give Flash Scratch a try! Its a great tool for learning and scoding your own scripts for Second Life without having to pay someone to do it and without a crash course in LSL

A Huge thanks to John Bennet of ATLAS Institute at University of Colorado and Eric Rosenbaum at MIT for writing Scratch for SL to begin with.

Read more: Flash Scratch to SL - Your Scripting Tool