/////////////////////////////////////////////////////////////////////////// // Copyright (C) Wizardry and Steamworks 2012 - License: GNU GPLv3 // // Please see: http://www.gnu.org/licenses/gpl.html for legal details, // // rights of fair usage, the disclaimer and warranty conditions. // /////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////// // CONFIGURATION // /////////////////////////////////////////////////////////////////////////// // Set this to the amount of L$ needed to attain the goal. integer GOAL = 100; /////////////////////////////////////////////////////////////////////////// // INTERNALS // /////////////////////////////////////////////////////////////////////////// // Progress @ http://grimore.org/fuss:lsl string wasProgress(integer percent, integer length, list symbols) { percent /= (integer)((float)100.0/(length)); string p = llList2String(symbols,0); integer itra = 0; do { if(itra>percent-1) p += llList2String(symbols,2); else p += llList2String(symbols,1); } while(++itra, 1); // If the goal hasn't been reached, jump to the doner section. if((integer)llGetObjectDesc() < GOAL) jump doner; // If the goal has been attained or overstepped, // let the owner know, schedule a reset and return. llInstantMessage(llGetOwner(), "Donation goal attained!"); llSetTimerEvent(60); return; @doner; // If somebody tipped and this is not a script restart, // then get the display text and add a thank you message // for the last tipper. We grab just the first name of // the tipper to make the donation jar more personal. if(_lastTip) { llSetText(llList2String(llGetPrimitiveParams([ PRIM_TEXT ]), 0) + "\nThank you, " + llList2String(llParseString2List(llKey2Name(_lastTip), [" "], [""]), 0) + "!", <.5,1,1>, 1); _lastTip = ""; } // Go back to accepting donations. state donations; } timer() { // The goal has been attained, so after 60s we // set the donations back to zero (laff) and we // go back to accept donations. llSetObjectDesc("0"); state donations; } on_rez(integer num) { llResetScript(); } }