User:Cow Taurog/Language scanner

From Second Life Wiki
< User:Cow Taurog
Revision as of 02:46, 17 August 2011 by Cow Taurog (talk | contribs) (update script to include license info)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Announces any nearby avatar, and their ISO 639-1 language code. <lsl> // This text is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States License. // http://creativecommons.org/licenses/by-nc-sa/3.0/ // Resale, or other commercial use is prohibited. // 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>