Bots Home
|
Create an App
hogwarts houses
Author:
hallowin90
Description
Source Code
Launch Bot
Current Users
Created by:
Hallowin90
cb.settings_choices = [ { name: 'ulMemberList', label: 'List of Gryffindor members, separated by commas (and they need to be the CB username exactly)', type: 'str', minLength: 0, maxLength: 10240, required: false, }, { name: 'avMemberList', label: 'List of current Slytherin members, separated by commas (and they need to be the CB username exactly)', type: 'str', minLength: 0, maxLength: 10240, required: false, }, { name: 'wgMemberList', label: 'List of Hufflepuff Members, separated by commas (and they need to be the CB username exactly)', type: 'str', minLength: 0, maxLength: 10240, required: false, }, { name: 'rcMemberList', label: 'List of Ravenclaw Members, separated by commas (and they need to be the CB username exactly)', type: 'str', minLength: 0, maxLength: 10240, required: false, }, { name: 'ulText', label: 'Text to put in front of Gryffindor Members', type: 'str', minLength: 0, maxLength: 20, required: false, defaultValue: ':rr-gryffindor' }, { name: 'avText', label: 'Text to put in front of Slytherin Members', type: 'str', minLength: 0, maxLength: 20, required: false, defaultValue: ':rr-slytherin' }, { name: 'wgText', label: 'Text to put in front of Hufflepuff Members', type: 'str', minLength: 0, maxLength: 20, required: false, defaultValue: ':rr-hufflepuff' }, { name: 'rcText', label: 'Text to put in front of Ravenclaw Members', type: 'str', minLength: 0, maxLength: 20, required: false, defaultValue: ':rr-ravenclaw' }, { name: 'ulTextColor', label: 'Gryffindor text color', type: 'str', minLength: 0, maxLength: 6, required: false, defaultValue: '7F0909' }, { name: 'avTextColor', label: 'Slytherin text color', type: 'str', minLength: 0, maxLength: 6, required: false, defaultValue: '0d6217' }, { name: 'wgTextColor', label: 'Hufflepuff text color', type: 'str', minLength: 0, maxLength: 6, required: false, defaultValue: '000000' }, { name: 'rcTextColor', label: 'Ravenclaw text color', type: 'str', minLength: 0, maxLength: 6, required: false, defaultValue: '000A90' }, { name: 'ulBGColor', label: 'Gryffindor background color', type: 'str', minLength: 0, maxLength: 6, required: false, defaultValue: 'FFC500' }, { name: 'avBGColor', label: 'Slytherin background color', type: 'str', minLength: 0, maxLength: 6, required: false, defaultValue: 'aaaaaa' }, { name: 'wgBGColor', label: 'Hufflepuff background color', type: 'str', minLength: 0, maxLength: 6, required: false, defaultValue: 'eee117' }, { name: 'rcBGColor', label: 'Ravenclaw background color', type: 'str', minLength: 0, maxLength: 6, required: false, defaultValue: '946B2D' }, ]; var doText ='yes'; var doColoring ='yes'; var ulMembers = {}; var avMembers = {}; var wgMembers = {}; var rcMembers = {}; var afMembers = {}; cb.onMessage(function (msg) { 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 ( isRC(u) ) { msg['background'] = '#' + cb.settings.rcBGColor; msg['c'] = '#' + cb.settings.rcTextColor; msg['m'] = " " + cb.settings.rcText + " " + 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; }); function isUL(username) { return (username in ulMembers); } function isAV(username) { return (username in avMembers); } function isWG(username) { return (username in wgMembers); } function isRC(username) { return (username in rcMembers); } 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 makeRC(username) { rcMembers[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.rcMemberList) { var rcMemberSettings = cb.settings.rcMemberList.split(','); for (var ii = 0; ii < rcMemberSettings.length; ii++) { var clean = rcMemberSettings[ii].toLowerCase().replace(/ /g,""); rcMembers[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.