Bots Home
|
Create an App
shazza1984 bot
Author:
shazza1984
Description
Source Code
Launch Bot
Current Users
Created by:
Shazza1984
// Shazza Club Bot // CB app settings cb.settings_choices = [ {name: 'doColoring', type: 'choice', label: 'Change text and background coloring for members (choose colors below)?', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes'}, {name: 'doText', type: 'choice', label: 'Add text labels in front of members messages (choose text below)?', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes'}, {name: 'a1Text', label: 'Text to put in front of Shazzas Sinn3r_Lover club members messages (e.g. smoke), the text will be put inside square brackets []', type: 'str', minLength: 0, maxLength: 20, required: false, defaultValue: 'Sinn3r_Lover'}, {name: 'a1TextColor', label: 'Shazzas Sinn3r_Lover club members text color - HTML colour code without starting \'#\' e.g. (000000 is black)', type: 'str', minLength: 0, maxLength: 6, required: false, defaultValue: '000000'}, {name: 'a1BGColor', label: 'Shazzas Sinn3r_ Lover club members background color - HTML colour code without starting \'#\' e.g. (DDA0DD is plum)', type: 'str', minLength: 0, maxLength: 6, required: false, defaultValue: 'DDA0DD'}, {name: 'a1MinTip', label: 'Minimum tip to become Shazzas Sinn3r_Lover club member', type: 'int', minValue: 1, defaultValue: 477}, {name: 'a1Announce', label: 'Text to show when someone tips to become a Shazzas SInn3r_Lover club 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 just became Shazzas Sinn3r_Lover!'}, {name: 'a1MemberList', label: 'List of current Shazzas Sinn3r_Lover club members, separated by commas (and they need to be the CB username exactly)', type: 'str', minLength: 0, maxLength: 10240, required: false, defaultValue: ''}, {name: 'a1RainText', label: 'Text to use for Shazzas Sinn3r_Lover club rain lines', type: 'str', minLength: 0, maxLength: 80, required: false, defaultValue: 'SINN3R_LOVER SINN3R_LOVER <3 <3 <3'}, {name: 'a1RainCount', label: 'Number of lines of Shazzas Sinn3r_Lover club rain', type: 'int', minValue: 1, maxValue: 15, defaultValue: 15}, {name: 'a2Text', label: 'Text to put in front of Shazzas Roommate_Sinn3r Club messages (e.g. hr)', type: 'str', minLength: 0, maxLength: 15, required: false, defaultValue: 'Roommate_Sinn3r'}, {name: 'a2TextColor', label: 'Shazzas Roommate_Sinn3r text color - HTML colour code without starting \'#\' e.g. (000000 is black)', type: 'str', minLength: 0, maxLength: 6, required: false, defaultValue: '000000'}, {name: 'a2BGColor', label: 'Shazzas Roommate_Sinn3r background color - HTML colour code without starting \'#\' e.g. (00BFFF is deepskyblue)', type: 'str', minLength: 0, maxLength: 6, required: false, defaultValue: '00BFFF'}, {name: 'a2MinTip', label: 'Minimum tip to become Shazzas Roommate_Sinn3r', type: 'int', minValue: 1, defaultValue: 777}, {name: 'a2Announce', label: 'Text to show when someone tips to become Shazzas Roommate_Sinn3r, 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 became Shazzas Roommate_SInn3r!'}, {name: 'a2MemberList', label: 'List of current Shazzas Roommate_SInn3r, separated by commas (and they need to be the CB username exactly)', type: 'str', minLength: 0, maxLength: 10240, required: false, defaultValue: ''}, {name: 'a2RainText', label: 'Text to use for Shazzas Roommate_Sinn3r rain lines', type: 'str', minLength: 0, maxLength: 80, required: false, defaultValue: 'ROOMMATE_SINN3R ROOMMATE_SINN3R <3 <3 <3'}, {name: 'a2RainCount', label: 'Number of lines of Shazzas Roommate_Sinn3r rain', type: 'int', minValue: 1, maxValue: 15, defaultValue: 15}, {name: 'a3Text', label: 'Text to put in front of Shazzas Husband_Sinn3r messages (e.g. hr)', type: 'str', minLength: 0, maxLength: 15, required: false, defaultValue: 'Husband_Sinn3r'}, {name: 'a3TextColor', label: 'Shazzas Husband_SInn3r text color - HTML colour code without starting \'#\' e.g. (1E90FF is dodgerblue)', type: 'str', minLength: 0, maxLength: 6, required: false, defaultValue: '1E90FF'}, {name: 'a3BGColor', label: 'Shazzas Husband_Sinn3r background color - HTML colour code without starting \'#\' e.g. 696969 is dimgrey)', type: 'str', minLength: 0, maxLength: 6, required: false, defaultValue: '696969'}, {name: 'a3MinTip', label: 'Minimum tip to become Shazzas Husband_SInn3r', type: 'int', minValue: 1, defaultValue: 1177}, {name: 'a3Announce', label: 'Text to show when someone tips to become Shazzas Husband_SInn3r, 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 became Shazzas Husband_SInn3r!'}, {name: 'a3MemberList', label: 'List of current Shazzas Husband_Sinn3r, separated by commas (and they need to be the CB username exactly)', type: 'str', minLength: 0, maxLength: 10240, required: false, defaultValue: ''}, {name: 'a3RainText', label: 'Text to use for Shazzas Husband_Sinn3r rain lines', type: 'str', minLength: 0, maxLength: 80, required: false, defaultValue: 'HUSBAND_SINN3R HUSBAND_SINN3R <3 <3 <3'}, {name: 'a3RainCount', label: 'Number of lines of Shazzas Husband_Sinn3r rain', type: 'int', minValue: 1, maxValue: 15, defaultValue: 15} ]; var a1Members = {}; var a2Members = {}; var a3Members = {}; var ffNotice = "CHECK OUT THE VIDEOS IN MY BIO !!... Follow Twitter @shazza1984cb"; var CONFIG_ADVERT_MINUTES = 10; // For auto-silencing at least some of token_wh*re_c*nts usernames var twcRegex = /t.?k.?n.?wh.?r.?_c.?nt.?/i; function showFFNotice(){ cb.chatNotice(ffNotice); cb.setTimeout(showFFNotice, (CONFIG_ADVERT_MINUTES * 60000)); } cb.onMessage(function (msg) { // vars for ease of use var u = msg['user']; if (isA3(u)) { msg['background'] = '#' + cb.settings.a3BGColor; msg['c'] = '#' + cb.settings.a3TextColor; msg['m'] = "[" + cb.settings.a3Text + "] " + msg['m']; } else if (isA2(u)) { msg['background'] = '#' + cb.settings.a2BGColor; msg['c'] = '#' + cb.settings.a2TextColor; msg['m'] = "[" + cb.settings.a2Text + "] " + msg['m']; } else if (isA1(u)) { msg['background'] = '#' + cb.settings.a1BGColor; msg['c'] = '#' + cb.settings.a1TextColor; msg['m'] = "[" + cb.settings.a1Text + "] " + 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.onEnter(function(user) { cb.sendNotice('Welcome to my room, ' + user['user'] + '. Please take a moment to read my room rules before chatting.... BUT PLEASE DO CHAT!! Thank you!', user['user'], '#CCF5EB', '', 'bold'); }); cb.onTip(function (tip) { var amountTipped = parseInt(tip['amount']); if (amountTipped >= cb.settings.a1MinTip && !isA1(tip['from_user'])) { // Make SINN3R_LOVER var announcement = cb.settings.a1Announce.replace("MEMBERNAME", tip['from_user']); makeA1(tip['from_user']); for (var i = 0; i < cb.settings.a1RainCount; i++) { cb.chatNotice(cb.settings.a1RainText); } cb.chatNotice(announcement); } else if (amountTipped >= cb.settings.a2MinTip && !isA2(tip['from_user'])) { // Make ROOMMATE_SINN3R var announcement = cb.settings.a2Announce.replace("MEMBERNAME", tip['from_user']); makeA2(tip['from_user']); for (var i = 0; i < cb.settings.a2RainCount; i++) { cb.chatNotice(cb.settings.a2RainText); } cb.chatNotice(announcement); } else if (amountTipped >= cb.settings.a3MinTip && !isA3(tip['from_user'])) { // Make HUSBAND_SINN3R var announcement = cb.settings.a3Announce.replace("MEMBERNAME", tip['from_user']); makeA3(tip['from_user']); for (var i = 0; i < cb.settings.a3RainCount; i++) { cb.chatNotice(cb.settings.a3RainText); } cb.chatNotice(announcement); } }); function isA3(username) { return (username in a3Members); } function isA2(username) { return (username in a2Members); } function isA1(username) { return (username in a1Members); } function makeA3(username) { a3Members[username] = {'u': 1}; } function makeA2(username) { a2Members[username] = {'u': 1}; } function makeA1(username) { a1Members[username] = {'u': 1}; } function grabSettings() { cb.log("starting grabbing settings"); // Get SINN3R_LOVERS if (cb.settings.a1MemberList) { var a1MemberSettings = cb.settings.a1MemberList.split(','); for (var ii = 0; ii < a1MemberSettings.length; ii++) { var clean = a1MemberSettings[ii].toLowerCase().replace(/ /g, ""); a1Members[clean] = {'u': 1}; } } // Get ROOMMATE_SINN3R if (cb.settings.a2MemberList) { var a2MemberSettings = cb.settings.a2MemberList.split(','); for (var ii = 0; ii < a2MemberSettings.length; ii++) { var clean = a2MemberSettings[ii].toLowerCase().replace(/ /g, ""); a2Members[clean] = {'u': 1}; } } // Get HUSBAND_SINN3R if (cb.settings.a3MemberList) { var a3MemberSettings = cb.settings.a3MemberList.split(','); for (var ii = 0; ii < a3MemberSettings.length; ii++) { var clean = a3MemberSettings[ii].toLowerCase().replace(/ /g, ""); a3Members[clean] = {'u': 1}; } } cb.log("finished grabbing settings"); } grabSettings(); showFFNotice();
© Copyright Chaturbate 2011- 2026. All Rights Reserved.