Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

send a folder?

Yamil Dagger
Registered User
Join date: 10 Jul 2007
Posts: 36
03-16-2008 14:03
Hey guys, I sell a very good split profit script on SLX (probably the best to date) but recently people have requested the option to have it send a FOLDER rather then sending something into the objects folder.

What do I need to do to tell it to create a new folder and drop the stuff somebody has bought into it instead?
Haplo Voss
Registered User
Join date: 18 Nov 2006
Posts: 137
03-16-2008 14:22
This is a snippet of a Vendor server I just made for myself and partner. I'm not including the security encryption methods I use for obvious reasons, however this is what you are looking for:

touch_start(integer num)
{
llOwnerSay((string)llGetKey());
i = llGetInventoryNumber(INVENTORY_ALL);
for (x = 0; x<=i; ++x)
{
string current = llGetInventoryName(INVENTORY_ALL, x);
if (current != "" && current != "Vendor Server";)
{
llOwnerSay("Processing inventory item: " + current);
inventory += llGetInventoryName(INVENTORY_ALL, x);
}
}
}
state_entry() {
//llEmail((string)llGetKey() + "@lsl.secondlife.com", "approved", "This is a test message.";); // Send email to self.

llSetTimerEvent(2.5); // Poll for emails. (Yes, that is a retarded way on an event-based system!)
}

timer() {
llGetNextEmail("", "";); // Check for email with any sender address and subject.
}

email(string time, string address, string subj, string message, integer num_left) {
llOwnerSay("You got mail! " + (string)num_left + " more mails.";);
llOwnerSay(llList2CSV([time, address, subj, message]));
message = llDeleteSubString(message, 0, llSubStringIndex(message, "\n\n";) + 1);
if (subj != "" && message == "approved";)
{

buyer = (key)subj;
llOwnerSay("Giving folder to: " + (string)buyer + llKey2Name(buyer));
llGiveInventoryList(buyer, llGetObjectDesc(), inventory);
}
else
{
llInstantMessage(buyer, "Sorry, you are not approved for purchase.";);
}
}
}

What this does is take everything in your inventory, put it in a list, then send it all to a buyer and using llGiveInventoryList forces a new folder to be created in their inventory - which in this case I have named "llGetObjDesc()" as it's simply handy to change the object's description and have it use that as the folder name.

NOTE: THIS IS NOT A SECURE VENDOR TO USE FOR SELLING YOUR ITEMS - I HAVE REMOVED MY PERSONAL ENCRYPTION INFORMATION FOR *MY* PROTECTION