// Set up Gloabls for RLV listener event integer channel; integer listener; // Human readable list which is used to translate return from @getoutfit // http://wiki.secondlife.com/wiki/LSL_Protocol/RestrainedLoveAPI#Clothing_and_Attachments list clothingTypes= [ "gloves","jacket","pants","shirt","shoes","skirt","socks","underpants", "undershirt","skin","eyes","hair","shape","alpha","tattoo" ]; removeListener() { if(listener!=0) { llListenRemove(listener); listener=0; } llSetTimerEvent(0.0); } default { state_entry() { listener=0; llOwnerSay("Touch me to find out which clothing types you are wearing."); } touch_start(integer total_number) { // Sink multiple clicks from impatient users if(listener!=0) { llOwnerSay("We are already looking for clothes. Please wait for the scan to finish."); return; } // Set up random channel for listener channel=(integer) (llFrand(100000)+100000); listener=llListen(channel,"",llDetectedKey(0),""); // Set a safety timeout for users without RLV and laggy sims llSetTimerEvent(5.0); llOwnerSay("Scanning for clothes ..."); llOwnerSay("@getoutfit="+(string) channel); } listen(integer channel,string name,key sender,string message) { // We don't need the listener any more, let's be good citizens and clean it up removeListener(); integer index; // Get the length for the loop integer len=llGetListLength(clothingTypes); // And here's the loop, work through the list for(index=0;index