De DigiWiki.
// script created by SpiritWolf Chikuwa
// minor changes by Strife Onizuka to speed things up
//
// /!\ PUBLIC DOMAIN /!\
// You can Copy/Mod/Trans
// Please, do not resell this script and give it full perm
// Just please leave this header intact
//
// Minor changes: (insert your name here and delete this comment if you do any mod of this script, thank you)
//
// Script start here:
list gInventoryList;
list getInventoryList()
{
list result = [];
integer n = llGetInventoryNumber(INVENTORY_ALL);
while(n)
result = llGetInventoryName(INVENTORY_ALL, --n) + result;
return result;
}
default
{
state_entry()
{
gInventoryList = getInventoryList();
}
touch_start( integer n )
{
integer i = 0;
string folder = llGetObjectName();
while(i < n)
{
llGiveInventoryList(llDetectedKey(i), folder, gInventoryList );
++i;
}
}
changed( integer change )
{
if ( change == CHANGED_INVENTORY )
gInventoryList = getInventoryList();
}
}
// llGetInventory number and name will scan all objects on the box.
// llGiveInventory will give you the content.
// See also llGetInventory and llGiveInventory on LSL Wiki for further informations.