Jump to content

Which function to use to trigger simple email to owner when an object is bought


Emma Krokus
 Share

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

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

Recommended Posts

I've looked at some past scripts, tried the Wiki but still have not found something that would do the following:

send me an email when an item is sold - set simply to click action BUY and the price set on the prim itself.

I'd prefer not have a script that sets a price.

Could someone help me identify the right function please? Or an alternative if buying in that way can't be picked up by a script command.

 

Thank you!

 

 

Link to comment
Share on other sites

You could use the change event to sent you an IM or email,  and then remove the script from the objects inventory,.if the owner has changed.
That way you will not get a message when the object is sold, but when it is rezzed the first time after it is bought. I think.

It's just a thought. I do not know how practical it is.

Link to comment
Share on other sites

I think Ron's suggestion is the only way to do it, assuming you're selling copies of whatever is in the prim's inventory rather than the original rezzed prim.

As he says, that won't notify you until the first time the new purchase is rezzed, but I think that's the best you can do if the customer is using the built-in buy capability rather than paying the object and thus causing a money event to fire.

Link to comment
Share on other sites

Right. The tricky part is whether the object is sold as Original or Copy. If Original, then the script is able to run right away when the owner changes. If Copy, though, the object that changed owner is stuck in the buyer's inventory until they rez it out, so the email wouldn't be sent when that buying happened but rather when (and if) the purchase is actually rezzed -- and rezzed somewhere the buyer's scripts are able to run.

Even for those Copy sales, that's usually good enough and your CHANGED_OWNER suggestion is right on target. If something more timely or precise is needed for selling copies, then I fear there's no choice but to go the whole scripted vendor route, with Pay dialogue, money() event, etc.

Link to comment
Share on other sites

Thank you very much, Qie, Ron and Innula. 

Shame there isn't a function that recognises a prim copy buy. 

Think I'll go with the CHANGED_OWNER suggestion and making the script delete itself after emailing me. 

 

Just one more little question before I go dropping scripts in every saleable prim in my shop and cause massive lag: I heard somewhere that mono scripts which are the same, share resources... is that true? Or am I starting a lagfest?

 

Emma :)

 

Link to comment
Share on other sites


Emma Krokus wrote:

I heard somewhere that mono scripts which are the same, share resources... is that true? Or am I starting a lagfest? 

Kind of. The bytecode is shared for all copies of the same already-compiled script in the same sim. Note it's just the bytecode, not the memory used for state, and if a script ever gets recompiled, it no longer shares bytecode with the other copies.

I don't know how many objects you'll have for sale there, but this email functionality is a really tiny script, triggered by a single relatively rare event, so the per-instance resource demand should be minuscule anyway. One note, however, is that every script causes the sim to use a barely measurable bit of time just for the scheduler to decide there's nothing for that script to do. Usually thousands of these will have no effect on performance, not even of other scripts, but it's just a factor that's independent of memory or "real" script lag when dealing with truly vast numbers of scripts.

Link to comment
Share on other sites

Thank you Qie - that was a useful link :)

 

Emma :)


Qie Niangao wrote:


Emma Krokus wrote:

I heard somewhere that mono scripts which are the same, share resources... is that true? Or am I starting a lagfest? 

Kind of.
. Note it's just the bytecode, not the memory used for state, and if a script ever gets recompiled, it no longer shares bytecode with the other copies.

I don't know how many objects you'll have for sale there, but this email functionality is a really tiny script, triggered by a single relatively rare event, so the per-instance resource demand should be minuscule anyway. One note, however, is that every script causes the sim to use a barely measurable bit of time just for the scheduler to decide there's nothing for that script to do. Usually thousands of these will have no effect on performance, not even of other scripts, but it's just a factor that's independent of memory or "real" script lag when dealing with truly vast numbers of scripts.

 

Link to comment
Share on other sites

Just to clarify, Emma.

If you are using objects in your shop to sell their contents, as opposed to themselves, then the scripts need to be inside the objects they're selling, not in the object rezzed in your shop.

In that case, the scripts aren't an issue for your region.   The object you're selling isn't really inside the prim's inventory -- all that contains is a pointer to the item that should be given to an avatar who pays the appropriate amount.

Link to comment
Share on other sites

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