Bots Home
|
Create an App
johnnn
Author:
hallowin90
Description
Source Code
Launch Bot
Current Users
Created by:
Hallowin90
cb.settings_choices = [ { name: 'doColoring', type: 'choice', label: 'Change text and background coloring for Clubs', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes' }, { name: 'doText', type: 'choice', label: 'Add emoji in front of clubs.', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes' }, { name: 'ulMinTip', label: 'Minimum tip to become a 420 FC', type: 'int', minValue: 1, defaultValue: 420 }, { name: 'ulAnnounce', label: 'Text to show when someone tips to become a 420 FC, the text MEMBERNAME will be replaced with the actual username (Note: graphics don\'t work in this text)', type: 'str', minLength: 0, maxLength: 10240, required: false, defaultValue: 'MEMBERNAME became a 420 Club Member!' }, { name: 'ulRainText', label: 'Text that is shown in the chat notice when someone joins 420 FC', type: 'str', minLength: 0, maxLength: 80, required: false, defaultValue: 'Someone became a 420 Club Member!' }, { name: 'ulRainCount', label: 'Number of times the above text is put into chat in a row when a user joins 420 FC', type: 'int', minValue: 1, maxValue: 15, defaultValue: 10 }, { name: 'ulTextColor', label: '420 fc text colour', type: 'str', minLength: 0, maxLength: 6, required: false, defaultValue: '1e036c' }, { name: 'ulBGColor', label: 'Tip User background colour', type: 'str', minLength: 0, maxLength: 6, required: false, defaultValue: 'dadada' }, { name: 'ulMemberList', label: 'List of current 420FC members, separated by commas (and they need to be the CB username exactly)', type: 'str', minLength: 0, maxLength: 10240, required: false, defaultValue: 'avalynnrose, facef944, insaniak00, lustingforsex, marywana, mojo777, notperci, hassaro, myemmagination, kmack2, centuriongod' }, { name: 'avText', label: 'Text to put in front of Drinking Club (assigned by broadcaster) ', type: 'str', minLength: 0, maxLength: 20, required: false, defaultValue: ':Drinkingclubgif' }, { name: 'avTextColor', label: 'Drinking Club text colour', type: 'str', minLength: 0, maxLength: 6, required: false, defaultValue: 'b80a0a' }, { name: 'avBGColor', label: 'Drinking Club background colour', type: 'str', minLength: 0, maxLength: 6, required: false, defaultValue: 'e9e9e9' }, { name: 'avMemberList', label: 'List of current Drinking Club members, separated by commas (and they need to be the CB username exactly)', type: 'str', minLength: 0, maxLength: 10240, required: false, defaultValue: 'renew, centuriongod' }, { name: 'wgText', label: 'Text to put in front of BravoTeam (assigned by broadcaster) messages', type: 'str', minLength: 0, maxLength: 20, required: false, defaultValue: ':Bravoteamgif' }, { name: 'wgTextColor', label: 'Bravo Team text colour', type: 'str', minLength: 0, maxLength: 6, required: false, defaultValue: '086c10' }, { name: 'wgBGColor', label: 'Bravo Team background colour', type: 'str', minLength: 0, maxLength: 6, required: false, defaultValue: 'eaeaea' }, { name: 'wgMemberList', label: 'List of Bravo Team Members, separated by commas (and they need to be the CB username exactly)', type: 'str', minLength: 0, maxLength: 10240, required: false, defaultValue: 'hy472, keaner, Warwick2013' }, ]; var ulMembers = {}; var avMembers = {}; var wgMembers = {}; var afMembers = {}; var ulText= ':420clubgif'; cb.onMessage(function (msg) { // vars for ease of use var u = msg['user']; 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']; } return msg; }); cb.onTip(function (tip) { var amountTipped = parseInt(tip['amount']); if (amountTipped == cb.settings.ulMinTip) { 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"); 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}; } } 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}; } } 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}; } } 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- 2024. All Rights Reserved.