Bots Home
|
Create an App
Lia Benett Team
Author:
micheluse13
Description
Source Code
Launch Bot
Current Users
Created by:
Micheluse13
// LiaBenett bot // CB app settings cb.settings_choices = [ { name: 'doColoring', type: 'choice', label: 'Change text and background coloring for Team Benett (choose colours below)?', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes' }, { name: 'doText', type: 'choice', label: 'Add text labels in front of Team Benett messages (choose text below)?', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes' }, { name: 'aaText', label: 'Text to put in front of Team Benett members messages (e.g. Team Benett), the text will be put inside square brackets [ ]', type: 'str', minLength: 0, maxLength: 15, required: false, defaultValue: 'Team Bennet' }, { name: 'aaIcon', label: 'Icon to put in front of Team Benett members messages', type: 'str', minLength: 0, maxLength: 15, required: false, defaultValue: 'smile' }, { name: 'aaMinTip', label: 'Minimum tip to become Team Benett member', type: 'int', minValue: 1, defaultValue: 999 }, { name: 'aaAnnounce', label: 'Text to show when someone tips to become a Team Benett 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 joined Team Benett <3 <3' }, { name: 'aaRainText', label: 'Text to use for Team Benett rain lines', type: 'str', minLength: 0, maxLength: 80, required: false, defaultValue: '<3 <3 999 <3 <3 TEAM BENETT <3 <3 999 <3 <3' }, { name: 'aaRainCount', label: 'Number of lines of Team Benett rain', type: 'int', minValue: 1, maxValue: 15, defaultValue: 10 }, { name: 'aaTextColor', label: ' Team Benett members text color - HTML colour code without starting \'#\' e.g. (FFFFFF is white)', type: 'str', minLength: 0, maxLength: 6, required: false, defaultValue: '000000' }, { name: 'aaBGColor', label: ' Team Benett members background color - HTML colour code without starting \'#\' e.g. (000000 is black)', type: 'str', minLength: 0, maxLength: 6, required: false, defaultValue: 'CCCCFF' }, { name: 'aaMemberList', label: 'List of current Team Benett members, separated by commas (and they need to be the CB username exactly)', type: 'str', minLength: 0, maxLength: 10240, required: false, defaultValue: '' }, { name: 'adMemberList', label: 'List of current Invited users, separated by commas (and they need to be the CB username exactly)', type: 'str', minLength: 0, maxLength: 10240, required: false, defaultValue: '' }, { name: 'anText', label: 'Text to put in front of Lia Benett Fans messages (e.g. GU), the text will be put inside square brackets []', type: 'str', minLength: 0, maxLength: 15, required: false, defaultValue: 'Unicorn' }, { name: 'anIcon', label: 'Icon to put in front of Lia Benett Fans messages', type: 'str', minLength: 0, maxLength: 15, required: false, defaultValue: 'smile' }, { name: 'anTextColor', label: 'Lia Benett Fans text color - HTML colour code without starting \'#\' e.g. (FFFFFF is white)', type: 'str', minLength: 0, maxLength: 6, required: false, defaultValue: '000000' }, { name: 'anBGColor', label: 'Lia Benett Fans background color - HTML colour code without starting \'#\' e.g. (000000 is black)', type: 'str', minLength: 0, maxLength: 6, required: false, defaultValue: 'ffcccc' }, { name: 'anMemberList', label: 'List of current Lia Benett Fans, separated by commas (and they need to be the CB username exactly)', type: 'str', minLength: 0, maxLength: 10240, required: false, defaultValue: '' }, { name: 'roomAD', label: 'Room Advertisement here', type: 'str', minLength: 1, maxLength: 2000, required: false, defaultValue: '' }, { name: 'roomADMin', label: 'Number of Minutes for Room Ad', type: 'int', minValue: 1, maxValue: 40, defaultValue: 10 }, { name: 'roomADS', label: 'Second Room Advertisement here', type: 'str', minLength: 1, maxLength: 2000, required: false, defaultValue: '' }, { name: 'roomADSMin', label: 'Number of Minutes for Second Room Ad', type: 'int', minValue: 1, maxValue: 40, defaultValue: 10 }, ]; var aaMembers = {}; var abMembers = {}; var acMembers = {}; var adMembers = {}; var aeMembers = {}; var afMembers = {}; var agMembers = {}; var ahMembers = {}; var aiMembers = {}; var ajMembers = {}; var akMembers = {}; var alMembers = {}; var amMembers = {}; var anMembers = {}; // var CONFIG_AD_MINUTES = 8; // var CONFIG_ADS_MINUTES = 5; // 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']; if ( isAN(u) ) { msg['background'] = '#' + cb.settings.anBGColor; msg['c'] = '#' + cb.settings.anTextColor; msg['m'] = ':' + cb.settings.anIcon + " " + msg['m']; } else if ( isAM(u) ) { msg['background'] = '#' + cb.settings.amBGColor; msg['c'] = '#' + cb.settings.amTextColor; msg['m'] = ':' + cb.settings.amIcon + " " + msg['m']; } else if ( isAL(u) ) { msg['background'] = '#' + cb.settings.alBGColor; msg['c'] = '#' + cb.settings.alTextColor; msg['m'] = ':' + cb.settings.alIcon + " " + msg['m']; } else if ( isAK(u) ) { msg['background'] = '#' + cb.settings.akBGColor; msg['c'] = '#' + cb.settings.akTextColor; msg['m'] = ':' + cb.settings.akIcon + " " + msg['m']; } else if ( isAJ(u) ) { msg['background'] = '#' + cb.settings.ajBGColor; msg['c'] = '#' + cb.settings.ajTextColor; msg['m'] = ':' + cb.settings.ajIcon + " " + msg['m']; } else if ( isAI(u) ) { msg['background'] = '#' + cb.settings.aiBGColor; msg['c'] = '#' + cb.settings.aiTextColor; msg['m'] = ':' + cb.settings.aiIcon + " " + msg['m']; } else if ( isAH(u) ) { msg['background'] = '#' + cb.settings.ahBGColor; msg['c'] = '#' + cb.settings.ahTextColor; msg['m'] = ':' + cb.settings.ahIcon + " " + msg['m']; } else if ( isAG(u) ) { msg['background'] = '#' + cb.settings.agBGColor; msg['c'] = '#' + cb.settings.agTextColor; msg['m'] = ':' + cb.settings.agIcon + " " + msg['m']; } else if ( isAF(u) ) { msg['background'] = '#' + cb.settings.afBGColor; msg['c'] = '#' + cb.settings.afTextColor; msg['m'] = ':' + cb.settings.afIcon + " " + msg['m']; } else if ( isAE(u) ) { msg['background'] = '#' + cb.settings.aeBGColor; msg['c'] = '#' + cb.settings.aeTextColor; msg['m'] = ':' + cb.settings.aeIcon + " " + msg['m']; } else if ( isAD(u) ) { msg['background'] = '#' + cb.settings.adBGColor; msg['c'] = '#' + cb.settings.adTextColor; msg['m'] = ':' + cb.settings.adIcon + " " + msg['m']; } else if ( isAC(u) ) { msg['background'] = '#' + cb.settings.acBGColor; msg['c'] = '#' + cb.settings.acTextColor; msg['m'] = ':' + cb.settings.acIcon + " " + msg['m']; } else if ( isAB(u) ) { msg['background'] = '#' + cb.settings.abBGColor; msg['c'] = '#' + cb.settings.abTextColor; msg['m'] = ':' + cb.settings.abIcon + " " + msg['m']; } else if ( isAA(u) ) { msg['background'] = '#' + cb.settings.aaBGColor; msg['c'] = '#' + cb.settings.aaTextColor; msg['m'] = ':' + cb.settings.aaIcon + " " + 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.aaMinTip) { // Make Team Benett and announce it var announcement = cb.settings.aaAnnounce.replace("MEMBERNAME", tip['from_user']); makeAA(tip['from_user']); for (var i = 0; i < cb.settings.aaRainCount; i++) { cb.sendNotice(cb.settings.aaRainText); } cb.sendNotice(announcement); } }); function ad() { cb.sendNotice(cb.settings.roomAD); cb.setTimeout(follow, (cb.settings.roomADMin * 60000)); } function ads() { cb.sendNotice(cb.settings.roomADS); cb.setTimeout(twitter, (cb.settings.roomADSMin * 60000)); } function init() { cb.sendNotice(cb.settings.roomAD); cb.setTimeout(ad, (cb.settings.roomADMin * 60000)); cb.sendNotice(cb.settings.roomADS); cb.setTimeout(ads, (cb.settings.roomADSMin * 60000)); } init(); function isAA(username) { return (username in aaMembers); } function isAB(username) { return (username in abMembers); } function isAC(username) { return (username in acMembers); } function isAD(username) { return (username in adMembers); } function isAE(username) { return (username in aeMembers); } function isAF(username) { return (username in afMembers); } function isAG(username) { return (username in agMembers); } function isAH(username) { return (username in ahMembers); } function isAI(username) { return (username in aiMembers); } function isAJ(username) { return (username in ajMembers); } function isAK(username) { return (username in akMembers); } function isAL(username) { return (username in alMembers); } function isAM(username) { return (username in amMembers); } function isAN(username) { return (username in anMembers); } function makeAA(username) { aaMembers[username] = {'u': 1}; } function makeAB(username) { abMembers[username] = {'u': 1}; } function makeAC(username) { acMembers[username] = {'u': 1}; } function makeAD(username) { adMembers[username] = {'u': 1}; } function makeAE(username) { aeMembers[username] = {'u': 1}; } function makeAF(username) { afMembers[username] = {'u': 1}; } function makeAG(username) { agMembers[username] = {'u': 1}; } function makeAH(username) { ahMembers[username] = {'u': 1}; } function makeAI(username) { aiMembers[username] = {'u': 1}; } function makeAJ(username) { ajMembers[username] = {'u': 1}; } function makeAK(username) { akMembers[username] = {'u': 1}; } function makeAL(username) { alMembers[username] = {'u': 1}; } function makeAM(username) { amMembers[username] = {'u': 1}; } function makeAN(username) { anMembers[username] = {'u': 1}; } function grabSettings() { cb.log("starting grabbing settings"); // Get Team Benett members if (cb.settings.aaMemberList) { var aaMemberSettings = cb.settings.aaMemberList.split(','); for (var ii = 0; ii < aaMemberSettings.length; ii++) { var clean = aaMemberSettings[ii].toLowerCase().replace(/ /g,""); aaMembers[clean] = {'u': 1}; } } cb.log("finished grabbing settings"); } grabSettings();
© Copyright Chaturbate 2011- 2024. All Rights Reserved.