Difference between revisions of "UnPackerAll"
Jump to navigation
Jump to search
m (lsl code tagging) |
m (<lsl> tag to <source>) |
||
Line 2: | Line 2: | ||
=====Will Unpack all items of a box===== | =====Will Unpack all items of a box===== | ||
< | <source lang="lsl2"> | ||
// script created by SpiritWolf Chikuwa | // script created by SpiritWolf Chikuwa | ||
// | // | ||
Line 58: | Line 58: | ||
// llGiveInventory will give you the content. | // llGiveInventory will give you the content. | ||
// See also llGetInventory and llGiveInventory on LSL Wiki for further informations. | // See also llGetInventory and llGiveInventory on LSL Wiki for further informations. | ||
</ | </source> | ||
[[Category:LSL Examples]] | [[Category:LSL Examples]] |
Latest revision as of 17:12, 24 January 2015
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Will Unpack all items of a box
// script created by SpiritWolf Chikuwa
//
// /!\ 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()
{
integer i;
integer n = llGetInventoryNumber(INVENTORY_ALL);
list result = [];
for( i = 0; i < n; i++ )
{
result += [ llGetInventoryName(INVENTORY_ALL, i) ];
}
return result;
}
default
{
state_entry()
{
gInventoryList = getInventoryList();
}
touch_start( integer n )
{
integer i;
for( i = 0; i < n; i++ )
{
llGiveInventoryList(llDetectedKey(i), llGetObjectName(), gInventoryList );
}
}
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.