Tip/Donation Jar
|
|
Keknehv Psaltery
Hacker
Join date: 11 Apr 2005
Posts: 1,185
|
03-07-2006 16:15
Finally tiring of people IMing me about a different tip jar that I whipped up in a minute and posted on the forums, I made a new one. Here it is: a tip jar with splitting capabilities, quick-pay modifications, and (hopefully) easy customization. Set the object's description to what you want the first line of the hover text to be, and perhaps set the splitPercentage to 0, or change the key (that's my key). Otherwise, a portion of the tips will go to me. This is just my little way to reward those who read the directions. Not that I'd mind or anything... For club owners, set the description, modify the settings to your liking, and set the key to the person who is going to get the tips. Set the percentage of each tip that they will receive, and the tip jar should be ready. Here's a simple script to get the key of the first person to touch the prim, and then die. (Condensed to one line for space) default{touch_start(integer a){llOwnerSay(llDetectedKey(0));llRemoveInventory(llGetScriptName());}} //Generic Tip Jar 1.0 -- 03/07/06 // by Keknehv Psaltery
integer IM = 0; integer WHISPER = 1; integer SAY = 2;
//##########################SET THESE VALUES#########################//
list suggestedTips = [25,50,100,200]; //The "Fast Pay" buttons (enter four values) integer defaultAmount = 40; //The default amount in the pay dialog
string amountBegin = "L$"; string amountEnd = " has been tipped so far";
string thanksBegin = "Thanks for the tip, "; string thanksEnd = "!";
//How the script thanks donors integer thanksMode = WHISPER; //Set this to IM, WHISPER, or SAY to select vector color = <0.6,0.6,0.6>; //The color for the hover text float alpha = 1.0; //The transparency for the hover text
key splitKey = "f1f2d29a-210b-4b00-96d7-ab16c962a40f"; //The key of the person to split the money with float splitPercentage = 10.0; //The percentage for the splittee
// Edit the prim's description -- this goes on the first line of the hovertext // e.g., the description might be "Keknehv's tip jar, please donate"
//##########################END CONFIGURATION########################//
string description; //This will be set to whatever the Prim's Description is -- not the owner's name //This means that you probably want to set the description to something like "Keknehv's tip jar, please donate!"
integer totalMoney = 0; //The total amount tipped so far
updateText() //Update the hover text. Placed here for easy modification, not speed { llSetText( description + "\n" + amountBegin + (string)totalMoney + amountEnd, color, alpha ); }
default { state_entry() { splitPercentage /= 100.0; if ( splitPercentage > 0 ) llRequestPermissions( llGetOwner(), PERMISSION_DEBIT ); else //There's no need to get permissions state soliciting; }
touch_start(integer total_number) { llRequestPermissions( llGetOwner(), PERMISSION_DEBIT ); } run_time_permissions( integer perm ) { if ( perm & PERMISSION_DEBIT ) state soliciting; } }
state soliciting //Accepting tips now... { state_entry() { llSetPayPrice( defaultAmount, suggestedTips ); description = llGetObjectDesc(); updateText(); } money( key id, integer amount ) { string donor = llKey2Name( id ); totalMoney += amount; description = llGetObjectDesc(); //Might as well... updateText(); if ( splitPercentage > 0 ) llGiveMoney( splitKey, (integer)(amount * splitPercentage) ); if ( thanksMode == 0 ) llInstantMessage( id, thanksBegin + donor + thanksEnd ); else if ( thanksMode == 1 ) llWhisper( 0, thanksBegin + donor + thanksEnd ); else if ( thanksMode == 2 ) llSay( 0, thanksBegin + donor + thanksEnd ); } }
|
|
Adman Drake
Registered User
Join date: 9 Feb 2006
Posts: 96
|
03-07-2006 16:25
A possible bug:
I've found that if an object IM's someone, and someone pays that object within the built-in 2 second delay that follows an IM, that the object will accept the money but not respond to the payment in the money event.
Maybe you could confim by setting your tip jar to IM mode, and then paying it twice in rapid succession (ie, pay it, wait for the "thank you" IM, and then pay it again within 2 seconds).
Let me know how it goes!
Adman
|
|
Ziggy Puff
Registered User
Join date: 15 Jul 2005
Posts: 1,143
|
03-07-2006 16:27
Not respond even after 2 seconds? Wow. That would be an interesting bug.
|
|
Keknehv Psaltery
Hacker
Join date: 11 Apr 2005
Posts: 1,185
|
03-07-2006 17:12
It seems to be working perfectly for me... It's just a bit delayed.
|
|
Dioxide DeSantis
Registered User
Join date: 2 Feb 2007
Posts: 63
|
05-18-2007 22:39
Works like a charm but how could I add a second person to split the tips with? For instance if I wanted an employee to get 80% and then two managers to get 10% each is there a way to do this? Thanks for posting the script! Here is what I came up with but I am not sure if this is correct or not any help would greatly be appreciated? //Generic Tip Jar 1.0 -- 03/07/06 // by Keknehv Psaltery
integer IM = 0; integer WHISPER = 1; integer SAY = 2;
//##########################SET THESE VALUES#########################//
list suggestedTips = [25,50,100,200]; //The "Fast Pay" buttons (enter four values) integer defaultAmount = 50; //The default amount in the pay dialog
string amountBegin = "L$"; string amountEnd = " has been tipped so far";
string thanksBegin = "Thanks for the tip, "; string thanksEnd = "!";
//How the script thanks donors integer thanksMode = WHISPER; //Set this to IM, WHISPER, or SAY to select vector color = <0.6,0.6,0.6>; //The color for the hover text float alpha = 1.0; //The transparency for the hover text
key splitKey = "key goes here"; //The key of the person to split the money with float splitPercentage = 10.0; //The percentage for the splittee
key splitKey2 = "key goes here"; //The key of the person to split the money with float splitPercentage2 = 10.0; //The percentage for the splittee
// Edit the prim's description -- this goes on the first line of the hovertext // e.g., the description might be "Keknehv's tip jar, please donate"
//##########################END CONFIGURATION########################//
string description; //This will be set to whatever the Prim's Description is -- not the owner's name //This means that you probably want to set the description to something like "Keknehv's tip jar, please donate!"
integer totalMoney = 0; //The total amount tipped so far
updateText() //Update the hover text. Placed here for easy modification, not speed { llSetText( description + "\n" + amountBegin + (string)totalMoney + amountEnd, color, alpha ); }
default { state_entry() { splitPercentage /= 100.0; if ( splitPercentage > 0 ) llRequestPermissions( llGetOwner(), PERMISSION_DEBIT ); else //There's no need to get permissions state soliciting; }
touch_start(integer total_number) { llRequestPermissions( llGetOwner(), PERMISSION_DEBIT ); } run_time_permissions( integer perm ) { if ( perm & PERMISSION_DEBIT ) state soliciting; } }
state soliciting //Accepting tips now... { state_entry() { llSetPayPrice( defaultAmount, suggestedTips ); description = llGetObjectDesc(); updateText(); } money( key id, integer amount ) { string donor = llKey2Name( id ); totalMoney += amount; description = llGetObjectDesc(); //Might as well... updateText(); if ( splitPercentage > 0 ) llGiveMoney( splitKey, (integer)(amount * splitPercentage) ); if ( splitPercentage2 > 0 ) llGiveMoney( splitKey2, (integer)(amount * splitPercentage2) ); if ( thanksMode == 0 ) llInstantMessage( id, thanksBegin + donor + thanksEnd ); else if ( thanksMode == 1 ) llWhisper( 0, thanksBegin + donor + thanksEnd ); else if ( thanksMode == 2 ) llSay( 0, thanksBegin + donor + thanksEnd ); } }
|
|
Mika Koltai
Registered User
Join date: 4 Feb 2007
Posts: 18
|
Wont start my perms or rez with llreset script
05-21-2007 01:50
I would like have this script to reset everytime it´s reset. Just to make sure it´s mine UUid who gets the money.... SRY Keknehv... I just don´t get to work. Or it´s just me who don´t know how deliver stuff. Try to sell it ($L0), gave it to an ava, they copied.... just don´t get it. someone?
//Generic Tip Jar 1.0 -- 03/07/06 mika mod add on rez och perm // by Keknehv Psaltery
integer IM = 0; integer WHISPER = 1; integer SAY = 2;
//##########################SET THESE VALUES#########################//
list suggestedTips = [25,50,100,200]; //The "Fast Pay" buttons (enter four values) integer defaultAmount = 40; //The default amount in the pay dialog
string amountBegin = "L$"; string amountEnd = " has been tipped so far";
string thanksBegin = "Thanks for the tip, "; string thanksEnd = "!";
//How the script thanks donors integer thanksMode = WHISPER; //Set this to IM, WHISPER, or SAY to select vector color = <0.6,0.6,0.6>; //The color for the hover text float alpha = 1.0; //The transparency for the hover text
key splitKey = "ed8f8683-1e93-422f-a0bd-626d3b569113"; //The key of the person to split the money with float splitPercentage = 10.0; //The percentage for the splittee
// Edit the prim's description -- this goes on the first line of the hovertext // e.g., the description might be "Keknehv's tip jar, please donate"
//##########################END CONFIGURATION########################//
string description; //This will be set to whatever the Prim's Description is -- not the owner's name //This means that you probably want to set the description to something like "Keknehv's tip jar, please donate!"
integer totalMoney = 0; //The total amount tipped so far
updateText() //Update the hover text. Placed here for easy modification, not speed { llSetText( description + "\n" + amountBegin + (string)totalMoney + amountEnd, color, alpha ); }
default {
on_rez(integer start_param) { // Restarts the script every time the object is rezzed Nope dont work llResetScript(); }
state_entry() { splitPercentage /= 100.0; if ( splitPercentage > 0 ) llRequestPermissions( llGetOwner(), PERMISSION_DEBIT ); else //There's no need to get permissions state soliciting; }
touch_start(integer total_number) { llRequestPermissions( llGetOwner(), PERMISSION_DEBIT ); } run_time_permissions(integer perm) { if (perm & PERMISSION_DEBIT) { state soliciting; } else { llResetScript(); //Works Not here either } } } state soliciting //Accepting tips now... { state_entry() { llSetPayPrice( defaultAmount, suggestedTips ); description = llGetObjectDesc(); updateText(); } money( key id, integer amount ) { string donor = llKey2Name( id ); totalMoney += amount; description = llGetObjectDesc(); //Might as well... updateText(); if ( splitPercentage > 0 ) llGiveMoney( splitKey, (integer)(amount * splitPercentage) ); if ( thanksMode == 0 ) llInstantMessage( id, thanksBegin + donor + thanksEnd ); else if ( thanksMode == 1 ) llWhisper( 0, thanksBegin + donor + thanksEnd ); else if ( thanksMode == 2 ) llSay( 0, thanksBegin + donor + thanksEnd ); } }
|
|
Rene Wildcat
Registered User
Join date: 6 Jan 2007
Posts: 6
|
05-27-2007 08:22
From: Dioxide DeSantis Works like a charm but how could I add a second person to split the tips with? For instance if I wanted an employee to get 80% and then two managers to get 10% each is there a way to do this? Thanks for posting the script! Here is what I came up with but I am not sure if this is correct or not any help would greatly be appreciated? //Generic Tip Jar 1.0 -- 03/07/06 // by Keknehv Psaltery
integer IM = 0; integer WHISPER = 1; integer SAY = 2;
//##########################SET THESE VALUES#########################//
list suggestedTips = [25,50,100,200]; //The "Fast Pay" buttons (enter four values) integer defaultAmount = 50; //The default amount in the pay dialog
string amountBegin = "L$"; string amountEnd = " has been tipped so far";
string thanksBegin = "Thanks for the tip, "; string thanksEnd = "!";
//How the script thanks donors integer thanksMode = WHISPER; //Set this to IM, WHISPER, or SAY to select vector color = <0.6,0.6,0.6>; //The color for the hover text float alpha = 1.0; //The transparency for the hover text
key splitKey = "key goes here"; //The key of the person to split the money with float splitPercentage = 10.0; //The percentage for the splittee
key splitKey2 = "key goes here"; //The key of the person to split the money with float splitPercentage2 = 10.0; //The percentage for the splittee
// Edit the prim's description -- this goes on the first line of the hovertext // e.g., the description might be "Keknehv's tip jar, please donate"
//##########################END CONFIGURATION########################//
string description; //This will be set to whatever the Prim's Description is -- not the owner's name //This means that you probably want to set the description to something like "Keknehv's tip jar, please donate!"
integer totalMoney = 0; //The total amount tipped so far
updateText() //Update the hover text. Placed here for easy modification, not speed { llSetText( description + "\n" + amountBegin + (string)totalMoney + amountEnd, color, alpha ); }
default { state_entry() { splitPercentage /= 100.0; if ( splitPercentage > 0 ) llRequestPermissions( llGetOwner(), PERMISSION_DEBIT ); else //There's no need to get permissions state soliciting; }
touch_start(integer total_number) { llRequestPermissions( llGetOwner(), PERMISSION_DEBIT ); } run_time_permissions( integer perm ) { if ( perm & PERMISSION_DEBIT ) state soliciting; } }
state soliciting //Accepting tips now... { state_entry() { llSetPayPrice( defaultAmount, suggestedTips ); description = llGetObjectDesc(); updateText(); } money( key id, integer amount ) { string donor = llKey2Name( id ); totalMoney += amount; description = llGetObjectDesc(); //Might as well... updateText(); if ( splitPercentage > 0 ) llGiveMoney( splitKey, (integer)(amount * splitPercentage) ); if ( splitPercentage2 > 0 ) llGiveMoney( splitKey2, (integer)(amount * splitPercentage2) ); if ( thanksMode == 0 ) llInstantMessage( id, thanksBegin + donor + thanksEnd ); else if ( thanksMode == 1 ) llWhisper( 0, thanksBegin + donor + thanksEnd ); else if ( thanksMode == 2 ) llSay( 0, thanksBegin + donor + thanksEnd ); } }
I tried this one, but it gave 100L$ to the second to split it with after I paid 10$ into. the first gets the 10% commission but the second gets 1000% while it is set to 10 aswell. I have been fiddling with the config of it. and this part i have changed From: someone key splitKey2 = "key goes here"; //The key of the person to split the money with float splitPercentage2 = 10.0; //The percentage for the splittee[/QUOTE}
made it into key splitKey2 = "key goes here"; //The key of the person to split the money with float splitPercentage2 = 0.10; //The percentage for the splittee
As the formula doesnt take the 10.0 here as % but just as number, multiplies the amount by this number. Therefor as 0.10 it takes it as percentage straight away.
|
|
Rene Wildcat
Registered User
Join date: 6 Jan 2007
Posts: 6
|
05-27-2007 12:54
another thing that doesnt seem to work is that the description doesnt get updated, as to who the tipjar is for. Anyone an idea how to get this to work properly?
|
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
05-27-2007 14:04
From: Rene Wildcat another thing that doesnt seem to work is that the description doesnt get updated, as to who the tipjar is for. Anyone an idea how to get this to work properly? From a quick scan of the code it is designed so that you Manually set the description. The reason the second split percentage didnt work as expected is that you dont divide it by 100 like you do with the first one.
_____________________
I'm back......
|
|
Rene Wildcat
Registered User
Join date: 6 Jan 2007
Posts: 6
|
05-27-2007 15:38
it takes the right amount, just doesnt make the percentage into a percentage. therefor I swapped it myself to the percentage amount.
|
|
Marylou Lane
Registered User
Join date: 3 Mar 2007
Posts: 60
|
question qbout tipjar owner
05-29-2007 09:40
hi ! I also alredy used this script but there is something I don't understand : when I put this script in a prim, the owner of the prim gets the money. So I have to sell the prim with the script to the person I want it to use... but I would like to keep ownership of the prim and money goes to another person.... do I only have to fill his key in splitkey??? and for example splitmoney 0,80 so that I get 20% and the other person get 80% ???
if someone could answer me, it would be nice thank you^^
|
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
05-29-2007 11:50
From: Marylou Lane hi ! I also alredy used this script but there is something I don't understand : when I put this script in a prim, the owner of the prim gets the money. So I have to sell the prim with the script to the person I want it to use... but I would like to keep ownership of the prim and money goes to another person.... do I only have to fill his key in splitkey??? and for example splitmoney 0,80 so that I get 20% and the other person get 80% ???
if someone could answer me, it would be nice thank you^^ Yes exactly that or put yourself down as the split. Any money paid into an object goes to its owner. Likewise any money paid out comes from its owners account.
_____________________
I'm back......
|
|
Marylou Lane
Registered User
Join date: 3 Mar 2007
Posts: 60
|
05-30-2007 03:07
thank you newgate^^ it works yes^^
|
|
Dioxide DeSantis
Registered User
Join date: 2 Feb 2007
Posts: 63
|
05-30-2007 06:16
Thought I would post the updated code for everyone. Not sure why the php tags are no longer working though.
//Generic Tip Jar 1.0 -- 03/07/06 // by Keknehv Psaltery
integer IM = 0; integer WHISPER = 1; integer SAY = 2;
//##########################SET THESE VALUES#########################//
list suggestedTips = [25,50,100,200]; //The "Fast Pay" buttons (enter four values) integer defaultAmount = 50; //The default amount in the pay dialog
string amountBegin = "L$"; string amountEnd = " has been tipped so far";
string thanksBegin = "Thanks for the tip, "; string thanksEnd = "!";
//How the script thanks donors integer thanksMode = WHISPER; //Set this to IM, WHISPER, or SAY to select
vector color = <0.6,0.6,0.6>; //The color for the hover text float alpha = 1.0; //The transparency for the hover text
key splitKey = "key goes here"; //The key of the person to split the money with float splitPercentage = 10.0; //The percentage for the splittee
key splitKey2 = "key goes here"; //The key of the person to split the money with float splitPercentage2 = 0.10; //The percentage for the splittee
// Edit the prim's description -- this goes on the first line of the hovertext // e.g., the description might be "Keknehv's tip jar, please donate"
//##########################END CONFIGURATION########################//
string description; //This will be set to whatever the Prim's Description is -- not the owner's name //This means that you probably want to set the description to something like "Keknehv's tip jar, please donate!"
integer totalMoney = 0; //The total amount tipped so far
updateText() //Update the hover text. Placed here for easy modification, not speed { llSetText( description + "\n" + amountBegin + (string)totalMoney + amountEnd, color, alpha ); }
default { state_entry() { splitPercentage /= 100.0; if ( splitPercentage > 0 ) llRequestPermissions( llGetOwner(), PERMISSION_DEBIT ); else //There's no need to get permissions state soliciting; }
touch_start(integer total_number) { llRequestPermissions( llGetOwner(), PERMISSION_DEBIT ); }
run_time_permissions( integer perm ) { if ( perm & PERMISSION_DEBIT ) state soliciting; } }
state soliciting //Accepting tips now... { state_entry() { llSetPayPrice( defaultAmount, suggestedTips ); description = llGetObjectDesc(); updateText(); }
money( key id, integer amount ) {
string donor = llKey2Name( id );
totalMoney += amount; description = llGetObjectDesc(); //Might as well... updateText();
if ( splitPercentage > 0 ) llGiveMoney( splitKey, (integer)(amount * splitPercentage) );
if ( splitPercentage2 > 0 ) llGiveMoney( splitKey2, (integer)(amount * splitPercentage2) );
if ( thanksMode == 0 ) llInstantMessage( id, thanksBegin + donor + thanksEnd ); else if ( thanksMode == 1 ) llWhisper( 0, thanksBegin + donor + thanksEnd ); else if ( thanksMode == 2 ) llSay( 0, thanksBegin + donor + thanksEnd ); } }
|
|
Esso Vollmar
Registered User
Join date: 24 Mar 2007
Posts: 6
|
05-31-2007 04:38
Why when someone makes bigger donations, some money goes to Keknehv Psaltery and not 100% to me?!?
|
|
Dioxide DeSantis
Registered User
Join date: 2 Feb 2007
Posts: 63
|
05-31-2007 05:15
From: Esso Vollmar Why when someone makes bigger donations, some money goes to Keknehv Psaltery and not 100% to me?!? Well the only way that would work is if you have his key in your config?
|
|
Esso Vollmar
Registered User
Join date: 24 Mar 2007
Posts: 6
|
05-31-2007 05:41
Ok, found it  Thx! How can I check what is my own key?
|
|
Milambus Oh
Registered User
Join date: 6 Apr 2007
Posts: 224
|
05-31-2007 07:03
llOwnerSay((string)llGetOwner());
Put that into the state entry of a new prim you create. I'm sure there are several other ways, but thats one.
|
|
Dioxide DeSantis
Registered User
Join date: 2 Feb 2007
Posts: 63
|
05-31-2007 07:12
The below code was in the original post. You can also drop the below into an object then click it.
default{touch_start(integer a){llOwnerSay(llDetectedKey(0));llRemoveInventory( llGetScriptName());}}
|
|
Justin Slade
Registered User
Join date: 6 Feb 2007
Posts: 132
|
Hep me understand
09-09-2007 10:59
From: Marylou Lane hi ! I also alredy used this script but there is something I don't understand : when I put this script in a prim, the owner of the prim gets the money. So I have to sell the prim with the script to the person I want it to use... but I would like to keep ownership of the prim and money goes to another person.... do I only have to fill his key in splitkey??? and for example splitmoney 0,80 so that I get 20% and the other person get 80% ???
if someone could answer me, it would be nice thank you^^ I placed the script into a prim, opened the script and entered the key for the manager and the other key was mine. I then gave this prim to the person that wants to earn money. That person becomes the owner and the manager gets 10% and I get 10%. is that correct. Because when the person that wants to make money puts their name into the description, it does nothing. Thanks for any help
|