Skip to content

Free Second Life Scripts: Vendor Split Revenues With Partner (Version 2)

This is a free script for Second Life.

Note that I have an update of this script.  I have, however, retained this version if you have used  (or wish to use) the “General” tab for indicating the price.  Before I explain what that means, let me say one thing about how the scrips are named.

To keep the two scripts separate, I’m calling this script version 2 – and the new script is called version 3.  Information on the version 3 script is found here:  Vendor Split Revenues Version 3.

In Version 2 (this version), the script will read the price from the “Description” of the item that you are selling.  More details are found in the script notes, below, but basically, you right click on the item you are selling and select “Edit.”  When the Edit dialog box opens, you’ll format the “Description”  (found just below the item’s name) to read “Price$ Name-of-Item”.  For example, the Description might read: 425$ Mesh Shirt.

I found the “Description” method to be a bit time consuming, and, in Version 3, I changed that so that you just enter the price of the item directly on the script.  Additionally, I made a number of other improvements.

So you have your choice: version 2 or version 3.  The information below is all about version 2.

This script is quite useful if you are selling items and you would like to split part of the revenues with a partner.  For example, let’s say that a friend of yours allows you to put up some vendor signs in their dance club.   In return, you agree to pay her or him 40% of the revenues that you collect.  This script will allow you to do that.

Most of the work on this script was done by Nick Fortune.  Nick had it set up so that the revenues were split 50 – 50.  I added more flexibility to the script, allowing you the ability to change split to whatever you and your partner had worked out.   For example, you can pay a 75 -25 split or a 80 – 20 split, etc.  It’s just a matter of indicating the percentage that you will be paying your partner.

I’ve set things up to make this really easy for you.  I’ve created a generic vendor poster object with the script in place.  All you need to do is add your own image to the poster.  (In other words, you’ll be adding an image of the item that you are selling. )  Then you need to make a couple adjustments in the vendor poster object and the script (as described in more detail below.  The free package also includes an object which will give you the UUID of your partner.   So stop over at my store and look for the following display:

(I have some directions on my website on how to use the Vendor Kit, above.  You’ll find them here: Vendor Kit – Sharing Revenues.  The discussion below is focused on the script and how to use it.)

Let’s look at the details.  One thing that you’ll need to know to use this script is your partner’s UUID key.  That’s a unique number that all Second Life avatars are assigned.  If you don’t know what the UUID key is, I have free tool at my store that you can use.   Or, you can make one yourself.  You’ll find the script and information here.

One of the things about this script which shows some real foresight on Nick’s part is its simplicity.  You don’t have to make any changes to the script after you plug in your partner’s UUID key (and percentage) and save it.  When it comes to telling the script how much something costs, you do that in the “Description” of your vendor poster.  (More details on this feature are found in the script below.) That makes it much easier to prepare a series of posters for partner sharing.  I’ve tried various “Notecard” methods, and this one is by far the easiest to use.

The free package is available at my store.  I only ask for one small favor.  While you are at my store, I would be grateful if you added the store to your “Picks.”  (If you’ve never added a store to your picks, here how to do it in two illustrations:  Adding a Pick )

Stop by my store (Chimera’s Simple Elegance) for the free package that has all the proper settings and is ready to be used.  If you’d like to put things together yourself, I’ve also reproduced the script for your use below.

Be sure to copy everything between the two lines.  Script follows . . .

_____________________________

//Sales Assistant v1.3
//Do not remove the following information...

//Originally Coded by Nick Fortune - 09/01/2004
//Updated by Chaiboy Rang - 07/29/2007
//Updated by Chimera Firecaster - 05/01/2010
//Small Revision Chimera Firecaster - 02/19/2011
//This script allows you to sell items and split the profit with a partner.  

//To use this script, you'll need to do the following:
//  1. Make a Vendor Sign with an image of the item(s) you are selling.
//  2. Rez a box and place the item or items being sold in the "Contents" of
//     the box.  
//  3. Take the box back into your inventory.
//  4. Then drag the box out of your inventory and place it in "Contents
//  5. Along with the box, place a copy of this script in the "Contents" of
//     the Vendor Sign.

// Note that you need to remove the checkmark from "For Sale."  Otherwise, you'll
//  you'll end up with both a "Buy" and "Pay" button.  "Buy" won't work, and
//  by removing the checkmark, you take care of that problem.

 //The script obtains the price of the item from the Vendor Sign's DESCRIPTION
//  Remember that DESCRIPTION is found in the GENERAL tab along with the NAME
//  that you assigned to the Vendor Sign (if any).

//Here's an example of how you want the DESCRIPTION to read:
//   100$ Men's Plaid Boxer Shorts

//The script will read the price from the DESCRIPTION, as long as you have
//   formatted it as follows: "Price$ Name-of-Item".  The dollar sign ($)
//   must be there for the script to work properly.  Note that the Name-of-Item
//   which follows Price$ is not important to the script.  That part of the
//   description can be anything that you. What's important is Price$.

//In addition to indicating the price in the description, you need to enter
//   two values below.  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: https://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

//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: where the x's are your partner's key
key gPartner = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; 

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

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

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

default {
 state_entry() {
 llWhisper(0, (string)gPartner);
 gOwner = llGetOwner();
 list Parsed = llParseString2List(llGetObjectDesc(), ["$"], []);
 gPrice = llList2Integer(Parsed, 0);
 if (!gPrice) {
 llInstantMessage(gOwner, "Error:  Please set object description to ''price$ info about object. This only sells a object so please put clothing,r bodyparts or multiple items in a bag or box. ''.  Touch to reset when ready.");
 }
 else {
 llSetPayPrice(gPrice, [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, "I require debit permissions to function.");
 llRequestPermissions(gOwner,PERMISSION_DEBIT);
 }
 else {
 gPerms = TRUE;
 llInstantMessage(gOwner, "I have aquired debit permissions from "+llKey2Name(gOwner)+".");
 if ((gPrice) && (gObject != "")) {
 if (gPartner != "") {
 llInstantMessage(gOwner, "Selling "+gObject+" for "+(string)gPrice+"$L. [Partner receives "+(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, gObject+" - $"+(string)gPrice+"L.  Right click and pay amount to purchase.");
 }
 }

 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);
 }
 }
 }
 }
}
_________________________________
%d bloggers like this: