pre-controll of correct pay amount
|
|
Abraxes Binder
Registered User
Join date: 23 May 2008
Posts: 205
|
06-03-2009 07:45
Hi, i am somehwat surprized over the functionality of the 'money' method. I have this litle snip money(key buyerId, integer amount) { if( amount==pris) { llSay(0,"Thanks for your purchase!"); llGiveInventory(buyerId,llGetInventoryName(INVENTORY_OBJECT, 0));//only one item in box //: } else //impecit: no purchase llSay(0,"please pay precisely the amount of Lindens "+(string)pris); } }
so i can incapsulate the 'give purchase' part, but the buyer still transfer the incorrect amount- Is it somehow posible to avoid the money transfer if the pay is incorrect or is the only way that STUPID repay hack (eg llGiveMoney() ) i have seen.. bad and prone to exploids i think.. :/ also, when an object is maked for resale it is posible to set the default touch to 'pay'. This makes a nice litle popup that shows all the content in the bundle. Is that posible to invoke by script? tyia. Ab
_____________________
BR ab
|
|
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
|
06-03-2009 07:56
From: Abraxes Binder Is it somehow posible to avoid the money transfer if the pay is incorrect or is the only way that STUPID repay hack (eg llGiveMoney() ) i have seen.. bad and prone to exploids i think.. :/
There is no way the script can know how much is paid before it is paid. You can make it easy on the customer if you make her choose from one price only: llSetPayPrice( PAY_HIDE, [ TheOnePrice, PAY_HIDE, PAY_HIDE, PAY_HIDE ]); This way you can avoid payback but you still have to check what is paid to decide if the customer shall be given the item. From: Abraxes Binder also, when an object is maked for resale it is posible to set the default touch to 'pay'. This makes a nice litle popup that shows all the content in the bundle. Is that posible to invoke by script?
llSetClickAction( CLICK_ACTION_PAY ); will set it to 'Pay on click'
_____________________
From Studio Dora
|
|
Sindy Tsure
Will script for shoes
Join date: 18 Sep 2006
Posts: 4,103
|
06-03-2009 07:59
You can use http://wiki.secondlife.com/wiki/LlSetPayPrice to force only a certain set of values to be paid. I don't think I've ever used this but I know it works.. Just my personal preference, I truly hate the touch-to-pay things. Always clicking on them by mistake and if it's a no-mod object being bought, the buyer can never turn it off.
_____________________
Sick of sims locking up every time somebody TPs in? Vote for SVC-3895!!! - Go here: https://jira.secondlife.com/browse/SVC-3895- If you see "if you were logged in.." on the left, click it and log in - Click the "Vote for it" link on the left
|
|
Sindy Tsure
Will script for shoes
Join date: 18 Sep 2006
Posts: 4,103
|
06-03-2009 08:01
From: Dora Gustafson There is now way the script can know how much is paid before it is paid Oh??? Do tell!! That'd be very nice...
_____________________
Sick of sims locking up every time somebody TPs in? Vote for SVC-3895!!! - Go here: https://jira.secondlife.com/browse/SVC-3895- If you see "if you were logged in.." on the left, click it and log in - Click the "Vote for it" link on the left
|
|
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
|
06-03-2009 08:06
From: Sindy Tsure Oh??? Do tell!! That'd be very nice... silly old keyboard  it is edited now
_____________________
From Studio Dora
|
|
RobbyRacoon Olmstead
Red warrior is hungry!
Join date: 20 Sep 2006
Posts: 1,821
|
06-03-2009 08:32
Keep in mind that there is no way to force a person to pay the correct amount. You can set the pay price in such a way (using llSetPayPrice as noted above) that the official viewer only displays that amount, but that's a user interface nicety only and does not enforce the correct price. Custom viewers can certainly remove that restriction (and have, in the past) so that the user can manually enter any amount, so if you care about getting the full purchase price, you must still verify the amount paid. Of course, if the user pays less than the purchase price despite having used llSetPayPrice, in other words trying to rip you off with a custom viewer, then you could always keep their money and not use llGiveMoney to give a refund .
|
|
Sindy Tsure
Will script for shoes
Join date: 18 Sep 2006
Posts: 4,103
|
06-03-2009 08:45
From: Dora Gustafson silly old keyboard  it is edited now Drat!
_____________________
Sick of sims locking up every time somebody TPs in? Vote for SVC-3895!!! - Go here: https://jira.secondlife.com/browse/SVC-3895- If you see "if you were logged in.." on the left, click it and log in - Click the "Vote for it" link on the left
|
|
Escort DeFarge
Together
Join date: 18 Nov 2004
Posts: 681
|
06-03-2009 13:10
From: RobbyRacoon Olmstead in other words trying to rip you off with a custom viewer, then you could always keep their money and not use llGiveMoney to give a refund  . I do exactly this to avoid having to give debit perms to hundreds (thousands?) of objects. I have NEVER had a single complaint in the years I have been doing it. You should ALWAYS code the money event as if any value could appear as the amount. NEVER rely on any other part of the script to enforce the price.
_____________________
http://slurl.com/secondlife/Together
|
|
Sindy Tsure
Will script for shoes
Join date: 18 Sep 2006
Posts: 4,103
|
06-03-2009 17:50
/me creates SVC-4340.. From: SVC-4340 llReturnMoney, please
It would be nice to have a llCall that tells the sim to reject the payment being made in a 'money' event.
Today, most scripts that take money are vendors and they always have to ask their owner for debit permissions so they can return money if a customer pays the wrong price. It would a lot easier if there was a way to say "d'oh! wrong price! try again!" without having to send the L$ back to the customer.
I can see that it would be difficult to have the sim do this in anything other than a money event and that there might be a lot of context that the sim would need to cart around to make runtime decisions about which llCall is being made during which event. Maybe making this sort of decision (on if llReturnMoney is ok to call) at compile time would be easier... http://jira.secondlife.com/browse/SVC-4340
_____________________
Sick of sims locking up every time somebody TPs in? Vote for SVC-3895!!! - Go here: https://jira.secondlife.com/browse/SVC-3895- If you see "if you were logged in.." on the left, click it and log in - Click the "Vote for it" link on the left
|
|
Abraxes Binder
Registered User
Join date: 23 May 2008
Posts: 205
|
06-04-2009 08:30
thanks for the reply, but i have a problem the method i actually needed to show the content was CLICK_ACTION_BUY That part works nicely. The fixed amount is stated and nothing else can be used. But.. The money event is now never invoked Why on earth have they (LL) made that?! Is it posible to invoke the money event without using the 'pay' option in the pie?
integer pris;
default { state_entry() { llSetClickAction( CLICK_ACTION_BUY );// will set it to 'buy on click' llSetText("mehh... ",<1,1,1>,1); pris=5; }
touch_start(integer total_number) { llSay(0,"Thank you for your interest in this product!"); } money(key buyerId, integer amount) { llOwnerSay("kscklasdnklasdckladkc"); //never... :/ so rest is irrelevent..
llSay(0,"Thanks for your purchase!"); llGiveInventory(buyerId,llGetInventoryName(INVENTORY_OBJECT, 0)); } }
_____________________
BR ab
|
|
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
|
06-04-2009 08:48
From: Abraxes Binder thanks for the reply, but i have a problem the method i actually needed to show the content was CLICK_ACTION_BUY That part works nicely. The fixed amount is stated and nothing else can be used. But.. The money event is now never invoked Why on earth have they (LL) made that?! Is it posible to invoke the money event without using the 'pay' option in the pie? Please take a look at the script I posted some time ago: /54/3a/313822/1.html
_____________________
From Studio Dora
|
|
Lear Cale
wordy bugger
Join date: 22 Aug 2007
Posts: 3,569
|
06-04-2009 09:30
From: Abraxes Binder thanks for the reply, but i have a problem the method i actually needed to show the content was CLICK_ACTION_BUY That part works nicely. The fixed amount is stated and nothing else can be used. But.. The money event is now never invoked Why on earth have they (LL) made that?! Is it posible to invoke the money event without using the 'pay' option in the pie?
No, other than setting the click action to "pay", which doesn't show the contents. For "buy", the changed() event is invoked for "sell original" or "sell copy". I don't know whether it's invoked for "sell contents" -- I suspect not, but that's easily tested. For "sell copy", the changed() event hander is invoked in the original object; CHANGED_OWNER is set, but of course llGetOwner() returns the same owner. But the money event is not invoked.
|
|
Lear Cale
wordy bugger
Join date: 22 Aug 2007
Posts: 3,569
|
06-04-2009 09:36
I don't think that quite answers. It shows how to make it sell on click (or, double-click in this case), but that doesn't show the buyer the contents (which is what I believe the OP wants). And it doesn't cause the money event to be invoked. Only "pay" causes the money() event to be invoked. Invoking money() on "buy" has often been requested, but I don't know much about the issues.
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
06-04-2009 16:03
From: Lear Cale No, other than setting the click action to "pay", which doesn't show the contents.
For "buy", the changed() event is invoked for "sell original" or "sell copy". I don't know whether it's invoked for "sell contents" -- I suspect not, but that's easily tested.
For "sell copy", the changed() event hander is invoked in the original object; CHANGED_OWNER is set, but of course llGetOwner() returns the same owner.
But the money event is not invoked. huh didn't know that... I would've expected changed owner to only invoke for the copy not the original... neat to know, and should make tracking purchases easier.
_____________________
| | . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - 
|
|
Abraxes Binder
Registered User
Join date: 23 May 2008
Posts: 205
|
06-05-2009 03:30
Thank you for the infomation Lear, then there is no way to do it. Dora, i made a mistake in my first post i said CLICK_ACTION_PAY i meant to say CLICK_ACTION_BUY -the popup that has a locked pay amount of money -eg no pay mistakes can be made, and the method further present the box content to the customer. CLICK_ACTION_BUY apearently cant invoke the money event CLICK_ACTION_PAY can but thats error-prone and need the stupid refund c... I can for the love of ..well anything.. in my wildest nightmare emagine why LL has made things this way It is plain idiotics. :/
BR ab
_____________________
BR ab
|
|
Lear Cale
wordy bugger
Join date: 22 Aug 2007
Posts: 3,569
|
06-05-2009 06:56
From: Void Singer huh didn't know that... I would've expected changed owner to only invoke for the copy not the original... neat to know, and should make tracking purchases easier. It surprised the heck out of me when it happened! Someone would be using an MLPV2 bed for sale, buy a copy, and it would reset itself! Since on reset it waits for owner to touch, no more sales for that unit until I touch it. Grr. I haven't retested this in a while. It might be that it was a temporary bug, but I now always save owner on default state entry, and on owner change, check to see if the owner actually changed. Easy enough to verify, and also find out if it happens for Buy Contents. I doubt it in that case, since different objects are bought in that case. But then, using logic, I wouldn't have predicted an owner change event for the original on Buy Copy.
|
|
Dytska Vieria
+/- .00004™
Join date: 13 Dec 2006
Posts: 768
|
06-05-2009 11:49
I would like the money event to be more granular. Or, maybe a money_start(key id, integer amount) and a money_end() event.
The money_start() event would not accept money unless there were some other new function, such as llAcceptMoney(key id, integer amount) to commit the transaction once any prerequisites are met in the process. This would prevent having to use debit permissions to refund the payment when the payment is not wanted.
_____________________
+/- 0.00004
|