Difference between revisions of "User:Cow Taurog/Language scanner"

From Second Life Wiki
Jump to navigation Jump to search
(create)
 
(oops, wrong license info)
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
Announces any nearby avatar, and their <span class="plainlinks">[http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes ISO 639-1]</span> language code.
<lsl>
<lsl>
// This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License
// http://creativecommons.org/licenses/by-sa/3.0/
// Commercial use is allowed.
// Modification and/or distribution is allowed, as long as attribution for each revision is given, and the same license is used.
//
// Cow Taurog's language code finder, v1.0
//
// This script will say the name of every avatar in range (including you), and their detected ISO 639-1 language code when touched.
// Feel free to use, reuse, or change the code, as long as you abide by the license
//
list lD; // stores detected avatars/languages
integer i; // loops through detected avatars
default{
default{
     touch_start(integer num){
     touch_start(integer num){ // when touched...
         llSensor("","",AGENT,96,PI);
         llSensor("","",AGENT,96,PI); // scan for any avatar within range
     }
     }
     sensor(integer num){
     sensor(integer num){ // if one or more avatars are found...
         llOwnerSay(llDetectedName(num-1)+", "+llGetAgentLanguage(llDetectedKey(num-1)));
         for(i=0;i<num;i++){ // for each avatar found...
    }
            lD=lD+[llDetectedName(i)+": "+llGetAgentLanguage(llDetectedKey(i))]; // add the name and language to the list
    no_sensor(){
        }
         llOwnerSay("No more avatars found.");
        llSay(0,"\n"+llDumpList2String(lD,"\n")); // say names and their language code over public chat
         llResetScript(); // reset the script for the next use
     }
     }
}
}
</lsl>
</lsl>

Latest revision as of 01:50, 17 August 2011

Announces any nearby avatar, and their ISO 639-1 language code. <lsl> // This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License // http://creativecommons.org/licenses/by-sa/3.0/ // Commercial use is allowed. // Modification and/or distribution is allowed, as long as attribution for each revision is given, and the same license is used. // // Cow Taurog's language code finder, v1.0 // // This script will say the name of every avatar in range (including you), and their detected ISO 639-1 language code when touched. // Feel free to use, reuse, or change the code, as long as you abide by the license // list lD; // stores detected avatars/languages integer i; // loops through detected avatars default{

   touch_start(integer num){ // when touched...
       llSensor("","",AGENT,96,PI); // scan for any avatar within range
   }
   sensor(integer num){ // if one or more avatars are found...
       for(i=0;i<num;i++){ // for each avatar found...
           lD=lD+[llDetectedName(i)+": "+llGetAgentLanguage(llDetectedKey(i))]; // add the name and language to the list
       }
       llSay(0,"\n"+llDumpList2String(lD,"\n")); // say names and their language code over public chat
       llResetScript(); // reset the script for the next use
   }

} </lsl>