Jump to content
Sunbleached

No copy items unpacker to folder

Recommended Posts

Hello! I'm trying to create an unpacker script for gacha (no copy items). is there any way to make the content appear in the folder and not in the objects? while it gives out just objects one by one.

string START_TEXT = "Touch To Unpack"; // Text on rez
string END_TEXT = "Item Is In Your Inventory"; // Text on completion
string OPEN_SOUND = "6f61a589-b000-b685-d198-8c50d35dc926"; // Opening sound UUID

default
{
    state_entry()
    {
        llSetMemoryLimit(llGetUsedMemory()+1024);
        llSetText(START_TEXT, <1.0,1.0,1.0>, 1);
    }
    touch_start(integer n)
    {
        if(llDetectedKey(0)==llGetOwner()) // Detect owner
        {
        for (n--;n>=0;n--)
        {
            integer j=llGetInventoryNumber(INVENTORY_ALL);
            for (j--;j>=0;j--)
            {
                string name=llGetInventoryName(INVENTORY_ALL,j);
                if (llGetInventoryType(name)!=INVENTORY_SCRIPT)
                {
                    llGiveInventory(llDetectedKey(n),name);
                    llTriggerSound(OPEN_SOUND, 1.0);
                    llSetText(END_TEXT, <1.0,1.0,1.0>, 1);
                    llRemoveInventory(llGetScriptName()); // Script self-delete
                }
            }
        }
        }
    }
}

 

Share this post


Link to post
Share on other sites

Serious question: Does it need to be a scripted unpacker? Were I to resell no-copy items, I'd just put it into a box and set the box to give contents on click. Then attach it as a HUD and position it to set that option. Now it works when rezzed or worn as a HUD and will create a folder named the same as the box name, and all inventory will go into that folder with a notice that no-copy items will be moved.

I'm just wondering, because it seems to me that unpacker scripts are a solution to non-existant problem. :)

If you are trying to do something special (like creating multiple inventory folders, etc.,) then I do understand. That requires scripting.

Edited by Alyona Su
  • Like 1

Share this post


Link to post
Share on other sites
5 hours ago, Sunbleached said:

Hello! I'm trying to create an unpacker script for gacha (no copy items). is there any way to make the content appear in the folder and not in the objects? while it gives out just objects one by one.

 

Can't be done.

I have created an inventory archive system using boxes, which will give you back your items on touch. I have everything given to a folder, but no copy items will be given one item at a time and can only arrive in the system folders which correspond to their type. This is the ONLY way no copy items can be transferred from a prim's inventory into your own.

A trick that I use is to have the script send a full-perm placeholder notecard to a folder with the name of the box, then have people look in their recent files and move all new items which did NOT arrive in that folder, over so that all the items are where they belong.

I would not have done this, if it weren't for the fact that I wanted to store some of my old outfits which for some reason came with mixed perms.

  • Thanks 1

Share this post


Link to post
Share on other sites
On 12/18/2019 at 8:20 AM, Alyona Su said:

Serious question: Does it need to be a scripted unpacker? Were I to resell no-copy items, I'd just put it into a box and set the box to give contents on click. Then attach it as a HUD and position it to set that option. Now it works when rezzed or worn as a HUD and will create a folder named the same as the box name, and all inventory will go into that folder with a notice that no-copy items will be moved.

I'm just wondering, because it seems to me that unpacker scripts are a solution to non-existant problem. :)

If you are trying to do something special (like creating multiple inventory folders, etc.,) then I do understand. That requires scripting.

I thought attachments (even huds) couldn't be opened that way? I will have to test that

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...