MLPV2 Menu Maker Helper

From Second Life Wiki
Revision as of 06:40, 16 November 2013 by Chaz Longstaff (talk | contribs) (Created page with "<lsl> //won't make your MLP menu for you completely but will save you some typing time //drop in a box of animations that are paired by name logically so that they will appear in…")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

<lsl> //won't make your MLP menu for you completely but will save you some typing time //drop in a box of animations that are paired by name logically so that they will appear in alpha order in an inventory list //it will make an MLP menu giving POSE name to first animation in the set of two //you may need to re-order M and F anims in the pose line //Chaz Longstaff November 2013 // //Sample of what this can produce for you //[05:26] POSE Cuddle 1 M|Cuddle 1 M|Kiss His Neck F //[05:26] POSE Relax Hug1 M|Relax Hug1 M|Sex Neck Kiss 01 F //[05:26] POSE Sex1 M|Sex1 M|Sex1 F //[05:26] POSE Sex1Brut M|Sex1Brut M|Sex1Brut F //[05:26] POSE Sex1BrutFast M|Sex1BrutFast M|Sex1BrutFast F //[05:26] POSE Sex1Fast M|Sex1Fast M|SexLickTit F



mySay(string objectName, string msg) {

   string name = llGetObjectName();
   llSetObjectName(objectName);
   llSay(0, "/me " + msg);
   llSetObjectName(name);

}


list printObjectList(integer type) {

   list       result = [];
   integer    n = llGetInventoryNumber(type);
   integer    i = 0;
   integer count = 0;
   string myitem;
   string myitem1;
   string myitem2;
   integer type;   
   mySay("", "__________________________________________");
   while(i < n) {
           
       string itemName = llGetInventoryName(INVENTORY_ALL, i);
       type = llGetInventoryType(itemName);
           
       if (type != INVENTORY_ANIMATION) {
       jump gonext;
       }
       
       string myitem = llGetInventoryName(type, i);
       if (count == 1) {
           myitem1 = myitem;
       }
       else myitem2 = myitem;
       
       if (count == 2) {
          mySay("","POSE " + myitem1 + "|" + myitem1  + "|" + myitem2 ); 
          count = 0;
          myitem = "";
          myitem1 = "";
          myitem2 = "";
       }
       else {
          count = count + 1;  
       }
       
              
       @gonext;
       


       ++i;
   }
   mySay("", "__________________________________________");
   return result;

}


//__________________________


default {

   on_rez(integer start_param) {
       llResetScript();
   }
   
   
   state_entry() {
   }
   
   
   changed(integer change) {
       if (change & CHANGED_INVENTORY) {
           llResetScript();
       }
   }
   
   touch_start(integer total_number) {
       string tmp = "all";  
       integer type;      
           type = INVENTORY_ALL;

       printObjectList(type);
   }
   


}

</lsl>