Jump to content

Malfunctioned tip jar sends money to another avatar than owner


Guest
 Share

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

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

Recommended Posts

Hi!

I have a tip jar which I used before for many years that started to send tip to a Cavatica2015 instead of me. I have no idea when it started to happen but I recently rerezzed it so it probably started then. I think I checked it when rerezzing it.

It send a share to my friend Keko which was the intention of the tip jar but my share went wrong.  The original scriptmaker Wietse Cassini was the Creator of the script and configuration card while i was the Owner. I'm also the Owner and Creator of the Object the script is placed within. It is not set to a group but it's placed an o group-owned land (Bibi's reef builder's group where I'm in charge of the group. The group is not open and Cavataci2015 is not part of the group.

I have updated the script and configuration card so i'm the Creator of them now also. For the moment it sends the money right.

Do anyone have an idea what could have happened?

Thanks,

Bibi Questi

 

 

------------------------------

Configuration card:

------------------------------

a66XXXXXXXXXXXXXXXXXX 50

# first line containts the key of the person to split profit with and the percentage in % seperated with a space
# for example:

b1c6f961-0e0c-4de1-ba69-307b9d58f742 10
# this would give me Goldorak Alonzo the creator of this script 10% of all tips. REMEMBER IT MUST BE ON THE FIRST LINE!!!

# to retreive the key of an avater use the key extractor or go to http://w-hat.com/name2key

----------------------------------------------

SCRIPT

---------------------------------------------

key line1;

key keyactive;
string nameactive;

key splitwith;
integer percentage;

default
{
    on_rez(integer param)
    {
        llResetScript();
    }
   
    state_entry()
    {
        line1 = llGetNotecardLine("config",0);
        llSetText("Tip jar intactive", <1,1,1> ,1.0);
    }

    dataserver(key queryid, string data)
    {
        if (queryid == line1)
        {
            list templist = llParseString2List(data, [" "],[]);
            splitwith = (key) llList2String(templist,0);
            percentage = (integer) llList2String(templist,1);
            llOwnerSay("Profit will be split with: "+llKey2Name(splitwith)+". Person will receive: "+(string) percentage+"%.");
           
            llRequestPermissions(llGetOwner(), PERMISSION_DEBIT);
        }  
    }
   
    run_time_permissions (integer perm)
    {
        if (perm == PERMISSION_DEBIT)
        {
            state active;  
        } else
        {
            llOwnerSay("I need those permissions. Please reset me to try again.");
        }
    }

}

state active
{
    on_rez(integer param)
    {
        llResetScript();
    }
   
    state_entry()
    {
        llSetText("Tip jar unassigned",<1,1,1>,1.0); 
        llSetPayPrice(PAY_HIDE, [PAY_HIDE, PAY_HIDE, PAY_HIDE, PAY_HIDE]);
    }  
   
  
    touch_start(integer nr)
    {
        key toucher = llDetectedKey(0);
        if (!llSameGroup(toucher))
        {
            return;
        }
   
        if (toucher == keyactive)
        {
            keyactive = NULL_KEY;
            nameactive = "";
            llSetText("Tip jar unassigned",<1,1,1>,1.0);
            llSetPayPrice(PAY_HIDE, [PAY_HIDE, PAY_HIDE, PAY_HIDE, PAY_HIDE]);
        } else
        {
            keyactive = toucher;
            nameactive = llKey2Name(toucher);
            llSetText("Support Bibi's Underwater World",<0,0,0>, 1.0);
            llSetPayPrice(PAY_DEFAULT, [PAY_DEFAULT, PAY_DEFAULT, PAY_DEFAULT, PAY_DEFAULT]);
        }

    }
   
    money(key id, integer amount)
    {
        integer split = llRound((amount * percentage) / 100);
        integer tipreceiver = amount - split;
        llGiveMoney(keyactive, tipreceiver);
        llGiveMoney(splitwith, split);
       
        llSay(0,"Thank you for your donation.");
    }
}

 

Link to comment
Share on other sites

The script loads the notecard and sets the avatar and percentage for the split payment. (without any check for plausibility btw.)

Then it waits for anyone to touch. This avatar will get the money. (It does not show who receives the money btw.)

So it's simple. You rez the tipjar and I click 1st. Your click is too late and will be ignored and I get the money. If you use simple free scripts you need to be careful when money is involved. And if you changed it by removing the display of the receiver name you didn't think this through.

Link to comment
Share on other sites

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