Shortnote

This is an extension of tipjar that implements particle effects when the current user of the tipjar is being tipped as well as lights, tipper tracker, texture orbit, totals and many more functions.

Setup

All the scripts should be placed in one single primitive along with any textures that you want to use.

Multifunction Tipjar Core

tipjar_core.lsl
//////////////////////////////////////////////////////////
// (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<llGetListLength(kSubst); ++itra) {
        if(llList2String(kSubst, itra) == "n") kSubst = llListReplaceList(kSubst, (list)llKey2Name(id), itra, itra);
        if(llList2String(kSubst, itra) == "m") kSubst = llListReplaceList(kSubst, (list)llKey2Name(llGetOwner()), itra, itra);
    }
    return llDumpList2String(kSubst, " ");
}
 
list tippers = [];
list tipperAmounts = [];
integer allSpoils = 0;
integer comHandleTiper = 0;
integer comHandleSpoiler = 0;
 
key nowTipperKey = NULL_KEY;
 
default
{
    state_entry() {
        llOwnerSay("Tipjar initialized and ready to be tipped. Good Luck " + llKey2Name(llGetOwner()) + "!");
        llSetPayPrice(0, PAY_CHOICES);
        llSetText(tokenSubstitute(OVERHEAD_MESSAGE, llGetOwner()), <1,1,1>, 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<llGetInventoryNumber(INVENTORY_OBJECT); ++itra) {
                gifts += llGetInventoryName(INVENTORY_OBJECT, itra);
            }
            for(itra=0; itra<llGetListLength(gifts); ++itra) {
                llGiveInventory(id, llList2String(gifts, itra));
            }
        }
        llListenRemove(comHandleTiper);
        return;
@owner_com;
        if(message == "◆ Tipers ◆") {
            integer itra;
            llInstantMessage(id, "---------- BEGIN TIPPERS ----------");
            for(itra=0; itra<llGetListLength(tippers); ++itra) {
                llInstantMessage(id, llKey2Name(llList2Key(tippers, itra)) + " has tipped you: l$" + llList2String(tipperAmounts, itra));
            }
            llInstantMessage(id, "----------- END TIPPERS -----------");
            return;
        }
        if(message == "◆ Poofer ◆") {
            llMessageLinked(LINK_THIS, 0, "tpoofer", "");
            return;
        }
        if(message == "◆ Poof ◆") {
            llMessageLinked(LINK_THIS, 0, "tpoof", nowTipperKey);
            return;
        }
        if(message == "◆ Lights ◆") {
            llMessageLinked(LINK_THIS, 0, "tlights", "");
            return;
        }
        if(message == "◆ Light ◆") {
            llMessageLinked(LINK_THIS, 0, "tlight", nowTipperKey);
            return;
        }
        if(message == "◆ Orbits ◆") {
            llMessageLinked(LINK_THIS, 0, "torbits", "");
            return;
        }
        if(message == "◆ Orbit ◆") {
            llMessageLinked(LINK_THIS, 0, "torbit", nowTipperKey);
            return;
        }
        if(message == "◆ Tops ◆") {
            integer itra;
            llInstantMessage(id, "---------- BEGIN TOP TIPPERS ----------");
            integer topNum;
            for(itra=0; itra<llGetListLength(tippers); ++itra) {
                if(itra==3) jump end_tippers;
                integer tip = llList2Integer(llListSort(tipperAmounts, 1, 0), itra);
                llInstantMessage(id, llKey2Name(llList2Key(tippers, llListFindList(tippers, (list)tip))) + " has tipped you: l$" + (string)tip);
            }
@end_tippers;
            llInstantMessage(id, "----------- END TOP TIPPERS -----------");
            return;
        }
        if(message == "◆ Total ◆") {
            llInstantMessage(id, "So far, " + llKey2Name(llGetOwner()) + " has made L$" + (string)allSpoils);
        }
        llListenRemove(comHandleSpoiler);
    }
 
    money(key id, integer amount) {
        if(~llListFindList(tippers, (list)id)) {
            integer tip = amount + llList2Integer(tipperAmounts, llListFindList(tippers, (list)id));
            tipperAmounts = llListReplaceList(tipperAmounts, (list)tip, llListFindList(tippers, (list)id), llListFindList(tippers, (list)id));
            jump tippers_updated;
        }
        tippers += id;
        tipperAmounts += amount;
@tippers_updated;
        allSpoils += amount;
        nowTipperKey = id;
        llMessageLinked(LINK_THIS, 0, "kpoof", nowTipperKey);
        llShout(0, tokenSubstitute(THANKS_MESSAGE, nowTipperKey));
        llSetText(llKey2Name(nowTipperKey) + " tipped me l$" + (string)amount, <1,1,1>, 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();
    }
}

Multifunction Tipjar Lights

tipjar_core.lsl
//////////////////////////////////////////////////////////
// (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.              //
//////////////////////////////////////////////////////////
 
///////////////////////////////////////////////////////////////////////////
//                              INTERNALS                                //
///////////////////////////////////////////////////////////////////////////
 
list menu_items = [];
list key_items = [];
integer mitra = 0;
list cList = [];
 
list tgtKeys = [];
list tgtNames = [];
string texName = "";
integer o = 0;
integer comHandle = 0;
integer comChannel = 0;
integer tmode = 0;
 
list mFwd() {
    if(mitra+1>llGetListLength(menu_items)) return cList;
    cList = llListInsertList(llListInsertList(llList2List(menu_items, ++mitra, (mitra+=9)), ["<= Back"], 0), ["Next =>"], 2);
    return cList;
} 
 
list mBwd() {
    if(mitra-19<0) return cList;
    cList = llListInsertList(llListInsertList(llList2List(menu_items, (mitra-=19), (mitra+=9)), ["<= Back"], 0), ["Next =>"], 2);
    return cList;
}
 
init() {
    llParticleSystem([]);
    comChannel = ((integer)("0x"+llGetSubString((string)llGetKey(),-8,-1)) & 0x3FFFFFFF) ^ 0xBFFFFFFF;
}
 
default {
 
    state_entry() {
        init();
    }
 
    on_rez(integer param) {
        llResetScript();
    }
 
    timer() {
        llSetTimerEvent(0);
        float cR = llFrand(1);
        float cG = llFrand(1);
        float cB = llFrand(1);
        llParticleSystem([5,<1,1,.0>,6,<2,2,.0>,1,<1,1,1>,3,<cR,cG,cB>,2,((float)1.0),4,((float)1.0),15,((integer)2),13,((float).8),7,((float)5.0),9,((integer)8),17,((float).5),18,((float).5),16,((float).5),22,(((float).4) * 3.14159274),23,(((float).0) * 3.14159274),8,<.0,.0,-.1>,0,((integer)355),20,llList2Key(tgtKeys,0)]);
        if(!--o) {
            llSetTimerEvent(0);
            llParticleSystem([]);
            return;
        }
        llSetTimerEvent(1);
    }
 
    link_message(integer sender_num, integer num, string str, key id) {
        if(str == "tlights") {
            llOwnerSay("Please wait, scanning for avatars...");
            llSensor("", "", AGENT, 96, TWO_PI);
            return;
        }
        if(str == "tlight") {
            tgtKeys = (list)id;
            integer itra;
            for(itra=2, mitra=0, menu_items=[]; itra<512; itra=itra<<1) {
                menu_items += (string)itra;
            }
            cList = llListInsertList(llListInsertList(llList2List(menu_items, mitra, (mitra+=9)), ["<= Back"], 0), ["Next =>"], 2);
            comHandle = llListen(comChannel+3, "", llGetOwner(), "");
            llDialog(llGetOwner(), "Please select the number of seconds the avatar will be poofed:\n", cList, comChannel+3);
            return;
        }
 
    }
 
    sensor(integer num) {
        integer itra;
        for(itra=0, mitra=0, tgtKeys=[], tgtNames=[], menu_items=[]; itra<num; ++itra) {
            string name = llDetectedName(itra);
            if(llDetectedKey(itra) != NULL_KEY) {
                tgtKeys += llDetectedKey(itra);
                tgtNames += llGetSubString(name, 0, 23);
                menu_items += llGetSubString(name, 0, 23);
            }
        }
        if(!llGetListLength(menu_items)) {
            llOwnerSay("Sorry, I could not find anybody around to poof.");
            return;
        }
        cList = llListInsertList(llListInsertList(llList2List(menu_items, mitra, (mitra+=9)), ["<= Back"], 0), ["Next =>"], 2);
        comHandle = llListen(comChannel+2, "", llGetOwner(), "");
        llDialog(llGetOwner(), "Please select an avatar to poof from the list below:\n", cList, comChannel+2);
    }
 
    listen(integer channel, string name, key id, string message) {
        if(message == "<= Back") {
            llDialog(id, "Please browse the available items:\n", mBwd(), channel);
            return;
        }
        if(message == "Next =>") {
            llDialog(id, "Please browse the available items:\n", mFwd(), channel);
            return;
        }
        if(channel == comChannel+2) {
            llListenRemove(comHandle);
            integer itra=llGetListLength(tgtNames)-1;
            do {
                if(llGetSubString(message,0,23) == llList2String(tgtNames, itra)) {
                    tgtKeys = (list)llList2Key(tgtKeys, itra);
                    jump found_target;
                }
            } while(--itra>=0);
@found_target;
            for(itra=2, mitra=0, menu_items=[]; itra<512; itra=itra<<1) {
                menu_items += (string)itra;
            }
            cList = llListInsertList(llListInsertList(llList2List(menu_items, mitra, (mitra+=9)), ["<= Back"], 0), ["Next =>"], 2);
            comHandle = llListen(comChannel+3, "", llGetOwner(), "");
            llDialog(llGetOwner(), "Please select the number of seconds the avatar will be poofed:\n", cList, comChannel+3);
            return;
        }
 
        if(channel == comChannel+3) {
            llListenRemove(comHandle);
            o = (integer)message;
            llSetTimerEvent(2);
        }
    }
}

Multifunction Tipjar Orbiter

tipjar_orbiter.lsl
//////////////////////////////////////////////////////////
// (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.              //
//////////////////////////////////////////////////////////
 
///////////////////////////////////////////////////////////////////////////
//                              INTERNALS                                //
///////////////////////////////////////////////////////////////////////////
 
list menu_items = [];
list key_items = [];
integer mitra = 0;
list cList = [];
 
list tgtNames = [];
integer comHandle = 0;
integer comChannel = 0;
list tgtKeys = [];
string orbitTexture = "";
 
list mFwd() {
    if(mitra+1>llGetListLength(menu_items)) return cList;
    cList = llListInsertList(llListInsertList(llListInsertList(llList2List(menu_items, ++mitra, (mitra+=9)), ["<= Back"], 0), ["[ ALL ]"], 1), ["Next =>"], 2);
    return cList;
} 
 
list mBwd() {
    if(mitra-19<0) return cList;
    cList = llListInsertList(llListInsertList(llListInsertList(llList2List(menu_items, (mitra-=19), (mitra+=9)), ["<= Back"], 0), ["[ ALL ]"], 1), ["Next =>"], 2);
    return cList;
}
 
init() {
    comChannel = ((integer)("0x"+llGetSubString((string)llGetKey(),-8,-1)) & 0x3FFFFFFF) ^ 0xBFFFFFFF;
}
 
integer Key2Number(key objKey) {
  return llAbs(((integer)("0x"+llGetSubString((string)objKey,-8,-1)) & 0x3FFFFFFF) ^ 0xBFFFFFFF);
}
 
default {
 
    state_entry() {
        init();
    }
 
    on_rez(integer param) {
        llResetScript();
    }
 
    link_message(integer sender_num, integer num, string str, key id) {
        if(id == "kcr_key") {
            llGiveInventory((key)str, orbitTexture);
            return;
        }
        if(str == "torbits") {
            llOwnerSay("Please wait, scanning for avatars...");
            llSensor("", "", AGENT, 64, TWO_PI);
            return;
        }
        if(str == "torbit") {
            integer itra;
            for(itra=0, mitra=0, menu_items=[]; itra<llGetInventoryNumber(INVENTORY_TEXTURE); ++itra) {
                menu_items += llGetSubString(llGetInventoryName(INVENTORY_TEXTURE, itra), 0, 23);
            }
            if(!llGetListLength(menu_items)) {
                llOwnerSay("Sorry, I have no textures loaded in my inventory. Drop some textures in my inventory first.");
                return;
            }
            cList = llListInsertList(llListInsertList(llList2List(menu_items, mitra, (mitra+=9)), ["<= Back"], 0), ["Next =>"], 2);
            comHandle = llListen(comChannel+2, "", llGetOwner(), "");
            llDialog(llGetOwner(), "Please select a texture to poof an avatar with:\n", cList, comChannel+2);
            return;
        }
 
    }
 
    sensor(integer num) {
        integer itra;
        for(itra=0, mitra=0, menu_items=[], tgtNames=[], tgtKeys=[]; itra<num; ++itra) {
            key detectedAVKey = llDetectedKey(itra);
            vector detectedAVPos = llDetectedPos(itra);
            string detectedAVName = llDetectedName(itra);
            if(detectedAVKey != NULL_KEY && llVecDist(llGetPos(), detectedAVPos) < 64) {
                tgtNames += llGetSubString(detectedAVName,0,23);
                tgtKeys += detectedAVKey;
                menu_items += llGetSubString(detectedAVName,0,23);
            }
        }
        if(!llGetListLength(menu_items)) {
            llOwnerSay("Sorry, I could not find anybody around to poof.");
            return;
        }
        cList = llListInsertList(llListInsertList(llList2List(menu_items, mitra, (mitra+=9)), ["<= Back"], 0), ["Next =>"], 2);
        comHandle = llListen(comChannel+1, "", llGetOwner(), "");
        llDialog(llGetOwner(), "Please select an avatar to surround in the bubble from the list below:\n", cList, comChannel+1);
    }
 
    listen(integer channel, string name, key id, string message) {
        if(channel == comChannel+1) {
            llListenRemove(comHandle);
            integer itra=llGetListLength(tgtNames)-1;
            do {
                if(llGetSubString(message,0,23) == llList2String(tgtNames, itra)) {
                    tgtKeys = (list)llList2Key(tgtKeys, itra);
                    jump found_target;
                }
            } while(--itra>=0);
@found_target;
            for(itra=0, mitra=0, menu_items=[]; itra<llGetInventoryNumber(INVENTORY_TEXTURE); ++itra) {
                menu_items += llGetSubString(llGetInventoryName(INVENTORY_TEXTURE, itra), 0, 23);
            }
            if(!llGetListLength(menu_items)) {
                llOwnerSay("Sorry, I have no textures loaded in my inventory. Drop some textures in my inventory first.");
                return;
            }
            cList = llListInsertList(llListInsertList(llList2List(menu_items, mitra, (mitra+=9)), ["<= Back"], 0), ["Next =>"], 2);
            comHandle = llListen(comChannel+2, "", llGetOwner(), "");
            llDialog(llGetOwner(), "Please select a texture to poof an avatar with:\n", cList, comChannel+2);
            return;
        }
        if(channel == comChannel+2) {
            llListenRemove(comHandle);
            orbitTexture = message;
            llMessageLinked(LINK_THIS, 0, "[K] Particle Surround" + "," + (string)(llGetPos() + <0,0,1>) + "," + (string)ZERO_VECTOR + "," + (string)ZERO_ROTATION + "," + (string)Key2Number(llList2Key(tgtKeys,0)), "kcr_rez");
            return;
        }
    }
}

Multifunction Tipjar Poofer

tipjar_poofer.lsl
//////////////////////////////////////////////////////////
// (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.              //
//////////////////////////////////////////////////////////
 
///////////////////////////////////////////////////////////////////////////
//                              INTERNALS                                //
///////////////////////////////////////////////////////////////////////////
 
list menu_items = [];
list key_items = [];
integer mitra = 0;
list cList = [];
 
list tgtKeys = [];
list tgtNames = [];
string texName = "";
integer o = 0;
integer comHandle = 0;
integer comChannel = 0;
 
list mFwd() {
    if(mitra+1>llGetListLength(menu_items)) return cList;
    cList = llListInsertList(llListInsertList(llList2List(menu_items, ++mitra, (mitra+=9)), ["<= Back"], 0), ["Next =>"], 2);
    return cList;
} 
 
list mBwd() {
    if(mitra-19<0) return cList;
    cList = llListInsertList(llListInsertList(llList2List(menu_items, (mitra-=19), (mitra+=9)), ["<= Back"], 0), ["Next =>"], 2);
    return cList;
}
 
init() {
    llParticleSystem([]);
    comChannel = ((integer)("0x"+llGetSubString((string)llGetKey(),-8,-1)) & 0x3FFFFFFF) ^ 0xBFFFFFFF;
}
 
default {
 
    state_entry() {
        init();
    }
 
    on_rez(integer param) {
        llResetScript();
    }
 
    timer() {
        llSetTimerEvent(0);
        llParticleSystem([12,texName,5,<.2,.2,.2>,6,<.45,.45,.45>,1,<1,1,1>,3,<1,1,1>,2,((float)1.0),4,((float)1.0),15,((integer)2),13,((float).8),7,((float)5.0),9,((integer)8),17,((float).5),18,((float).5),16,((float).5),22,(((float).4) * 3.14159274),23,(((float).0) * 3.14159274),8,<.0,.0,-.1>,0,((integer)335),20,llList2Key(tgtKeys,0)]);
        if(!--o) {
            llSetTimerEvent(0);
            llParticleSystem([]);
            return;
        }
        llSetTimerEvent(1);
    }
 
    link_message(integer sender_num, integer num, string str, key id) {
        if(str == "tpoofer") {
            llOwnerSay("Please wait, scanning for avatars...");
            llSensor("", "", AGENT, 96, TWO_PI);
            return;
        }
        if(str == "tpoof") {
            tgtKeys = (list)id;
            integer itra;
            for(itra=0, mitra=0, menu_items=[]; itra<llGetInventoryNumber(INVENTORY_TEXTURE); ++itra) {
                menu_items += llGetSubString(llGetInventoryName(INVENTORY_TEXTURE, itra), 0, 23);
            }
            if(!llGetListLength(menu_items)) {
                llOwnerSay("Sorry, I have no textures loaded in my inventory. Drop some textures in my inventory first.");
                return;
            }
            cList = llListInsertList(llListInsertList(llList2List(menu_items, mitra, (mitra+=9)), ["<= Back"], 0), ["Next =>"], 2);
            comHandle = llListen(comChannel+2, "", llGetOwner(), "");
            llDialog(llGetOwner(), "Please select a texture to poof an avatar with:\n", cList, comChannel+2);
            return;
        }
    }
 
    sensor(integer num) {
        integer itra;
        for(itra=0, mitra=0, tgtKeys=[], tgtNames=[], menu_items=[]; itra<num; ++itra) {
            string name = llDetectedName(itra);
            if(llDetectedKey(itra) != NULL_KEY) {
                tgtKeys += llDetectedKey(itra);
                tgtNames += llGetSubString(name, 0, 23);
                menu_items += llGetSubString(name, 0, 23);
            }
        }
        if(!llGetListLength(menu_items)) {
            llOwnerSay("Sorry, I could not find anybody around to poof.");
            return;
        }
        cList = llListInsertList(llListInsertList(llList2List(menu_items, mitra, (mitra+=9)), ["<= Back"], 0), ["Next =>"], 2);
        comHandle = llListen(comChannel+1, "", llGetOwner(), "");
        llDialog(llGetOwner(), "Please select an avatar to poof from the list below:\n", cList, comChannel+1);
    }
 
    listen(integer channel, string name, key id, string message) {
        if(message == "<= Back") {
            llDialog(id, "Please browse the available items:\n", mBwd(), channel);
            return;
        }
        if(message == "Next =>") {
            llDialog(id, "Please browse the available items:\n", mFwd(), channel);
            return;
        }
        if(channel == comChannel+1) {
            llListenRemove(comHandle);
            integer itra=llGetListLength(tgtNames)-1;
            do {
                if(llGetSubString(message,0,23) == llList2String(tgtNames, itra)) {
                    tgtKeys = (list)llList2Key(tgtKeys, itra);
                    jump found_target;
                }
            } while(--itra>=0);
@found_target;
            for(itra=0, mitra=0, menu_items=[]; itra<llGetInventoryNumber(INVENTORY_TEXTURE); ++itra) {
                menu_items += llGetSubString(llGetInventoryName(INVENTORY_TEXTURE, itra), 0, 23);
            }
            if(!llGetListLength(menu_items)) {
                llOwnerSay("Sorry, I have no textures loaded in my inventory. Drop some textures in my inventory first.");
                return;
            }
            cList = llListInsertList(llListInsertList(llList2List(menu_items, mitra, (mitra+=9)), ["<= Back"], 0), ["Next =>"], 2);
            comHandle = llListen(comChannel+2, "", llGetOwner(), "");
            llDialog(llGetOwner(), "Please select a texture to poof an avatar with:\n", cList, comChannel+2);
            return;
        }
        if(channel == comChannel+2) {
            integer itra=llGetInventoryNumber(INVENTORY_TEXTURE);
            do {
                if(llGetSubString(llGetInventoryName(INVENTORY_TEXTURE, itra), 0, 23) == message) {
                    texName = llGetInventoryName(INVENTORY_TEXTURE, itra);
                    jump found_texture;
                }
            } while(--itra>=0);
@found_texture;
            llListenRemove(comHandle);
            for(itra=2, mitra=0, menu_items=[]; itra<512; itra=itra<<1) {
                menu_items += (string)itra;
            }
            cList = llListInsertList(llListInsertList(llList2List(menu_items, mitra, (mitra+=9)), ["<= Back"], 0), ["Next =>"], 2);
            comHandle = llListen(comChannel+3, "", llGetOwner(), "");
            llDialog(llGetOwner(), "Please select the number of seconds the avatar will be poofed:\n", cList, comChannel+3);
            return;
        }
 
        if(channel == comChannel+3) {
            llListenRemove(comHandle);
            o = (integer)message;
            llSetTimerEvent(2);
        }
    }
}

Multifunction Tipjar Rezzer

tipjar_rezzer.lsl
//////////////////////////////////////////////////////////
// (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.              //
//////////////////////////////////////////////////////////
 
string objectName = "";
integer reqID = 0;
 
default
{
    link_message(integer sender_num, integer num, string str, key id)
    {
        if(id != "kcr_rez") return;
        list data = llCSV2List(str);
        if(llGetListLength(data) != 5) {
            llSay(DEBUG_CHANNEL, "Rezzer expected 5 parameters and got only: " + (string)llGetListLength(data));
            return;
        }
        reqID = sender_num;
        objectName = llList2String(data, 0);
        list posDec = llParseString2List(llList2String(data, 1), ["<", ">", ","], []);
        vector pos = ZERO_VECTOR;
        pos.x = llList2Integer(posDec, 0);
        pos.y = llList2Integer(posDec, 1);
        pos.z = llList2Integer(posDec, 2);
        list velDec = llParseString2List(llList2String(data, 2), ["<", ">", ","], []);
        vector vel = ZERO_VECTOR;
        vel.x = llList2Integer(velDec, 0);
        vel.y = llList2Integer(velDec, 1);
        vel.z = llList2Integer(velDec, 2);
        list rotDec = llParseString2List(llList2String(data, 3), ["<", ">", ","], []);
        rotation rot = ZERO_ROTATION;
        rot.x = llList2Integer(rotDec, 0);
        rot.y = llList2Integer(rotDec, 1);
        rot.z = llList2Integer(rotDec, 2);
        rot.s = llList2Integer(rotDec, 3);
        llRezObject(objectName, pos, vel, rot, llList2Integer(data, 4));
        llSensor(objectName, "", ACTIVE|PASSIVE|SCRIPTED, 64, TWO_PI);
    }
 
    sensor(integer num)
    {
        key rezObjectKey = NULL_KEY;
        string rezObjectName = "";
 
        integer itra = 0;
        do {
            rezObjectKey = llDetectedKey(itra);
            rezObjectName = llDetectedName(itra);
            if(rezObjectName == objectName) {
                jump found_object;
            }
        } while(++itra<num);
        llSensor(objectName, "", ACTIVE|PASSIVE|SCRIPTED, 64, TWO_PI);
        return;
@found_object;
        llMessageLinked(reqID, 0, rezObjectKey, "kcr_key");
    }
    on_rez(integer num) {
        llResetScript();
    }
}

Particle Surround

For orbiting, you need to create a primitive called [K] Particle Surround and make the primitive invisible and temporary. Then, add the following script into the primitive and then place it in the tipjar.

tipjar_orbiter.lsl
//////////////////////////////////////////////////////////
// (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.              //
//////////////////////////////////////////////////////////
 
///////////////////////////////////////////////////////////////////////////
//                              INTERNALS                                //
///////////////////////////////////////////////////////////////////////////
 
integer Key2Number(key objKey) {
  return llAbs(((integer)("0x"+llGetSubString((string)objKey,-8,-1)) & 0x3FFFFFFF) ^ 0xBFFFFFFF);
}
 
integer hidTarget = -1;
integer nTarget = -1;
key avKey = NULL_KEY;
 
default
{
    at_target(integer tnum, vector targetpos, vector ourpos) {
        if(avKey == NULL_KEY) return;
        llParticleSystem([  // start of particle settings
           // Texture Parameters:
           PSYS_SRC_TEXTURE, llGetInventoryName(INVENTORY_TEXTURE, 0),
           PSYS_PART_START_SCALE, <.50, .50, .50>,  PSYS_PART_END_SCALE, <.50, .50, .50>, 
           PSYS_PART_START_COLOR, <1,1,1>, PSYS_PART_END_COLOR, <1,1,1>, 
           PSYS_PART_START_ALPHA, (float) 1,       PSYS_PART_END_ALPHA, (float) 1,     
 
           // Production Parameters:
           PSYS_SRC_BURST_PART_COUNT, (integer)  2, 
           PSYS_SRC_BURST_RATE,         (float)  .20,  
           PSYS_PART_MAX_AGE,           (float)  3.30, 
           PSYS_SRC_MAX_AGE,            (float)  .00, 
 
           // Placement Parameters:
           PSYS_SRC_PATTERN, (integer) 8, // 1=DROP, 2=EXPLODE, 4=ANGLE, 8=CONE,
 
           // Placement Parameters (for any non-DROP pattern):
           PSYS_SRC_BURST_SPEED_MIN, (float) .01, PSYS_SRC_BURST_SPEED_MAX, (float) .05, 
           PSYS_SRC_BURST_RADIUS, (float) 2,
 
           // Placement Parameters (only for ANGLE & CONE patterns):
           PSYS_SRC_ANGLE_BEGIN, (float) .00 *PI,  PSYS_SRC_ANGLE_END, (float) 1 *PI,  
           PSYS_SRC_OMEGA, <00.00, 00.00, 00.00>, 
 
           // After-Effect & Influence Parameters:
           //PSYS_SRC_ACCEL, < 0, 0, 0>,
           PSYS_SRC_TARGET_KEY, (key) llGetLinkKey(llGetLinkNumber() + 1), 
 
           PSYS_PART_FLAGS, (integer) ( 0                  // Texture Options:     
                                | PSYS_PART_INTERP_COLOR_MASK   
                                | PSYS_PART_INTERP_SCALE_MASK   
                                | PSYS_PART_EMISSIVE_MASK   
                             // | PSYS_PART_FOLLOW_VELOCITY_MASK
                                                  // After-effect & Influence Options:
                              | PSYS_PART_WIND_MASK            
                              | PSYS_PART_BOUNCE_MASK          
                             // | PSYS_PART_FOLLOW_SRC_MASK     
                              | PSYS_PART_TARGET_POS_MASK     
                             // | PSYS_PART_TARGET_LINEAR_MASK    
                            )
            //end of particle settings                     
        ]);
    }
    not_at_target() {
        llSleep(1);
        llTargetRemove(nTarget);
        vector pos = llList2Vector(llGetObjectDetails(avKey, [OBJECT_POS]), 0);
        nTarget = llTarget(pos, 1);
        llMoveToTarget(pos, .5);
    }
    timer() {
        llSetTimerEvent(0);
        llTargetRemove(nTarget);
        vector pos = llList2Vector(llGetObjectDetails(avKey, [OBJECT_POS]), 0);
        nTarget = llTarget(pos, 1);
        llMoveToTarget(pos, .5);
        llSetTimerEvent(1);
    }
    on_rez(integer param) {
        hidTarget = param;
        llSetPrimitiveParams([PRIM_TEMP_ON_REZ, 1]);
        llSensorRepeat("", "", AGENT, 64, TWO_PI, (1.0 - llGetRegionTimeDilation())*10.0); 
    }
    sensor(integer num_detected) {
        integer itra;
        for(itra=0; itra<num_detected; ++itra) {
            avKey = llDetectedKey(itra);
            if(Key2Number(avKey) == hidTarget) {
                llSensorRemove();
                vector size = llGetAgentSize(avKey);
                size.z += .17 + .5;
                llSetScale(<size.z, size.z, size.z>);
                llSetStatus(STATUS_PHYSICS|STATUS_PHANTOM, TRUE);
                llSetTimerEvent(1);
                return;
            }
        }
    }
}

secondlife/multifunction_tipjar.txt · Last modified: 2022/11/24 07:46 by 127.0.0.1

Access website using Tor Access website using i2p Wizardry and Steamworks PGP Key


For the contact, copyright, license, warranty and privacy terms for the usage of this website please see the contact, license, privacy, copyright.