Bots Home
|
Create an App
daisy
Author:
bob
Description
Source Code
Launch Bot
Current Users
Created by:
Bob
// title - daisybot // author - @daisy_marz // including bits of code from indshadow, aperson1, badbadbhudda, and kinddino because i'm a dumb baby // author's note:i worked really hard on this so please do not duplicate! if you modify my code, i would appreciate it if you please gave credit! // //includes: //-clubs //-optional freeze //-optional thank you //-rotating notifier for announcements and deals //-tip menu and elite menu //-hatstore cb.settings_choices = [ { name: 'memberList', label: "list of all club members. each club is delimited by semicolons, and each member in each club is delimited by commas. [cc;kk;ha;eha;]", type: 'str', minlength: 0, maxlength: 10240, required: false, defaultValue: '' }, { name: 'docoloring', label: 'change background coloring for club members?', type: 'choice', choice1: 'yes', choice2: 'no', required: true, defaultValue: 'yes' }, { name: 'dotext', label: 'add text labels in front of club members?', type: 'choice', choice1: 'yes', choice2: 'no', required: true, defaultValue: 'yes' }, { name: 'limitlist', label: 'limit club listing (/clublist)?', type: 'choice', choice1: 'broadcaster only', choice2: 'broadcaster and mods', choice3: 'everyone', required: true, defaultValue: 'broadcaster and mods'}, { name: 'cctip', label: 'tip amount to become a cum club member:', type: 'int', minValue: 1, required: true, defaultValue: 500}, { name: 'kktip', label: 'tip amount to become a kink kult member:', type: 'int', minValue: 1, required: true, defaultValue: 510}, { name: 'ccBGcolor', label: 'cum club color:', type: 'str', minLength: 0, maxLength: 6, required: true, defaultValue: 'BBECFC'}, { name: 'kkBGcolor', label: 'kink kult color:', type: 'str', minLength: 0, maxLength: 6, required: true, defaultValue: '3ACCFC'}, { name: 'haBGcolor', label: 'hacker color:', type: 'str', minLength: 0, maxLength: 6, required: true, defaultValue: 'A8F0E6'}, { name: 'ehaBGcolor', label: 'elite hacker color:', type: 'str', minLength: 0, maxLength: 6, required: true, defaultValue: '7B7B7B'}, {name: 'tipmenutoggle', label: 'enable tip menu?', type: 'choice', choice1: 'yes', choice2: 'no', defaultValue: 'yes'}, //{name: 'leaderboardtoggle', label: 'enable leaderboard?', type: 'choice', choice1: 'yes', choice2: 'no', defaultValue: 'yes'}, //{name: 'tipdisplaytoggle', label: 'display how much a user has tipped next to their name?', type: 'choice', choice1: 'yes', choice2: 'no', defaultValue: 'no'}, {name: 'freezetoggle', label: 'would you like to use the freeze counter?', type: 'choice', choice1: 'yes', choice2: 'no', defaultValue: 'yes'}, {name: 'freezetip', label: 'tip amount to freeze daisy:', type: 'int', minValue: 1, defaultValue: 11}, {name: 'freezetime', label: 'seconds to increase freeze by:', type: 'int', minValue: 1, defaultValue: 5}, {name: 'thawtip', label: 'tip amount to thaw daisy:', type: 'int', minValue: 1, defaultValue: 12}, {name: 'thawtime', label: 'seconds to reduce freeze by:', type: 'int', minValue: 1, defaultValue: 5}, {name: 'thankstoggle', label: 'automatic thank you for tips over 25tk?', type: 'choice', choice1: 'yes', choice2: 'no', defaultValue: 'yes'}, {name: 'thanksmessage', label: 'thank you message:', type: 'str', minLength: 1, maxLength: 1000, defaultValue: 'thanks!'}, {name: 'notifiertoggle', label: 'would you like to periodically send messages to the room?', type: 'choice', choice1: 'yes', choice2: 'no', defaultValue: 'yes'}, {name:'msgcolor', type:'str', label:'message color:', defaultValue: '#7B7B7B'}, {name: 'msg1', label: 'message one:', type: 'str', minLength: 1, maxLength: 1000, defaultValue: 'love me!'}, {name: 'msg2', label: 'message two:', type: 'str', minLength: 1, maxLength: 1000, defaultValue: 'uwu!',required: false}, {name: 'msg3', label: 'message three', type: 'str', minLength: 1, maxLength: 1000, defaultValue: 'owo!',required: false}, {name: 'msg4', label: 'message four:', type: 'str', minLength: 1, maxLength: 1000, defaultValue: 'uWu!',required: false}, {name: 'msg5', label: 'message five:', type: 'str', minLength: 1, maxLength: 1000, defaultValue: 'OwO!',required: false}, ] // club variables var cctext = 'cum club'; var ccannounce = 'welcome to the cum club, MEMBERNAME!'; var ccjoinannounce = 'cum club member MEMBERNAME has joined the chat!'; var kktext = 'kink kult'; var kkannounce = 'welcome to the kink kult, MEMBERNAME!'; var kkjoinannounce = 'kink kult member MEMBERNAME has joined the chat!'; var hatext = 'h4x0r'; var haannounce = 'MEMBERNAME broke the system!'; var hajoinannounce = 'hacker MEMBERNAME has joined the chat! hide your IP.'; var ehatext = 'l337 h4x0r'; var ehaannounce = 'hacker MEMBERNAME broke the system AGAIN and became elite! they now have access to the elite menu.'; var ehajoinannounce = 'elite hacker MEMBERNAME has joined the chat! this is now their domain.'; var ccMembers = []; var kkMembers = []; var haMembers = []; var ehaMembers = []; // freeze variables var totalfreezetime = 0; var freezerunning = false; // thank you variables var minthanktip = 25; var badtip = 666 var verybadtip = 2222 //notifier variables var i=0; var maxitems = 5; var notifminutes = 3; //tip menu variables var menuminutes = 5; var menuitemcolor = '#F590AA'; var secretmenuitemcolor = '#c6efff'; var elitemenuitemcolor = '#0535ff'; //hatstore variables var blkhattext = ':l33tblackhatt '; var gryhattext = ':l33tgreyhatt '; var whthattext = ':l33twhitehatt '; var pnkhattext = ':l33tpinkhatt '; var blkhatannounce = 'MEMBERNAME has put on a black hat!'; var gryhatannounce = 'MEMBERNAME has put on a grey hat!'; var whthatannounce = 'MEMBERNAME has put on a white hat!'; var pnkhatannounce = 'MEMBERNAME has put on a pink hat!'; var hatlessannounce = 'MEMBERNAME took off their hat.' var hasblkhat = []; var haswhthat = []; var hasgryhat = []; var haspnkhat = []; ////////////////////////////////////////// //leaderboard vars //how often the leaderboard should periodically show up in the chat (in mins) var leaderboardminutes = 10; cb.onMessage(function (msg) { var u = msg['user']; //clubmsgs if (iscc(u)) { if(cb.settings.docoloring == 'yes') { msg['background'] = '#' + cb.settings.ccBGcolor; } if(cb.settings.dotext == 'yes') { msg['m'] = "[" + cctext + "] " + msg['m']; } } else if (iskk(u)) { if(cb.settings.docoloring == 'yes') { msg['background'] = '#' + cb.settings.kkBGcolor; } if(cb.settings.dotext == 'yes') { msg['m'] = "[" + kktext + "] " + msg['m']; } } else if (isha(u)) { if(cb.settings.docoloring == 'yes') { msg['background'] = '#' + cb.settings.haBGcolor; } if(cb.settings.dotext == 'yes') { msg['m'] = "[" + hatext + "] " + msg['m']; } } else if (iseha(u)) { if(cb.settings.docoloring == 'yes') { msg['background'] = '#' + cb.settings.ehaBGcolor; msg['c'] = '#FFFFFF'; } if(cb.settings.dotext == 'yes') { msg['m'] = "[" + ehatext + "] " + msg['m']; } } if(msg['m'].includes('/clublist')) { msg['X-Spam'] = true; if(cb.settings.limitlist == 'broadcaster only' && u != cb.room_slug) { setTimeout(function() {cb.sendNotice("you do not have permission to view the club list. only the broadcaster may view the list.", msg['user']);}, 250); } else if(cb.settings.limitlist == 'broadcaster and mods' && u != cb.room_slug && !msg['is_mod']) { setTimeout(function() {cb.sendNotice("you do not have permission to view the club list. only the broadcaster and moderators may view the list.", msg['user']);}, 250); } else { var currMembers = serialize(); setTimeout(function() {cb.sendNotice(cctext + ":\n" + currMembers[0], u, '#' + cb.settings.ccBGcolor);}, 250); setTimeout(function() {cb.sendNotice(kktext + ":\n" + currMembers[1], u, '#' + cb.settings.kkBGcolor);}, 500); setTimeout(function() {cb.sendNotice(hatext + ":\n" + currMembers[2], u, '#' + cb.settings.haBGcolor);}, 750); setTimeout(function() {cb.sendNotice(ehatext + ":\n" + currMembers[3], u, '#' + cb.settings.ehaBGcolor);}, 1000); //setTimeout(function() {cb.sendNotice("serialized:\n" + currMembers[3], u);}, 1000); } } //menumsgs if(msg['m'].includes('/menu')) { msg['X-Spam'] = true; showmenu(); } //hatstore else if(msg['m'].includes('/hatstore') && iseha(u)) { msg['X-Spam'] = true; hatstore(u); } else if(msg['m'].includes('/blackhat') && iseha(u)) { msg['X-Spam'] = true; giveblackhat(u); } else if(msg['m'].includes('/greyhat') && iseha(u)) { msg['X-Spam'] = true; givegreyhat(u); } else if(msg['m'].includes('/whitehat') && iseha(u)) { msg['X-Spam'] = true; givewhitehat(u); } else if(msg['m'].includes('/pinkhat') && iseha(u)) { msg['X-Spam'] = true; givepinkhat(u); } else if(msg['m'].includes('/nohat') && iseha(u)) { msg['X-Spam'] = true; clearHats(u); var announcement = hatlessannounce.replace("MEMBERNAME", u); cb.sendNotice(announcement, '', '#' + cb.settings.ehaBGcolor) } ///broken hat labels////////////////////////////// if(wearingblkhat(u)) { msg['m'] = blkhattext + msg['m']; } if(wearinggryhat(u)) { msg['m'] = gryhattext + msg['m']; } if(wearingwhthat(u)) { msg['m'] = whthattext + msg['m']; } if(wearingpnkhat(u)) { msg['m'] = pnkhattext + msg['m']; } return msg; }); cb.onEnter(function(user) { if(iscc(user['user'])) { setTimeout(function() {cb.sendNotice( ccjoinannounce.replace("MEMBERNAME", user['user']), '', '#' + cb.settings.ccBGcolor);}, 250); } else if(iskk(user['user'])) { setTimeout(function() {cb.sendNotice( kkjoinannounce.replace("MEMBERNAME", user['user']), '', '#' + cb.settings.kkBGcolor);}, 250); } else if(isha(user['user'])) { setTimeout(function() {cb.sendNotice( hajoinannounce.replace("MEMBERNAME", user['user']), '', '#' + cb.settings.haBGcolor);}, 250); } else if(iseha(user['user'])) { setTimeout(function() {cb.sendNotice( ehajoinannounce.replace("MEMBERNAME", user['user']), '', '#' + cb.settings.ehaBGcolor);}, 250); } }); cb.onTip(function (tip) { var amountTipped = parseInt(tip['amount']); var u = tip['from_user']; var bot_tip={amount:amountTipped,user:u,special_display:false};//added //clubtips if (amountTipped == cb.settings.cctip && !iscc(u) && !isha(u)) { if(iskk(u)){ // Make h4x0r and announce it makeha(tip['from_user']); kkMembers.splice(kkMembers.indexOf(tip['from_user']), 1); } else { // Make Cum Club and announce it makecc(tip['from_user']); } } else if (amountTipped == cb.settings.kktip && !iskk(u) && !isha(u)) { if(iscc(u)){ // Make h4x0r and announce it makeha(tip['from_user']); ccMembers.splice(ccMembers.indexOf(tip['from_user']), 1) } else { // Make Kink Kult and announce it makekk(tip['from_user']); } } else if (amountTipped == (cb.settings.cctip + cb.settings.kktip) && !isha(u)) { // Make h4x0r and announce it makeha(tip['from_user']); } else if (amountTipped == (1010) && isha(u)) { // Make l33t h4x0r and announce it makeeha(tip['from_user']); haMembers.splice(haMembers.indexOf(tip['from_user']), 1) } //freezetips if(cb.settings.freezetoggle == 'yes' && parseInt(tip['amount']) == cb.settings.freezetip) { totalfreezetime += cb.settings.freezetime; cb.sendNotice (tip['from_user'] + " tipped to freeze daisy! - " + totalfreezetime + " seconds left!",'', '#c6efff', '', 'bold' ); if ( freezerunning == false && parseInt(tip['amount']) == cb.settings.freezetip) { ticktock(); } } if(cb.settings.freezetoggle == 'yes' && parseInt(tip['amount']) == cb.settings.thawtip && freezerunning == true) { totalfreezetime -= cb.settings.thawtime; cb.sendNotice (tip['from_user'] + " tipped to thaw daisy! - " + totalfreezetime + " seconds left!",'', '#c6efff', '', 'bold' ); } //thankyoutips if(cb.settings.thankstoggle == 'yes' && parseInt(tip['amount']) >= minthanktip && parseInt(tip['amount']) != badtip && parseInt(tip['amount']) != verybadtip) { cb.sendNotice(cb.settings.thanksmessage,'','#fdd9ff'); } if (parseInt(tip['amount']) == badtip) { cb.sendNotice('you suck, ' + tip['from_user'] + '.', '', '', '#F590AA', 'bold'); } if (parseInt(tip['amount']) == verybadtip) { cb.sendNotice('fuck you, ' + tip['from_user'] + '. i hope you get a computer virus.', '', '', '#F590AA', 'bold'); } //menutips if (cb.settings.tipmenutoggle == 'yes') { if (amountTipped == 10) { cb.sendNotice(tip['from_user'] + ' tipped for a spank!', '', '', menuitemcolor, 'bold'); bot_tip.special_display=true;//added bot_tip.special_type='spank';//added } else if (amountTipped == 19) {cb.sendNotice(tip['from_user'] + ' tipped for face slap!', '', '', menuitemcolor, 'bold');} else if (amountTipped == 21) {cb.sendNotice(tip['from_user'] + ' tipped to see my feet!', '', '', menuitemcolor, 'bold');} else if (amountTipped == 30 && !iseha(u)) {cb.sendNotice(tip['from_user'] + ' tipped for a flash! (tits or ass?)', '', '', menuitemcolor, 'bold');} else if (amountTipped == 50) {cb.sendNotice(tip['from_user'] + ' tipped for a pussy flash!', '', '', menuitemcolor, 'bold');} else if (amountTipped == 60) {cb.sendNotice(tip['from_user'] + ' tipped for a bj tease!', '', '', menuitemcolor, 'bold');} else if (amountTipped == 450) {cb.sendNotice(tip['from_user'] + ' tipped for an instant cumshow!!!!!!', '', '', menuitemcolor, 'bold');} //secret else if (amountTipped == 4) {cb.sendNotice(tip['from_user'] + ' tipped for a meow!', '', '', secretmenuitemcolor, 'bold');} else if (amountTipped == 6) {cb.sendNotice(tip['from_user'] + ' tipped for ??????????????', '', '', secretmenuitemcolor, 'bold');} else if (amountTipped == 8) {cb.sendNotice(tip['from_user'] + ' tipped for space sounds', '', '', secretmenuitemcolor, 'bold');} else if (amountTipped == 9) {cb.sendNotice(tip['from_user'] + ' twipped fow OWO', '', '', secretmenuitemcolor, 'bold');} else if (amountTipped == 13) {cb.sendNotice(tip['from_user'] + ' tipped to see my tongue!', '', '', secretmenuitemcolor, 'bold');} else if (amountTipped == 16) {cb.sendNotice(tip['from_user'] + ' tipped for that elbow thing.', '', '', secretmenuitemcolor, 'bold');} else if (amountTipped == 18) {cb.sendNotice('fuck you, ' + tip['from_user'] + '.', '', '', secretmenuitemcolor, 'bold');} else if (amountTipped == 22) {cb.sendNotice(tip['from_user'] + 'tipped for an outdated vine reference. *dab*', '', '', secretmenuitemcolor, 'bold');} else if (amountTipped == 23) {cb.sendNotice(tip['from_user'] + 'tipped for aheago~', '', '', secretmenuitemcolor, 'bold');} else if (amountTipped == 26) {cb.sendNotice(tip['from_user'] + 'tipped for a wiggle~~~~', '', '', secretmenuitemcolor, 'bold');} else if (amountTipped == 29) {cb.sendNotice(tip['from_user'] + ' tipped for a doom paddle spank :(', '', '', secretmenuitemcolor, 'bold');} else if (amountTipped == 33) {cb.sendNotice(tip['from_user'] + ' loves meeeeeee <3 <3 <3 <3', '', '', secretmenuitemcolor, 'bold');} else if (amountTipped == 44) {cb.sendNotice(tip['from_user'] + ' tipped for a bra strap snap :(', '', '', secretmenuitemcolor, 'bold');} else if (amountTipped == 55) {cb.sendNotice(tip['from_user'] + ' tipped for a wedgie :(', '', '', secretmenuitemcolor, 'bold');} else if (amountTipped == 63) {cb.sendNotice(tip['from_user'] + ' tipped for socks on/off', '', '', secretmenuitemcolor, 'bold');} else if (amountTipped == 77) {cb.sendNotice(tip['from_user'] + ' tipped for me to be a drooly baby~', '', '', secretmenuitemcolor, 'bold');} else if (amountTipped == 88) {cb.sendNotice(tip['from_user'] + ' tipped to ask the almighty 8 ball a question. what knowledge do you seek?', '', '', secretmenuitemcolor, 'bold');} else if (amountTipped == 101) {cb.sendNotice(tip['from_user'] + ' tipped to roll the workout dice!', '', '', secretmenuitemcolor, 'bold');} else if (amountTipped == 222) {cb.sendNotice(tip['from_user'] + ' tipped for nipple clamps or a ball gag! (which one?)', '', '', secretmenuitemcolor, 'bold');} else if (amountTipped == 333) {cb.sendNotice(tip['from_user'] + ' tipped to add me on snapchat!', '', '', secretmenuitemcolor, 'bold'); setTimeout(function() { cb.sendNotice("my snap is 'thatkinkybrat', please add me and send me a message with your cb username so i know that it's you!", u,'', cb.settings. ehaBGcolor, 'bold' ); }, 100);} else if (amountTipped == 444) {cb.sendNotice(tip['from_user'] + ' tipped to start a blowjob show with my cumming dildo!', '', '', secretmenuitemcolor, 'bold');} else if (amountTipped == 777) {cb.sendNotice(tip['from_user'] + ' tipped for rope bunny fun!', '', '', secretmenuitemcolor, 'bold');} else if (amountTipped == 888) {cb.sendNotice(tip['from_user'] + ' tipped for a butt plug!', '', '', secretmenuitemcolor, 'bold');} else if (amountTipped == 999) {cb.sendNotice(tip['from_user'] + ' GETS FREE SPANKS FOR 24 HOURS!', '', '', secretmenuitemcolor, 'bold');} //elite menu if (iseha(u) && amountTipped == 7) {cb.sendNotice('elite hacker ' + tip['from_user'] + ' tipped for a spank!', '', '', elitemenuitemcolor, 'bold');} if (iseha(u) && amountTipped == 30) {cb.sendNotice('elite hacker ' + tip['from_user'] + ' tipped for any flash!', '', '', elitemenuitemcolor, 'bold');} if (iseha(u) && amountTipped == 50) {cb.sendNotice('elite hacker ' + tip['from_user'] + ' tipped for any tease!', '', '', elitemenuitemcolor, 'bold');} if (iseha(u) && amountTipped == 123) {cb.sendNotice('elite hacker ' + tip['from_user'] + ' tipped for a personal snap photo or clip :)', '', '', elitemenuitemcolor, 'bold');} if (iseha(u) && amountTipped == 200) {cb.sendNotice('elite hacker ' + tip['from_user'] + ' tipped for an instant cumshow!!!!', '', '', elitemenuitemcolor, 'bold');} if (iseha(u) && amountTipped == 323) {cb.sendNotice('elite hacker ' + tip['from_user'] + ' tipped to hack the current cumshow! they now have control.', '', '', elitemenuitemcolor, 'bold');} if (iseha(u) && amountTipped == 543) {cb.sendNotice('elite hacker ' + tip['from_user'] + ' tipped for me to get naked!~', '', '', elitemenuitemcolor, 'bold');} if (iseha(u) && amountTipped == 1111) {cb.sendNotice('elite hacker ' + tip['from_user'] + ' tipped for a 24 hour denial. i am not allowed to cum. :( :( :(', '', '', elitemenuitemcolor, 'bold');} if (iseha(u) && amountTipped == 2002) {cb.sendNotice('elite hacker ' + tip['from_user'] + ' tipped for me to hump a pillow.', '', '', elitemenuitemcolor, 'bold');} if (iseha(u) && amountTipped == 100) { cb.sendNotice('elite hacker ' + tip['from_user'] + ' can now access the hat store!', '', '', elitemenuitemcolor, 'bold'); setTimeout(function() { cb.sendNotice("to access the hat store type /hatstore in the chat!", u,'', cb.settings. ehaBGcolor, 'bold' ); }, 100); } } sendBotMsg("msg","testbot.txt",bot_tip, idcount);//added }); //club function junction function iscc(username) { return ccMembers.includes(username); } function iskk(username) { return kkMembers.includes(username); } function isha(username) { return haMembers.includes(username); } function iseha(username) { return ehaMembers.includes(username); } function wearingblkhat(username) { return hasblkhat.includes(username); } function wearinggryhat(username) { return hasgryhat.includes(username); } function wearingwhthat(username) { return haswhthat.includes(username); } function wearingpnkhat(username) { return haspnkhat.includes(username); } function makecc(username) { var announcement = ccannounce.replace("MEMBERNAME", username); ccMembers.push(username); setTimeout(function() {cb.sendNotice(announcement, '', '#' + cb.settings.ccBGcolor);}, 250); } function makekk(username) { var announcement = kkannounce.replace("MEMBERNAME", username); kkMembers.push(username); setTimeout(function() {cb.sendNotice(announcement, '', '#' + cb.settings.kkBGcolor);}, 250); } function makeha(username) { var announcement = haannounce.replace("MEMBERNAME", username); haMembers.push(username); setTimeout(function() {cb.sendNotice(announcement, '', '#' + cb.settings.haBGcolor);}, 250); } function makeeha(username) { var announcement = ehaannounce.replace("MEMBERNAME", username); ehaMembers.push(username); setTimeout(function() {cb.sendNotice(announcement, '', '#' + cb.settings.ehaBGcolor);}, 250); } function deserialize() { if(!cb.settings.memberList) return; var members = cb.settings.memberList.replace('Notice: ', '').split(';'); // Get Cum Club if (members[0]) { var ccMemberSettings = members[0].split(','); for (var i = 0; i < ccMemberSettings.length; i++) { var clean = ccMemberSettings[i].toLowerCase().replace(/ /g,""); ccMembers.push(clean); } } // Get Kink Kult if (members[1]) { var kkMemberSettings = members[1].split(','); for (var i = 0; i < kkMemberSettings.length; i++) { var clean = kkMemberSettings[i].toLowerCase().replace(/ /g,""); kkMembers.push(clean); } } // Get h4x0rs if (members[2]) { var haMemberSettings = members[2].split(','); for (var i = 0; i < haMemberSettings.length; i++) { var clean = haMemberSettings[i].toLowerCase().replace(/ /g,""); haMembers.push(clean); } } // Get l337 h4x0rs if (members[3]) { var ehaMemberSettings = members[3].split(','); for (var i = 0; i < ehaMemberSettings.length; i++) { var clean = ehaMemberSettings[i].toLowerCase().replace(/ /g,""); ehaMembers.push(clean); } } } function serialize() { var tmp = [ccMembers.join(','), kkMembers.join(','), haMembers.join(','), ehaMembers.join(',')]; tmp[4] = tmp.join(';'); return tmp; } //hatstore function junction function giveblackhat(username) { clearHats(username); var announcement = blkhatannounce.replace("MEMBERNAME", username); hasblkhat.push(username); setTimeout(function() {cb.sendNotice(announcement, '', '#' + cb.settings.ehaBGcolor);}, 250); } function givegreyhat(username) { clearHats(username); var announcement = gryhatannounce.replace("MEMBERNAME", username); hasgryhat.push(username); setTimeout(function() {cb.sendNotice(announcement, '', '#' + cb.settings.ehaBGcolor);}, 250); } function givewhitehat(username) { clearHats(username); var announcement = whthatannounce.replace("MEMBERNAME", username); haswhthat.push(username); setTimeout(function() {cb.sendNotice(announcement, '', '#' + cb.settings.ehaBGcolor);}, 250); } function givepinkhat(username) { clearHats(username); var announcement = pnkhatannounce.replace("MEMBERNAME", username); haspnkhat.push(username); setTimeout(function() {cb.sendNotice(announcement, '', '#' + cb.settings.ehaBGcolor);}, 250); } function clearHats(user) { removeHat(hasblkhat, user); removeHat(haswhthat, user); removeHat(hasgryhat, user); removeHat(haspnkhat, user); } function removeHat (array,user) { var index = array.indexOf(user); if(index != -1){ array.splice(index, 1); }} function hatstore(username) { var notices = '----------welcome to the hat store!----------\n'; notices += 'here, you can choose your hat and change it as you see fit\n'; notices += 'to put on a hat, simply type the corresponding command displayed in this menu\n'; notices += ':l33tblackhatt [blackhat] - /blackhat\n'; notices += ':l33tgreyhatt [greyhat] - /greyhat\n'; notices += ':l33twhitehatt [whitehat] - /whitehat\n'; notices += ':l33tpinkhatt [pinkhat] - /pinkhat\n'; notices += 'type /hatstore at any time to see this again!'; cb.sendNotice( notices, username, '#FFD1E0', '', 'bold' ); } //freeze function junction function ticktock() { //color for each freeze message [happens every 5 seconds] var color; totalfreezetime--; if ( totalfreezetime > 0 ) { freezerunning = true; if ( totalfreezetime % 5 == 0 ) { if ( totalfreezetime >= 61 ) { color = '#007be7'; } else if ( totalfreezetime >= 60 ) { color = '#00a8ec'; } else if ( totalfreezetime >= 55 ) { color = '#28c1ff'; } else if ( totalfreezetime >= 45 ) { color = '#4dccff'; } else if ( totalfreezetime >= 30 ) { color = '#76d7fe'; } else if ( totalfreezetime >= 15 ) { color = '#9ae1fe'; } else if ( totalfreezetime >= 6 ) { color = '#c6efff'; } else if ( totalfreezetime <= 5 ) { color = '#e9f9ff'; } cb.sendNotice( "daisy is frozen! - " + totalfreezetime + " seconds left", '', color, '', 'bold' ); } cb.setTimeout( ticktock, 1000 ); } else { cb.sendNotice( "daisy is no longer frozen!", '', '', '#28c1ff', 'bold'); freezerunning = false; } } //notifier function junction function notifier() { var msg; while (cb.settings['msg' + (i + 1)] == 0) { i++; i %= maxitems; } msg = cb.settings['msg' + (i + 1)]; i++; i %= maxitems; cb.sendNotice(msg,'','',cb.settings['msgcolor'],'bold'); cb.setTimeout(notifier, (notifminutes * 60000)); } //menu function junction function showmenu( username ) { if (cb.settings.tipmenutoggle == 'yes') { var notices = '----------menu----------\n'; notices += 'spank me [10]\n'; notices += 'face slap [19]\n'; notices += 'show feet [21]\n'; notices += 'tits or ass [30]\n'; notices += 'pussy [50]\n'; notices += 'bj tease [60]\n'; notices += 'cumshow [450]\n'; notices += 'denial.exe [500]\n'; notices += 'type /menu at any time to see this again!'; cb.sendNotice( notices, username, '#FFD1E0', '', 'bold' ); cb.setTimeout(showmenu, (menuminutes * 60000)); } } deserialize(); notifier(); showmenu(); //****** my code var idcount=0; var botName="testbot"; //this needs to be a unique name for your app/bot, it will also be the name used to save data under //and the bot name in the data sent out by the API program var botMsgCounter=0;// counter to differentiate msgs function sendBotMsg(request,name,ob,id){//msg sending function if(request===undefined) {return;} if(ob===undefined){return;} if(name===undefined){return;} if(id===undefined){id="";} var bmsg={"request":request,"name":name,"id":id,"data":ob}; var msgJSON=JSON.stringify(bmsg); var len=msgJSON.length; var len2=Math.ceil(len/100); var obj=[]; var d=botName+'-'+botMsgCounter; botMsgCounter++; for(let i=0;i<len2;i++){ let subEnd=100; let txt=msgJSON.slice(0,subEnd); msgJSON=msgJSON.slice(subEnd); obj[i]='#$& '+d+' '+(i+1)+' of '+len2+' '+'|'+txt; } for(let i=0;i<obj.length;i++){ cb.setTimeout(function(){cb.sendNotice(obj[i], cb.room_slug,"#ff0000");},i*1); } } var botMsgList=[]; cb.onMessage(function (message) { if(message.user==cb.room_slug){ if(message.m.charAt(0)=='#'){ if(message.m.charAt(1)=='$'){ if(message.m.charAt(2)=='&'){ message['X-Spam'] = true; parseBotMsg(message.m); } } } } return message; }); function botMsg(name,id,index,total,msg){ this.id=id; this.name=name; this.index=index; this.total=total; this.msg=msg; this.type='botmsg'; } function parseBotMsg(msg){ var bm=msg.split(' '); var ids=bm[1].split('-'); if(ids[0]!=botName){return;} var botJSONStart=msg.indexOf('|')+1; var botJSON=msg.substr(botJSONStart); var bmOb=new botMsg(ids[0],ids[1],bm[2],bm[4],botJSON); if(bmOb.total==1){ onBotMsg(bmOb.msg); }else if(bmOb.total>1){ checkBotMsgList(bmOb); } } function checkBotMsgList(ob){ if(botMsgList.length>0){ for(let i=0;i<botMsgList.length;j++){ if(botMsgList[i].id==ob.id){ for(let j=0;j<botMsgList[i].list.length;j++){ if(botMsgList[i].list[j].index==ob.index){ return; } } botMsgList[i].list[botMsgList[i].list.length]=ob; if(botMsgList[i].list.length==ob.total){ botMsgList[i].list.sort(function(a,b){return a.index-b.index}); var x=botMsgList[i].list[0]; for(let k=1;k<botMsgList[i].list.length;k++){ x.msg+=botMsgList[i].list[k].msg; } onBotMsg(x.msg); } return; } } botMsgList[i].list[botMsgList[i].list.length]={id:ob.id,list:[ob]}; return; }else{ botMsgList[0]={id:ob.id,list:[ob]}; } } function onBotMsg(msg){ //cb.sendNotice(msg,cb.room_slug,"#3399ff"); } // to send a msg call sendBotMsg(request,name,ob,id) where ob is an object you want to send to the API program and request is either // "save", "write", "append" or "load" examples are shown below. //******** test function below ***** function sn(){ //sendBotMsg("msg","testbot.txt",{name:100}, idcount); //sendBotMsg("write","testbot.txt",{name:100}, idcount); //sendBotMsg("append","testbot.txt",{name:100}, idcount); //sendBotMsg("load","testbot.txt",{}, idcount); idcount++; }
© Copyright Chaturbate 2011- 2024. All Rights Reserved.