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

From Second Life Wiki
Jump to: navigation, search
(update script to include license info)
(oops, wrong license info)
 
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.
 
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 text is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States License.
+
// This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License
// http://creativecommons.org/licenses/by-nc-sa/3.0/
+
// http://creativecommons.org/licenses/by-sa/3.0/
// Resale, or other commercial use is prohibited.
+
// 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.
 
// Modification and/or distribution is allowed, as long as attribution for each revision is given, and the same license is used.
 
//
 
//

Latest revision as of 02: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>