Bots Home
|
Create an App
Artemismoon Group Bot
Author:
roydz
Description
Source Code
Launch Bot
Current Users
Created by:
Roydz
// Artemis Group bot // 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' }, // Group One {name: 'raText', label: 'Text to put in front of Top group messages (e.g. Citizen), the text will be put inside square brackets []', type: 'str', minLength: 0, maxLength: 15, required: false, defaultValue: 'top'}, {name: 'raMinTip', label: 'Minimum tip to become a Top Group', type: 'int', minValue: 1, defaultValue: 1888}, {name: 'raAnnounce', label: 'Text to show when someone tips to become a Top Group, 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 became a Artemismoon'}, {name: 'raBGColor', label: 'Top Group background color - HTML colour code without starting \'#\' e.g. (000000 is black)', type: 'str', minLength: 0, maxLength: 6, required: false, defaultValue: 'd7dc42'}, {name: 'raMemberList', label: 'List of current Top Group, separated by commas (and they need to be the CB username exactly)', type: 'str', minLength: 0, maxLength: 10240, required: false, defaultValue: ''}, {name: 'raRainText', label: 'Text to use for Top Group rain lines', type: 'str', minLength: 0, maxLength: 80, required: false, defaultValue: 'top group'}, {name: 'raRainCount', label: 'Number of lines for Top Group', type: 'int', minValue: 1, maxValue: 15, defaultValue: 5}, // Group Two {name: 'rbText', label: 'Text to put in front of 2nd group messages (e.g. Ki)', type: 'str', minLength: 0, maxLength: 15, required: false, defaultValue: '2nd'}, {name: 'rbMinTip', label: 'Minimum tip to become a 2nd group', type: 'int', minValue: 1, defaultValue: 1888}, {name: 'rbAnnounce', label: 'Text to show when someone tips to become a 2nd group, 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 became a Artemismoon'}, {name: 'rbBGColor', label: '2nd group background color - HTML colour code without starting \'#\' e.g. (F5B608 is orangey/gold)', type: 'str', minLength: 0, maxLength: 6, required: false, defaultValue: '8ce0ad'}, {name: 'rbMemberList', label: 'List of current 2nd group, separated by commas (and they need to be the CB username exactly)', type: 'str', minLength: 0, maxLength: 10240, required: false, defaultValue: ''}, {name: 'rbRainText', label: 'Text to use for 2nd group rain lines', type: 'str', minLength: 0, maxLength: 80, required: false, defaultValue: '2nd'}, {name: 'rbRainCount', label: 'Number of lines for 2nd group', type: 'int', minValue: 1, maxValue: 15, defaultValue: 5}, // Group lunar lover {name: 'rcText', label: 'Text to put in front of Lunar Lover messages (e.g. Lo)', type: 'str', minLength: 0, maxLength: 15, required: false, defaultValue: 'Lunar Lover'}, {name: 'rcMinTip', label: 'Minimum tip to become a Lunar Lover', type: 'int', minValue: 1, defaultValue: 777}, {name: 'raAnnounce', label: 'Text to show when someone tips to become a Lunar Lover, 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 became a Lunar Lover'}, {name: 'rcBGColor', label: 'Lunar Lover background color - HTML colour code without starting \'#\' e.g. (F5B608 is orangey/gold)', type: 'str', minLength: 0, maxLength: 6, required: false, defaultValue: 'f26464'}, {name: 'rcMemberList', label: 'List of current Lunar Lover, separated by commas (and they need to be the CB username exactly)', type: 'str', minLength: 0, maxLength: 10240, required: false, defaultValue: 'catgirlellie,ozone_s,feralw,walking_on_by,mrdoubtfire,sguy82,philosopherbum'}, {name: 'rcRainText', label: 'Text to use for Lunar Lover rain lines', type: 'str', minLength: 0, maxLength: 80, required: false, defaultValue: 'Lunar Lover'}, {name: 'rcRainCount', label: 'Number of lines for Lunar Lover', type: 'int', minValue: 1, maxValue: 15, defaultValue: 5}, // Group Four {name: 'rdText', label: 'Text to put in front of 3rd Group messages (e.g. Lo)', type: 'str', minLength: 0, maxLength: 15, required: false, defaultValue: '3rd'}, {name: 'rdMinTip', label: 'Minimum tip to become a 3rd Group', type: 'int', minValue: 1, defaultValue: 1888}, {name: 'rdAnnounce', label: 'Text to show when someone tips to become a 3rd Group, 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 became a Artemismoon'}, {name: 'rdBGColor', label: '3rd Group background color - HTML colour code without starting \'#\' e.g. (F5B608 is orangey/gold)', type: 'str', minLength: 0, maxLength: 6, required: false, defaultValue: '50fcfe'}, {name: 'rdMemberList', label: 'List of current 3rd Group, separated by commas (and they need to be the CB username exactly)', type: 'str', minLength: 0, maxLength: 10240, required: false, defaultValue: ''}, {name: 'rdRainText', label: 'Text to use for 3rd Group rain lines', type: 'str', minLength: 0, maxLength: 80, required: false, defaultValue: '3rd'}, {name: 'rdRainCount', label: 'Number of lines for 3rd Group', type: 'int', minValue: 1, maxValue: 15, defaultValue: 5}, // Group Five {name: 'reText', label: 'Text to put in front of 4th Group messages (e.g. Lo)', type: 'str', minLength: 0, maxLength: 15, required: false, defaultValue: '4th'}, {name: 'reMinTip', label: 'Minimum tip to become a 4th Group', type: 'int', minValue: 1, defaultValue: 1888}, {name: 'reAnnounce', label: 'Text to show when someone tips to become a 4th Group, 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 became a Artemismoon'}, {name: 'reBGColor', label: '4th Group background color - HTML colour code without starting \'#\' e.g. (F5B608 is orangey/gold)', type: 'str', minLength: 0, maxLength: 6, required: false, defaultValue: 'BDBBBB'}, {name: 'reMemberList', label: 'List of current 4th Group, separated by commas (and they need to be the CB username exactly)', type: 'str', minLength: 0, maxLength: 10240, required: false, defaultValue: ''}, {name: 'reRainText', label: 'Text to use for 4th Group rain lines', type: 'str', minLength: 0, maxLength: 80, required: false, defaultValue: '4th'}, {name: 'reRainCount', label: 'Number of lines for 4th Group', type: 'int', minValue: 1, maxValue: 15, defaultValue: 5}, ]; var raMembers = {}; var rbMembers = {}; var rcMembers = {}; var rdMembers = {}; var reMembers = {}; // 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']; // Groups if (isRA(u)) { msg['background'] = '#' + cb.settings.raBGColor; msg['m'] = "[" + cb.settings.raText + "] " + msg['m']; } else if ( isRB(u) ) { msg['background'] = '#' + cb.settings.rbBGColor; msg['m'] = "[" + cb.settings.rbText + "] " + msg['m']; } else if ( isRC(u) ) { msg['background'] = '#' + cb.settings.rcBGColor; msg['m'] = "[" + cb.settings.rcText + "] " + msg['m']; } else if ( isRD(u) ) { msg['background'] = '#' + cb.settings.rdBGColor; msg['m'] = "[" + cb.settings.rdText + "] " + msg['m']; } else if ( isRE(u) ) { msg['background'] = '#' + cb.settings.reBGColor; msg['m'] = "[" + cb.settings.reText + "] " + 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.raMinTip && !isRA(tip['from_user'])) { // Make 1st and announce it var announcement = cb.settings.raAnnounce.replace("MEMBERNAME", tip['from_user']); makeRA(tip['from_user']); for (var i = 0; i < cb.settings.raRainCount; i++) { cb.chatNotice(cb.settings.raRainText); } cb.chatNotice(announcement); } if (amountTipped == cb.settings.rbMinTip) { // Make 2nd and announce it var announcement = cb.settings.rbAnnounce.replace("MEMBERNAME", tip['from_user']); makeRB(tip['from_user']); for (var i = 0; i < cb.settings.rbRainCount; i++) { cb.chatNotice(cb.settings.rbRainText); } cb.chatNotice(announcement); } if (amountTipped == cb.settings.rcMinTip) { // Make Loves and announce it var announcement = cb.settings.rcAnnounce.replace("MEMBERNAME", tip['from_user']); makeRC(tip['from_user']); for (var i = 0; i < cb.settings.rcRainCount; i++) { cb.chatNotice(cb.settings.rcRainText); } cb.chatNotice(announcement); } if (amountTipped == cb.settings.rdMinTip) { // Make 3rd and announce it var announcement = cb.settings.rdAnnounce.replace("MEMBERNAME", tip['from_user']); makeRD(tip['from_user']); for (var i = 0; i < cb.settings.rdRainCount; i++) { cb.chatNotice(cb.settings.rdRainText); } cb.chatNotice(announcement); } if (amountTipped == cb.settings.reMinTip) { // Make 4th and announce it var announcement = cb.settings.reAnnounce.replace("MEMBERNAME", tip['from_user']); makeRE(tip['from_user']); for (var i = 0; i < cb.settings.reRainCount; i++) { cb.chatNotice(cb.settings.reRainText); } cb.chatNotice(announcement); } }); function isRA(username) { return (username in raMembers); } function isRB(username) { return (username in rbMembers); } function isRC(username) { return (username in rcMembers); } function isRD(username) { return (username in rdMembers); } function isRE(username) { return (username in reMembers); } function makeRA(username) { raMembers[username] = {'u': 1}; } function makeRB(username) { rbMembers[username] = {'u': 1}; } function makeRC(username) { rcMembers[username] = {'u': 1}; } function makeRD(username) { rdMembers[username] = {'u': 1}; } function makeRE(username) { reMembers[username] = {'u': 1}; } function grabSettings() { cb.log("starting grabbing settings"); // Get 1st members if (cb.settings.raMemberList) { var raMemberSettings = cb.settings.raMemberList.split(','); for (var ii = 0; ii < raMemberSettings.length; ii++) { var clean = raMemberSettings[ii].toLowerCase().replace(/ /g,""); raMembers[clean] = {'u': 1}; } } // Get 2nd if (cb.settings.rbMemberList) { var rbMemberSettings = cb.settings.rbMemberList.split(','); for (var ii = 0; ii < rbMemberSettings.length; ii++) { var clean = rbMemberSettings[ii].toLowerCase().replace(/ /g,""); rbMembers[clean] = {'u': 1}; } } // Get Loves if (cb.settings.rcMemberList) { var rcMemberSettings = cb.settings.rcMemberList.split(','); for (var ii = 0; ii < rcMemberSettings.length; ii++) { var clean = rcMemberSettings[ii].toLowerCase().replace(/ /g,""); rcMembers[clean] = {'u': 1}; } } // Get 3rd if (cb.settings.rdMemberList) { var rdMemberSettings = cb.settings.rdMemberList.split(','); for (var ii = 0; ii < rdMemberSettings.length; ii++) { var clean = rdMemberSettings[ii].toLowerCase().replace(/ /g,""); rdMembers[clean] = {'u': 1}; } } // Get 4th if (cb.settings.reMemberList) { var reMemberSettings = cb.settings.reMemberList.split(','); for (var ii = 0; ii < reMemberSettings.length; ii++) { var clean = reMemberSettings[ii].toLowerCase().replace(/ /g,""); reMembers[clean] = {'u': 1}; } } cb.log("finished grabbing settings"); } grabSettings();
© Copyright Chaturbate 2011- 2026. All Rights Reserved.