Jump to content

Script, 3-way partner split in Multi Display board sending everything in contents.


BarbiBi3holes14
 Share

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

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

Recommended Posts

I am new to all this, so I am asking if there is anyone that can maybe assist me, I would appreciate it greatly.  I am just starting out, and I have a store that the landlord takes a 50% split of all sold items.  I and my partner also have a split, so instead of tracking the sales, we decided on a script to make the required divisions.   The landlord provided me a script that does do the split, but when put into a Multi-Display Ad Board, when someone makes a purshase of a particular item, they not only get THAT item they purchased, but EVERYTHING in the Contents!  So, say there is 15 items in the contents of the AD Board, and the customer purchases 1 item, they get that item, and all other items that are for sale, but they should not get ALL the items, just the one they purchased.

I do see in the script that there is 2 places where it says "INVENTORY_ALL", but I'm not sure if that is the problem.  The script DOES work for a single item purchase from a single item AD Poster; i.e. does the 3-way split of the purchase, and delivers the single item in the contents available to purchase. 

I would really love to use this script in the Multi-Boards, as it would reduce my alloted prim usage greatly using Multi-Displays rather than indivdual, single item AD Posters.

Here is the script:

//////////////////////////////////////////////////////////////////////////////////
integer price = 149; // set this to the price you want to sell the object for
string keyforshare1 = "UUID OF FIRST PARTNER SPLIT"; //put the key of person that gets the share here
float cut1 = 0.5; //0.5 = 50% 0.25 = 25% and so on
string keyforshare2 = "UUID OF SECOND PARTNER SPLIT"; //put the key of person that gets the share here
float cut2 = 0.10; //0.5 = 50% 0.25 = 25% and so on
///////////////////////////////////////////////////////////////////////////////////
list inventory = [];

default {
state_entry() {
llRequestPermissions(llGetOwner(),PERMISSION_DEBIT);
llSetPayPrice(-1,[price]);
integer i;
for ( i = 0; i < llGetInventoryNumber(INVENTORY_ALL); i++) {
string item = llGetInventoryName(INVENTORY_ALL, i);

inventory += [item];

}
integer index = llListFindList(inventory, [llGetScriptName()]);
inventory = llDeleteSubList(inventory, index, index);
}

run_time_permissions(integer perm) {
if(perm & PERMISSION_DEBIT) {
state cash;
}
}

}

state cash{
state_entry() {
}

money (key id, integer ammount) {
integer share;
if(keyforshare1!="")
{
share = llRound((float)ammount * cut1);
llGiveMoney((key)keyforshare1, share);
}
if(keyforshare2!="")
{
share = llRound((float)ammount * cut2);
llGiveMoney((key)keyforshare2, share);
}
llGiveInventoryList(id, llGetObjectName(), inventory);
}
}

END OF SCRIPT

I would be much thankful if somebody could perhaps modify this script so that it is only permitting the item purchased to be dispensed, and not the ENTIRE contents of items.

Thanks so much for any assistance.

Barbi

Link to comment
Share on other sites

This is not a question of a simple change. It would be a complete rewrite.

The script will need to see what face of the mesh was touched (assuming that your vendor is a mesh and not multiple prims). Then you need to make the script check, what texture is on the "main" face of the vendor (the face showing the texture of the item that will be sold). Then you need to define a relation between the texture name and the name of the corresponding item that should be given (for example via strided lists).

These are all basic tasks for an experienced scripter, but still a lot of work to explain step by step. I don't think that anyone will do all this work for you for free here. The aim of this forum is to help other scripters who are still learning.

I advice you to look for a "hungry" scripter in the employment forum.

  • Like 1
Link to comment
Share on other sites

Thank you, but you lost me at the first right turn. lol

It seems perhaps a bit more explanation is required.  The Multi-board runs on a notecard, runs through a cycle of pictures of the item when a forward or back arrow is used.  the notecard list 1.. the texture (picture) of the item, 2. the boxed item to that particular picture, and 3. the price of the item.  This script is ALSO in the contents, which is supposed to do teh split once teh purchase is made from the board.

Once the customer finds the item, they right click and select pay from the pie chart.  When they do that, they are supposed to receive JUST that item purchased, but instead, receive the entire number of items, including all textures and boxed items for a single price of the ONE item they're purchasing.

This script works fine in a single item AD POSTER, and splits the sale 3 ways, AND, it also does the split correctly when used in the Multi-display board.  The problem is, inteh Single Poster, there is only the texture (picture) and 1 boxed item, which they do receive, but inthe Multi-board, they receive the entire contents that is in tehboard, not the individula item they purchase.

I had thought that THAT was controlled by the notecard, as to which item is selected for purchase?

The script works fine, in either, but what I am attempting to prevent is the customer receiving all of the contents in the inventory, and just receiving the particular item that they purchase.

Again, I DO see that the script says...

default {
state_entry() {
llRequestPermissions(llGetOwner(),PERMISSION_DEBIT);
llSetPayPrice(-1,[price]);
integer i;
for ( i = 0; i < llGetInventoryNumber(INVENTORY_ALL); i++) {
string item = llGetInventoryName(INVENTORY_ALL, i);

inventory += [item];

In my other single board scripts, where the purchase is only split 2 ways, between my partner and I, this particular area instead says "(INVENTORY_OBJECT)"

I'm assuming that "ALL" means ALL that is in the inventory or the contents of the board?  Is this not able to be altered so that it doesn't say ALL, but OBJECT in some way, without writing an entire script?

Sorry to be such a noob, but I'm pretty much at a loss as to this particular issue.  I've pretty much figured out nost of everything else myself, wiht thehelp of Internet searches and my own intelligence and common sense, but theNet isn't helpful in this particular circumstance.

Thanks for the responses though.  I do appreciate them.

Barbi

 

Link to comment
Share on other sites

is what Xiija and Estelle said

the script you have is written and works as a single item vendor. This script expects that there is only 1 item (and will only ever be 1) in the object Contents

what you wanting (as you perfectly describe in your requirements spec) is a mult-item vendor script. Which Xiija and Estelle mention

you need to get a actual multi-item vendor script. What you have wont do what you want without a total rewrite

Link to comment
Share on other sites

Yes, thank you.  I am posting the original scropt that came WITH the Multi-Vendor board.  I'm sure it is probably a simple addition to the script to take it from a 2-way split to a 3-way one.  Unfortunately, I am not so knowledgeable in scripting to alter this one.  I have done some very simple editing, but have no idea how to do this particular alteration.

Here is the "original" vendor script in its entire form:

//Vendor - Split Income With Partner (Version 3.0)
//Do not remove the following information...

//Originally Coded by Nick Fortune and called Sales Assistance- 09/01/2004
//Updated by Chaiboy Rang - 07/29/2007
//Updated by Chimera Firecaster - 05/01/2010
//Small Revision Chimera Firecaster - 02/19/2011
//Extensive revisions Chimera Firecaster - April, 2014
//
//Information on the 2014 revisions . . .
// - It's easier to enter a price directly in the script rather than
// setting it up in the description of the item, a technique which
// was used in all previous versions of this script.
// - I've also set up the "Pay" dialog box so that it only includes
// the price of the item. In previous versions the customer could
// enter a lower or higher amount. This is less confusing to the
// customer and less chance of errors on the part of the creator
// - I've also included information on Second Life's "Allow Total
// Access" message. It's important to allow access or the partner
// will not receive their share of the proceeds.
// - Another new addition is a check feature. The script checks
// to make sure the UUID is valid and if it is valid, it reports
// back with the unique name (log-in name) of the partner
// - Improved the text of several messages
// - Finally, the script was reformatted in current LSL standards
//
// More information on this scripts and other free Second Life scripts can
// be found on my website at: http://chimerafire.wordpress.com/
//
//General purpose of script:
// This script allows you to sell items and split the profit with a partner.
//
// What you need to do:
//
// 1. Using a "box" prim, flatten it out and make a poster. I'll call this the
// "Vendor Poster." Add a texture which illustrates your product. To the
// contents of the poster, add this script plus your product AND the demo of
// your product.
//
// 2. Look in the "Contents" of the vendor poster, right-click on this script
// and select OPEN. You'll make a couple of modifications. Look for
// "Enter the price of Your Item" (below) Change 111111 to the amount you are
// charging for the product.
//
// 3. You'll also need to enter the name of the item you are selling and the name
// of the demo item. The name must be exactly the same as name in the item's
// "General" tab. The best way to do this is to right click on the item you are
// selling and select "Edit." Look under the "General" tab and copy the "Name" to
// the clipboard. Then paste the name in the appropriate place in the script
// as indicated below. By using copy and paste, you'll be assure the name is
// exactly the same. Do that also for the demo Item.
//
// 4. Two more values are required to appropriately pay your partner's share.
// FIRST, you need to enter your partner's UUID key.
// If you don't know what that is, do a search on web for information
// on how to obtain it. Or you may visit: http://chimerafire.wordpress.com/
// for a free script to obtain an avatar's UUID key.
// SECONDLY, you need to enter the percentage of the total that you are paying
// your partner. The default percentage is 50%. You can make this whatever
// you and your partner have mutually agreed upon. Enter the value as a
// decimal. For example, if you are paying your partner 40%, enter the
// value as .40
//
// 5. Save the script by clicking the "Save" button at the bottom of the script
// editor. When you save it, Second Life will trigger the following message:
// "Warning. [Name of Your Vendor Poster] wants total access to your Linden Dollar
// account. If you allow access, it can remove funds at any time . . . Do not
// allow access if you do not fully understand why it wants access to your
// account." In order for this script to work properly and provide your
// partner with their share, you must click on the "ALLOW TOTAL ACCESS"
// button. What this means is that vendor poster that you have created can remove
// your partner's share each time someone purchases the product. If you
// don't allow access then your partner will never receive any money. and all
// of the money will end up going to you. Since it is the script in the vendor
// poster which is distributing the money, it only does so when you have a sale,
// and you do not have to worry about your account being emptied.
//
// 6. Look in the "General" tab of the vendor poster and make sure that
// "TOUCH DEFAULT" IS turned on AND make sure that "FOR SALE" is NOT checked.
// This will save you several hours of heartache (Can you guess that I spent a
// day dealing with it...yikes, yes!) If you have any Pay settings turned on, the
// script will not work properly, so don't forget to check these settings
//
// 7. Just to make sure everything is ready, do a "Re-set" of the script. You can do
// that by opening the script and clicking on the "Reset" button. You'll get the
// Allow Total Access message again. Be sure to click the "ALLOW TOTAL ACCESS"
// button as explain above or your partner will not receive his or her share.
//
//
//Note: this is a FREE script. It is given generously to the Second Life
// community without the expectation of anything in return. It may be
// distributed, but please do not charge for it. That's bad form and will
// most certainly bring bad karma to those who dishonor the kindness of others.

//-----Do Not Remove Above Header

//INFORMATION THAT YOU NEED TO ADD . . .

// 1. PUT YOUR PARTNER'S KEY IN THE NEXT LINE BETWEEN THE QUOTES: where the x's are your partner's key
key gPartner = "xxx-xxx-xxx-xxxx-xxxxx";

// 2. PUT THE PERCENTAGE YOU WISH TO PAY YOUR PARTNER IN THE NEXT LINE
float gPercent = .50;

// 3. PUT THE PRICE OF THE ITEM IN THE NEXT LINE BY REPLACING 111111 WITH YOUR PRICE
integer gPrice = 149;

///----------------Don't need to change anything below this line-------------------

key gOwner;
integer gCut;
integer gPerms = FALSE;
string gObject;

default
{
state_entry()
{
if (gPartner)
{
llOwnerSay("Your partner's UUID is: "+(string)gPartner);
llOwnerSay("Your partner's name (log-in name) is: " + "secondlife:///app/agent/" + (string)gPartner + "/about");
}
else
{
llOwnerSay("There's a problem. Check your partner's UUID. Second Life is reporting that it is not valid.");
}

gOwner = llGetOwner();
if (gPrice == 111111)
{
llInstantMessage(gOwner, "Ooops! You are missing the price for your item. "+
"Enter the price where indicated in the script, save the script and start again.");
}
else
{
llSetPayPrice(PAY_HIDE, [gPrice, PAY_HIDE, PAY_HIDE, PAY_HIDE]);
if (gPartner != "")
{
gCut = llRound(gPrice * gPercent);
}
gObject = llGetInventoryName(INVENTORY_OBJECT,0);
llRequestPermissions(gOwner,PERMISSION_DEBIT);
}
}

on_rez(integer passed)
{
if(llDetectedKey(0) != llGetOwner())
{
llResetScript();
}
}

run_time_permissions(integer type)
{
if ((type & PERMISSION_DEBIT) != PERMISSION_DEBIT)
{
gPerms = FALSE;
llInstantMessage(gOwner, "The proper permissions have NOT been set. Your partner will NOT "+
"receive his/her percentage. In order for your partner to receive their share, you must "+
"'Allow Access' Re-set the script and choose 'Allow Access'");
llRequestPermissions(gOwner,PERMISSION_DEBIT);
}
else
{
gPerms = TRUE;
llInstantMessage(gOwner, "The proper permissions have been set so that you'll be able to "+
"share the proceeds with your partner.");
if ((gPrice) && (gObject != ""))
{
if (gPartner != "")
{
llInstantMessage(gOwner, "Item being sold: "+gObject+".\nFor the amount of: "+(string)gPrice+"$L. "+
"\nPartner will receive: "+(string)gCut+"$L cut.");
}
else
{
llInstantMessage(gOwner, "Selling "+gObject+" for "+(string)gPrice+"$L. [NO Partner Defined.]");
}
}
else
{
llInstantMessage(gOwner, "I have permissions, but your box is missing contents or missing a price.");
llInstantMessage(gOwner, "Fix error and touch to reset when ready.");
}
}
}

touch_start(integer total_number)
{
if (llDetectedKey(0) == llGetOwner())
{
llResetScript();
}
else
{
llWhisper(0, "If you would like to purchase this item, right click and select PAY.");
}
}

//Note that the test amount < gPrice or amout > gPrice is not necessary since the Pay dialog box
//will only show the correct amount. I've left this in the event you need have
//more price variability
money(key giver, integer amount)
{
if (gPerms == TRUE)
{
if (amount < gPrice)
{
llSay(0, gObject+" costs L$" + (string) gPrice);
llSay(0, "You paid $L"+(string)amount+", which is not enough!");
llGiveMoney(giver, amount);
}
else
{
llSay(0, "Thank you for your purchase!");
llGiveInventory(giver, gObject);

if (amount > gPrice)
{
llGiveMoney(giver, amount - gPrice);
}

if (gPartner != "")
{
llGiveMoney(gPartner, gCut);
}
}
}
}

}

END OF SCRIPT

 

As you can see, this script is designed to work with the board it comes with, and does a 2-way split with a partner, which works fine.  I can set the UUID, the percentage of the split & the price of the outfit, which is then divided per the script.

I'm sure that there is a way to adapt this script and add another UUID for a 3-way split, but again, I am not really that knowledgeable with scripts, as of yet anyways. :0)

My delemma is, with the landlord taking 50% of the sale, which I know is a bit much, if I use this script, which would work, I would then have to keep track of what is sold, and then pay my partner directly the share that they would be entitled to.  Because this is not an actual enterprise to make a living in SL, but more of a hobby that allows me a bit of creativity that I would like to subsidize somewhat with perhaps SOME return on my expenditures.

Thanks so much to everyone who has responded so kindly.  I really do appreciate all of your assistance and input, and am so thankful for anything that perhaps can be done with this.

Much love, peace and joy,

Barbi

 

Link to comment
Share on other sites

this script like the first is a single-item vendor

+

on the website where you got it is a ref to the inworld where you can get a full-perms multi-item vendor

the location has moved to here: http://maps.secondlife.com/secondlife/Gamma/65/107/54

the vendor you want is: Free Multi-Item Vendor Kit. Go in the door. Turn left. On the left-hand side of the front inside wall. 2nd from top. Has a orange shoe on the piccy. (The single-item vendors are on the right-hand side. You dont want them)

get it going as-is. Afte you comfortable with how it works then come back on here ok. And we be able to help you mod it to a 3-way partnership if you get stuck

+

ps.

the lady who is providing this vendor kit asks that if you do use it then would be nice if can add her shop to your Profile Picks. That would be the nice thing to do

Link to comment
Share on other sites

My thanks for the tip, Iri, but that's where this script is from. :0)

I did actually go there, found on her on the net, and I did get both kits, the single board AND the multi item vendor kit.  Obviously, the single item board works fine, but seems a bit large for my tastes AND the store.  It takes up a lot of room and limits how much can be displayed on the walls.

The multi-vendor/item board also works fine, I even have her partner split script.  The problem is.... neither works in teh multi-item board.  The 2-way, and even the 3-way that I do have works fine for a single item board sale, but it doesn't work for a multi-item board.  Once an item is purchased, the script DOES split the sale, 2 and even 3 ways, but the problem is it also allows the purchaser to obtain ALL items in the multi board, not JUST the one they purchased.

In effect, what that does is allow the purchase, say of a L$99 "SINGLE" outfit, but if there is 15 different outfits in the board, the purchaser receives ALL 15 outfits, NOT JUST the one they purchased!  The amount is still split as the script dictates, but I loose the sales of the other 14 outfits, because the person making the purchase of only 1 outfit, receives ALL 15 of them!

That is the delemma here.  I'm thinking that there is no way to split a sale with a partner or even 2, using a multi-item sales board.  And, being a small boutique store, there is not enough room to hang 200 "single" item posters to do what the multi boards do for much less prims!  I could put, not saying it's intelligent, say 200 outfits, that's 200 prims, 1 for each single ad poster, in a multi board that is only 5 prims.

I don't see any type of script that is available for use in a multi-vendor board that could differentiate the sale of just 1 item, other that just putting ONE item in the multi board, which does kind of defeats the PURPOSE of a "multi board"!  :0)

For the scripters here, that might be something to consider working on.. just a thought. ☺  I'm sure I'm NOT the only person that has had this situation come up, and I believe that there may just be a lucrative market for such a script... if one could actually get one that worked!   Again.. just saying.  ☺☺☺

So, thank you for all the help and suggestions, I really so appreciate your generousity in taking the time and all your responses.

Have a great wonderful life with peace and joy... and love.

Cordially,

Barbi

GB Styles

Link to comment
Share on other sites

I guess I don't understand the problem.  Right now you are calculating a L$ cut at the top of the script and applying it to each sale.  What you really want to do is apply a percentage cut at the time of sale, so do the calculation there.  That way, whether your vendor is a single-item or multi-item vendor, you simply enter your list of item prices once.  The customer pays the sale price, the script calculates the L$ from it and distributes it to you and your partner.  If you decide to change the percentage cut, you only have to change that one number.

Link to comment
Share on other sites

like Rolig says, is a bit difficult to know what you mean when say it doesnt work. What are the steps you are taking to make it work?

like are you just replacing the script in the multi-item vendor with the script from the single-item vendor? bc if you are then is not going to do what you want

+

you have to mod the money event of the multi-item vendor script (like Rolig is also saying) to do the actual partnership money split. The multi-item vendor kit script does multi-items as-is but dont do partnership money splits

modding it to do this has been left to the intending user to do by the lady provider. She have provided the partnership money split code in the single-item vendor script. You have to combine the functionality of both these scripts to make exactly what you want

this is the money event code (copypasta here from the actual Multi-Item Vendor Script)

 

   money(key id, integer amount)    {        if( amount>=price )        {            llGiveInventory(id,itemName);            llSay(0,"Thanks for your purchase!");        }    }

 

look at how the money event is coded in the first script you posted. See if you can mod/merge that money event code (and the dependencies [global vars and permissions] ) with this multi-item vendor money event code

+

when do this then you will have exactly what you want. A multi-item vendor that does a 3-way partnership spit on each purchase. And the buyer only gets the 1 item they purchased

+

ps. i just add on here something

bc this is a vendor you wanting then is seen (at least by me) as a commercial thingy you wanting. Might only be that you hoping to get only a little money of it but is still commercial

so I am happy to help you generally but I am not going to actual write the mod and post here. You have to have a go at it yourself. If do that and get stuck and you done most of it but it dont work bc bug then can help you with that part ok

but if is all beyond you at this stage of your LSL journey then bc commercial then suggest you put a addy in the Wanted forums for help. bc starving LSL artists in cold garrets with no coal or bread or warm mittens even (:

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3370 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...