pay "through" a script to original author
|
|
Saiir Asturias
Registered User
Join date: 30 Oct 2005
Posts: 1
|
04-09-2007 02:27
Is it possible to pay anyone other than the owner of a scripted object? For example, I, person A, create object X and give it to person B. Then somebody comes along and pays the object, but the money goes to me and not person B.
(I'm not planning anything nefarious, this is another angle on the commission script model, but I want to aggregate commission information on an external site so owners of the objects can track their results and request commission payout via a web site.)
On a related note, an does an object know the key of its owner?
|
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
04-09-2007 02:39
From: Saiir Asturias Is it possible to pay anyone other than the owner of a scripted object? For example, I, person A, create object X and give it to person B. Then somebody comes along and pays the object, but the money goes to me and not person B.
(I'm not planning anything nefarious, this is another angle on the commission script model, but I want to aggregate commission information on an external site so owners of the objects can track their results and request commission payout via a web site.)
On a related note, an does an object know the key of its owner? You answered your own question in most respects. The commission model is how it would work. Object X would request debit permissions from its owner (person B) when rezzed ands then pay person A the money it received when paid. The issue, as you also state, is getting people to trust this as it has far to high a potential for nefarious use. The answer to your second question is llGetOwner().
|
|
Sys Slade
Registered User
Join date: 15 Feb 2007
Posts: 626
|
04-09-2007 04:09
You'd also have to trust those you sell/give it to. By simply choosing no when it asks for debit permission, they take all the money and you get nothing.
|
|
Twisted Pharaoh
if ("hello") {"hey hey";}
Join date: 24 Mar 2007
Posts: 315
|
04-09-2007 04:36
You can have the script break if the debit permission is not set or use llGetCreator() to IM you when a payment occurs.
|
|
Sys Slade
Registered User
Join date: 15 Feb 2007
Posts: 626
|
04-09-2007 04:49
You could break the script, but it wouldn't stop payments going through. If it's something that relies on the script to do something, like a vendor, and it has the creators name all over it, it'll cause a lot of grief for the creator when everyone starts messaging them about items not received. You also can't run the permissions check or IM the creator in a no script area, but payments still go through to the owner. So if it's your name and reputation being used, you really need to have some trust in the people who have this access. If we had some sort of event for derez it'd be a simple matter to reset the object to a default plywood state each time and shape/texture it on rez in a script area. Nobody pays plywood boxes 
|
|
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
|
04-09-2007 05:03
No, you can stop the script accepting payments - you could set all of the pay price boxes to PAY_HIDE with llSetPayPrice so there's no way to actually pay the object, or you could have two states, one a "waiting for debit permissions" state without a money() event, which sends the script to a "debit okay" state which does have a money() event. You'd have to keep the script no-mod obviously. There are a fair number of affiliate programmes out there which do this; they wouldn't operate if it was as simple as refusing debit permission to con the creator  They can also be used for things like charity vendors.
_____________________
http://ordinalmalaprop.com/forum/ - visit Ordinal's Scripting Colloquium for scripting discussion with actual working BBCode!
http://ordinalmalaprop.com/engine/ - An Engine Fit For My Proceeding, my Aethernet Journal
http://www.flickr.com/groups/slgriefbuild/ - Second Life Griefbuild Digest, pictures of horrible ad griefing and land spam, and the naming of names
|
|
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
|
04-09-2007 05:34
Here's a simple example: // Simple affiliate resale script // Sells a single object via pay, and gives a cut to another person. // Checks parameters set. Obviously this needs to be no-mod if you give it // to an affiliate!
// Ordinal Malaprop // 2007-04-09
// Name of the item to be sold // Leave blank to set this to the first object in the vendor's inventory string ITEM = ""; // Item price integer PRICE = 100; // The following is the % cut that the creator gets // Can't be over 100 or less than 0 float PERCENTAGE = 25.0; // If wanting to pay someone apart from the creator, // change this to be a valid key rather than NULL_KEY key CUT_GOES_TO = NULL_KEY;
default { state_entry() { llSetText("", ZERO_VECTOR, 0.0); // If no specific destination, set to creator if (CUT_GOES_TO == NULL_KEY) { CUT_GOES_TO = llGetCreator(); } // Set sale item to the first in inventory if blank if (ITEM == "") { ITEM = llGetInventoryName(INVENTORY_OBJECT, 0); } llOwnerSay("Waiting for debit permission..."); // Check that everything is okay if (PERCENTAGE < 0.0 || PERCENTAGE > 100.0) { // Bad percentage llOwnerSay("Invalid affiliate percentage - " + (string)PERCENTAGE + "% - will not run"); } else if (llGetInventoryType(ITEM) == -1) { // Bad item llOwnerSay("Invalid sale item - " + ITEM + " - will not run"); } else { // If valid, request permissions llRequestPermissions(llGetOwner(), PERMISSION_DEBIT); } }
run_time_permissions(integer perm) { if (perm & PERMISSION_DEBIT) { state ready; } else { llOwnerSay("Debit permission failed"); } }
changed(integer change) { if (change & (CHANGED_OWNER | CHANGED_INVENTORY)) { llResetScript(); } }
on_rez(integer p) { llResetScript(); } }
state ready { state_entry() { llOwnerSay("Ready to sell"); llSetText(ITEM + "\nPay L$" + (string)PRICE, <1.0, 1.0, 0.5>, 1.0); // Only have one quick pay button with the price on it llSetPayPrice(-1, [PRICE, -1, -1, -1]); }
money(key id, integer amount) { if (amount != PRICE) { // Warn and refund if this happens somehow llSay(0, "Wrong price! Please pay " + (string)PRICE); llGiveMoney(id, amount); } else { llSay(0, "Thank you!"); // Give object to customer llGiveInventory(id, ITEM); // Send cut of sale price llGiveMoney(CUT_GOES_TO, llRound(amount * PERCENTAGE / 100.0)); } }
changed(integer change) { if (change & (CHANGED_OWNER | CHANGED_INVENTORY)) { llResetScript(); } }
on_rez(integer p) { llResetScript(); } }
_____________________
http://ordinalmalaprop.com/forum/ - visit Ordinal's Scripting Colloquium for scripting discussion with actual working BBCode!
http://ordinalmalaprop.com/engine/ - An Engine Fit For My Proceeding, my Aethernet Journal
http://www.flickr.com/groups/slgriefbuild/ - Second Life Griefbuild Digest, pictures of horrible ad griefing and land spam, and the naming of names
|
|
Sys Slade
Registered User
Join date: 15 Feb 2007
Posts: 626
|
04-09-2007 05:34
The PAY_HIDE would work in a script enabled area, but not in a no script area. It also wouldn't block payments in the case of a default state with no money event, as llSetPayPrice has no effect in a state without a money event. Denying the debit permission would never switch it to the state with the money event, meaning payments would be accepted but only go to the owner. A simple money(){} in the default state should take care of that though.
Anyway, I'm sure there's ways to get a reasonably safe script for this kind of use (I don't have time to look properly at the moment). The point was that it's wise to get to know your agents before entering any sort of business deal with them. My advice would be the same in RL. If it involves money, cover yourself as much as possible.
|
|
ed44 Gupte
Explorer (Retired)
Join date: 7 Oct 2005
Posts: 638
|
04-09-2007 06:32
Remember that objects cannot hold money. All money is paid straight into the owner's account. Your script can use the money event to pay or do whoever, but it would be from the owner's account and only if the owner has given the object debit permissions.
|