Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Freebie dispenser that won't give twice to the same avatar.

Kittie Munro
Registered User
Join date: 28 May 2007
Posts: 29
06-16-2008 05:58
I thought this might be an easy script to find, I've seen them being used in some of the newer malls for advertising.
Is there a simple script around that allows someone to take a free item once, and once only?

thanks
Kittie
Winter Ventura
Eclectic Randomness
Join date: 18 Jul 2006
Posts: 2,579
06-16-2008 06:09
Not really.

The problem is, that in order to do that, you need to store the key (or name) of the person who you gave it to. That's simple enough, but the problem is, you can only keep track of a limited number of keys, before your script runs out of memory.

So let's pick an arbitrary number, like let's say you can only store 100 keys. (in actuality, this varies. The more complex your script, the fewer keys you can store). So I come along, grab your item, and then it won't give me another. That's great.. but after 99 other people come and get one.. the ONLY sane thing you can do, is to delete the oldest key. That means that your giver will only keep track of the 100 MOST RECENT people to grab it.

So if your giver is busy, I could come back the next day. With 99 alts, or 99 friends, I could easily rack up quite a few of these items.

There are ways AROUND this... you can add so-called "memory scripts".. each script could perhaps remember 200 keys... But even that approach isn't going to be perfect. The more of those scripts you use, the longer you're going to have to pause the script to "heck" and see if the thoucher has gotten the item before.

The approach that a lot of people use, is to send the keys out to a web-based php script, and perhaps storing the keys in a MySQL database someplace. For most purposes, this works, but it's not SIMPLE to implement, and requires a good deal of programming knowledge.

So what does that leave you with, that's easy?

Put simply... have you considered just making the item "no transfer?"

If an item is No-Trans, then it doesn't matter if a person has 1 or 100 of your item.. Unless perhaps it's a chair or a dance pad or something. As long as they can't "give it away" they're only getting the item for their own personal use. "Copy" permission is pretty wise anyways, given LL's propensity to randomly delete inventory items these days.

So that's my advice.

Yes Copy, No Transfer... and don't worry if people grab more than one.
_____________________

● Inworld Store: http://slurl.eclectic-randomness.com
● Website: http://www.eclectic-randomness.com
● Twitter: @WinterVentura
Kittie Munro
Registered User
Join date: 28 May 2007
Posts: 29
06-16-2008 07:03
Thanks Winter, that certainly explains why I'm not finding very much on the subject.
I have considered making the items no transfer, but would prefer to be able to simply limit the number of times the item can be taken by one person.
The "number of keys" issue isn't really a problem since the item given would change daily and the giveaway is for a limited period of time.

Oh well - guess I'll just have to rethink my freebies
RichD Tomsen
Photographer / Builder
Join date: 18 Nov 2007
Posts: 24
06-16-2008 09:11
What about this.... Put a script inside the object your giving away.. The script will use the OWNER_CHANGE condition to increment a counter. If it’s greater then 1 (owner --> first person ---> first to second) it does an llDie... its not fool proof. If the first person never rezzes the object then he can give it to the second with no issue. Basically this would let it rezz in world by no more then one new owner.