Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Find by name in inventory.

kohne Kato
Woo. Yay.
Join date: 4 May 2003
Posts: 109
06-30-2003 12:32
This script looks through the inventory for the first thing with a name matching the user's input. If it finds something, it gives it to the user. If not, it notifies the user.

CODE
integer FoundInventory(string str)
{
integer found=FALSE;
key a=llGetInventoryKey(str);
if (a!=NULL_KEY)
{
found=TRUE;
}
return found;
}

default
{ state_entry()
{
llListen(0,"","","");
}

listen(integer ch, string nm, key id, string m)
{
string low_m=llToLower(m);
if (FoundInventory(m))
{
llGiveInventory(id, llGetInventoryKey(m));
}
else
{
llSay(0,"Sorry. Could not find "+m+" in my inventory. Please check your spelling.");
}
}
}


Code is open source. Gassy Cat Workshop.
Nada Epoch
The Librarian
Join date: 4 Nov 2002
Posts: 1,423
Discussion Thread
04-25-2005 09:11
/54/f6/44204/1.html
_____________________
i've got nothing. ;)
Floyd Gilmour
Registered User
Join date: 5 Jul 2006
Posts: 149
08-28-2006 15:32
Does not work, it never finds the object.