Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Question for you scripting god...

Juro Kothari
Like a dog on a bone
Join date: 4 Sep 2003
Posts: 4,418
03-29-2005 13:37
I sell wares out of boxes, not vendors, but I'd like to know if it's possible to script the box to have a customer blacklist? Basically, it would check to see if the AV who is attempting to purchase is on the list and if so, not sell to them?
_____________________
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
03-29-2005 14:01
Yes, several ways, or at least I think so.

Accepting payment invokes the money() event, which includes the key of the giver. You could use key2name and check against a list to prevent it accepting money I think.

I've not tried this, but:

CODE

list myBlacklist;
default
{
money(key giver, integer amount)
{
if(llListFindList(myBlacklist, [llKey2Name(giver)]) < 0)
{
llInstantMessage(giver, "Tough, you're blacklisted");
} else {
llGiveInventoryList(giver, "stuff you just bought", list of what they buy);
}
}
}


It's totally unchecked, but something like that, plus ways to add to the blacklist ought to work.
Juro Kothari
Like a dog on a bone
Join date: 4 Sep 2003
Posts: 4,418
03-29-2005 14:39
Thanks Eloise! I'll experiment with it tonight!
_____________________
Adam Zaius
Deus
Join date: 9 Jan 2004
Posts: 1,483
03-29-2005 18:53
If llSetForSale() actually stays in 1.6 (not sure if that happened) - it should be able to do it for you. :)

-Adam
_____________________
Co-Founder / Lead Developer
GigasSecondServer
Rysidian Rubio
Ruby Red Head
Join date: 14 Jan 2004
Posts: 263
03-30-2005 21:45
Just a thought after reading Eloise' code. Using that code if a blacklisted person paid money into your box they wouldn't recieve the item or get a refund, you would have to script in the refunding.
CODE
money(key giver, integer amount)
{
if(llListFindList(myBlacklist, [llKey2Name(giver)]) < 0)
{
llInstantMessage(giver, "Tough, you're blacklisted");
llGiveMoney(giver,amount); //refunds user's money, but needs PERMISSION_DEBIT to be set up for the owner.
}
else
{
llGiveInventoryList(giver, "stuff you just bought", list of what they buy);
}
}
_____________________
"Bad News is - I cant script a thing....
Good News is - I buy less asprin than those who can :D"
-Rosa Gardner
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
03-31-2005 01:52
the llListFindList is also wrong!

You need to swap the blacklisted response and the OK to sell responses around, oops.