Bots Home
|
Create an App
Sassifrassire club
Author:
sassifrassire
Description
Source Code
Launch Bot
Current Users
Created by:
Sassifrassire
// Sassifrassire Members and Fanclub // CB app settings cb.settings_choices = [ { name: 'doColoring', type: 'choice', label: 'Change text and background coloring for Sassifrassire (choose colours below)?', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes' }, { name: 'doText', type: 'choice', label: 'Add text labels in front of Sassifrassire messages (choose text below)?', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes' }, { name: 'ulText', label: 'Text to put in front of Sassifrassire members messages, the text will be put inside square brackets [ ]', type: 'str', minLength: 0, maxLength: 15, required: false, defaultValue: '696' }, { name: 'ulMinTip', label: 'tip to become Sassifrassire member', type: 'int', minValue: 222, defaultValue: 696 }, { name: 'ulAnnounce', label: 'Text to show when someone tips to become a Sassifrassire 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: ' 696 MEMBERNAME Has just joined Sassifrassire 696' }, { name: 'ulRainText', label: 'Text to use for Sassifrassire rain lines', type: 'str', minLength: 0, maxLength: 80, required: false, defaultValue: '696***696***Sassifrassire***696***696' }, { name: 'ulRainCount', label: 'Number of lines of Sassifrassire rain', type: 'int', minValue: 1, maxValue: 15, defaultValue: 5 }, { name: 'ulTextColor', label: 'Sassifrassire 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: 'Sassifrassire members background color - HTML colour code without starting \'#\' e.g. (000000 is black)', type: 'str', minLength: 0, maxLength: 6, required: false, defaultValue: 'FA5858' }, { name: 'ulMemberList', label: 'List of current Sassifrassire members, separated by commas (and they need to be the CB username exactly)', type: 'str', minLength: 0, maxLength: 10240, required: false, defaultValue: 'SDXCajun, Stubby660, Excelsior62, Austinpowers26, Fordexpr, Badguy55' }, { name: 'afMemberList', label: 'List of current Fan Club members, separated by commas (and they need to be the CB username exactly)', type: 'str', minLength: 0, maxLength: 10240, required: false, defaultValue: 'SDXcajun, Stubby660, Excelsior62, Austinpowers26, Frenchmaid85' }, { name: 'bothTextColor', label: 'SS and Fanclub text color - HTML colour code without starting \'#\' e.g. (FFFFFF is white)', type: 'str', minLength: 0, maxLength: 6, required: false, defaultValue: '000000' }, { name: 'bothBGColor', label: 'SS and Fanclub background color - HTML colour code without starting \'#\' e.g. (000000 is black)', type: 'str', minLength: 0, maxLength: 6, required: false, defaultValue: 'FFCC00' } ]; var ulMembers = {}; var afMembers = {}; cb.onMessage(function (msg) { // vars for ease of use var u = msg['user']; var tag = ""; if( isUL(u) && isAF(u) ) { msg['background'] = '#' + cb.settings.bothBGColor; msg['c'] = '#' + cb.settings.bothTextColor; tag = "[" +cb.settings.ulText+" / "+ cb.settings.afText + "] "; } else if ( isUL(u) ) { msg['background'] = '#' + cb.settings.ulBGColor; msg['c'] = '#' + cb.settings.ulTextColor; tag = "[" + cb.settings.ulText + "] "; } else if ( isAF(u) ) { msg['background'] = '#' + cb.settings.afBGColor; msg['c'] = '#' + cb.settings.afTextColor; tag = "[" + cb.settings.afText + "] "; } if ( !msg['is_mod'] && tag.length > 0 ) { msg['m'] = tag + msg['m']; } }); cb.onTip(function (tip) { var amountTipped = parseInt(tip['amount']); if (amountTipped == cb.settings.ulMinTip) { // Make SammiesSecret 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); } else if (amountTipped == cb.settings.afMinTip) { // FanClub and announce it var announcement = cb.settings.afAnnounce.replace("MEMBERNAME", tip['from_user']); makeUL(tip['from_user']); for (var i = 0; i < cb.settings.afRainCount; i++) { cb.chatNotice(cb.settings.afRainText); } cb.chatNotice(announcement); } }); function isUL(username) { return (username in ulMembers); } function isAF(username) { return (username in afMembers); } function makeUL(username) { ulMembers[username] = {'u': 1}; } function makeAF(username) { afMembers[username] = {'u': 1}; } function grabSettings() { cb.log("starting grabbing settings"); // Get SammiesSecrets members 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 Fan Club Members 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.