Jump to content

llGetInventoryNumber( INVENTORY_ALL ) - 2?


SeeAirAhh Josephina
 Share

You are about to reply to a thread that has been inactive for 1271 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Better formatted would be:

integer total_inv = llGetInventoryNumber(INVENTORY_ALL);
integer new_number = total_inv - 2;

Alternatively assuming you want to exclude something specific from your count you could do:
integer i;
integer count = 0;
for(i = 0; i < total_inv ; i++){
   string inv_name = llGetInventoryName(INVENTORY_ALL, i); 
   if(inv_name != "blabla" && inv_name != "somename"){
      count++;
   }
}
llSay(0, (string)count);

Link to comment
Share on other sites

It  really depends on the use-case. Looping through all the items in the prims inventory and checking them against multiple strings might be unnecessarily wasteful if you've already somehow confirmed the existence of those two things earlier in the code.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1271 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...