Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Give all inventory but one, using llGiveInventory?

Okiphia Anatine
Okiphia Rayna
Join date: 22 Nov 2007
Posts: 454
01-01-2008 01:33
Okies..so.. I have a 'diary' that Iw ish to be made public, essentially people can just read it if they like.
I've figured out how to make it so that I can add new notecard entries whenever I want, and have it still give every entry, without having to edit the script to add a new llGiveInventory line. I normally just use multiple lines if there are multiple notecards, since I rarely add to things like this.

However, this time I'll be adding to it often, and don't want to fuss about with the script every time I do. But with the script
CODE

default
{
state_entry()
{
llGiveInventory(llDetectedKey(0),llGetInventoryName(INVENTORY_ALL, 0));
}
}

it still gives the giver script itself, which I don't want to do.

Is there any way to define a variable to be exluded from the llGiveInventory?

I've tried just defining the string 'scriptname', and adding '-sriptname' to the end of it in a last ditch effort, but that of course didn't work.

Any ideas?

EDIT:: No idea why its adding a big space between the m and e of llGiveInventory Name...mabe I'm the only one seeing it...
Okiphia Anatine
Okiphia Rayna
Join date: 22 Nov 2007
Posts: 454
01-01-2008 01:45
also..i've just realized.. I think that that only gives one item.. XD

Edit:: YEah, me being stupid..working on llGiveInventoryList.. sorry!
Talon Brown
Slacker Punk
Join date: 17 May 2006
Posts: 352
01-01-2008 03:22
If you still need help with the first question and you're only giving notecards, replace INVENTORY_ALL with INVENTORY_NOTECARD which will restrict it to just notecards.
Okiphia Anatine
Okiphia Rayna
Join date: 22 Nov 2007
Posts: 454
01-01-2008 03:24
From: Talon Brown
If you still need help with the first question and you're only giving notecards, replace INVENTORY_ALL with INVENTORY_NOTECARD which will restrict it to just notecards.

oh yeah ;) thankies lol


OK so.. used the wiki example for llGiveInventoryList and modified it a little.. wondering if I made any mistakes.it seems like it should be able to be so much simpler...here it is

CODE

default
{
on_rez(integer nevermind)
{
llSetText("Touch me to unpack\nyour new "+llGetObjectName()+".",<1,1,1>,1.0);
}
touch_start(integer total_number)
{
// give all items in a prim to the owner, as folder (with the name of the prim)
// Ezhar Fairlight <efairlight@gmail.com>

// user-friendly additions by Mechanique Thirty (egypt@urnash.com)
// Script adjusted to run faster by Strife Onizuka.

list inventory;
string name;
integer num = llGetInventoryNumber(INVENTORY_ALL);
string text = llGetObjectName() + " is giving it's contents\n";
integer i;
key user = llDetectedKey(0);//Set to llDetectedKey(0); to allow anyone to use

for (i = 0; i < num; ++i) {
name = llGetInventoryName(INVENTORY_ALL, i);
if(llGetInventoryPermMask(name, MASK_OWNER) & PERM_COPY)
inventory += name;
else
llSetText("The Diary of Okiphia Rayna\nClick to Recieve", <.2, .7, .2>, 1.0);
}

//chew off the end off the text message.
text = llGetObjectName();

//we don't want to give them this script
i = llListFindList(inventory, [llGetScriptName()]);
if(~i)//if this script isn't found then we shouldn't try and remove it
inventory = llDeleteSubList(inventory, i, i);

if (llGetListLength(inventory) < 1) llSay(0, "No items to offer."); else
{
llGiveInventoryList(user, text, inventory);
llSetText("The Diary of Okiphia Rayna\nClick to Recieve",<.2,.7,.2>,1);
name = "Your new "+ text +" can be found in your inventory, in a folder called '"+ text +"'. Drag it onto your avatar to wear it!";
if(user == llGetOwner());
}
}
}