Jump to content

Application mailbox script question


Maldran Korobase
 Share

You are about to reply to a thread that has been inactive for 4635 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Hello,

 

I'm writing an application drop box thing that will mail off the application to the object's owner when one gets added to the inventory so was wondering if there was a variable that held the recently added item's name or ID or do I just have to get that by using the llGetInventoryNAme()?

 

Thanks!

Link to comment
Share on other sites

The only way to know what was just added to an object's inventory is to have a list of everything that was there before something new was added. Then, when a new item is added, look to see what is there now that wasn't on the list before. Something like....

changed (integer change)  //A change has occurred....{    if(change & CHANGED_INVENTORY) // If it was a change in the inventory ....    {        integer i;        for (i=0;i<llGetInventoryNumber(INVENTORY_ALL);++i)  //Look at every item in inventory ....        {            string temp = llGetInventoryName(INVENTORY_ALL,i);  // .... Get its name....            if (!~llListFindList(gOldList, [temp]) )  // ....If it is not on the global list called gOldList that you created earlier            {                llSay(0, temp+ " has just been added to inventory.");                gOldList += [temp];  // Add the new name to the gOldList so it will be recognized next time this event is triggered                jump out;  // There's no point looking at the other items, so abort the loop            }        }        else  // The change wasn't an addition. It was a subtraction.        {            llSay(0,"Something has just been removed from inventory.");            // We could figure out what, but that's a different problem.        }        @out;  //Here's where you jumped to when you aborted the loop    }}

 

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4635 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...