donation box
|
Nada Epoch
The Librarian
Join date: 4 Nov 2002
Posts: 1,423
|
05-29-2003 16:48
Summary: The following script will make an object accept donations on your behalf. Usage: stick it on any object you own(my favorite is a top hat), and it will promptly display: "<your name>'s donation hat. Donate if you are so inclined." at which point anyone can right click on it and give you a tip. also, the script tells the donator thanks, and then tells you who donated how much so you can send them a thank you notecard  default { state_entry() { llSetText(llKey2Name(llGetOwner())+"'s donation hat.\nDonate if you are so inclined!",<1,1,1>,1); }
money(key id, integer amount) { llInstantMessage(id,"Thanks for the tip!"); llInstantMessage(llGetOwner(),llKey2Name(id)+" donated $" + (string)amount); } }
Credits: Script written by: jean cook, ama omega, and nada epoch 5-29-03 Discussion Thread/54/6e/48924/1.html
_____________________
i've got nothing. 
|
Chance Small
Linden PITA
Join date: 30 Jul 2003
Posts: 170
|
08-26-2003 14:55
There's an error in your code... This Line: llInstantMessage(llGetOwner,llKey2Name(id)+" donated $" + (string)amount); Needs To Be: llInstantMessage(llGetOwner(),llKey2Name(id)+" donated $" + (string)amount);
|
Raemus Patel
Registered User
Join date: 21 Jun 2004
Posts: 29
|
06-25-2004 05:40
"and then tells you who donated how much so you can send them a thank you notecard"
Couldn't you just have the hat vend out a notecard saying thanx? That wouldnt requier much added scripting...
|
Twist Zaius
Junior Member
Join date: 5 Mar 2004
Posts: 8
|
07-06-2004 11:10
You probably going to be wanting to add this event too: on_rez(integer start) { llResetScript(); }
_____________________
I'm everything thats wrong with the world
|
Goshua Lament
Registered User
Join date: 25 Dec 2003
Posts: 703
|
07-25-2004 10:25
From: someone Originally posted by Raemus Patel Couldn't you just have the hat vend out a notecard saying thanx? That wouldnt requier much added scripting... All you have to do is add a llGiveInventory line inside the money event. Just add llGiveInventory(llDetectedKey(0),_llGetInventoryName(INVENTORY_NOTECARD,_0)); after the llInstantMessage. Yes, it is pretty easy scripting.
_____________________
Flickr Second Life Photo GalleryI no longer regularly login to SecondLife, but please contact me if an issue arises that needs my attention.
|
Camden Callahan
Registered User
Join date: 25 Jul 2004
Posts: 4
|
07-30-2004 19:14
From: someone Originally posted by Raemus Patel "and then tells you who donated how much so you can send them a thank you notecard"
Couldn't you just have the hat vend out a notecard saying thanx? That wouldnt requier much added scripting... I'm sure the donator would prefer a card written and sent by the actual person instead of just automated. It shows that you actually care enough about it to do it yourself...
|
Lazerus Glitterbuck
Wascally Wabbit
Join date: 6 Jan 2005
Posts: 14
|
04-28-2005 17:58
Sorry to dig up an old thread but I though better to do this than make a new post. Does anyone know how I can modify this script so that it shows a running total?
|
Davy Flytrap
Registered User
Join date: 21 Feb 2005
Posts: 146
|
05-31-2005 08:06
Laz..if you IM me ingame i have made one that totals up all donations
|
Keknehv Psaltery
Hacker
Join date: 11 Apr 2005
Posts: 1,185
|
05-31-2005 10:19
integer totaldonated; string owner;
default { on_rez( integer sparam ) { llResetScript(); } state_entry() { owner = llKey2Name( llGetOwner() ); llSetText( owner + "'s donation hat.\nDonate if you are so inclined!\n$0 Donated so far",<1,1,1>,1); }
money(key id, integer amount) { totaldonated+=amount; llSetText( owner + "'s donation hat.\nDonate if you are so inclined!\n$" + (string)amount + " Donated so far",<1,1,1>,1); llInstantMessage(id,"Thanks for the tip!"); llGiveInventory(llDetectedKey(0),_llGetInventoryNa me(INVENTORY_NOTECARD,_0)); llInstantMessage(llGetOwner,llKey2Name(id)+" donated $" + (string)amount); } }
There you go.. Although I do wonder, why did it take 3 people to code this?
|
Nada Epoch
The Librarian
Join date: 4 Nov 2002
Posts: 1,423
|
05-31-2005 13:15
back in beta, everything took longer and more people 
_____________________
i've got nothing. 
|
Cherry Took
Mud Wrestling Champeeeen
Join date: 7 Jan 2005
Posts: 160
|
Holy Cow!
05-31-2005 17:03
Willya look at Nada Epoch's join date? (emits low whistle) Beaut! lol
|
Hiro Pendragon
bye bye f0rums!
Join date: 22 Jan 2004
Posts: 5,905
|
06-02-2005 01:42
default{state_entry(){llSetText("Gimme ur $$",<1,1,1>,1);}money(key i, integer a){}}
_____________________
Hiro Pendragon ------------------ http://www.involve3d.com - Involve - Metaverse / Emerging Media Studio
Visit my SL blog: http://secondtense.blogspot.com
|
Cazzj Brearly
Look! A UFO!
Join date: 21 Mar 2005
Posts: 113
|
07-26-2005 17:24
From: Hiro Pendragon default{state_entry(){llSetText("Gimme ur $$",<1,1,1>,1);}money(key i, integer a){}} Touche'...and brilliant. 
|
Bubba Gumshoe
Registered User
Join date: 29 Jul 2005
Posts: 4
|
08-13-2005 17:39
tryed this script didnt work 
|
Flugelhorn McHenry
Valved bugle
Join date: 10 Jul 2004
Posts: 34
|
08-16-2005 15:20
From: Keknehv Psaltery There you go.. Although I do wonder, why did it take 3 people to code this? The code in Keknehv's post doesn't work because some weird spacing has crept into one of the functions. Also, the bit of code that reads (string)amount + " Donated so far" should actually read (string)totaldonated + " donated so far" Here's my take on the whole thing: integer totaldonated; string owner;
default { state_entry() { owner = llKey2Name(llGetOwner()); llSetText( owner + "'s donation box.\nAll donations gratefully accepted.\n$0 donated so far.\nRight-click on me and select Pay to donate.",<1,1,1>,1); } on_rez( integer sparam ) { llResetScript(); }
money(key id, integer amount) { totaldonated+=amount; llSetText( owner + "'s donation box.\nAll donations gratefully accepted.\n$" + (string)totaldonated + " donated so far.\nRight-click on me and select Pay to donate.",<1,1,1>,1); llInstantMessage(id,"Thanks very much for the tip!"); llInstantMessage(llGetOwner(),llKey2Name(id)+" donated $" + (string)amount); } } (I've just removed the llGiveInventory line because I don't see why you should burden someone with an unwanted notecard if they've been so kind as to give you some cash.)
|
Flugelhorn McHenry
Valved bugle
Join date: 10 Jul 2004
Posts: 34
|
08-16-2005 15:33
From: Keknehv Psaltery There you go.. Although I do wonder, why did it take 3 people to code this? The code in Keknehv's post doesn't work because some weird spacing has crept into one of the functions. Also, the bit of code that reads (string)amount + " Donated so far" should actually read (string)totaldonated + " donated so far" Here's my take on the whole thing: integer totaldonated; string owner;
default { state_entry() { owner = llKey2Name(llGetOwner()); llSetText( owner + "'s donation box.\nAll donations gratefully accepted.\n$0 donated so far.\nRight-click on me and select Pay to donate.",<1,1,1>,1); } on_rez( integer sparam ) { llResetScript(); }
money(key id, integer amount) { totaldonated+=amount; llSetText( owner + "'s donation box.\nAll donations gratefully accepted.\n$" + (string)totaldonated + " donated so far.\nRight-click on me and select Pay to donate.",<1,1,1>,1); llInstantMessage(id,"Thanks very much for the tip!"); llInstantMessage(llGetOwner(),llKey2Name(id)+" donated $" + (string)amount); } } (I've just removed the llGiveInventory line because I don't see why you should burden someone with an unwanted notecard if they've been so kind as to give you some cash.)
|
JC Kilian
Registered User
Join date: 12 Jul 2005
Posts: 21
|
Could this be modified...
04-09-2006 13:41
Would it be possible for someone to show me how this script could be modified in order for the donations to be split between 2 people? For example, a dancer gets a certain percent of the donation, and the Club Owner gets a certain percent? Just wondering  Thanks for any feedback on this
|
Koz Farina
Registered User
Join date: 31 Dec 2005
Posts: 11
|
07-22-2006 15:34
hi,
is it possible to trigger this from a button, as opposed to the 'Pay' pie menu?
I want to ad a donate button to a HUD, but Pay is not an option.
So, basically, I need a touch script which does the same as "apy' revealing the Pay amount options (which can be configured in the normal way)
thanks K
|