Bots Home
|
Create an App
Color Clubed
Author:
receie23
Description
Source Code
Launch Bot
Current Users
Created by:
Receie23
// LiviHumanity bot // CB app settings cb.settings_choices = [ { name: 'doColoring', type: 'choice', label: 'Change text and background coloring?', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes' }, { name: 'doText', type: 'choice', label: 'Add labels in front of messages (choose label below)?', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes' }, { name: 'ulMinTip', label: 'Minimum tip to become a Grey', type: 'int', minValue: 0, defaultValue: 0 }, { name: 'ulAnnounce', label: 'Text to show when someone tips to become a Livi 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 Livi Lover!!!!!! <3<3' }, { name: 'ulRainText', label: 'Text to use for raining lines', type: 'str', minLength: 0, maxLength: 80, required: false, defaultValue: '<3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3' }, { name: 'ulRainCount', label: 'Number of lines of Love rain', type: 'int', minValue: 1, maxValue: 15, defaultValue: 1 }, { name: 'ulText', label: 'Text to put in front of Livi Lovers messages (e.g. Livi Lover), the text will be put inside square brackets [ ]', type: 'str', minLength: 0, maxLength: 15, required: false, defaultValue: 'Grey' }, { name: 'ulBGColor', label: 'Livi Lover background color - HTML colour code without starting \'#\' e.g. (000000 is black)', type: 'str', minLength: 0, maxLength: 6, required: false, defaultValue: 'CCCCFF' }, { name: 'ulMemberList', label: 'List of current Livi Lovers, separated by commas (and they need to be the CB username exactly)', type: 'str', minLength: 0, maxLength: 10240, required: false, defaultValue: '' }, { name: 'avText', label: 'Text to put in front of Goddess Livis messages (e.g. QU), the text will be put inside square brackets [ ]', type: 'str', minLength: 0, maxLength: 15, required: false, defaultValue: 'Goddess' }, { name: 'avBGColor', label: 'Goddess Livis background color - HTML colour code without starting \'#\' e.g. (000000 is black)', type: 'str', minLength: 0, maxLength: 6, required: false, defaultValue: '062A78' }, { name: 'avMemberList', label: 'Mod List', type: 'str', minLength: 0, maxLength: 10240, required: false, defaultValue: 'receie23' }, { name: 'wgText', label: 'Badge for FanClub members', type: 'str', minLength: 0, maxLength: 15, required: false, defaultValue: 'slicefanbadge' }, { name: 'wgBGColor', label: 'Fan Club background color - HTML colour code without starting \'#\' e.g. (000000 is black)', type: 'str', minLength: 0, maxLength: 6, required: false, defaultValue: '90EE90' }, { name: 'wgMemberList', label: 'List Fan Club members, separated by commas (and they need to be the CB username exactly)', type: 'str', minLength: 0, maxLength: 10240, required: false, defaultValue: 'phiyah03,cumnmymouth16,receie23,kingjackal' }, { name: 'afText', label: 'Badge for Broadcasters messages', type: 'str', minLength: 0, maxLength: 15, required: false, defaultValue: 'sliceshowbadge' }, { name: 'afBGColor', label: 'Broadcasters background color - HTML colour code without starting \'#\' e.g. (000000 is black)', type: 'str', minLength: 0, maxLength: 6, required: false, defaultValue: 'D4AF37' }, { name: 'afMemberList', label: 'Broadcasters Name (to be the CB username exactly)', type: 'str', minLength: 0, maxLength: 105, required: false, defaultValue: 'slicings' }, ]; var ulMembers = {}; var avMembers = {}; var wgMembers = {}; var afMembers = {}; 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['m'] = ":" + cb.settings.ulText + " " + msg['m']; } else if ( isAV(u) ) { msg['background'] = '#' + cb.settings.avBGColor; msg['m'] = ":" + cb.settings.avText + " " + msg['m']; } else if ( isWG(u) ) { msg['background'] = '#' + cb.settings.wgBGColor; msg['m'] = ":" + cb.settings.wgText + " " + msg['m']; } else if ( isAF(u) ) { msg['background'] = '#' + cb.settings.afBGColor; msg['m'] = ":" + cb.settings.afText + " " + msg['m']; } return msg; }); cb.onTip(function (tip) { var amountTipped = parseInt(tip['amount']); if (amountTipped == cb.settings.ulMinTip) { // Make Livi Lovers 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 Livi Lovers 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 Goddess Livi 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 Mermaid Prince 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 Fairy Kings 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 HT 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.