Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Discussion: Donation / Tipjar script with a 'goal' and progress meter

Angel Fluffy
Very Helpful
Join date: 3 Mar 2006
Posts: 810
08-04-2006 10:35
What it is : a donation box / tip jar script, that uses the concept of 'goals' and a progress meter to encourage people to donate (as people donate more when they can see the progress being made towards a set goal).

Edit the config settings, drop in a prim, and pay it some money to find out how it works.

In future, I intend to add a 'biggest donors' field to it which people can use to recieve a list of the top 5 donors when the prim is clicked on.

CODE

// CARP Donation box script. Written by Angel Fluffy, with credit to :
// Keknehv Psaltery, jean cook, ama omega, nada epoch, YadNi Monde
// for their work on the "DONATION box" script upon which it was based.

string imtext = "I'm the __________ Donation Box! Please right click and pay me to donate, as this supports the __________ project and helps keep the place open for you!";
// this is the text sent to someone who clicks on the prim containing this script and who isn't the owner.

// first line of hover text above box (always constant)
string floaty = "__________ Donation Box\n";

// when total donated this month is less than monthlyneeded, display whatfunding_1 as the funding target,
// when it is more, display whatfunding_2. This allows you to show your donors when you have switched
// from funding your essential running costs to funding expansion.
string whatfunding_1 = "Funding : __________ \n";
string whatfunding_2 = "Funding : __________ \n";

// name of the current month
// we *could* get this automatically, but changing the month automatically isn't as easy as it seems.
// This is a change I might make in a future version.
string thismonth = "October";

// How much are we trying to raise per month?
// The script displays a countdown in SETTEXT above the prim its in, counting down until this target is reached.
// After this target is reached, the countdown disappears, being replaced with a tally.
// The goal of this is to encourage people to donate by setting a clear goal they feel they can help achieve by donating.
integer monthlyneeded = 30000;


// These two variables define the starting numbers for how much has been donated across all time, and how much this month.
// These starting numbers will have the donations the script recieves in between each reset/save added to it,
// and the result displayed in float text over the top of the script.
// The first time you start accepting donations, you should set both of the numbers below to zero.
// When saving this script, you (the object owner) should touch the donation box object,
// which will then tell you how much has been donated in total and how much has been donated this month.
// Entering this information here before saving will allow you to preserve the 'state' of the script across edits/restarts.
integer totaldonated = 0;
integer monthdonated = 0;

// these settings are like the above, but save the 'last donor' information. You can set them to "" and 0 to clear saved info.
string lastdonor = "Taffy Tinlegs";
integer lastdonated = 0;

// this interval defines how long we wait between each reminder to donate broadcast to SAY (range=20m)
integer timer_interval = 3600;

// these settings determine what the 'default' donation amounts are.
// the buttons are the 'fast pay' buttons, the 'payfield' is the default amount in the text box.
list paybuttons = [50,200,400,800];
integer payfield = 100;


// these variables should be left undefined.
string owner;
string otext;
integer mpercent;

integer updatemath() {
float mpercentfloat = ((monthdonated * 100) / monthlyneeded);
mpercent = (integer)mpercentfloat;

return 1;
}

integer updatetext() {
otext = floaty;

if (mpercent >= 100) {
otext += whatfunding_2;
} else {
otext += whatfunding_1;
}
if (lastdonated > 0) {
otext += "Last donation : L$" + (string)lastdonated + " by " + lastdonor +"\n";
}
if (mpercent >= 100) {
otext += "We have raised L$"+(string)(monthdonated - monthlyneeded)+" for this, beyond our basic running costs of L$"+(string)monthlyneeded+" for "+thismonth+". \n";
//otext += "The excess will go towards giving prizes and running special events!";
} else {
otext += "Our donors have contributed "+(string)mpercent+"% of our basic running costs ("+(string)monthdonated+"/"+(string)monthlyneeded+") for "+thismonth+".\n";
}
llSetText(otext,<1,1,1>,1);
return 1;
}
default
{
on_rez( integer sparam )
{
llResetScript();
}
state_entry()
{
updatemath();
updatetext();
owner = llKey2Name( llGetOwner() );
llSetPayPrice(payfield,paybuttons);
llSetTimerEvent(timer_interval);
llSay(0,"Script updated. Usually this is caused by the donation box owner updating the script.");
}

money(key id, integer amount)
{
totaldonated += amount;
monthdonated += amount;
lastdonor = llKey2Name(id);
lastdonated = amount;
updatemath();
updatetext();
llInstantMessage(id,"On behalf of everyone who uses this place, thank you for the donation!");
llSay(0,(string)llKey2Name(id)+" donated L$" + (string)amount + ". Thank you very much for supporting us, it is much appreciated!" );
}
touch_start(integer num_detected){
if (llDetectedKey(0) == llGetOwner()) {
llOwnerSay("Reporting script status, because you are recognised as the owner of this donation box.");
llOwnerSay("Current TOTAL donations across all time: L$"+(string)totaldonated);
llOwnerSay("Current TOTAL donations for this month: L$"+(string)monthdonated);
} else {
llInstantMessage(llDetectedKey(0),imtext);
}
}
timer() {
integer premainder = 100 - mpercent;
integer aremainder = monthlyneeded - monthdonated;
if (mpercent < 100) {
llSay(0,"We still need to meet the last "+(string)premainder+"% of our basic costs (L$"+(string)aremainder+") this month, to pay for land tier etc. Please consider donating to help us out!");
}
llSetTimerEvent(timer_interval);
}
}
_____________________
Volunteer Portal (FAQs!) : https://wiki.secondlife.com/wiki/Volunteer_Portal

JIRA / Issue Tracker : http://jira.secondlife.com (& http://tinyurl.com/2jropp)
Nada Epoch
The Librarian
Join date: 4 Nov 2002
Posts: 1,423
original thread
08-04-2006 22:35
/15/66/127049/1.html
_____________________
i've got nothing. ;)
Angel Fluffy
Very Helpful
Join date: 3 Mar 2006
Posts: 810
10-17-2006 13:17
Updated both this and the other topic's donation box script to version 1.6, which has improved comments/docs.
_____________________
Volunteer Portal (FAQs!) : https://wiki.secondlife.com/wiki/Volunteer_Portal

JIRA / Issue Tracker : http://jira.secondlife.com (& http://tinyurl.com/2jropp)
Angel Fluffy
Very Helpful
Join date: 3 Mar 2006
Posts: 810
added particle script
10-19-2006 10:29
Update : I also use this particle script for drawing attention to my donation box.
_____________________
Volunteer Portal (FAQs!) : https://wiki.secondlife.com/wiki/Volunteer_Portal

JIRA / Issue Tracker : http://jira.secondlife.com (& http://tinyurl.com/2jropp)
Tuber Potato
Registered User
Join date: 26 Jan 2006
Posts: 57
10-21-2006 13:09
I just wanted to say thanks! This script rools! I use it to raise funds for prizes and to pay for my stream. I also like that its fairly easy to read and see whats happening, so it can be edited to have appropriate thank yous etc...


Thanks Again!
Tuber Potato
Registered User
Join date: 26 Jan 2006
Posts: 57
10-22-2006 21:32
OK, I made one modification to this script that I think others might like so I'm posting the change.

Basically, I wanted the tip jar to hide the donation amounts, because some people are poor, and I appreciate them donating what ever they can with the tip jar making their small donations feel insignificant.

At the top with the rest of the variables, I added one for showing donation amount. make it equal to "yes" if you want the tip jar to announce the donation amount. Any other setting, like "no" will cause the script to hide the donation amount.

Edit: I realized I posted the copy of the script that had been customized with my particular needs (the text, time, etc) so I have reposted the original script with just the Hide Donation functionality added.

CODE
// CARP Donation box script. Written by Angel Fluffy, with credit to :
// Keknehv Psaltery, jean cook, ama omega, nada epoch, YadNi Monde
// for their work on the "DONATION box" script upon which it was based.

string imtext = "I'm the __________ Donation Box! Please right click and pay me to donate, as this supports the __________ project and helps keep the place open for you!";
// this is the text sent to someone who clicks on the prim containing this script and who isn't the owner.

// first line of hover text above box (always constant)
string floaty = "__________ Donation Box\n";

// when total donated this month is less than monthlyneeded, display whatfunding_1 as the funding target,
// when it is more, display whatfunding_2. This allows you to show your donors when you have switched
// from funding your essential running costs to funding expansion.
string whatfunding_1 = "Funding : __________ \n";
string whatfunding_2 = "Funding : __________ \n";

// name of the current month
// we *could* get this automatically, but changing the month automatically isn't as easy as it seems.
// This is a change I might make in a future version.
string thismonth = "October";

// How much are we trying to raise per month?
// The script displays a countdown in SETTEXT above the prim its in, counting down until this target is reached.
// After this target is reached, the countdown disappears, being replaced with a tally.
// The goal of this is to encourage people to donate by setting a clear goal they feel they can help achieve by donating.
integer monthlyneeded = 30000;

//this string is used to publicly announce how much people have donated.
//set to "yes" if you want to publicly announce who gave what.
//set to "no" if you would like to thank the donor, but not publicize their donation amount.
//this functionality was added by Tuber Potato, who wishes to allow some anonymity to his donors.
string announcedonation = "yes";

// These two variables define the starting numbers for how much has been donated across all time, and how much this month.
// These starting numbers will have the donations the script recieves in between each reset/save added to it,
// and the result displayed in float text over the top of the script.
// The first time you start accepting donations, you should set both of the numbers below to zero.
// When saving this script, you (the object owner) should touch the donation box object,
// which will then tell you how much has been donated in total and how much has been donated this month.
// Entering this information here before saving will allow you to preserve the 'state' of the script across edits/restarts.
integer totaldonated = 0;
integer monthdonated = 0;

// these settings are like the above, but save the 'last donor' information. You can set them to "" and 0 to clear saved info.
string lastdonor = "Taffy Tinlegs";
integer lastdonated = 0;

// this interval defines how long we wait between each reminder to donate broadcast to SAY (range=20m)
integer timer_interval = 3600;

// these settings determine what the 'default' donation amounts are.
// the buttons are the 'fast pay' buttons, the 'payfield' is the default amount in the text box.
list paybuttons = [50,200,400,800];
integer payfield = 100;


// these variables should be left undefined.
string owner;
string otext;
integer mpercent;

integer updatemath() {
float mpercentfloat = ((monthdonated * 100) / monthlyneeded);
mpercent = (integer)mpercentfloat;

return 1;
}

integer updatetext() {
otext = floaty;

if (mpercent >= 100) {
otext += whatfunding_2;
} else {
otext += whatfunding_1;
}
if (lastdonated > 0) {
if (announcedonation == "yes") {
otext += "Last Donation : L$" + (string)lastdonated + " by " + lastdonor +"\n";
} else { otext += Last Donor: " + lastdonor + "\n|;
}

}
if (mpercent >= 100) {
otext += "We have raised L$"+(string)(monthdonated - monthlyneeded)+" for this, beyond our basic running costs of L$"+(string)monthlyneeded+" for "+thismonth+". \n";
//otext += "The excess will go towards giving prizes and running special events!";
} else {
otext += "Our donors have contributed "+(string)mpercent+"% of our basic running costs ("+(string)monthdonated+"/"+(string)monthlyneeded+") for "+thismonth+".\n";
}
llSetText(otext,<1,1,1>,1);
return 1;
}
default
{
on_rez( integer sparam )
{
llResetScript();
}
state_entry()
{
updatemath();
updatetext();
owner = llKey2Name( llGetOwner() );
llSetPayPrice(payfield,paybuttons);
llSetTimerEvent(timer_interval);
llSay(0,"Script updated. Usually this is caused by the donation box owner updating the script.");
}

money(key id, integer amount)
{
totaldonated += amount;
monthdonated += amount;
lastdonor = llKey2Name(id);
lastdonated = amount;
updatemath();
updatetext();
llInstantMessage(id,"On behalf of everyone who uses this place, thank you for the donation!");
if (announcedonation == "yes") {
llSay(0,(string)llKey2Name(id)+" donated L$" + (string)amount + ". Thank you very much for supporting us, it is much appreciated!" );
} else {
llSay(0,"Thank you, " + (string)llKey2Name(id) + ", for your generous donation. It is greatly appreciated.");
}
}
touch_start(integer num_detected){
if (llDetectedKey(0) == llGetOwner()) {
llOwnerSay("Reporting script status, because you are recognised as the owner of this donation box.");
llOwnerSay("Current TOTAL donations across all time: L$"+(string)totaldonated);
llOwnerSay("Current TOTAL donations for this month: L$"+(string)monthdonated);
} else {
llInstantMessage(llDetectedKey(0),imtext);
}
}
timer() {
integer premainder = 100 - mpercent;
integer aremainder = monthlyneeded - monthdonated;
if (mpercent < 100) {
llSay(0,"We still need to meet the last "+(string)premainder+"% of our basic costs (L$"+(string)aremainder+") this month, to pay for land tier etc. Please consider donating to help us out!");
}
llSetTimerEvent(timer_interval);
}
}
Angel Fluffy
Very Helpful
Join date: 3 Mar 2006
Posts: 810
10-23-2006 10:04
Perhaps the 'show donations' button could be an integer, and donations with amounts less than this integer could have the donation amount hidden?

Example: if integer is set to 1, then all donations are listed by name and how much they donated. If on the other hand it's set to 10, then any donations of less than L$10 show up as just a name, with the amount hidden. If it's set to 1000, then any donations less than L$1000 have their amount hidden.

Perhaps this would allow people throwing in a few L$ to avoid feeling insignificant, whilst still allowing the large donors to be credited for their donation?

Personally I find that publishing a board of who has donated and how much they have donated encourages donations. People keep trying to out-donate each other, in order to get into the top 20/top 10 list of donors, which is seen as desirable. If one does that, it can also be helpful to put up a notice... something along the lines of "Supporting us by donations you can afford is welcome". This reminds people that they are NOT expected to donate beyond their means, meaning that the poor have no duty to donate, as they can't afford it.
_____________________
Volunteer Portal (FAQs!) : https://wiki.secondlife.com/wiki/Volunteer_Portal

JIRA / Issue Tracker : http://jira.secondlife.com (& http://tinyurl.com/2jropp)
Tuber Potato
Registered User
Join date: 26 Jan 2006
Posts: 57
10-23-2006 12:55
That's a good idea!

However, I find my large donors to be the ones wishing the anonymity just as much as my low donors. In fact, sometimes people tip me large amounts directly and ask me not to say anything. So such functionality does not meet my needs.

Also, I am not a full-time scripter or programmer by any stretch of the imagination. My simple adjustments took me a while and were solely motivated by my need to hide the amounts. In the spirit of open source, I provided the code.

So ultimately, I am using the script for more of a personal tip jar than an organization's income method. However, I like the fact that it can show that I do have actual costs and it does prompt tipping to help me meet that cost. If used on a large scale for a big night club or something, prompting bidding wars and such would be useful. But my addition just sort of makes the script usable by normal folks beyond the average no frills tip jar.

If someone were to request such an adjustment, I would be willing to help out and do what I can. But until then, necessity powers my adjustments.

Thanks again Angel, your script is a great!
Dragger Allen
Registered User
Join date: 3 Mar 2007
Posts: 247
05-16-2007 13:23
is any one else getting syntex errors all over this script i love the idea and the concept but i am not a scripter so have no idea what the errors actually are
Tuber Potato
Registered User
Join date: 26 Jan 2006
Posts: 57
05-16-2007 13:27
From: Dragger Allen
is any one else getting syntex errors all over this script i love the idea and the concept but i am not a scripter so have no idea what the errors actually are


Hi Dagger,

I just used my tip jar with this script the other day, and it worked fine. I would be happy to send you copy of my tip jar in world.

Tuber
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
05-16-2007 13:42
From: Dragger Allen
is any one else getting syntex errors all over this script i love the idea and the concept but i am not a scripter so have no idea what the errors actually are



The line
CODE

} else { otext += Last Donor: " + lastdonor + "\n|;


should be
CODE

} else { otext += "Last Donor: " + lastdonor + "\n";


Personally I'd get rid of the string compares for "yes" and use a straight boolean.
_____________________
I'm back......
Angel Fluffy
Very Helpful
Join date: 3 Mar 2006
Posts: 810
05-16-2007 14:47
From: Newgate Ludd
The line
CODE

} else { otext += Last Donor: " + lastdonor + "\n|;


should be
CODE

} else { otext += "Last Donor: " + lastdonor + "\n";


Personally I'd get rid of the string compares for "yes" and use a straight boolean.


Yes, this script is very old and has lots of room for improvement. If you do improve upon it, I'm sure everyone would appreciate you posting the improved version up here :)
_____________________
Volunteer Portal (FAQs!) : https://wiki.secondlife.com/wiki/Volunteer_Portal

JIRA / Issue Tracker : http://jira.secondlife.com (& http://tinyurl.com/2jropp)
Talisien Llewellyn
Inconnu Council of 12
Join date: 23 Sep 2007
Posts: 14
05-26-2008 09:15
Is it possible to have multiple tip jars communicate with each other across a region? I want to place a few around my sim, yet I would like them to work together to show the goal.
Luke Poplin
Registered User
Join date: 2 Feb 2007
Posts: 32
05-27-2008 09:31
Here is my untested take on it. Perhaps someone in world could test it.

I added the ability to network and some automatic month stuff. See the comments.

Also, added another script to reset the monthly amount automatically when it changes. Just add them both to the prim.

Feel free to use/correct/improve.

CODE

// Luke Poplin edit 27 May 08
// Changes:
// Edited formatting, comments and some variable names for my own readability
// Added automatic current month determination
// Added automatic month changeover via link message
// Added donation announcement on/off
// Added networking within region
// Added color variable for floating text

// CARP Donation box script. Written by Angel Fluffy, with credit to :
// Keknehv Psaltery, jean cook, ama omega, nada epoch, YadNi Monde
// for their work on the "DONATION box" script upon which it was based.

// Text sent to someone who clicks on the prim who isn't the owner.
string imtext = "I'm the __________ Donation Box! Please right click and pay me to donate, as this supports the __________ project and helps keep the place open for you!";


// First line of hover text above box (always constant)
// LP edit: Uses the name of the object (see state_entry)
string floaty;

// Hover text color. Default is white.
// Color list found @ http://lslwiki.net/lslwiki/wakka.php?wakka=Color
vector color = <1.0, 1.0, 1.0>;

// When total donated this month is less than monthlyneeded, display funding_1 as the funding target,
// when it is more, display funding_2. This allows you to show your donors when you have switched
// from funding your essential running costs to funding expansion.
string funding_1 = "Funding : __________ \n";
string funding_2 = "Funding : __________ \n";

// Name of the current month
//LP Edit: Added this function to determine name of current month
string thismonth()
{
list name = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "November", "December"];
list parse_stamp = llParseString2List(llGetTimestamp(), ["-", "T"], []);
integer month_num = (integer)llList2Float(parse_stamp, 1);
string month = llGetSubString(llList2String(name, month_num - 1), 0, -1);
return month;
}

// How much are we trying to raise per month?
// The script displays a countdown in SETTEXT above the prim its in, counting down until this target is reached.
// After this target is reached, the countdown disappears, being replaced with a tally.
// The goal of this is to encourage people to donate by setting a clear goal they feel they can help achieve by donating.
integer monthlyneeded = 30000;

// This boolean is used to publicly announce how much people have donated.
// set to TRUE if you want to publicly announce who gave what.
// set to FALSE if you would like to thank the donor, but not publicize their donation amount.
// this functionality was added by Tuber Potato, who wishes to allow some anonymity to his donors.
// LP Edit: Changed this to Boolean
integer announce = TRUE;

// These two variables define the starting numbers for how much has been donated across all time, and how much this month.
// These starting numbers will have the donations the script recieves in between each reset/save added to it,
// and the result displayed in float text over the top of the script.
// The first time you start accepting donations, you should set both of the numbers below to zero.
// When saving this script, you (the object owner) should touch the donation box object,
// which will then tell you how much has been donated in total and how much has been donated this month.
// Entering this information here before saving will allow you to preserve the 'state' of the script across edits/restarts.
integer totaldonated = 0;

// LP Edit: Added a reset for this if the month changes (see link_message).
// This is determined via linked message to the Month Check script.
integer monthdonated = 0;

// These settings are like the above, but save the 'last donor' information. You can set them to "" and 0 to clear saved info.
string lastdonor = "";
integer lastdonated = 0;

// Determine if box announces the reminder to donate.
// TRUE = makes announcement, FALSE = does not
integer verbose = TRUE;

// This interval defines how long we wait between each reminder to donate broadcast to SAY (range=20m)
integer timer_interval = 3600;

// These settings determine what the 'default' donation amounts are.
// the buttons are the 'fast pay' buttons, the 'payfield' is the default amount in the text box.
list paybuttons = [50,200,400,800];
integer payfield = 100;

// LP Edit: Added networking for boxes in the same region via llRegionSay
// Regional networking.
// TRUE = on. FALSE = off. Default is off.
integer networked = FALSE;

// Regional networking broadcast channel
integer ch_net = -11766421;


// these variables should be left undefined.
// LP Edit: Changed owner to Key type.
// The string variable wasn't being utilized.
// key owner being used in touch_start checks
key owner;
string otext;
integer mpercent;

integer updatemath()
{
float mpercentfloat = ( (monthdonated * 100) / monthlyneeded );
mpercent = (integer)mpercentfloat;
return 1;
}

integer updatetext()
{
otext = floaty;

if (mpercent >= 100)
{
otext += funding_2;
}
else
{
otext += funding_1;
}

if (lastdonated > 0)
{
if (announce)
{
otext += "Last Donation : L$" + (string)lastdonated + " by " + lastdonor +"\n";
}
else
{
otext += "Last Donor: " + lastdonor + "\n";
}
}

if (mpercent >= 100)
{
otext += "We have raised L$" + (string)(monthdonated - monthlyneeded) + " for this, beyond our basic running costs of L$" + (string)monthlyneeded + " for " + thismonth() + ". \n";
//otext += "The excess will go towards giving prizes and running special events!";
}
else
{
otext += "Our donors have contributed " + (string)mpercent + "% of our basic running costs (" + (string)monthdonated + "/" + (string)monthlyneeded + ") for " + thismonth() + ".\n";
}

llSetText(otext,color,1);
return 1;
}
default
{
changed(integer change)
{
if(change & CHANGED_OWNER)
{
llResetScript();
}
}

state_entry()
{
floaty = llGetObjectName() + "\n";
updatemath();
updatetext();
owner = llGetOwner();
llSetPayPrice(payfield,paybuttons);

if(networked)
{
llListen(ch_net, "", "", "");
}

if(verbose)
{
llSetTimerEvent(timer_interval);
}

// Initize month check by setting thismonth() as the starting month
llMessageLinked(LINK_THIS, 1, thismonth(), NULL_KEY);

llSay(0,"Script updated. Usually this is caused by the donation box owner updating the script.");
}

listen(integer channel, string name, key id, string message)
{
if( llGetOwnerKey(id) == owner)
{
list temp = llParseString2List(message, ["^"], []);
string last_name = llList2String(temp, 0);
integer last_don = llList2Integer(temp, 1);

totaldonated += last_don;
monthdonated += last_don;
lastdonor = last_name;
updatemath();
updatetext();
}
}

link_message(integer sender_number, integer number, string message, key id)
{
if(number == -1)
{
monthdonated = 0;
}
}

money(key id, integer amount)
{
totaldonated += amount;
monthdonated += amount;
lastdonor = llKey2Name(id);
lastdonated = amount;
updatemath();
updatetext();
llInstantMessage(id,"On behalf of everyone who uses this place, thank you for the donation!");

if(announce)
{
llSay(0,lastdonor + " donated L$" + (string)amount + ". Thank you very much for supporting us, it is much appreciated!" );
}
else
{
llSay(0,"Thank you, " + lastdonor + ", for your generous donation. It is greatly appreciated.");
}

//Send donation data to all boxes in the region. Format: "name^amount"
if(networked)
{
llRegionSay(ch_net, lastdonor + "^" + (string)lastdonated);
}
}

touch_start(integer num_detected)
{
key who;

if (who == owner)
{
llOwnerSay("Reporting script status, because you are recognised as the owner of this donation box.");
llOwnerSay("Current TOTAL donations across all time: L$" + (string)totaldonated);
llOwnerSay("Current TOTAL donations for this month: L$" + (string)monthdonated);
}
else
{
llInstantMessage(who,imtext);
}
}

timer()
{
integer premainder = 100 - mpercent;
integer aremainder = monthlyneeded - monthdonated;

if (mpercent < 100)
{
llSay(0,"We still need to meet the last " + (string)premainder + "% of our basic costs (L$" + (string)aremainder + ") this month, to pay for land tier etc. Please consider donating to help us out!");
}
}
}


Second Script:

CODE

//Month Check
//Luke Poplin
//27 May 08

string start_month;

string thismonth()
{
list name = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "November", "December"];
list parse_time = llParseString2List(llGetTimestamp(), ["-", "T"], []);
integer month_num = (integer)llList2Float(parse_time, 1);
string month = llGetSubString(llList2String(name, month_num - 1), 0, -1);
return month;
}

default
{
state_entry()
{
llSetTimerEvent(3600);
}

link_message(integer sender_number, integer number, string message, key id)
{
if(number == 1)
{
start_month = message;
}
}

timer()
{
if( start_month != thismonth() )
{
llMessageLinked(LINK_THIS, -1, "", NULL_KEY);
}
}
}
Very Keynes
LSL is a Virus
Join date: 6 May 2006
Posts: 484
05-27-2008 09:32
Yes, You would have one central script, as above, that displays the goal and totals etc. and will listen on a given channel, call it TipCH, the remote tip jars would then just be simple scripts that accept a payment and then llRegionSay(TipCh, information);

As for the actual coding behind that I will leave it up to you for now.
Jeffery Biedermann
Star Tech Industries CEO
Join date: 16 May 2007
Posts: 14
07-28-2008 12:39
Nice Update. I had a few problems with the script, still have one bug to fix, but if i can manage that, i will post up another update. :)
SkydiverAnarta Fall
Registered User
Join date: 22 Mar 2008
Posts: 4
Donation Jars
08-11-2008 03:27
Hi All,
I've just been reading the thread, and may I say open-mouthed! I know absolutely NOTHING about scripts, and am trying to find info on usage and a basic script for a donation jar. I don't want the jar to show my name, rather the Island name and can't figure out how to change this in the examples given. I would like to make my own jar and place the script into it as my Island is themed. Can anyone out there help?
Very Keynes
LSL is a Virus
Join date: 6 May 2006
Posts: 484
08-11-2008 04:47
From: SkydiverAnarta Fall
Can anyone out there help?


Here you are Skydiver, this should at least get you started.

CODE

// Simple Tip/Donations Jar
// By Very Keynes
// Use at will

integer Donations;
string Donor;
string Island = "Island name here";

display_paid()
{
llSetText("Donations for " + Island + " so far: " + (string) Donations + ".00", <1.0,1.0,1.0>,1.0);
}

default
{
state_entry()
{
display_paid();
}

money(key id, integer amount)
{
Donations += amount;
display_paid();
Donor = llGetSubString(llKey2Name(id), 0, llSubStringIndex(llKey2Name(id)," ") - 1);
llInstantMessage(id,"Thankyou for your donation, " + Donor + ".");
//llSay(0,"Thankyou for your donation, " + Donor + ".");
}
}



Just replace the string "Island name here" with the name of the island (or a Person / Venue).
It will display the Island name and total of all donations in Floating text, and send out a thankyou message to each Donor. As you said it was for an Island i set it to IM the Donor. For use in clubs you may prefer the llsay option (commented out above) as it will encurage other donors.
Remember that the money will go to the objects owner. If you want the money to be divided amongst the Islands owners then deed the Donations Jar to the owners Group.
Milton Hayek
Registered User
Join date: 28 Apr 2006
Posts: 25
syntax errors in Luke Poplin revision?
08-13-2008 14:36
From: Luke Poplin
Here is my untested take on it. Perhaps someone in world could test it.

I added the ability to network and some automatic month stuff. See the comments.

Also, added another script to reset the monthly amount automatically when it changes. Just add them both to the prim.

Feel free to use/correct/improve.

CODE

// Luke Poplin edit 27 May 08

...



Are the lines at the beginning ( "
CODE
 " ) and end ( " 
" ) supposed to be a part of the script? When I create a new script, delete what's in it, and copy and paste this into it, It complains of "syntax error at 0.0. When I delete the first line it complains of an error at the end. If anyone can enlighten me, thanks. And thanks to the authors. :)
Luke Poplin
Registered User
Join date: 2 Feb 2007
Posts: 32
08-13-2008 14:55
Milton,

There are 2 scripts in my example. If you go 3/4 of the way down you will see "Second Script:". That may be the problem.
Milton Hayek
Registered User
Join date: 28 Apr 2006
Posts: 25
Thanks, but still a syntax error
08-13-2008 15:39
From: Luke Poplin
Milton,

There are 2 scripts in my example. If you go 3/4 of the way down you will see "Second Script:". That may be the problem.


Thanks very much. My, that was a prompt response. I was indeed making that error despite having actually LOOKED for such a break mark. When I didn't find it (because I suck at finding things) I decided I had misunderstood and it was 1 script after all. But I've corrected that now and when I press the "save" button I still get a syntax error at 0,0 on the first script. Maybe I should just ignore it and see if it works anyway? Or would that be risking my tips too much?
Luke Poplin
Registered User
Join date: 2 Feb 2007
Posts: 32
08-13-2008 16:16
Scripts are good...delevered in world....CHEERS!