Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Script for boxed object and lazy buyers (automatic object directory creation)

Kyrah Abattoir
cruelty delight
Join date: 4 Jun 2004
Posts: 2,786
02-03-2005 07:37
i did this lil script for my vendor, when i sell items in boxes.

CODE
list populate()
{
integer i;
integer j;
list objects;
list types = [INVENTORY_TEXTURE,INVENTORY_SOUND,
INVENTORY_OBJECT,INVENTORY_SCRIPT,
INVENTORY_LANDMARK,INVENTORY_CLOTHING,
INVENTORY_BODYPART,INVENTORY_NOTECARD,
INVENTORY_ANIMATION,INVENTORY_GESTURE];
for (j = 0;j < llGetListLength(types);j++)
{
if (llGetInventoryNumber(llList2String(type,j)) > 0)
{
for (i = 0;i < llGetInventoryNumber(llList2String(type,j));i++)
objects += [llGetInventoryName(llList2String(type,j),i)];
}
}
return objects;
}

default
{
on_rez(integer param)
{
llWhisper(0,"Click me to get your items");
}
touch_start(integer total)
{
if (llDetectedKey(0) == llGetOwner())
{
llGiveInventoryList(llGetOwner(),llGetObjectName(),populate());
llDie(); //optional
}
}
}


now this one for objects you sell it give each object one by one:

CODE

default
{
on_rez(integer param)
{
llWhisper(0,"Click me to get your items");
}
touch_start(integer total)
{
if (llDetectedKey(0) == llGetOwner())
{
integer i;
integer j;
list objects;
list types = [INVENTORY_TEXTURE,INVENTORY_SOUND,
INVENTORY_OBJECT,INVENTORY_SCRIPT,
INVENTORY_LANDMARK,INVENTORY_CLOTHING,
INVENTORY_BODYPART,INVENTORY_NOTECARD,
INVENTORY_ANIMATION,INVENTORY_GESTURE];

for (j = 0;j < llGetListLength(types);j++)
{
if (llGetInventoryNumber(llList2String(type,j)) > 0)
{
for (i = 0;i < llGetInventoryNumber(llList2String(type,j));i++)
objects += [llGetInventoryName(llList2String(type,j),i)];
}
}
for(i=0;i < llGetListLength(objects);i++)
llGiveInventory(llGetOwner(),llList2String(objects,i);
}

}
}
_____________________

tired of XStreetSL? try those!
apez http://tinyurl.com/yfm9d5b
metalife http://tinyurl.com/yzm3yvw
metaverse exchange http://tinyurl.com/yzh7j4a
slapt http://tinyurl.com/yfqah9u
Toneless Tomba
(Insert Witty Title Here)
Join date: 13 Oct 2004
Posts: 241
02-03-2005 11:20
You may want to note this only works for items you have full copy permissions . This is due to llGiveInventoryList(), it's been suggested a couple times in the forums to be fixed.
Kyrah Abattoir
cruelty delight
Join date: 4 Jun 2004
Posts: 2,786
02-04-2005 01:55
o god i have missed this... so you actually cannot give a list of nocopy objects???
_____________________

tired of XStreetSL? try those!
apez http://tinyurl.com/yfm9d5b
metalife http://tinyurl.com/yzm3yvw
metaverse exchange http://tinyurl.com/yzh7j4a
slapt http://tinyurl.com/yfqah9u
Toneless Tomba
(Insert Witty Title Here)
Join date: 13 Oct 2004
Posts: 241
02-07-2005 07:18
From: Kyrah Abattoir
o god i have missed this... so you actually cannot give a list of nocopy objects???


True, but you should be fine with your vendor because the items you created, you the creator have fully copy permissions. But if it was a gift box that was transfered to someone else with this script then yeah you can run into problems.