User:Tribal Toland/slaves

From Second Life Wiki
< User:Tribal Toland
Revision as of 09:24, 4 December 2007 by Tribal Toland (talk | contribs) (New page: == Slave Scripts !! == In general these are used fairly often. First, we get the amount of slaves that are in the object: get_slaves() { slaveCount = 0; integer i = 0; in...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Slave Scripts !!

In general these are used fairly often.

First, we get the amount of slaves that are in the object:

get_slaves()
{
   slaveCount = 0;
   integer i = 0;
   integer num = llGetInventoryNumber(INVENTORY_SCRIPT);
   do
   {
       string name = llGetInventoryName(INVENTORY_SCRIPT,i);
       if(llSubStringIndex(llToLower(name),"slave") == 0)
       {
           ++slaveCount;
       }
       ++i;
   }  
   while(i < num);
   llOwnerSay("Number of slaves: "+(string)slaveCount);
}