If you need to put multiple copies of the same script in 100+ prims

Data pubblicazione: 21-feb-2009 17.45.55

This is always the case with xytext boards :(

here some useful utility scripts:

// this will give the named script only to prims with numbered name

string sSCRIPT="xytext1.2 Esp";

default

{

state_entry()

{

integer p = llGetNumberOfPrims();

integer i = 0;

for (i = 2; i <= p; i++)

{

key prim = llGetLinkKey(i);

string linkname=llGetLinkName(i);

if( (integer)linkname>10 )

{

llSay(0,"Giving "+sSCRIPT+" to "+linkname);

llGiveInventory(prim, sSCRIPT);

}

}

}

}

Script for autodeleting when called on channel -9999 with a fragment of the name of the inventory to delete:

default

{

link_message(integer sender,integer channel,string data, key id)

{

if(channel=-9999)

{

integer num=llGetInventoryNumber(INVENTORY_ALL);

integer i;

for(i=0;i<num;i++)

{

string name=llGetInventoryName(INVENTORY_ALL,i);

if(llSubStringIndex(name,data)>=0)

{

llRemoveInventory(name);

llSay(0,"Removed inventory element "+name);

}

}

}

}

}

So if you want to update the scripts:

1\ send to -9999 asking to remove xytext script (very fast)

2\ put the new xytext script in the root object

3\ call the first script to give this to every other prims

4\ take the object

5\ rez and set all scripts to running!!! (This can be a bit slow)