Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Discussion: 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.

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

{ state_entry()

listen(integer ch, string nm, key id, string m)
string low_m=llToLower(m);
if (FoundInventory(m))
llGiveInventory(id, llGetInventoryKey(m));
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
Original Thread
04-25-2005 09:11
i've got nothing. ;)