Script to report on who made which animations in a prim

From Second Life Wiki
Revision as of 13:39, 19 December 2011 by Chaz Longstaff (talk | contribs)
Jump to navigation Jump to search

<lsl> //really pretty basic. Just drop script in. Will delete itself at end. //bear in mind that counting starts at 0, so add at the end add 1 in your head to the total key myQuery; integer Anim_Qty; string ObjectName; integer x; key CreatorID;

default {


       state_entry() {
           x = 0;
           Anim_Qty = llGetInventoryNumber(INVENTORY_ANIMATION);
           state animreport;
       }

}


state animreport {

   state_entry() {
   
           ObjectName = llGetInventoryName(INVENTORY_ANIMATION, x);
           llSetText( "[" + (string)x + "] : " + ObjectName + "\n\n\n",<1.0,1.0,1.0>,1.0);
           CreatorID = llGetInventoryCreator(ObjectName);
           myQuery = llRequestAgentData(CreatorID, DATA_NAME);
   }
   
   dataserver(key queryid, string data) {
       if (myQuery == queryid) {
           llSay(0, (string)x + ". " + ObjectName + " : " + data);
           llSetTimerEvent(5); 
           if (x < Anim_Qty) {
               x = x + 1;
               state next;
           }
       } 
   }
   
   timer() {
       llSetText("",<1.0,1.0,1.0>,1.0);
       llSetTimerEvent(0); 
       llRemoveInventory(llGetScriptName());
   }

}


state next {

   state_entry() {
       
       state animreport;
       
   }

}

</lsl>