Difference between revisions of "Talk:LlRemoveInventory"

From Second Life Wiki
Jump to navigation Jump to search
(New page: how much does the script sleep? how much does a deletion take if I must delete several inventory objects?)
 
Line 1: Line 1:
how much does the script sleep?
how much does the script sleep?
how much does a deletion take if I must delete several inventory objects?
how much does a deletion take if I must delete several inventory objects?
== removing inventory can be laggy like Schroedingers Cat. ==
//I think if you remove an inventory item via llRemoveInventory(name) within procedure b() and then try to remove an item of the same name by using procedure b() again, that procedure can actually PASS its build-in if(llGetInventoryType(n)!=-1){} condition and try to remove the item again, when the item does not exist anymore and should not have passed that condition in the first place, because the same procedure removed the item earlier.
//procedure b() is this:
removeinv(string name)
{
    if(llGetInventoryType(n)!=-1){
        llOwnerSay(name+" has an inventory type, therefore it exists. killing it with fire");
        llRemoveInventory(name);
        llOwnerSay(name+" should be dead by now);
    }
}
//but that may depend on how rapidly and under what conditions b() is triggered. (maybe when its triggered twice within CHANGED_INVENTORY matters)
//whatever, it seems to fail too often to ckeck if the item exists before deleting it. It may have been deleted by other means.

Revision as of 20:19, 24 December 2008

how much does the script sleep? how much does a deletion take if I must delete several inventory objects?

removing inventory can be laggy like Schroedingers Cat.

//I think if you remove an inventory item via llRemoveInventory(name) within procedure b() and then try to remove an item of the same name by using procedure b() again, that procedure can actually PASS its build-in if(llGetInventoryType(n)!=-1){} condition and try to remove the item again, when the item does not exist anymore and should not have passed that condition in the first place, because the same procedure removed the item earlier. //procedure b() is this:


removeinv(string name) {

   if(llGetInventoryType(n)!=-1){
       llOwnerSay(name+" has an inventory type, therefore it exists. killing it with fire");
       llRemoveInventory(name);
       llOwnerSay(name+" should be dead by now);
   }

}

//but that may depend on how rapidly and under what conditions b() is triggered. (maybe when its triggered twice within CHANGED_INVENTORY matters) //whatever, it seems to fail too often to ckeck if the item exists before deleting it. It may have been deleted by other means.