Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Poseball Question..

Malina Chuwen
Evotive
Join date: 25 Apr 2008
Posts: 502
05-21-2008 21:10
First off: yes, I already checked search and read what I could find.. The only thread I found, the original posters final question still hasnt been answered..

So.. How do you change the default tip percentages?

I've changed the script around to practically every percentage, and its still stuck at 10%..

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.";);
}

.. also, not sure why it didn't change my title. Lol. I had a Poseball question but decided to post this one instead.
Georg Stonewall
Husband of Nikki
Join date: 21 Jan 2007
Posts: 211
05-21-2008 23:26
Hi Malina,
the money part of your script looks good to me.
So if you have changed the percentage with the global variable in the top of the script, then I guess this variable get maybe overwritten somewhere else in the script.
Have a look where else in your script the variable percentage exists.
_____________________
G&N Quality Design


SLURL

Blog

Flickr

XStreetSL
Malina Chuwen
Evotive
Join date: 25 Apr 2008
Posts: 502
05-22-2008 08:49
Hey Georg,

There is nothing else to change... I've read it a hundred times and I still see no other percentage to alter.

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("Empty",<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("Empty",<1,1,1>,1.0);
llSetPayPrice(PAY_HIDE, [PAY_HIDE, PAY_HIDE, PAY_HIDE, PAY_HIDE]);
} else
{
keyactive = toucher;
nameactive = llKey2Name(toucher);
llSetText(nameactive+"'s tip jar",<1,1,1>, 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.";);
}
}
Meade Paravane
Hedgehog
Join date: 21 Nov 2006
Posts: 4,845
05-22-2008 08:58
The percentage is coming from a notecard and the notecard is only being read when the script resets.

When you change the percentage, are you resetting the script? If not, it's not going to see the new notecard info.
_____________________
Tired of shouting clubs and lucky chairs? Vote for llParcelSay!!!
- Go here: http://jira.secondlife.com/browse/SVC-1224
- 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
Malina Chuwen
Evotive
Join date: 25 Apr 2008
Posts: 502
05-22-2008 09:11
The only notecard I have has my avatar key..

Edited: Ooo. Now I see it - Thanks!! =p
Meade Paravane
Hedgehog
Join date: 21 Nov 2006
Posts: 4,845
05-22-2008 09:17
It works now?
_____________________
Tired of shouting clubs and lucky chairs? Vote for llParcelSay!!!
- Go here: http://jira.secondlife.com/browse/SVC-1224
- 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
Malina Chuwen
Evotive
Join date: 25 Apr 2008
Posts: 502
05-22-2008 09:22
I think, lol. Not able to try right now.
Meade Paravane
Hedgehog
Join date: 21 Nov 2006
Posts: 4,845
05-22-2008 09:24
Ok.. :)

If it does work, I'd also change this line...

llGiveMoney(splitwith, split);

..to be..

if (splitwith != llGetOwner())
llGiveMoney(splitwith, split);

The owner of the object already has the cash and there's no need to have them pay themselves - it just generates spam in the account history and, if you don't have payment pop-ups disabled, you spam yourself with pop-ups.
_____________________
Tired of shouting clubs and lucky chairs? Vote for llParcelSay!!!
- Go here: http://jira.secondlife.com/browse/SVC-1224
- 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
Malina Chuwen
Evotive
Join date: 25 Apr 2008
Posts: 502
05-22-2008 22:42
Yes!

Now it says "Person will recieve 5%" But who is this 'person'? I'm assuming the person that isn't getting tipped.. Also, it still seeks permissions even with that script you've posted.. Gonna tinker around with it a bit.
Malina Chuwen
Evotive
Join date: 25 Apr 2008
Posts: 502
05-24-2008 15:26
I have another question =x

How do I get it to only have the other person get the Tip popup box? I don't mind knowing that someone has been tipped but doesn't it make them wait until they recieve payment?

Also.. If I change:

llSetText("Empty",<1,1,1>,1.0);
llSetPayPrice(PAY_HIDE, [PAY_HIDE, PAY_HIDE, PAY_HIDE, PAY_HIDE]);

To something like:

llSetText("Total Tips",<1,1,1>,1.0);
llSetPayPrice(money);

.. Or something .. Would that show the current tip amount? It's becoming a very popular request! Lol. I don't mind fussing around with which script to use, but knowing where to put it would help me so much! I only have myself to test these jars so it's a tad hard deciding if they work properly or not..