Bots Home
|
Create an App
BOTB Club
Author:
matt36
Description
Source Code
Launch Bot
Current Users
Created by:
Matt36
// Best of the Best bot // CB app settings cb.settings_choices = [ { name: 'doColoring', type: 'choice', label: 'Change text and background coloring for BOTB (choose colours below)?', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes' }, { name: 'doText', type: 'choice', label: 'Add text labels in front of BOTB (choose text below)?', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes' }, { name: 'ulText', label: 'Text to put in front of BOTB members messages (e.g. BOTB, the text will be put inside square brackets [ ]', type: 'str', minLength: 0, maxLength: 15, required: false, defaultValue: 'BOTB' }, { name: 'ulMinTip', label: 'Minimum tip to become BOTB member', type: 'int', minValue: 1, defaultValue: 505 }, { name: 'ulAnnounce', label: 'Text to show when someone tips to become a BOTB member, 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 is now one of the Best!!' }, { name: 'ulRainText', label: 'Text to use for BOTB rain lines', type: 'str', minLength: 0, maxLength: 80, required: false, defaultValue: '' }, { name: 'ulRainCount', label: 'Number of lines of BOTB rain', type: 'int', minValue: 1, maxValue: 15, defaultValue: 10 }, { name: 'ulTextColor', label: 'BOTB members text color - HTML colour code without starting \'#\' e.g. (FFFFFF is white)', type: 'str', minLength: 0, maxLength: 6, required: false, defaultValue: '000000' }, { name: 'ulBGColor', label: 'BOTB members background color - HTML colour code without starting \'#\' e.g. (000000 is black)', type: 'str', minLength: 0, maxLength: 6, required: false, defaultValue: 'fffff' }, { name: 'ulMemberList', label: 'List of current BOTB members, separated by commas (and they need to be the CB username exactly)', type: 'str', minLength: 0, maxLength: 10240, required: false, defaultValue: 'rolla133' }, { name: 'avText', label: 'Text to put in front of King Wet messages (e.g. QU), the text will be put inside square brackets [ ]', type: 'str', minLength: 0, maxLength: 15, required: false, defaultValue: 'Asshole' }, { name: 'avBGColor', label: 'King Wet background color - HTML colour code without starting \'#\' e.g. (000000 is black)', type: 'str', minLength: 0, maxLength: 6, required: false, defaultValue: 'ffffff' }, { name: 'avMemberList', label: 'List of current King users, separated by commas (and they need to be the CB username exactly)', type: 'str', minLength: 0, maxLength: 10240, required: false, defaultValue: 'wethebest101' }, { name: 'wgText', label: 'Text to put in front of Better than Best messages (e.g. GU), the text will be put inside square brackets []', type: 'str', minLength: 0, maxLength: 15, required: false, defaultValue: 'BetterThanBest' }, { name: 'wgTextColor', label: 'Better than Best text color - HTML colour code without starting \'#\' e.g. (FFFFFF is white)', type: 'str', minLength: 0, maxLength: 6, required: false, defaultValue: '000000' }, { name: 'wgBGColor', label: 'Highest Rolla background color - HTML colour code without starting \'#\' e.g. (000000 is black)', type: 'str', minLength: 0, maxLength: 6, required: false, defaultValue: 'ffffff' }, { name: 'wgMemberList', label: 'List of current highest rolla users, separated by commas (and they need to be the CB username exactly)', type: 'str', minLength: 0, maxLength: 10240, required: false, defaultValue: 'falsename' }, ]; var ulMembers = {}; var avMembers = {}; var wgMembers = {}; var afMembers = {}; // 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) { // vars for ease of use var u = msg['user']; if (!(msg['m'][0] == "/" || msg['m'][0] == "?" || msg['m'][0] == "$" || msg['m'][0] == "!")) { if (isUL(u) && isAF(u)) { msg['background'] = '#' + cb.settings.bothBGColor; msg['c'] = '#' + cb.settings.bothTextColor; msg['m'] = "[" + cb.settings.ulText + " / " + cb.settings.afText + "] " + msg['m']; } else if (isUL(u)) { msg['background'] = '#' + cb.settings.ulBGColor; msg['c'] = '#' + cb.settings.ulTextColor; msg['m'] = "[" + cb.settings.ulText + "] " + msg['m']; } else if (isAV(u)) { msg['background'] = '#' + cb.settings.avBGColor; msg['c'] = '#' + cb.settings.avTextColor; msg['m'] = "[" + cb.settings.avText + "] " + msg['m']; } else if (isWG(u)) { msg['background'] = '#' + cb.settings.wgBGColor; msg['c'] = '#' + cb.settings.wgTextColor; msg['m'] = "[" + cb.settings.wgText + "] " + msg['m']; } else if (isAF(u)) { msg['background'] = '#' + cb.settings.afBGColor; msg['c'] = '#' + cb.settings.afTextColor; msg['m'] = "[" + cb.settings.afText + "] " + msg['m']; } } if (twcRegex.test(u)) { // Auto-silencing at least some of token_wh*re_c*nts usernames msg['X-Spam'] = true; } return msg; }); cb.onTip(function (tip) { var amountTipped = parseInt(tip['amount']); if (amountTipped == cb.settings.ulMinTip) { // Make truewidowland and announce it var announcement = cb.settings.ulAnnounce.replace("MEMBERNAME", tip['from_user']); makeUL(tip['from_user']); for (var i = 0; i < cb.settings.ulRainCount; i++) { cb.chatNotice(cb.settings.ulRainText); } cb.chatNotice(announcement); } }); function isUL(username) { return (username in ulMembers); } function isAV(username) { return (username in avMembers); } function isWG(username) { return (username in wgMembers); } function isAF(username) { return (username in afMembers); } function makeUL(username) { ulMembers[username] = { 'u': 1 }; } function makeAV(username) { avMembers[username] = { 'u': 1 }; } function makeWG(username) { wgMembers[username] = { 'u': 1 }; } function makeAF(username) { afMembers[username] = { 'u': 1 }; } function grabSettings() { cb.log("starting grabbing settings"); // Get truewidowlandmembers if (cb.settings.ulMemberList) { var ulMemberSettings = cb.settings.ulMemberList.split(','); for (var ii = 0; ii < ulMemberSettings.length; ii++) { var clean = ulMemberSettings[ii].toLowerCase().replace(/ /g, ""); ulMembers[clean] = { 'u': 1 }; } } // Get truewidowland if (cb.settings.avMemberList) { var avMemberSettings = cb.settings.avMemberList.split(','); for (var ii = 0; ii < avMemberSettings.length; ii++) { var clean = avMemberSettings[ii].toLowerCase().replace(/ /g, ""); avMembers[clean] = { 'u': 1 }; } } // Get king tipper of truewidowland if (cb.settings.wgMemberList) { var wgMemberSettings = cb.settings.wgMemberList.split(','); for (var ii = 0; ii < wgMemberSettings.length; ii++) { var clean = wgMemberSettings[ii].toLowerCase().replace(/ /g, ""); wgMembers[clean] = { 'u': 1 }; } } // Get truewidow fans if (cb.settings.afMemberList) { var afMemberSettings = cb.settings.afMemberList.split(','); for (var ii = 0; ii < afMemberSettings.length; ii++) { var clean = afMemberSettings[ii].toLowerCase().replace(/ /g, ""); afMembers[clean] = { 'u': 1 }; } } cb.log("finished grabbing settings"); } grabSettings();
© Copyright Chaturbate 2011- 2026. All Rights Reserved.