Bots Home
|
Create an App
Gaialove
Author:
roydz
Description
Source Code
Launch Bot
Current Users
Created by:
Roydz
// gaialove bot by roydz // CB app settings cb.settings_choices = [ { name: 'doColoring', type: 'choice', label: 'Change text and background coloring for members and heroes (choose colours below)?', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes' }, { name: 'doText', type: 'choice', label: 'Add text labels in front of members and heroes messages (choose text below)?', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes' }, // First Group {name: 'gaText', label: 'Text to put in front of Group one messages (e.g. One)', type: 'str', minLength: 0, maxLength: 20, required: false, defaultValue: 'One'}, {name: 'gaTextColor', label: 'Group One text color - HTML colour code without starting \'#\' e.g. (FFFFFF is white)', type: 'str', minLength: 0, maxLength: 6, required: false, defaultValue: '000000'}, {name: 'gaBGColor', label: 'Group One background color - HTML colour code without starting \'#\' e.g. (000000 is black)', type: 'str', minLength: 0, maxLength: 6, required: false, defaultValue: '87f797'}, {name: 'gaMinTip', label: 'Minimum tip to become a Group One', type: 'int', minValue: 1, defaultValue: 1888}, {name: 'gaAnnounce', label: 'Text to show when someone tips to become a Group One, the text MEMBERNAME will be replaced with the username of the new (Note: graphics don\'t work in this text)', type: 'str', minLength: 0, maxLength: 10240, required: false, defaultValue: 'MEMBERNAME just Joined Group One'}, {name: 'gaMemberList', label: 'List of current Group One, separated by commas (and they need to be the CB username exactly)', type: 'str', minLength: 0, maxLength: 10240, required: false, defaultValue: ''}, {name: 'gaRainText', label: 'Text to use for Group One rain lines', type: 'str', minLength: 0, maxLength: 80, required: false, defaultValue: 'Group One'}, {name: 'gaRainCount', label: 'Number of lines for Group One', type: 'int', minValue: 1, maxValue: 15, defaultValue: 5}, // Second Group {name: 'gbText', label: 'Text to put in front of Group Two messages (e.g. Two)', type: 'str', minLength: 0, maxLength: 20, required: false, defaultValue: 'Group Two'}, {name: 'gbTextColor', label: 'Group Two text color - HTML colour code without starting \'#\' e.g. (000000 is black)', type: 'str', minLength: 0, maxLength: 6, required: false, defaultValue: '000000'}, {name: 'gbBGColor', label: 'Group Two background color - HTML colour code without starting \'#\' e.g. (F5B608 is orangey/gold)', type: 'str', minLength: 0, maxLength: 6, required: false, defaultValue: 'ffbb59'}, {name: 'gbMinTip', label: 'Minimum tip to become Group Two', type: 'int', minValue: 1, defaultValue: 8888}, {name: 'gbAnnounce', label: 'Text to show when someone tips to become a Group Two, the text MEMBERNAME will be replaced with the username of the new member (Note: graphics don\'t work in this text)', type: 'str', minLength: 0, maxLength: 10240, required: false, defaultValue: 'MEMBERNAME just Joined Group Two'}, {name: 'gbMemberList', label: 'List of current Group Two, separated by commas (and they need to be the CB username exactly)', type: 'str', minLength: 0, maxLength: 10240, required: false, defaultValue: ''}, {name: 'gbRainText', label: 'Text to use for Group Two rain lines', type: 'str', minLength: 0, maxLength: 80, required: false, defaultValue: 'Group Two'}, {name: 'gbRainCount', label: 'Number of lines of Group Two rain', type: 'int', minValue: 1, maxValue: 20, defaultValue: 20}, // Third Group {name: 'gcText', label: 'Text to put in front of Group Three messages (e.g. Three)', type: 'str', minLength: 0, maxLength: 20, required: false, defaultValue: 'Group Three'}, {name: 'gcTextColor', label: 'Group Three text color - HTML colour code without starting \'#\' e.g. (000000 is black)', type: 'str', minLength: 0, maxLength: 6, required: false, defaultValue: '000000'}, {name: 'gcBGColor', label: 'Group Three background color - HTML colour code without starting \'#\' e.g. (F5B608 is orangey/gold)', type: 'str', minLength: 0, maxLength: 6, required: false, defaultValue: 'ee87f7'}, {name: 'gcMinTip', label: 'Minimum tip to become a Group Three', type: 'int', minValue: 1, defaultValue: 5888}, {name: 'gcAnnounce', label: 'Text to show when someone tips to become a Group Three, the text MEMBERNAME will be replaced with the username of the new member (Note: graphics don\'t work in this text)', type: 'str', minLength: 0, maxLength: 10240, required: false, defaultValue: 'MEMBERNAME just Joined Group Three'}, {name: 'gcMemberList', label: 'List of current Group Three, separated by commas (and they need to be the CB username exactly)', type: 'str', minLength: 0, maxLength: 10240, required: false, defaultValue: ''}, {name: 'gcRainText', label: 'Text to use for Group Three rain lines', type: 'str', minLength: 0, maxLength: 80, required: false, defaultValue: 'Group Three'}, {name: 'gcRainCount', label: 'Number of lines of Group Three rain', type: 'int', minValue: 1, maxValue: 15, defaultValue: 15}, // Forth Group {name: 'gdText', label: 'Text to put in front of Group Four messages (e.g. Lo)', type: 'str', minLength: 0, maxLength: 20, required: false, defaultValue: 'Group Four'}, {name: 'gdTextColor', label: 'Group Four text color - HTML colour code without starting \'#\' e.g. (000000 is black)', type: 'str', minLength: 0, maxLength: 6, required: false, defaultValue: '000000'}, {name: 'gdBGColor', label: 'Group Four background color - HTML colour code without starting \'#\' e.g. (F5B608 is orangey/gold)', type: 'str', minLength: 0, maxLength: 6, required: false, defaultValue: '99e9f0'}, {name: 'gdMinTip', label: 'Minimum tip to become a Group Four', type: 'int', minValue: 1, defaultValue: 2888}, {name: 'gdAnnounce', label: 'Text to show when someone tips to become a Group Four, the text MEMBERNAME will be replaced with the username of the new member (Note: graphics don\'t work in this text)', type: 'str', minLength: 0, maxLength: 10240, required: false, defaultValue: 'MEMBERNAME just Joined Group Four'}, {name: 'gdMemberList', label: 'List of current Group Four, separated by commas (and they need to be the CB username exactly)', type: 'str', minLength: 0, maxLength: 10240, required: false, defaultValue: ''}, {name: 'gdRainText', label: 'Text to use for Group Four rain lines', type: 'str', minLength: 0, maxLength: 80, required: false, defaultValue: 'Group Four'}, {name: 'gdRainCount', label: 'Number of lines of Group Four rain', type: 'int', minValue: 1, maxValue: 15, defaultValue: 10}, // Fifth Group {name: 'geText', label: 'Text to put in front of Group Five messages (e.g. Lo)', type: 'str', minLength: 0, maxLength: 20, required: false, defaultValue: 'Group Five'}, {name: 'geTextColor', label: 'Group Five text color - HTML colour code without starting \'#\' e.g. (000000 is black)', type: 'str', minLength: 0, maxLength: 6, required: false, defaultValue: '000000'}, {name: 'geBGColor', label: 'Group Five background color - HTML colour code without starting \'#\' e.g. (F5B608 is orangey/gold)', type: 'str', minLength: 0, maxLength: 6, required: false, defaultValue: 'FFFFFF'}, {name: 'geMinTip', label: 'Minimum tip to become a Group Five', type: 'int', minValue: 1, defaultValue: 929}, {name: 'geAnnounce', label: 'Text to show when someone tips to Join Group Five, the text MEMBERNAME will be replaced with the username of the new member (Note: graphics don\'t work in this text)', type: 'str', minLength: 0, maxLength: 10240, required: false, defaultValue: 'MEMBERNAME just Joined Group Five'}, {name: 'geMemberList', label: 'List of current Group Five, separated by commas (and they need to be the CB username exactly)', type: 'str', minLength: 0, maxLength: 10240, required: false, defaultValue: ''}, {name: 'geRainText', label: 'Text to use for Group Five rain lines', type: 'str', minLength: 0, maxLength: 80, required: false, defaultValue: 'Group Five'}, {name: 'geRainCount', label: 'Number of lines of Group Five rain', type: 'int', minValue: 1, maxValue: 15, defaultValue: 10}, // Sixth Group {name: 'gfText', label: 'Text to put in front of Special Group One messages (e.g. Lo)', type: 'str', minLength: 0, maxLength: 20, required: false, defaultValue: 'Special Group One'}, {name: 'gfTextColor', label: 'Special Group One text color - HTML colour code without starting \'#\' e.g. (000000 is black)', type: 'str', minLength: 0, maxLength: 6, required: false, defaultValue: '000000'}, {name: 'gfBGColor', label: 'Special Group One background color - HTML colour code without starting \'#\' e.g. (F5B608 is orangey/gold)', type: 'str', minLength: 0, maxLength: 6, required: false, defaultValue: 'FFFFFF'}, {name: 'gfMinTip', label: 'Minimum tip to become a Special Group One', type: 'int', minValue: 1, defaultValue: 1402}, {name: 'gfAnnounce', label: 'Text to show when someone tips to Join Special Group One, the text MEMBERNAME will be replaced with the username of the new member (Note: graphics don\'t work in this text)', type: 'str', minLength: 0, maxLength: 10240, required: false, defaultValue: 'MEMBERNAME just Joined Special Group One'}, {name: 'gfMemberList', label: 'List of current Special Group One, separated by commas (and they need to be the CB username exactly)', type: 'str', minLength: 0, maxLength: 10240, required: false, defaultValue: ''}, {name: 'gfRainText', label: 'Text to use for Special Group One rain lines', type: 'str', minLength: 0, maxLength: 80, required: false, defaultValue: 'Special Group One'}, {name: 'gfRainCount', label: 'Number of lines of Special Group One', type: 'int', minValue: 1, maxValue: 15, defaultValue: 10}, // Seventh Group {name: 'ggText', label: 'Text to put in front of Special Group Two messages (e.g. Lo)', type: 'str', minLength: 0, maxLength: 20, required: false, defaultValue: 'Special Group Two'}, {name: 'ggTextColor', label: 'Special Group Two text color - HTML colour code without starting \'#\' e.g. (000000 is black)', type: 'str', minLength: 0, maxLength: 6, required: false, defaultValue: '000000'}, {name: 'ggBGColor', label: 'Special Group Two background color - HTML colour code without starting \'#\' e.g. (F5B608 is orangey/gold)', type: 'str', minLength: 0, maxLength: 6, required: false, defaultValue: 'FFFFFF'}, {name: 'ggMinTip', label: 'Minimum tip to become a Special Group Two', type: 'int', minValue: 1, defaultValue: 2414}, {name: 'ggAnnounce', label: 'Text to show when someone tips to Join Special Group Two, the text MEMBERNAME will be replaced with the username of the new member (Note: graphics don\'t work in this text)', type: 'str', minLength: 0, maxLength: 10240, required: false, defaultValue: 'MEMBERNAME just Joined Special Group Two'}, {name: 'ggMemberList', label: 'List of current Special Group Two, separated by commas (and they need to be the CB username exactly)', type: 'str', minLength: 0, maxLength: 10240, required: false, defaultValue: ''}, {name: 'ggRainText', label: 'Text to use for Special Group Two rain lines', type: 'str', minLength: 0, maxLength: 80, required: false, defaultValue: 'Special Group Two'}, {name: 'ggRainCount', label: 'Number of lines of Special Group Two rain', type: 'int', minValue: 1, maxValue: 15, defaultValue: 10}, // Room Advert text { name: 'roomADS', label: 'Room Adverts Here', type: 'str', minLength: 1, maxLength: 2000, required: false, defaultValue: 'Place advert here - it can be your twitter or anything else' },{ name: 'blockMemberList', label: 'List of Blocked Users, separated by commas (and they need to be the CB username exactly)', type: 'str', minLength: 0, maxLength: 10240, required: false, defaultValue: '' } ]; var gaMembers = {}; var gbMembers = {}; var gcMembers = {}; var gdMembers = {}; var geMembers = {}; var gfMembers = {}; var ggMembers = {}; var blockMembers = {}; var CONFIG_ADVERT_MINUTES = 10; var EMOTE_FOLLOW = ' :follo'; var CONFIG_TWITTER_MINUTES = 5; // For auto-silencing at least some of token_wh*re_c*nts usernames var twcRegex = /t.?k.?n.?wh.?r.?_c.?nt.?/i; cb.onMessage(function (msg) { // handle user commands if (!msg['X-Spam']){ silent_room = false; } // vars for ease of use var u = msg['user']; var m = msg['m']; var isMod = msg['is_mod']; var isFan = msg['in_fanclub']; var isModel = (u == cb.room_slug); var hasTokens = msg['has_tokens']; var hasTipped = msg['tipped_recently']; var isGrey = !(hasTokens || isMod || isModel || isFan); var modsAllowed = true; var exempt = (isModel || isMod); if(m[0] == '/'){ // Is a command msg['X-Spam'] = true; if(isModel || (isMod && modsAllowed) ){ // IsModel or Mod var actionArray = m.substr(1).split(' '); if( isModel ){ if( actionArray.length >= 2){ switch(actionArray[0]) { case "addone": cb.sendNotice('Adding G-One Member '+actionArray[1]); setOne(actionArray[1]); break; case "removeone": cb.sendNotice('Removing G-One Member '+actionArray[1]); unsetOne(actionArray[1]); break; case "addtwo": cb.sendNotice('Adding G-Two Member '+actionArray[1]); setTwo(actionArray[1]); break; case "removetwo": cb.sendNotice('Removing G-Two Member '+actionArray[1]); unsetTwo(actionArray[1]); break; case "addthree": cb.sendNotice('Adding G-Three Member '+actionArray[1]); setThree(actionArray[1]); break; case "removethree": cb.sendNotice('Removing G-Three Member '+actionArray[1]); unsetThree(actionArray[1]); break; case "addfour": cb.sendNotice('Adding G-Four Member '+actionArray[1]); setFour(actionArray[1]); break; case "removefour": cb.sendNotice('Removing G-Four Member '+actionArray[1]); unsetFour(actionArray[1]); break; case "addfive": cb.sendNotice('Adding G-Five Member '+actionArray[1]); setFive(actionArray[1]); break; case "removefive": cb.sendNotice('Removing G-Five Member '+actionArray[1]); unsetFive(actionArray[1]); break; default: } }else if( actionArray.length == 1){ switch(actionArray[0].toLowerCase()) { case "showone": cb.sendNotice('Current G-One Members', u); var n = ""; for (var user in gaMember) { n += "-- "+user+"\n"; } cb.sendNotice(n,u); break; case "showtwo": cb.sendNotice('Current G-Two Members', u); var n = ""; for (var user in gbMember) { n += "-- "+user+"\n"; } cb.sendNotice(n,u); break; case "showthree": cb.sendNotice('Current G-Three Members', u); var n = ""; for (var user in gcMember) { n += "-- "+user+"\n"; } cb.sendNotice(n,u); break; case "showfour": cb.sendNotice('Current G-Four Members', u); var n = ""; for (var user in gdMember) { n += "-- "+user+"\n"; } cb.sendNotice(n,u); break; case "showfive": cb.sendNotice('Current G-Five Members', u); var n = ""; for (var user in geMembers) { n += "-- "+user+"\n"; } cb.sendNotice(n,u); break; case "leader": sendLeaderboard(true, cb.room_slug); msg['X-Spam'] = true; break; case "help": var n = ""; n += "Multi Bot Actions\n"; n += "---------------------------\n"; n += "/addone <membername> : Add One Member\n"; n += "/removeone <membername> : Remove One Member\n"; n += "/showone: List Group One Members\n"; n += "\n"; n += "These commands are the same for all groups\n"; n += "So for group two its : /addtwo and /removetwo"; n += "\n"; n += "and so on up to group five"; cb.sendNotice(n,u); break; default: } } }else{ // Is a mod if( actionArray.length >= 2){ switch(actionArray[0]) { case "addone": cb.sendNotice('Adding G-One Member '+actionArray[1]); setOne(actionArray[1]); break; case "removeone": cb.sendNotice('Removing G-One Member '+actionArray[1]); unsetOne(actionArray[1]); break; case "addtwo": cb.sendNotice('Adding G-Two Member '+actionArray[1]); setTwo(actionArray[1]); break; case "removetwo": cb.sendNotice('Removing G-Two Member '+actionArray[1]); unsetTwo(actionArray[1]); break; case "addthree": cb.sendNotice('Adding G-Three Member '+actionArray[1]); setThree(actionArray[1]); break; case "removethree": cb.sendNotice('Removing G-Three Member '+actionArray[1]); unsetThree(actionArray[1]); break; case "addfour": cb.sendNotice('Adding G-Four Member '+actionArray[1]); setFour(actionArray[1]); break; case "removefour": cb.sendNotice('Removing G-Four Member '+actionArray[1]); unsetFour(actionArray[1]); break; case "addfive": cb.sendNotice('Adding G-Five Member '+actionArray[1]); setFive(actionArray[1]); break; case "removefive": cb.sendNotice('Removing G-Five Member '+actionArray[1]); unsetFive(actionArray[1]); break; default: } }else if( actionArray.length == 1 ){ switch(actionArray[0].toLowerCase()) { case "help": var n = ""; n += "Multi Bot Actions\n"; n += "---------------------------\n"; n += "/addone <membername> : Add One Member\n"; n += "/removeone <membername> : Remove One Member\n"; n += "/showone: List Group One Members\n"; n += "\n"; n += "These commands are the same for all groups\n"; n += "So for group two its : /addtwo and /removetwo"; n += "\n"; n += "and so on up to group four"; cb.sendNotice(n,u); break; default: } } } } // No else, if its a command and not a model or a mod, do nothing }else{ // Block listings if( isGrey ){ m = stripImages(m); msg['m'] = m; } if( m.replace(/[^A-Za-z]/g, "").length > 3 && m.replace(/[^A-Za-z]/g, "").length == m.replace(/[^A-Z]/g, "").length && !exempt ){ cb.chatNotice("Please drop the caps lock! Thank you", u); msg['X-Spam'] = true; } if( /(E+ *R+ *O* *H+ *O+ *O+ *K+ *U+ *P+|T+ *O+ *P+ *G+ *A+ *M+ *E+ *S+ *C+ *R+ *A+ *C+ *K+|d+ *e+ *a+ *l+ *n+ *e+ *w+ *s+|e+ *r+ *o+ *s+ *b+ *b+|EvaCamSessions|GIRLS4PARTY|NUDE4STRIP|pussy4show|ChaT4FrEE|BEST4CAMS|CAMNAKEDS|GIRLS2PARTY|STRIP4PLAY|MiaGoCam|FLIRT4SHOW|NUDE2STRIP|LIVE4PARTY|GIRLS4STRIP|JUST2PORN|PUSSY4STRIP|WET4GUYS|FLIRT4SHOW| MiaGoCam |tokenschaturbate)/i.test(m) && !exempt ){ cb.sendNotice("You can shove your spam where the sun don't shine!", u); msg['X-Spam'] = true; return msg; } if( /(\bbb|baby|babay|babe|babz|babes|baaby|babez|babie\b)/i.test(m) && !exempt ){ cb.sendNotice("No bb, baby or babe, name is Gaialove!", u); msg['X-Spam'] = true; }else if( /((see|watch|view|look at|visit) my cam)/i.test(m) && !exempt ){ cb.sendNotice("No thank you", u); msg['X-Spam'] = true; }else if( /((see|watch|view|look at) my (dick|cock|penis))/i.test(m) && !exempt ){ cb.sendNotice("No thank you, the mods are a little busy to watch you!", u); msg['X-Spam'] = true; }else if( /(show feet)/i.test(m) && !exempt ){ cb.sendNotice("Sorry I do NOT show feet", u); msg['X-Spam'] = true; }else if( /(show (pussy|puss|pu55y)(plz|please|plse|plze))/i.test(m) && !exempt ){ cb.sendNotice("Wanting to see Pussy please tip!", u); msg['X-Spam'] = true; }else if( /(show (boobs|boob|b00bs|b00b|boobz)(plz|please|plse|plze))/i.test(m) && !exempt ){ cb.sendNotice("Wanting to see Boobs please tip!", u); msg['X-Spam'] = true; }else if( /(show (arse|ass|asshole))/i.test(m) && !exempt ){ cb.sendNotice("Want to see Ass please Tip!", u); msg['X-Spam'] = true; }else if( /(open (ass|arse|boobs|pussy|feet|foot))/i.test(m) && !exempt ){ cb.sendNotice("May I suggest becoming a surgeon if you want to open body parts!", u); msg['X-Spam'] = true; }else if( /(whore|slag|bitch)/i.test(m) && !exempt ){ cb.sendNotice("Please go and visit someone elses room that cares what you put!", u); msg['X-Spam'] = true; }else if (isBLOCK(u) && !exempt ) { msg['X-Spam'] = true; // Groups }else{ if ( isGG(u) ) { msg['background'] = '#' + cb.settings.ggBGColor; msg['m'] = "["+ cb.settings.ggText + "] " + msg['m']; } else if ( isGF(u) ) { msg['background'] = '#' + cb.settings.gfBGColor; msg['c'] = '#' + cb.settings.gfTextColor; msg['m'] = "[" + cb.settings.gfText + "] " + msg['m']; } else if ( isGE(u) ) { msg['background'] = '#' + cb.settings.geBGColor; msg['c'] = '#' + cb.settings.geTextColor; msg['m'] = "[" + cb.settings.geText + "] " + msg['m']; } else if ( isGD(u) ) { msg['background'] = '#' + cb.settings.gdBGColor; msg['c'] = '#' + cb.settings.gdTextColor; msg['m'] = "[" + cb.settings.gdText + "] " + msg['m']; } else if ( isGC(u) ) { msg['background'] = '#' + cb.settings.gcBGColor; msg['c'] = '#' + cb.settings.gcTextColor; msg['m'] = "[" + cb.settings.gcText + "] " + msg['m']; } else if ( isGB(u) ) { msg['background'] = '#' + cb.settings.gbBGColor; msg['c'] = '#' + cb.settings.gbTextColor; msg['m'] = "[" + cb.settings.gbText + "] " + msg['m']; } else if ( isGA(u) ) { msg['background'] = '#' + cb.settings.gaBGColor; msg['m'] = "[" + cb.settings.gaText + "] " + msg['m']; } else if (msg['user'] == cb.room_slug) { msg['m'] = " :gipeace " + msg['m']; } } } return msg; }); cb.onTip(function (tip) { handleTip(tip.amount, tip.from_user); scheduleUpdate(); silent_room = false; var amountTipped = parseInt(tip['amount']); if (amountTipped == cb.settings.gaMinTip && !isGA(tip['from_user'])) { // Make Group and announce it var announcement = cb.settings.gaAnnounce.replace("MEMBERNAME", tip['from_user']); makeGA(tip['from_user']); for (var i = 0; i < cb.settings.gaRainCount; i++) { cb.sendNotice(cb.settings.gaRainText); } cb.sendNotice(announcement); } if (amountTipped == cb.settings.gbMinTip) { // Make Group and announce it var announcement = cb.settings.gbAnnounce.replace("MEMBERNAME", tip['from_user']); makeGB(tip['from_user']); for (var i = 0; i < cb.settings.gbRainCount; i++) { cb.sendNotice(cb.settings.gbRainText); } cb.sendNotice(announcement); } if (amountTipped == cb.settings.gcMinTip) { // Make Group and announce it var announcement = cb.settings.gcAnnounce.replace("MEMBERNAME", tip['from_user']); makeGC(tip['from_user']); for (var i = 0; i < cb.settings.gcRainCount; i++) { cb.sendNotice(cb.settings.gcRainText); } cb.sendNotice(announcement); } if (amountTipped == cb.settings.gdMinTip) { // Make Group and announce it var announcement = cb.settings.gdAnnounce.replace("MEMBERNAME", tip['from_user']); makeGD(tip['from_user']); for (var i = 0; i < cb.settings.gdRainCount; i++) { cb.sendNotice(cb.settings.gdRainText); } cb.sendNotice(announcement); } if (amountTipped == cb.settings.geMinTip) { // Make Group and announce it var announcement = cb.settings.geAnnounce.replace("MEMBERNAME", tip['from_user']); makeGE(tip['from_user']); for (var i = 0; i < cb.settings.geRainCount; i++) { cb.sendNotice(cb.settings.geRainText); } cb.sendNotice(announcement); } if (amountTipped == cb.settings.gfMinTip) { // Make Group and announce it var announcement = cb.settings.gfAnnounce.replace("MEMBERNAME", tip['from_user']); makeGF(tip['from_user']); for (var i = 0; i < cb.settings.gfRainCount; i++) { cb.sendNotice(cb.settings.gfRainText); } cb.sendNotice(announcement); } if (amountTipped == cb.settings.ggMinTip) { // Make Group and announce it var announcement = cb.settings.ggAnnounce.replace("MEMBERNAME", tip['from_user']); makeGG(tip['from_user']); for (var i = 0; i < cb.settings.ggRainCount; i++) { cb.sendNotice(cb.settings.ggRainText); } cb.sendNotice(announcement); } }); cb.onEnter(function(user) { cb.sendNotice('Welcome to my room, ' + user['user'] + '. Please take a moment to read my Profile below before chatting. Thank you!', user['user'], '#FAC7FF', '', 'bold'); }); // functions function handleTip(amount, user) { user_total_tips[user] = (user_total_tips[user] || 0) + amount; user_last_tip_time[user] = new Date().valueOf(); } function sortLeaderboard(){ var lb = []; for (var user in user_total_tips) { if (user_total_tips.hasOwnProperty(user)){ lb.push([user_total_tips[user], -user_last_tip_time[user], user]); } } if (lb.length > 0){ lb.sort(function(a, b){ var r,i; for (i=0; i < a.length; i++){ if (a[i] < b[i]){ return 1; } if (a[i] > b[i]){ return -1; } } return 0; }); leader_username = lb[0][2]; } return lb; } function formatRanking(leaderboard, rank){ if (rank < leaderboard.length) { var p = leaderboard[rank]; return p[2] + ' (' + p[0] + ' token' + (p[0]!=1 ? 's' : '') + ')'; } else { return '--'; } } function getTop3(leaderboard){ var rank, result=''; for (rank=0; rank<20; rank++){ if (rank>0){ result += '|'; } if (rank < leaderboard.length){ result += leaderboard[rank][2]; } } return result; } function sendLeaderboard(force, to_user) { var lb = sortLeaderboard(), l = to_user ? lb.length : 20, out = 'Tippers leaderboard'; if (!force) { var top3 = getTop3(lb); if (top3 == last_top3){ return; } last_top3 = top3; } if (l<3) { l=3; } if (l < lb.length) { out += ' top 3 (Type !lb to see the full leaderboard)'; } if (to_user){ out += ' [v' + VERSION+']'; } for (var rank=0; rank<l; rank++) { out += NL + '' + (rank+1) + '. ' + formatRanking(lb, rank); } cb.chatNotice(out, to_user); if (!to_user){ scheduleInterval(); } } function scheduleUpdate(){ var print_on_tip = cb.settings.print_on_tip; if (print_on_tip != 'never') { var counter = ++update_counter; cb.setTimeout(function(){ if (update_counter == counter){ sendLeaderboard(print_on_tip == 'always'); } }, UPDATE_TIME); } } function scheduleInterval(){ var interval = cb.settings.print_interval; if (interval > 0) { var counter = ++interval_counter; cb.setTimeout(function(){ if (interval_counter == counter){ sendLeaderboard(!silent_room); } }, interval*INTERVAL_MULTIPLIER); silent_room = true; } } // Function on Groups function isGA(username) { return (username in gaMembers); } function isGB(username) { return (username in gbMembers); } function isGC(username) { return (username in gcMembers); } function isGD(username) { return (username in gdMembers); } function isGE(username) { return (username in geMembers); } function isGF(username) { return (username in gfMembers); } function isGG(username) { return (username in ggMembers); } function isBLOCK(username) { return (username in blockMembers); } function makeGA(username) { gaMembers[username] = {'u': 1}; } function makeGB(username) { gbMembers[username] = {'u': 1}; } function makeGC(username) { gcMembers[username] = {'u': 1}; } function makeGD(username) { gdMembers[username] = {'u': 1}; } function makeGE(username) { geMembers[username] = {'u': 1}; } function makeGF(username) { gfMembers[username] = {'u': 1}; } function makeGG(username) { ggMembers[username] = {'u': 1}; } // Adding and Removing Group Members // Group function setOne(username) { gaMembers[username] = {'u': 1}; } function unsetOne(username) { delete gaMembers[username]; } // Group function setTwo(username) { gbMembers[username] = {'u': 1}; } function unsetTwo(username) { delete gbMembers[username]; } // Group function setThree(username) { gcMembers[username] = {'u': 1}; } function unsetThree(username) { delete gcMembers[username]; } // Group function setFour(username) { gdMembers[username] = {'u': 1}; } function unsetFour(username) { delete gdMembers[username]; } // Group function setFive(username) { geMembers[username] = {'u': 1}; } function unsetFive(username) { delete geMembers[username]; } // Group function setSix(username) { gfMembers[username] = {'u': 1}; } function unsetSix(username) { delete gfMembers[username]; } // Group function setSeven(username) { ggMembers[username] = {'u': 1}; } function unsetSeven(username) { delete ggMembers[username]; } function stripImages(m){ var words = m.split(' '); m = ""; for (var i = 0; i < words.length; i++){ if ( /(:[a-z]*)/i.test(words[i]) && words[i].length > 3){ m += "[Grey Emotes Not Allowed]"+ " "; }else{ m += words[i]+ " "; } } return m.trim(); } function advert() { cb.sendNotice(EMOTE_FOLLOW, '', '#FFBEFF', '', 'bold'); cb.setTimeout(advert, (CONFIG_ADVERT_MINUTES * 60000)); } function twitter() { cb.sendNotice(cb.settings.roomADS, '', '#FFBEFF', '', 'bold'); cb.setTimeout(twitter, (CONFIG_TWITTER_MINUTES * 60000)); } function init() { cb.sendNotice(EMOTE_FOLLOW, '', '#FFBEFF', '', 'bold'); cb.setTimeout(advert, (CONFIG_ADVERT_MINUTES * 60000)); cb.setTimeout(twitter, (CONFIG_TWITTER_MINUTES * 60000)); } init(); // Get Member Lists function grabSettings() { cb.log("starting grabbing settings"); // Get members if (cb.settings.gaMemberList) { var gaMemberSettings = cb.settings.gaMemberList.split(','); for (var ii = 0; ii < gaMemberSettings.length; ii++) { var clean = gaMemberSettings[ii].toLowerCase().replace(/ /g,""); gaMembers[clean] = {'u': 1}; } } // Get if (cb.settings.gbMemberList) { var gbMemberSettings = cb.settings.gbMemberList.split(','); for (var ii = 0; ii < gbMemberSettings.length; ii++) { var clean = gbMemberSettings[ii].toLowerCase().replace(/ /g,""); gbMembers[clean] = {'u': 1}; } } // Get if (cb.settings.gcMemberList) { var gcMemberSettings = cb.settings.gcMemberList.split(','); for (var ii = 0; ii < gcMemberSettings.length; ii++) { var clean = gcMemberSettings[ii].toLowerCase().replace(/ /g,""); gcMembers[clean] = {'u': 1}; } } // Get if (cb.settings.gdMemberList) { var gdMemberSettings = cb.settings.gdMemberList.split(','); for (var ii = 0; ii < gdMemberSettings.length; ii++) { var clean = gdMemberSettings[ii].toLowerCase().replace(/ /g,""); gdMembers[clean] = {'u': 1}; } } // Get if (cb.settings.geMemberList) { var geMemberSettings = cb.settings.geMemberList.split(','); for (var ii = 0; ii < geMemberSettings.length; ii++) { var clean = geMemberSettings[ii].toLowerCase().replace(/ /g,""); geMembers[clean] = {'u': 1}; } } // Get if (cb.settings.gfMemberList) { var gfMemberSettings = cb.settings.gfMemberList.split(','); for (var ii = 0; ii < gfMemberSettings.length; ii++) { var clean = gfMemberSettings[ii].toLowerCase().replace(/ /g,""); gfMembers[clean] = {'u': 1}; } } // Get if (cb.settings.ggMemberList) { var ggMemberSettings = cb.settings.ggMemberList.split(','); for (var ii = 0; ii < ggMemberSettings.length; ii++) { var clean = ggMemberSettings[ii].toLowerCase().replace(/ /g,""); ggMembers[clean] = {'u': 1}; } } // Get Blocked members if (cb.settings.blockMemberList) { var blockMemberSettings = cb.settings.blockMemberList.split(','); for (var ii = 0; ii < blockMemberSettings.length; ii++) { var clean = blockMemberSettings[ii].toLowerCase().replace(/ /g, ""); blockMembers[clean] = {'u': 1}; } } cb.log("finished grabbing settings"); } grabSettings();
© Copyright Chaturbate 2011- 2026. All Rights Reserved.