It is supposed to delete all scripts in a prim, then delete itself.
What it does is delete 4, then stop. When it reaches i=4, the length of the name is 0 and it exits the loop and kills itself. The trace prints say what I expect except the scripts it does delete are not in alpha order [llGetInventoryName, says it should return in alpha order not that I care]
Leaving 2 scripts.
Anybody have a clue what I've messed up, debug trace at end of post
================================================
default
{
state_entry
{
integer i;
string name;
string ServerScript;
integer NameSize = 1;
ServerScript = llGetScriptName();
llSay(0, "Script name = "+ServerScript);
for (i=0;NameSize > 0; i++)
{
name = llGetInventoryName(INVENTORY_SCRIPT, i);
NameSize = llStringLength(name);
llSay(0," Index = "+(string)i+" Size = "+(string)NameSize);
if ((llStringLength(name) > 0) && (name != ServerScript))
{
llSay(0, "Deleting Script = "+name);
llRemoveInventory(name);
}
}
llSay(UpdateChan, "Purged"
;llRemoveInventory("Purge"
;}
}
=========================================
Script name = Purge
Index = 0 Size = 16
Deleting Script = AvController 4.1
Index = 1 Size = 21
Deleting Script = AvScannerDomestic 4.0
Index = 2 Size = 16
Deleting Script = Configurator 4.1
Index = 3 Size = 17
Deleting Script = Show Coverage 2.0
Index = 4 Size = 0