////////////////////////////////////////////////////////// // (C) Wizardry and Steamworks - 2011, GPLv3 // // Please see: http://www.gnu.org/licenses/gpl.html // // for legal details, rights of fair usage and // // the disclaimer and warranty conditions. // ////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////// // CONFIGURATION // ////////////////////////////////////////////////////////// // // string THANKS_MESSAGE = "Thank you for your tip %n%! %m% greatly appreciates it!"; string TIPPER_TOUCH_MESSAGE = "Hello %n%! This tipjar belongs to %m%. If you like my work, please consider giving me a tip. To tip me, please right-click my tipjar and select Pay and enter the ammount you would like to tip me with. Thank you!"; string TIPPER_DIALOG_MESSAGE = "Hello, %n%! Please choose an option from the ones below:\nJoin - will send you a group invite.\nGift - will send you a free gift!"; string OVERHEAD_MESSAGE = "%m%'s Tipjar, any tip is welcome!"; list TIPPER_TOUCH_MENU = [ "◆ Join ◆", "◆ Gift ◆" ]; key INVITE_GROUP_KEY = "004079ff-e1b0-c671-dd5e-eb4f6e361684"; string INVITE_GROUP_MESSAGE = "Please join the group %n%! To do so, please click the link in your history window (ctrl+h):"; list PAY_CHOICES = [25 ,50, 100, 200]; // // // END CONFIGURATION // ////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////// // INTERNALS // /////////////////////////////////////////////////////////////////////////// string tokenSubstitute(string input, key id) { list kSubst = llParseString2List(input, ["%"], [""]); integer itra; for(itra=0; itra, 1); } touch_start(integer num) { integer comChannel; if(llDetectedKey(0) == llGetOwner()) jump owner_touch; llInstantMessage(llDetectedKey(0), tokenSubstitute(TIPPER_TOUCH_MESSAGE, llDetectedKey(0))); comChannel = ((integer)("0x"+llGetSubString((string)llGetKey(),-8,-1)) & 0x3FFFFFFF) ^ 0xBFFFFFFF; comHandleTiper = llListen(comChannel, "", llDetectedKey(0), ""); llDialog(llDetectedKey(0), tokenSubstitute(TIPPER_DIALOG_MESSAGE, llDetectedKey(0)), TIPPER_TOUCH_MENU, comChannel); return; @owner_touch; comChannel = ((integer)("0x"+llGetSubString((string)llGetOwner(),-8,-1)) & 0x3FFFFFFF) ^ 0xBFFFFFFF; comHandleSpoiler = llListen(comChannel, "", llDetectedKey(0), ""); llDialog(llDetectedKey(0), "Tipjar: Please choose an option:\n", [ "◆ Tipers ◆", "◆ Tops ◆", "◆ Total ◆", "◆ Poofer ◆", "◆ Lights ◆", "◆ Orbits ◆" ], comChannel); } listen(integer channel, string name, key id, string message) { if(id == llGetOwner()) jump owner_com; if(message == "◆ Join ◆") { llInstantMessage(id, tokenSubstitute(INVITE_GROUP_MESSAGE, id) + "\n secondlife:///app/group/" + (string)INVITE_GROUP_KEY + "/about"); } if(message == "◆ Gift ◆") { integer itra; list gifts; for(itra=0; itra, 1); integer comChannel = ((integer)("0x"+llGetSubString((string)llGetOwner(),-8,-1)) & 0x3FFFFFFF) ^ 0xBFFFFFFF; comHandleSpoiler = llListen(comChannel, "", llGetOwner(), ""); llDialog(llGetOwner(), "\n" + llKey2Name(nowTipperKey) + " has just tipped you: L$" + (string)amount + ". What would you like to do?", [ "◆ Poof ◆", "◆ Light ◆", "◆ Orbit ◆" ], comChannel); } on_rez(integer num) { llResetScript(); } }