Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

finding the content of a prim

Tarak Voss
Meanderer
Join date: 14 Oct 2006
Posts: 330
06-22-2007 19:06
Is there a scripting way to see if a prim has a notecard and/or Texture in it's content and if so how can you replace it with another?
Osgeld Barmy
Registered User
Join date: 22 Mar 2005
Posts: 3,336
06-22-2007 22:50
http://lslwiki.net/lslwiki/wakka.php?wakka=inventory
Tarak Voss
Meanderer
Join date: 14 Oct 2006
Posts: 330
06-22-2007 23:37
Yep I looked there - always check Wiki first but it didn't make a lot of sense. However I came up with the following which seems to do the trick:

string whattocheck= "";

default
{

touch_start(integer total_number)
{
whattocheck = (llGetInventoryName (INVENTORY_NOTECARD, 0) );

while(whattocheck != "";)
{
llSay(0, "I have removed notecard named " + whattocheck + " from my contents.";);
llRemoveInventory(whattocheck);
whattocheck = (llGetInventoryName (INVENTORY_NOTECARD, 0) );
}

llSay(0, "Please drag and drop your new notecard into the prim";);
}
}