Bots Home
|
Create an App
Dorothy's Fembot
Author:
dorothy
Description
Source Code
Launch Bot
Current Users
Created by:
Dorothy
/** Name: Dorothy's Easy Fembot Author: chelsea2950 Current version 2.0 Created 11/29/2018 Last Updated 01/22/2019 (see description for change log) This ultrabot is intended to be used for simple setups, usually for new cammers with minimal configuration required. I've borrowed some existing features from many places/bots including 18yearold, allinone and ultrabot for most, so credit to those who have gone before for all your hard work (britney and justin, alice and shaggy, lund, acrazyguy, and I'm sure many others). However, this bot is also intended to be transparent and not give back door access to anyone, including the developer, so my source will always be visible. Main features from the Easy Fembot are: Messaging for mods and broadcasters Private Messages to other users Silence Level and Graphic Level Leaderboard Nice List Tip Count next to name Silence individual users Silence individual users without notification (ninja) Gray Chat Time Lock Blocked word list Up to 5 Rotating Notifiers **/ // prototype functions { String.prototype.capitalize = function() { return this.charAt(0).toUpperCase() + this.slice(1); } String.prototype.repeat = function (number) { return new Array(number + 1).join(this); } String.prototype.equals = function (str) { var m = new RegExp(str); return this.match(m) != null; } String.prototype.equalsIgnoreCase = function (str) { var m = new RegExp(str, "i"); return this.match(m) != null; } } {cb.settings_choices = [ {name: 'dummy0', label: "******************* Introduction ******************** Latest Updt: 01/22/2019 (version 2.0) See Change Log **************************************************** Welcome to Dorothy's Ultra Fembot, if this is your first time using the bot, you can accept all of the defaults and it will just turn on the minimum set of features such as messaging and tip tracking/leaderboard. Other features such as tip menu, token poll, notifiers, and more can be set up in future shows or turned on during the show by you or your moderator. Moderators are given significant privileges by this bot, so please make sure you assign moderators you can trust. I've also setup a default tip menu, token poll, positions menu, and lush menu using prices that I find to be common, but please update these per your preference, the defaults are only suggestions! Also, you can see the full list of commands for the bot by typing '/fbhelp' in the chat (no quotes), and then also see more detailed help by section. Please enjoy using the ultrabot and feel free to say hello if you see me around, or DM me on twitter @thechelsea2950 if you have questions. Thank you! - chelsea", type: 'choice',required: false}, // *** Messages and Notifications {name: 'dummy1', label: '************ Notifications and Messages *************', type: 'choice',required: false}, {name: 'enableEntryMessage', label: 'Display notification to users when they enter?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'No'}, {name: 'entryMessage', label: 'Enter the message to display', type: 'str',required: false, minLength: 1, maxLength: 1000, defaultValue: 'Welcome to my room! Please have a great time and treat your fellow chatters with kindness. Rude comments and demands will not be tolerated.'}, {name: 'enableNotifier', label: 'Would you like to periodically send a message to the room? Up to 5 messages can be displayed in rotation according to the interval specified below', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'No'}, {name: 'notifierMessage1', label: 'Enter the first notification message you would like to display.',required: false, type: 'str', minLength: 1, maxLength: 1000, defaultValue: '[Update as needed] Welcome everyone to the show! Today we are doing goals with a tip menu, and the dice game is on as well!'}, {name: 'notifierMessage2', label: 'Notification Message #2', required: false,type: 'str', minLength: 1, maxLength: 1000}, {name: 'notifierMessage3', label: 'Notification Message #3', required: false,type: 'str', minLength: 1, maxLength: 1000}, {name: 'notifierMessage4', label: 'Notification Message #4', required: false,type: 'str', minLength: 1, maxLength: 1000}, {name: 'notifierMessage5', label: 'Notification Message #5', required: false,type: 'str', minLength: 1, maxLength: 1000}, {name: 'notifierInterval', label: 'Notification display interval (minutes)', type: 'int', minValue: 1, maxValue: 60, defaultValue: 5}, {name: 'notifiersTextColor', label: 'Text color used for Notification Messages 1-5 and Chat Notices /cn, /cnh, /cnd, /cndh)', type: 'choice', choice1: "White/No Color",choice2: "Black",choice3: "Dark Grey",choice4: "Dark Red",choice5: "Dark Orange",choice6: "Dark Green",choice7: "Dark Aqua",choice8: "Dark Blue",choice9: "Dark Purple",choice10: "Dark Pink",defaultValue: "Dark Aqua"}, {name: 'notifiersBgColor', label: 'Background highlight color used for Notification Messages 1-5 and Chat Notices (/cn, /cnh, /cnd, /cndh)', type: 'choice', choice1: "White/No Color",choice2: "Light Yellow",choice3: "Light Blue",choice4: "Light Pink",choice5: "Light Red",choice6: "Light Green",choice7: "Light Purple",choice8: "Light Orange",choice9: "Light Grey",choice10: "Light Aqua",defaultValue: "Light Aqua"}, {name: 'defaultTimerDescription', label: 'Optional: Enter the description you would like to use for the general timer (/startclock function). The value will be displayed in the countdown text, and can be changed during the show with the command "/chgtimerdesc". Max length of 30 characters',required: false, type: 'str', minLength: 1, maxLength: 30}, // *** Tip Count and Leaderboard {name: 'dummy2', label: '*********** Tip Count and Leaderboard ***************', type: 'choice',required: false}, {name: 'enableSubjectChange', label: 'Allow moderators to change Room Subject. Note that if an app or bot is running that updates the room title, it will always override on next update', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes'}, {name: 'enableTipCount', label: 'Display user tip count as prefix in messages?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes'}, {name: 'enableTipLeaderIcons', label: 'Display icon for the top 3 tippers as prefix in messages? If yes, enter a value for positions 1-3 below.', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'No'}, {name: 'tipLeaderGif1', type: 'str',defaultValue: ':crowngold',required: false,label: 'Choose the icon to be displayed for the top tipper of the current session (optional). It can be a gif or a string of text/special characters (&!&). If using a gif, make sure to start it with the colon (:) as it would be typed in the chat'}, {name: 'tipLeaderGif2', type: 'str',defaultValue: ':mtlhfu2',required: false,label: 'Choose the icon to be displayed for the second highest tipper of the current session (optional).'}, {name: 'tipLeaderGif3', type: 'str',defaultValue: ':mtlhfu3 ',required: false,label: 'Choose the icon to be displayed for the third highest tipper of the current session (optional).'}, {name: 'enableLeaderboard', label: 'Display the leaderboard in the chat (top 5 tippers in current session)?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes'}, {name: 'leaderInterval', label: 'Leaderboard display interval (minutes)', type: 'int',required: false, minValue: 1, maxValue: 60, defaultValue: 5}, {name: 'leaderTextColor', label: 'Text color used for Leaderboard', type: 'choice', choice1: "White/No Color",choice2: "Black",choice3: "Dark Grey",choice4: "Dark Red",choice5: "Dark Orange",choice6: "Dark Green",choice7: "Dark Aqua",choice8: "Dark Blue",choice9: "Dark Purple",choice10: "Dark Pink",defaultValue: "Dark Blue"}, {name: 'leaderBgColor', label: 'Background color used for Leaderboard', type: 'choice', choice1: "White/No Color",choice2: "Light Yellow",choice3: "Light Blue",choice4: "Light Pink",choice5: "Light Red",choice6: "Light Green",choice7: "Light Purple",choice8: "Light Orange",choice9: "Light Grey",choice10: "Light Aqua",defaultValue: "Light Blue"}, // *** Chat Controls {name: 'dummy3', label: '*************** Chat Controls ***********************', type: 'choice',required: false}, {name: 'dummychat', label: 'For the below lists, User IDs should be separated by commas and without spaces (user1,user2,user3). The values will be saved each time you start, but please also store your lists in an external document in case the saved settings for this bot get erased or reset. Also note that users can be added in show for each, but those are not permanently saved and should be copied to this settings page to be saved for the next show.', type: 'choice',required: false}, {name: 'silenceList', label: 'Enter the names of any users you have had to repeatedly silence in the past and would like to ensure cannot chat in your room.', type: 'str', minLength: 1, maxLength: 1000, defaultValue: '', required: false}, {name: 'ninjaList', label: 'Enter the names of any users you would like to ensure cannot chat in your room, but do not want them to be notified of being silenced. This for those users who may tip sometimes, but you really do not want to listen to their comments unles it is in a tip note.', type: 'str', minLength: 1, maxLength: 1000, defaultValue: '', required: false}, {name: 'niceList', label: 'Enter the names of any users you would like to grant voice and graphic usage privileges regardless of the silence and graphic levels (permanent nice list). These are typically gray users that do not make rude comments and demands.', type: 'str', minLength: 1, maxLength: 1000, defaultValue: '', required: false}, {name: 'enablePMs', label: 'Allow users to PM in chat', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes'}, {name: 'lockGrayChat', label: 'Prevent gray chat for the first X minutes that they are in the room? If yes, set the time threshold with the next setting. This setting will usually prevent bots from posting to the chat as they do it immediately upon entering', required: false,type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'No'}, {name: 'grayChatTime',type: 'int',minValue: 1,maxValue: 20,defaultValue: 5,required: false,label: 'If gray chat is locked upon entering, set the time threshold (in minutes) for when they can begin chatting.'}, // *** Blocked Word List {name: 'dummy7', label: '*************** Blocked Word List *******************', type: 'choice',required: false}, {name: 'enableWordList', label: 'Enable Blocked Word List.', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes'}, {name: 'wordBlockList', label: 'Enter the words you would like to block in the chat. Words should be separated by a comma with no spaces.', type: 'str', minLength: 1, maxLength: 1000, defaultValue: 'cunt,bitch,slut,c2c,cumslut,chatur.,[http://sexmap.', required: false} ]; } { // *********************************** Variables and Arrays ************************************** var initialize = 0; /* Used to run initialization once */ var numberOfModerators = 1; /* Count of entries in moderator array */ var silenceLevel = 0; /* Default to everyone can chat */ var graphicLevel = 1; /* Default to grays cannot post graphics */ var numPMs = 0; var timerStart = 0; /* captured time when the timer was started, used to calculate time left */ var clockStartTime = 0; var clockStopTime = 0; var timerDuration = 0; var clockTimeAdded = 0; var clockMinsRemain = 0; var clockSecsRemain = 0; var clockSkipMin = false; var clockSkipSec = false; var notifierToggle = 0; var leaderboardToggle = 0; var tipCountToggle = 0; var tipLeaderIconsToggle = 0; var grayLockToggle = 0; var numberOfTippers = 0; var firstlb = 0; var leaderTimer = 0; var num = 0; var grayChatTime = cb.settings.grayChatTime; var timerDesc = cb.settings.defaultTimerDescription var notifierMessage1 = cb.settings.notifierMessage1; var notifierMessage2 = cb.settings.notifierMessage2; var notifierMessage3 = cb.settings.notifierMessage3; var notifierMessage4 = cb.settings.notifierMessage4; var notifierMessage5 = cb.settings.notifierMessage5; var BC = cb.room_slug; var leaderInt = parseInt(cb.settings.leaderInterval) * 60000; var green = "#a2dfac"; // Used for general messaging from fembot var purple = "#e2a2ea"; var yellow = "#f4d599"; // Used for clock countdown var red = "#f4c1bc"; // Used for last 2 minutes of clock countdown var blue = "#0099ff"; var HLgreen = "#91c970"; // Green notice highlighting var HLpurple = "#e2a2ea"; // Purple notice highlighting var HLyellow = "#fcff9b"; // Yellow notice highlighting var HLred = "#ff6d69"; // Red notice highlighting var HLblue = "#81bcff"; // Blue notice highlighting var ticketHolderBgColor = '#e8fbe8' // Light green highlighting for ticket show buyers var ticketStatsBgColor = '#e0e0e0' // Light gray for ticket show stats background var dashLine = new Array(61).join("-"); // Arrays */ var niceListArray = []; var silenceListArray = []; var ninjaListArray = []; var wordListArray = []; var MessageArray = []; var pmArray = []; var grayLockList = []; var moderatorList = {name: [], type: []}; var tipCountArray = {name: [], amount: []}; var grayLockStatus = {canChat: [], entered: []}; var priceCheckArray = {amount: [], name: []}; } { // *********************************** Functions ************************************** { // Generic functions to set the color or separator characters function checkTextColor(color) { switch (color) { case "White/No color": return "#FFFFFF"; case "Black": return "#000000"; case "Dark Blue": return "#0629AC"; case "Dark Pink": return "#FF6680"; case "Dark Green": return "#006600"; case "Dark Red": return "#cc0000"; case "Dark Purple": return "#3d003d"; case "Dark Grey": return "#737373"; case "Dark Orange": return "#e77400"; case "Dark Aqua": return "#006767"; default: if (/^#[0-9A-F]{6}$/i.test(color)) { return color; } else if (/^[0-9A-F]{6}$/i.test(color)) { return ('#' + color); } else { return ("default"); } } } function checkBgColor(color) { switch (color) { case "White/No color": return "#FFFFFF"; case "Light Aqua": return "#adeaea"; case "Light Pink": return "#FFE6EA"; case "Light Green": return "#94e594"; case "Light Red": return "#ff9a9a"; case "Light Purple": return "#f2cdff"; case "Light Orange": return "#ffd9b3"; case "Light Grey": return "#e6e6e6"; case "Light Blue": return "#d1eaee"; case "Light Yellow": return "#ffff94" case "Cream": return "#f9f6ed" default: if (/^#[0-9A-F]{6}$/i.test(color)) { return color; } else if (/^[0-9A-F]{6}$/i.test(color)) { return ('#' + color); } else { return ("default"); } } } //********** Price Check Function ************** function priceChecker(mode, name, price, sendto) { if (price != 0 && price !=null) { if (mode === 'add') { if (cbjs.arrayContains(priceCheckArray.name,name)) { nameIndex = priceCheckArray.name.indexOf(name); priceCheckArray.name.splice(nameIndex,1); priceCheckArray.amount.splice(nameIndex,1); } if (cbjs.arrayContains(priceCheckArray.amount,price)) { priceIndex = priceCheckArray.amount.indexOf(price); cb.sendNotice('Warning! There is a duplicate price entry. When adding ' + name + ', the configured price of ' + price + ' was found already in use for ' + priceCheckArray.name[priceIndex] + '.',sendto,yellow); } if (price == 1 || price == 5 || price == 10 || price == 15 || price == 20 || price == 25 || price == 50 || price == 100) { cb.sendNotice('Warning! When adding ' + name + ', the configured price of ' + price + ' is a common tip amount (1,5,10,15,20,25,50,100) and not recommended for any specific feature price. It is recommended to use uncommon tip amounts for all prices.',sendto,yellow); } priceCheckArray.name.push(name); priceCheckArray.amount.push(price); } else if (mode === 'rmv') { if (cbjs.arrayContains(priceCheckArray.name,name)) { nameIndex = priceCheckArray.name.indexOf(name); priceCheckArray.name.splice(nameIndex,1); priceCheckArray.amount.splice(nameIndex,1); } } } } //********** Tip Count Functions ************** function populateTipCountArray(user,tip) { tipCountArray.name.push(user); tipCountArray.amount.push(tip); } function findTipper(user) { for (var i = 0; i < tipCountArray.name.length; i++) { if(tipCountArray.name[i] == user) { break; } } return i; } //********** Room Subject Function ************** function setRoomSubject(newSubject, user) { cb.changeRoomSubject(newSubject); cb.sendNotice(user + ' has updated the room title to "' + newSubject + '".', "", "", "bold"); } //********** Leaderboard Functions ************** function setLeaderToggle(option, mod) { if(option == 'on') { if(leaderboardToggle == 1) { cb.sendNotice('The Leaderboard display is already turned on.',mod,green); } else { leaderboardToggle = 1; sendLeaderboard(); cb.sendNotice('You have enabled the Leaderboard display.',mod,green); } } else if(option == 'off') { if(leaderboardToggle == 0) { cb.sendNotice('The Leaderboard display is already turned off.',mod,green); } else { leaderboardToggle = 0; cb.sendNotice('You have disabled the Leaderboard display. Tip leaders are stil tracked but the board is not displayed.',mod,green); } } else if(option != null) { cb.sendNotice(option + ' is not a valid option for /useleaderboard.\nType /fbhelp useleaderboard to see how to use /useleaderboard.',mod,green); } else if(option == null) { cb.sendNotice('You did not enter a valid option for /useleaderboard.\nType /fbhelp useleaderboard to see how to use /useleaderboard.',mod,green); } } function sendLeaderboard() { if(firstlb == 0) { leaderTimer = leaderInt - 30000; firstlb = 1 } else { leaderTimer = leaderInt; } cb.setTimeout(leaderboardTimer, leaderTimer); } function leaderboardTimer() { if(leaderboardToggle == 1) { sortTippers(); setLeaderBoardColors(); var outString = ""; for (var i = 1; i <= 5; i++) { if (tipCountArray.name[i - 1] == null) outString += " " + i + ". empty" + "\n"; else outString += " " + i + ". " + '"' + tipCountArray.name[i - 1] + '"' + ": " + tipCountArray.amount[i - 1] + "\n"; } cb.sendNotice("\u2606 \u2606 \u2606 \u2606 \u2606 \u2606 \u2606 \u2606 \u2606 LEADERBOARD \u2606 \u2606 \u2606 \u2606 \u2606 \u2606 \u2606 \u2606 \u2606\n" + outString + "\u2606 \u2606 \u2606 \u2606 \u2606 \u2606 \u2606 \u2606 \u2606 \u2606 \u2606 \u2606 \u2606 \u2606 \u2606 \u2606 \u2606 \u2606 \u2606 \u2606 \u2606 \u2606 \u2606 \u2606 \u2606", "", leaderBgColor, leaderTextColor, "bold"); sendLeaderboard(); } } function showLeaderBoard(from, group) { if(leaderboardToggle == 1) { sortTippers(); setLeaderBoardColors(); var outString = ""; for (var i = 1; i <= 5; i++) { if (tipCountArray.name[i - 1] == null) outString += " " + i + ". empty" + "\n"; else outString += " " + i + ". " + '"' + tipCountArray.name[i - 1] + '"' + ": " + tipCountArray.amount[i - 1] + "\n"; } cb.sendNotice("\u2606 \u2606 \u2606 \u2606 \u2606 \u2606 \u2606 \u2606 \u2606 LEADERBOARD \u2606 \u2606 \u2606 \u2606 \u2606 \u2606 \u2606 \u2606 \u2606\n" + outString + "\u2606 \u2606 \u2606 \u2606 \u2606 \u2606 \u2606 \u2606 \u2606 \u2606 \u2606 \u2606 \u2606 \u2606 \u2606 \u2606 \u2606 \u2606 \u2606 \u2606 \u2606 \u2606 \u2606 \u2606 \u2606", from, leaderBgColor, leaderTextColor, "bold", group); } else { cb.sendNotice('The broadcaster has decided not to use the Leaderboard feature.',from,green); } } function setLeaderBoardColors() { if (cb.settings.leaderTextColor == "Custom") { leaderTextColor = checkTextColor(cb.settings.leaderTextCustomColor); if (noticeTextColor == "default") { cb.sendNotice("Leaderboard - Error while setting the text color. It has to be in a HEX format. Using default value.", cb.room_slug, "#FFFFFF", "#FF0000", "bold"); leaderTextColor = '#FFFFFF'; } } else { leaderTextColor = checkTextColor(cb.settings.leaderTextColor); } if (cb.settings.leaderBgColor == "Custom") { leaderBgColor = checkBgColor(cb.settings.leaderBgCustomColor); if (leaderBgColor == "default") { cb.sendNotice("Leaderboard - Error while setting the background color. It has to be in a HEX format. Using default value.", cb.room_slug, "#FFFFFF", "#FF0000", "bold"); leaderBgColor = '#FFFFFF'; } } else { leaderBgColor = checkBgColor(cb.settings.leaderBgColor); } } function sortTippers() { var swapped, temp1, temp2; do { swapped = false; for (var i = 0; i < tipCountArray.amount.length ; i++) { if (tipCountArray.amount[i] < tipCountArray.amount[i + 1]) { temp1 = tipCountArray.amount[i]; temp2 = tipCountArray.name[i]; tipCountArray.amount[i] = tipCountArray.amount[i + 1]; tipCountArray.amount[i + 1] = temp1; tipCountArray.name[i] = tipCountArray.name[i + 1]; tipCountArray.name[i + 1] = temp2; swapped = true; } } } while (swapped); } function showTippers(from,group,num) { sortTippers(); var outString = ""; for (var i = 1; i <= num; i++) { if (tipCountArray.name[i - 1] == null) outString += "\u25ba " + i + ". --" + "\n"; else outString += "\u25ba " + i + ". " + '"' + tipCountArray.name[i - 1] + '"' + ": " + tipCountArray.amount[i - 1] + "\n"; } cb.sendNotice(dashLine + "\n\u25ba \u25ba \u25ba ALL TIPPERS \u25c4 \u25c4 \u25c4\n" + outString + dashLine, from, "", '#111111', "bold",group); } function populateModeratorArray(user,type) { if (!cbjs.arrayContains(moderatorList,user,type)) { moderatorList.name.push(user); moderatorList.type.push(type); } else { return; } } function populateFanClubArray(user) { if (!cbjs.arrayContains(fanClubList,user)) { fanClubList.push(user); } else { return; } } //********** Chat Control Functions ************** function setSilenceLevel(s, mod) { if(parseInt(s) >= 0 && parseInt(s) <= 3) { silenceLevel = parseInt(s); cb.sendNotice('The silence level has been set to ' + s + '.', cb.room_slug, green); cb.sendNotice('The silence level has been set to ' + s + '.', "", green, "", "", "red"); switch(parseInt(s)) { case 0: cb.sendNotice('All members can talk in chat.', cb.room_slug, green); cb.sendNotice('All members can talk in chat.', "", green, "", "", "red"); break; case 1: cb.sendNotice('Only members with tokens can talk in chat.', cb.room_slug, green); cb.sendNotice('Only members with tokens can talk in chat.', "", green, "", "", "red"); break; case 2: cb.sendNotice('Only members who have tipped can talk in chat.', cb.room_slug, green); cb.sendNotice('Only members who have tipped can talk in chat.', "", green, "", "", "red"); break; case 3: cb.sendNotice('Only members who have tipped at least 10 tokens can talk in chat.', cb.room_slug, green); cb.sendNotice('Only members who have tipped at least 10 tokens can talk in chat.', "", green, "", "", "red"); break; } } else { cb.sendNotice(s + ' is not a valid setting.\nType "/fbhelp silencelevel" to see how to use /silencelevel.',mod,green); } } function setGraphicLevel(s, mod) { if(parseInt(s) >= 0 && parseInt(s) <= 3) { graphicLevel = parseInt(s); cb.sendNotice('The graphic level has been set to ' + s + '.', cb.room_slug, green); cb.sendNotice('The graphic level has been set to ' + s + '.', "", green, "", "", "red"); switch(parseInt(s)) { case 0: cb.sendNotice('All members can use graphics in chat.',BC,green); cb.sendNotice('All members can use graphics in chat.', "", green, "", "", "red"); break; case 1: cb.sendNotice('Only members with tokens can use graphics in chat.', BC, green); cb.sendNotice('Only members with tokens can use graphics in chat.', "", green, "", "", "red"); break; case 2: cb.sendNotice('Only members who have tipped can use graphics in chat.', BC, green); cb.sendNotice('Only members who have tipped can use graphics in chat.', "", green, "", "", "red"); break; case 3: cb.sendNotice('Only members who have tipped at least 10 tokens can use graphics in chat.', BC, green); cb.sendNotice('Only members who have tipped at least 10 tokens can use graphics in chat.', "", green, "", "", "red"); break; } } else { cb.sendNotice(s + ' is not a valid setting.\nType "/fbhelp graphiclevel" to see how to use /graphiclevel.', mod, green); } } //********** List Maintenance Functions ************** function addRmvNinja(user, mod, mode) { if (mode == 'a') { if(cbjs.arrayContains(ninjaListArray,user)) { cb.sendNotice(user + ' has already been added to the ninja list.', mod, green); } else if(cbjs.arrayContains(moderatorList,user)) { cb.sendNotice(user + ' is a moderator and cannot be ninja\'d..', mod, green); } else if(user == cb.room_slug) { cb.sendNotice(user + ' is the broadcaster and cannot be ninja\'d..', mod, green); } else { ninjaListArray.push(user); cb.sendNotice('You have added ' + user + ' to the ninja list.', mod, green); } } else if (mode == 'r') { if(cbjs.arrayContains(ninjaListArray,user)) { cbjs.arrayRemove(ninjaListArray,user); cb.sendNotice('You have removed ' + user + ' from the ninja list.', mod, green); } else { cb.sendNotice(user + ' is not on the ninja list.', mod, green); } } } function addRmvSilence(user, mod, mode) { if (mode == 'a') { if(cbjs.arrayContains(silenceListArray,user)) { cb.sendNotice(user + ' has already been silenced.', mod, green); } else if(cbjs.arrayContains(moderatorList,user)) { cb.sendNotice(user + ' is a moderator and cannot be silenced.', mod, green); } else if(user == cb.room_slug) { cb.sendNotice(user + ' is the broadcaster and cannot be silenced.', mod, green); } else { silenceListArray.push(user); cb.sendNotice('You have added ' + user + ' to the silence list. Note this is only applied during this session, permanent silence list changes must be made to list defined when starting the ultrabot. This list should also be saved to a separate document.', mod, green); cb.sendNotice('You have been silenced due to rudeness, demands or otherwise inappropriate behavior. In the future, you can avoid this by being nice and not making demands.', user, green); } } else if (mode == 'r') { if(cbjs.arrayContains(silenceListArray,user)) { cbjs.arrayRemove(silenceListArray,user); cb.sendNotice('You have removed ' + user + ' from the silence list. Note this is only applied during this session, permanent silence list changes must be made to the list defined when starting the ultrabot. This list should also be saved to a separate document.', mod, green); cb.sendNotice('You have been unsilenced by ' + mod + '. Please be nice and don\'t make demands.', user, green); } else { cb.sendNotice(user + ' is not currently silenced.', mod, green); } } } function addRmvWord(word, mod, mode) { if (mode == 'a') { if(cbjs.arrayContains(wordListArray,word)) { cb.sendNotice(word + ' has already been added to the Blocked Word list.', mod, green); } else { wordListArray.push(word); cb.sendNotice('You have added "' + word + '" to the Blocked Word list. Note this is only applied during this session, permanent word list changes must be made to the list defined when starting the ultrabot. This list should also be saved to a separate document.', mod, green); } } else if (mode == 'r') { if(cbjs.arrayContains(wordListArray,word)) { cbjs.arrayRemove(wordListArray,word); cb.sendNotice('You have removed "' + word + '" from the Blocked Word list. Note this is only applied during this session, permanent word list changes must be made to the list defined when starting the ultrabot. This list should also be saved to a separate document.', mod, green); } else { cb.sendNotice(word + ' is not on the Blocked Word list.', mod, green); } } } function addRmvNice(user, mod, mode) { if(mode == 'a') { if(!cbjs.arrayContains(niceListArray,user)) { niceListArray.push(user); cb.sendNotice('You have added ' + user + ' to the nice list. Note this is only applied during this session, permanent nice list changes must be made to the list defined when starting the ultrabot. This list should also be saved to a separate document.', mod, green); cb.sendNotice(mod + ' has added you to the nice list. You will be able to chat and use graphcs regardless of the global room settings. Thank you for being nice!',user,green); } else { cb.sendNotice(user + ' is already on the nice list.', mod, green); } } else if(mode == 'r') { if(cbjs.arrayContains(niceListArray,user)) { cbjs.arrayRemove(niceListArray,user); cb.sendNotice('You have removed ' + user + ' from the nice list. Note this is only applied during this session, permanent nice list changes must be made to the list defined when starting the ultrabot. This list should also be saved to a separate document.', mod, green); cb.sendNotice(mod + ' has removed you from the nice list.', user, green); } else { cb.sendNotice(user + ' is not on the nice list.', mod, green); } } } function populateNiceListArray(user) { if (!cbjs.arrayContains(niceListArray, user)) niceListArray.push(user); else return; } function populateWordListArray(word) { if (!cbjs.arrayContains(wordListArray, word)) wordListArray.push(word); else return; } //********** Timer Functions ************** function clockTimerMin() { if (!clockSkipMin) { switch (clockMinsRemain) { case 120: case 90: case 60: case 45: case 30: case 20: case 15: case 10: case 9: case 8: case 7: case 6: case 5: case 4: case 3: case 2: cb.sendNotice("\u23f1 \u23f1 \u23f1 There are " + clockMinsRemain + " minutes left on the timer " + (timerDesc != '' ? ("until " + timerDesc) : "") + "\u23f1 \u23f1 \u23f1", "", yellow, "", "bold"); } clockMinsRemain--; if (clockMinsRemain > 0) { cb.setTimeout(clockTimerMin, 60000); } else { clockSecsRemain = 60; cb.sendNotice("\u23f1 \u23f1 \u23f1 There is 1 minute left on the timer " + (timerDesc != '' ? ("until " + timerDesc) : "") + "!! \u23f1 \u23f1 \u23f1", "", red, "", "bold"); clockTimerSec(); } } else { clockSkipMin = false; } } function clockTimerSec() { if (!clockSkipSec) { if (clockMinsRemain > 0) { cb.setTimeout(clockTimerMin, clockSecsRemain*1000); } else { clockSecsRemain--; if (clockSecsRemain < 1) { cb.sendNotice("\u23f0 \u23f0 \u23f0 Time is up! \u23f0 \u23f0 \u23f0", "", yellow, "", "bold"); } else { switch (clockSecsRemain) { case 30: case 10: case 5: case 4: case 3: case 2: case 1: cb.sendNotice("\u23f1 \u23f1 \u23f1 There are " + clockSecsRemain + " second" + (clockSecsRemain > 1 ? "s" : "") + " left on the timer " + (timerDesc != '' ? ("until " + timerDesc) : "") + " \u23f1 \u23f1 \u23f1", "", red, "", "bold"); } } if (clockSecsRemain > 0) { cb.setTimeout(clockTimerSec, 1000); } } } else { clockSkipSec = false; } } function clockAddTime(clocktimetoadd, u) { clockStopTime = new Date(clockStopTime.getTime() + clocktimetoadd * 60000); cb.sendNotice(u + " has added " + clocktimetoadd + " minute" + (clocktimetoadd === 1 || clocktimetoadd === -1 ? "" : "s") + " to the timer.",cb.room_slug,"","", "bold"); cb.sendNotice(clocktimetoadd + " minute" + (clocktimetoadd === 1 || clocktimetoadd === -1 ? "" : "s") + " have been added to the timer. " + clockTimeLeft(),"",yellow,"", "bold"); clockMinsRemain = clockMinsRemain + clocktimetoadd; if (clockMinsRemain < 1) { clockSkipMin = true; clockTimeLeft = clockTimeCal(); clockMS = clockTimeLeft % 1000; clockSeconds = ((clockTimeLeft - clockMS) % 60000) / 1000; clockSecsRemain = clockSeconds; clockTimerSec(); } return; } function clockTimeCal() { clockStartTime = new Date(); return clockStopTime - clockStartTime.getTime(); } function stopClockTimer(mod) { clockStopTime = new Date(); if (clockMinsRemain > 0 || clockSecsRemain > 0) { clockMinsRemain = 0; clockSecsRemain = 0; clockSkipMin = true; clockSkipSec = true; } if(mod != null) { cb.sendNotice(mod + ' has stopped the timer.',"",yellow,"", "bold"); } } function clockTimeLeft(user) { var clockTimeLeft = clockTimeCal(); var clockMS = clockTimeLeft % 1000; var clockSeconds = ((clockTimeLeft - clockMS) % 60000); var clockMinutes = ((clockTimeLeft - clockSeconds - clockMS) % 3600000); var clockHours = (clockTimeLeft - clockMinutes - clockSeconds - clockMS); clockSeconds = clockSeconds / 1000; clockMinutes = clockMinutes / 60000; clockHours = clockHours / 3600000; if (clockHours > 0) { return clockHours + " hour" + (clockHours > 1 ? "s" : "") + " and " + clockMinutes + " minute" + (clockMinutes > 1 ? "s" : "") + " remaining to vote."; } else if (clockMinutes > 0 && clockSeconds === 0) { return clockMinutes + " minute" + (clockMinutes > 1 ? "s" : "") + " remaining on the timer."; } else if (clockMinutes > 0) { return clockMinutes + " minute" + (clockMinutes > 1 ? "s" : "") + " and " + clockSeconds + " second" + (clockSeconds > 1 ? "s" : "") + " remaining on the timer."; } else { return clockSeconds + " second" + (clockSeconds > 1 ? "s" : "") + " remaining on the timer."; } } //********** Chat Notice Functions ************** function sendPublicNotice (message, user, type) { if (message != null) { if (message != "" || message != " " || message != "\u00a0") { setNoticeColor(); switch (type) { case "div": cb.sendNotice(dashLine + "\n\u25ba " + message.capitalize() + "\n" + dashLine, "", "", noticeTextColor, "bold"); break; case "divh": cb.sendNotice(dashLine + "\n\u25ba " + message.capitalize() + "\n" + dashLine, "", noticeBgColor, noticeTextColor, "bold"); break; case "h": cb.sendNotice("\u25ba " + message.capitalize(), "", noticeBgColor, noticeTextColor, "bold"); break; case "": cb.sendNotice("\u25ba " + message.capitalize(), "", "", noticeTextColor, "bold"); break; } } else { cb.sendNotice("You can't send a blank message.\nType a message and try again.", user, "#fee"); } } else { cb.sendNotice("You can't send a blank message.\nType a message and try again.", user, "#fee"); } } //********** PM Functions ************** var TMgreenB = "#d2f8d2"; /* Background Highlighting used for tm */ var TMgreenF = "#007e00"; /* Text Color used for tm */ var BCpurpleB = "#f3e0f1"; /* Background Highlighting used for bc */ var BCpurpleF = "#752d6e"; /* Text Color used for bc */ var TBMblueB = "#dff1f3"; /* Background Highlighting used for tbm */ var TBMblueF = "#1a1aff"; /* Text Color used for tbm */ var PMaquaB = "#f2ebd4"; /* Background Highlighting used for pm */ var PMaquaF = "#008181"; /* Text Color used for pm */ function sendPrivateNotice (message, user, type, dest) { if (message != null) { if (message != '' || message != ' ' || message != '\u00a0') { switch (type) { case 'tm': if (user == cb.room_slug) { cb.sendNotice('\u261b You to mods: ' + message, cb.room_slug, TMgreenB, TMgreenF, "bold"); cb.sendNotice('\u261b ' + cb.room_slug + ' to mods: ' + message, "", TMgreenB, TMgreenF, "bold", "red"); } else { cb.sendNotice('\u261b ' + user + ' to mods: ' + message, "", TMgreenB, TMgreenF, "bold", "red"); } break; case 'bc': cb.sendNotice('\u261b ' + user + ' to you: ' + message, cb.room_slug, BCpurpleB, BCpurpleF, "bold"); cb.sendNotice('\u261b ' + 'You to ' + cb.room_slug + ': ' + message, user, BCpurpleB, BCpurpleF, "bold"); break; case 'tbm': if (user == cb.room_slug) { cb.sendNotice('\u261b You to mods: ' + message, cb.room_slug, TBMblueB, TBMblueF, "bold"); cb.sendNotice('\u261b ' + cb.room_slug + ' to mods: ' + message, "", TBMblueB, TBMblueF, "bold", "red"); } else { cb.sendNotice('\u261b ' + user + ' to ' + cb.room_slug + ' and mods: ' + message, "", TBMblueB, TBMblueF, "bold", "red"); cb.sendNotice('\u261b ' + user + ' to you and mods: ' + message, cb.room_slug, TBMblueB, TBMblueF, "bold"); } break; case 'pm': if (dest != null && (dest != "" || dest != " " || dest != "\u00a0")) { cb.sendNotice('\u261b ' + user + ': ' + message, dest, PMaquaB, PMaquaF, "bold"); cb.sendNotice('\u261b ' + 'You to ' + dest + ': ' + message, user, PMaquaB, PMaquaF, "bold"); pmArray[findPM(dest)][1] = user; } else { cb.sendNotice("You didn't specify who should receive the message.\nPlease enter a username and try again."); } break; } } else { cb.sendNotice("You can't send a blank message.\nType a message and try again.", user, green); } } else { cb.sendNotice("You can't send a blank message.\nType a message and try again.", user, green); } } function findPM(user) { for(var i = 0; i < pmArray.length; i++) { if(pmArray[i][0] == user) { break; } } if(i == pmArray.length) { pmArray[numPMs] = new Array; pmArray[numPMs][0] = user; pmArray[numPMs][1] = ''; numPMs++; findPM(user); } return i; } function sendReply(message, from) { if(pmArray[findPM(from)][1] != '') { var fullmsg = from + ': '; var msg = ''; for(var i = 1; i < message.length; i++) { if(i == 1) { msg += message[i]; fullmsg += message[i]; } else { msg += ' ' + message[i]; fullmsg += ' ' + message[i]; } } replyTo = pmArray[findPM(from)][1] pmArray[findPM(replyTo)][1] = from; cb.sendNotice('\u261b ' + fullmsg, replyTo, PMaquaB, PMaquaF, "bold"); cb.sendNotice('\u261b You to ' + replyTo + ': ' + msg, from, PMaquaB, PMaquaF, "bold"); } else { cb.sendNotice("No one has PM'd you.", from, green); } } //********** Notifier Functions ************** function showNotifier() { cb.setTimeout(notifierTimer,cb.settings.notifierInterval*60000); } function setNoticeColor() { noticeTextColor = checkTextColor(cb.settings.notifiersTextColor); noticeBgColor = checkBgColor(cb.settings.notifiersBgColor); } function notifierTimer() { if(notifierToggle == 1) { setNoticeColor(); rotcnt++; if (rotcnt > 5) { rotcnt = 1; } switch (rotcnt) { case (1): { if(notifierMessage1 == '' || notifierMessage1 == null || rotcnt > 5) { rotcnt = 0; } else { cb.sendNotice("\u25ba " + notifierMessage1, '', noticeBgColor, noticeTextColor, "bold"); } } break; case (2): { if(notifierMessage2 == '' || notifierMessage2 == null || rotcnt > 5) { rotcnt = 0; } else { cb.sendNotice("\u25ba " + notifierMessage2, '', noticeBgColor, noticeTextColor, "bold"); } } break; case (3): { if(notifierMessage3 == '' || notifierMessage3 == null || rotcnt > 5) { rotcnt = 0; } else { cb.sendNotice("\u25ba " + notifierMessage3, '', noticeBgColor, noticeTextColor, "bold"); } } break; case (4): { if(notifierMessage4 == '' || notifierMessage4 == null || rotcnt > 5) { rotcnt = 0; } else { cb.sendNotice("\u25ba " + notifierMessage4, '', noticeBgColor, noticeTextColor, "bold"); } } break; case (5): { if(notifierMessage5 == '' || notifierMessage5 == null || rotcnt > 5) { rotcnt = 0; } else { cb.sendNotice("\u25ba " + notifierMessage5, '', noticeBgColor, noticeTextColor, "bold"); } } break; } showNotifier(); } } function setNotifierToggle(option, mod) { if(option == 'on') { if(notifierToggle == 1) { cb.sendNotice('The Notifier toggle is already turned on.',mod,green); } else { notifierToggle = 1; rotcnt = 0; notifierTimer(); cb.sendNotice('You have enabled the display of the rotating notifier messages.',mod,green); } } else if(option == 'off') { if(notifierToggle == 0) { cb.sendNotice('The Notifier toggle is already turned off.',mod,green); } else { notifierToggle = 0; cb.sendNotice('You have disabled the display of the rotating notifier messages.',mod,green); } } else if(option != null) { cb.sendNotice(option + ' is not a valid option for /usenotifier.\nType /fbhelp notifier to see how to use /usenotifier.',mod,green); } else if(option == null) { cb.sendNotice('You did not enter a valid option for /usenotifier.\nType /fbhelp notifier to see how to use /usenotifier.',mod,green); } } function setTipCountToggle(option, mod) { if(option == 'on') { if(tipCountToggle == 1) { cb.sendNotice('The Tip Count display is already turned on.',mod,green); } else { tipCountToggle = 1; cb.sendNotice('You have enabled the Tip Count display next to each user name in the chat.',mod,green); } } else if(option == 'off') { if(tipCountToggle == 0) { cb.sendNotice('The Tip Count display is already turned off.',mod,green); } else { tipCountToggle = 0; cb.sendNotice('You have disabled the Tip Count display.',mod,green); } } else if(option != null) { cb.sendNotice(option + ' is not a valid option for /usetipcount.\nType /fbhelp usetipcount to see how to use /usetipcount.',mod,green); } else if(option == null) { cb.sendNotice('You did not enter a valid option for /usetipcount.\nType /fbhelp usetipcount to see how to use /usetipcount.',mod,green); } } // *********************************** Gray Chat Lock Function ************************************** function setGrayLockToggle(option, mod) { if(option == 'on') { if(grayLockToggle == 1) { cb.sendNotice('The Gray Chat Lock is already enabled with threshold set to ' + grayChatTime + ' minutes.', mod, green); } else { grayLockToggle = 1; cb.sendNotice('You have enabled the Gray Chat Lock with the configured threshold set to ' + grayChatTime + ' minutes.', mod, green); } } else if(option == 'off') { if(grayLockToggle == 0) { cb.sendNotice('The Gray Chat Lock is already disabled.', mod, green); } else { grayLockToggle = 0; cb.sendNotice('You have disabled the Gray Chat Lock.', mod, green); } } else if(option != null) { cb.sendNotice(option + ' is not a valid option for /usegraylock, the option should be "on" or "off".', mod, green); } else if(option == null) { cb.sendNotice('You did not enter a valid option for /usegraylock, the option should be "on" or "off".', mod, green); } } function grayLockCheck(user,isBC,isMod,isFan,isNotGray) { if (!cbjs.arrayContains(grayLockList,user)) { addToLockList(user,isBC,isMod,isFan,isNotGray); } var grayIndex = grayLockList.indexOf(user); if (grayLockStatus.canChat[grayIndex]) { return true; } else if (grayExpired(grayLockStatus.entered[grayIndex])) { grayLockStatus.canChat[grayIndex] = true; return true; } else { return false; } } function grayExpired(enteredDateTime) { return grayTimeElapsed(enteredDateTime) >= grayChatTime; } function grayTimeElapsed(enteredDateTime) { var nowDateTime = Date.now(); var elapsedMinutes = Math.floor((nowDateTime - enteredDateTime) / (1000 * 60)); return elapsedMinutes; } function addToLockList(user,isBC,isMod,isFan,isNotGray) { if (isBC || isNotGray || isFan || isMod || cbjs.arrayContains(VIPListArray,user) || cbjs.arrayContains(extFanListArray,user)) { initCanChat = true; } else { initCanChat = false; } grayLockList.push(user); grayLockStatus.entered.push(Date.now()); grayLockStatus.canChat.push(initCanChat); } function grayTimeLeft(user) { var ERR = -1; if (!cbjs.arrayContains(grayLockList,user)) { return ERR; } var entered = grayLockStatus.entered[grayLockList.indexOf(user)]; return grayChatTime - grayTimeElapsed(entered); } function addRmvGrayLock(mode,user,sendto) { if (mode == 'a') { if(grayLockStatus.canChat[grayLockList.indexOf(user)] === false) { cb.sendNotice(user + ' is already on chat restricted time lock.', sendto, green); } else { grayLockStatus.canChat[grayLockList.indexOf(user)] = false; grayLockStatus.entered[grayLockList.indexOf(user)] = Date.now(); cb.sendNotice('You have added ' + user + ' to the chat restricted time lock, and reset their timer to start now and last for ' + grayChatTime + ' minutes.', sendto, green); } } else if (mode == 'r') { if(grayLockStatus.canChat[grayLockList.indexOf(user)] === false) { grayLockStatus.canChat[grayLockList.indexOf(user)] = true; cb.sendNotice('You have removed ' + user + ' from the chat restricted time lock. They are now free to chat.', sendto, green); } else { cb.sendNotice(user + ' is not on chat restricted time lock.', sendto, green); } } } function clearGrayLock(sendto) { grayLockList = []; grayLockStatus.canChat = []; grayLockStatus.entered = []; cb.sendNotice('You have cleared the chat restricted time lock list. The list will be rebuilt as users chat or enter the room.', sendto, green); } // *********************************** Help Function ************************************** function helpCommon(option,from) { if(option == null){option = '';} cb.sendNotice('Dorothys Fembot Help Menu', from, green); cb.sendNotice('',from,green); cb.sendNotice( '/reply [msg] - If a moderator or broadcaster PMs you in the chat, you can use the command /reply [msg] to send a message back to the last person that PMd you.' + '\n/timeleft - Display the time left on a timed countdown clock.' + '\n/leaders - Display the tip leaderboard at any time in the chat, only to the user that requests it.' + '\n/wordlist - Display the blocked word list at any time in the chat, only to the user that requests it.' ,from); cb.sendNotice('',from,green); } function helpModBC(option,from) { var valid = 0; if(option == null){option = '';} switch(option) { case '': { valid = 1; cb.sendNotice('Dorothys Fembot Help Menu for Broadcasters and Moderators', from, green); cb.sendNotice('Type /fbhelp [X], where [X] is one of the following choices, for more detailed information.\nEx: "/fbhelp messaging" to see the submenu for messaging related commands.', from); cb.sendNotice('',from,green); cb.sendNotice( 'messaging (/pm, /reply, /bc, /tm, /tbm)' + '\nchatcontrol (/silencelevel, /graphiclevel, /ninja, /unninja, /ninjalist, /silence, /unsilence, /silencelist)' + '\ntimer (/startclock, /addtoclock, /timeleft, /stopclock)' + '\nnotices (/cn, /cnh, /cnd, /cndh, /usenotifier, /chgmsg1.../chgmsg5, /dspmsg, /leaders, /useleaderboard, /usetipcount, /tippers)' + '\nnicelist (/addnice, /rmvnice, /nicelist)' + '\nwordlist (/addword, /rmvword, /wordlist)' + '\nother (/newsubject, /dumpsettings)' + '\nabout' ,from); cb.sendNotice('',from,green); break; } case 'other': { valid = 1; cb.sendNotice('Fembot Command List',from,green); cb.sendNotice('',from,green); cb.sendNotice( 'Other Commands' + '\n/newsubject [X]: Update the room subject to a new value [X].' + '\n/checkcolor [BG],[FG]: Display a test message to check a color combination with the color names or color codes in the format of "background,foreground". For example, you could use the command "/checkcolor #cdcdff,#0000ff" using hex codes or "/checkcolor Light Pink,Dark Pink" using the colors defined in the bot.' + '\n/dumpsettings: Send a list of all of the fembot settings defined when the current bot session was started to the chat... mainly for troubleshooting.' ,from); cb.sendNotice('',from,green); break; } case 'messaging': { valid = 1; cb.sendNotice('Ultra Fembot help for Messaging Commands:',from,green); cb.sendNotice( 'pm: This command is usable by moderators and broadcasters to send a PM to a specific user in the main chat window.' + '\nThe syntax for using PMs is "/pm [X] [Y]", where [X] is the username of the user you want to send the message to, and [Y] is the message you want to send.' + '\nA related command is /reply.' + '\n/reply: This command is usable by everyone once they have received a PM from a moderator or broadcaster.' + '\nThe syntax for replying to a PM is "/reply [X]", where [X] is message that you want to PM to the user who most recently sent a PM to you.' + '\nYou should be careful using this to ensure the last person that PM\'d you is the person you are intending to reply to.' + '\nAlternatvely, a new PM can be sent using the /pm command rather than reply if you are not sure who last PM\'d you.' + '\n/bc: This command is usable by moderators to send a PM specifically to the broadcaster.' + '\nThe syntax for using this type of PM is "/bc [X]", where [X] is the message you want to send.' + '\n/tm: This command that is usable by moderators and the broadcaster to send a PM to the moderator group as a whole.' + '\nThe syntax for using this type of PM is "/tm [X]", where [X] is the message you want to send.' + '\n/tbm: This command is usable by moderators and the broadcaster to send a PM to the moderator group plus the broadcaster.' + '\nThe syntax for using this type of PM is "/tbm [X]", where [X] is the message you want to send.' ,from); cb.sendNotice('',from,green); break; } case 'timer': { valid = 1; cb.sendNotice('Ultra Fembot help for Timer Commands:',from,green); cb.sendNotice( '/startclock: This command is usable by moderators and broadcasters to start a timer in the room. This timer is not tied to any specific function, just a countdown.' + '\nThe syntax for using the command is "/startclock [T]", where [T] is the desired duration of the countdown timer in minutes. The function will accept whole numbers only.' + '\nThe timer will make announcements at 15, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 minutes and 30 seconds remaining. The function /addtoclock can be used to add time to a currently running timer.' + '\n/addtoclock: This command is usable by moderators and broadcasters to add time to (or subtract time from) an existing countdown.' + '\nThe syntax for using addtoclock is "/addtoclock [T]", where [T] is the amount of time you want to add in minutes. The command will accept positive or negative whole numbers only. Negative numbers can be used to subtract time from the clock.' + '\n/timeleft: This command will display the amount of time left in the countdown.' + '\n/stopclock: This command will end the countdown timer.' ,from); cb.sendNotice('',from,green); break; } case 'notices': { valid = 1; cb.sendNotice('Ultra Fembot help for Chat Notice Commands:',from,green); cb.sendNotice( 'cn: This command is usable by moderators and the broadcaster to post a one-time notice in the chat.' + '\nThe syntax for using this type of notice is "/cn [X]", where [X] is the message you want to send.' + '\nThis is the plain notification without any separators or highlighting.' + '\n/cnd: This command is usable by moderators and the broadcaster to post a one-time notice in the chat.' + '\nThe syntax for using this type of notice is "/cnd [X]", where [X] is the message you want to send.' + '\nThis notification includes a dash separator before and after the message, but no highlighting.' + '\n/cnh: This command is usable by moderators and the broadcaster to post a one-time notice in the chat.' + '\nThe syntax for using this type of notice is "/cnh [X]", where [X] is the message you want to send.' + '\nThis notification includes highlighting, but no separators.' + '\n/cndh: This command is usable by moderators and the broadcaster to post a one-time notice in the chat.' + '\nThe syntax for using this type of notice is "/cndh [X]", where [X] is the message you want to send.' + '\nThis notification includes both separators and highlighting.' + '\n/usenotifier: This command is usable by moderators and broadcasters to toggle on or off the display of the periodic notification message defined by the broadcaster.' + '\nThe syntax for using notifier is /usenotifier [X], where [X] is either "on" or "off".' + '\n/chgmsg1: Change the text of the message slotted in Notifier 1. Notifications must be enabled for the message to display.' + '\nThe syntax for using command is /chgmsg1 [X], where [X] is the new message that should be displayed.' + '\n/chgmsg2: Change the text of the message slotted in Notifier 1. Notifications must be enabled for the message to display.' + '\nThe syntax for using command is /chgmsg2 [X], where [X] is the new message that should be displayed.' + '\n/chgmsg3: Change the text of the message slotted in Notifier 1. Notifications must be enabled for the message to display.' + '\nThe syntax for using command is /chgmsg3 [X], where [X] is the new message that should be displayed.' + '\n/chgmsg4: Change the text of the message slotted in Notifier 1. Notifications must be enabled for the message to display.' + '\nThe syntax for using command is /chgmsg4 [X], where [X] is the new message that should be displayed.' + '\n/chgmsg5: Change the text of the message slotted in Notifier 1. Notifications must be enabled for the message to display.' + '\nThe syntax for using command is /chgmsg5 [X], where [X] is the new message that should be displayed.' + '\n/dspmsg [X]: Display the message slotted in position [X], where [X] can be the integers 1-5 or "all".' + '\n/leaders: This command is usable by everyone with the default delivery of displaying the tip leader list only to the requesting user. The leaderboard can also be ' + 'sent to the general chat for all to see, or to the broadcaster or mods specifically.' + '\nThe syntax for using leaderboard is "/leaders" to send to yourself. Moderators and broadcasters can use "/leaders all", "/leaders mods" or "/leaders bc".' + '\nThis command triggers the display of the top 5 tippers of the current session, regardless of the setting for periodic display of the leaderboard.' + '\n/useleaderboard [X]: This command is usable by moderators and broadcasters to toggle the display of the leaderboard in the chat per the defined interval.' + '\nThe syntax for using the leaderboard toggle is /useleaderboard [X], where [X] is either "on" or "off".' + '\nThe interval for the display is still controlled by the configuration settings when enabling the bot.' + '\n/usetipcount [X]: This command is usable by moderators and broadcasters to toggle the display of the user\'s tip count at the beginning of their chat messages.' + '\nThe syntax for using the tip count toggle is /usetipcount [X], where [X] is either "on" or "off".' + '\nNote that enabling and disabling this will not control whether the token tip counts are tracked, only whether they are displayed.' + '\n/tippers: This command that is usable by moderators and broadcasters to trigger the display of the top 25 tippers of the current session with the default delivery displaying ' + 'the tip leader list only to the requesting user. The leaderboard can also be sent to the general chat for all to see, or to the broadcaster or mods specifically.' + '\nThe syntax for using leaderboard is "/tippers" to send to yourself. Moderators and broadcasters can use "/leaders all", "/leaders mods" or "/leaders bc".' ,from); cb.sendNotice('',from,green); break; } case 'chatcontrol': { valid = 1; cb.sendNotice('Ultra Fembot help for Chat Control Commands:',from,green); cb.sendNotice( '\n/silencelevel: This command is used by moderators and broadcasters to control who is able to chat in the room.' + '\nThe syntax for using silencelevel is "/silencelevel [X]", where [X] is a number from 0 to 3.' + '\nSetting the Silence Level to 0 will grant chat privileges to all users, ' + 'setting it to 1 will remove chat privileges from users without tokens, ' + 'setting it to 2 will remove chat privileges from users who have not tipped, ' + 'and setting it to 3 will remove chat privileges from users who have not tipped at least 10 tokens.' + '\nThe default setting for /silencelevel is 0. The chat ability of broadcasters, moderators, and fan club members is unaffected by the Silence Level.' + '\n/graphiclevel: This command is used by moderators and broadcasters to control who is able to post graphics or gifs in the room.' + '\nThe syntax for using graphiclevel is "/graphiclevel [X]", where [X] is a number from 0 to 3.' + '\nSetting the Graphic Level to 0 will grant graphic usage privileges to all users, ' + 'setting it to 1 will revoke graphic usage privileges from users who do not have tokens, ' + 'setting it to 2 will revoke graphic usage privileges from users who have not tipped, ' + 'and setting it to 3 will revoke graphic usage privileges from users who have not tipped at least 10 tokens.' + '\nThe default setting for /graphiclevel is 1. The graphiclevel does not affect the ability of broadcasters, moderators, and fan club members from posting graphics.' + '\n/ninja: This command is usable by moderators and broadcasters.' + '\nThe syntax for using silence is "/ninja [X]", where [X] is the user you want to silence without notification.' + '\nThe effect of the /ninja feature is similar the /silence feature except that the user is not notified.' + '\nThe effect of /ninja can be reversed by running the command /unninja.' + '\n/unninja: This command is usable by moderators and broadcasters.' + '\nThe syntax for using unninja is "/unninja [X]", where [X] is the username of the user you want to remove from the ninja list.' + '\nunninja grants chat privileges back to a user who was previously silenced by ninja.' + '\n/ninjalist: This command is usable by moderators and broadcasters.' + '\nUsing this command will display the list of users that has been silenced using the /ninja command.' + '\nUsers can be removed from this list by running the command /unninja.' + '\n/silence: The syntax for using silence is "/silence [X]", where [X] is the user you want to silence.' + '\nThe effect of the /silence feature is similar the Chaturbate silence feature when you click on a user\'s name and select silence for 6 hrs, ' + 'except that it lasts for the duration of the current session. Also, the user is notified of being silenced, differentiating it from the /ninja function.' + '\nThe effect of /silence can be reversed by running the command /unsilence.' + '\n/unsilence: This command is usable by moderators and broadcasters to grant chat privileges back to a user who was previously silenced.' + '\nThe syntax for using unsilence is "/unsilence [X]", where [X] is the username of the user you want to unsilence.' + '\nNOTE: /unsilence cannot undo the effect of Chaturbate\'s silence for 6 hours feature!' + '\n/silencelist: This is a command that is usable by moderators and broadcasters to display the list of users that has been silenced using the /silence command.' + '\n/usegraylock [on/off]: Toggle the setting for whether the Gray Chat Time Lock feature is "on" or "off". Overrides the initial setting defined on the start page.' + '\n/chggraytime [X]: Change the gray lock time threshold to a new value [X] minutes. Valid values are from 1 to 20 minutes. Overrides the initial setting defined on the start page.' + '\n/clrgraylock: Clears all gray chat lock tracking and starts over. All gray users will be time restricted by the current time threshold setting.' + '\n/addgraylock [user]: Reinstates gray time lock on a specific user, they will not be able to chat until the gray chat lock time elapses.' + '\n/rmvgraylock [user]: Removes gray time lock on a specific user, they will be able to chat immediately, assuming not silenced by other means (ninja, silence, silencelevel).' ,from); cb.sendNotice('',from,green); break; } case 'nicelist': { valid = 1; cb.sendNotice('Ultra Fembot help for Timer Commands:',from,green); cb.sendNotice( '/addnice: This command is usable by moderators and broadcasters.' + '\nThe syntax for using addnice is "/addnice x", where x is the username of the user you want to add to the nice list.' + '\nAdding a user to the nice list guarantees that user voice and graphic usage privileges regardless of the silence and graphic level settings. ' + 'Using /silence will still silence a user on the nice list.' + '\nUsers can be removed from the nice list by using the command /rmvnice.' + '\nSee the help sections for silencelevel and graphiclevel for more information on the global settings or the help section for nicelist for more information on the nice list.' + '\n/rmvnice: This command is usable by moderators and broadcasters.' + '\nThe syntax for using this command is "/rmvnice x", where x is the username of the user you want to remove from the nice list.' + '\n/nicelist: Sometimes, there are nice or polite users you would like to allow to chat even when they don\'t have tokens or haven\'t tipped. ' + 'When the silence level is elevated, usually these users are no longer able to chat, but adding them to the nice list allows them to still chat despite the silence level.' + 'Users can be added to the nice list using the command /addnice [user] where [user] is the user name that should be added.' + 'Likewise users can be removed from the nice list using the command /rmvnice [user] where [user] is the user name that should be removed' + 'The list of users currently in the nice list can be displayed using the command /nicelist.' ,from); cb.sendNotice('',from,green); break; } case 'wordlist': { valid = 1; cb.sendNotice('Ultra Fembot help for Blocked Word List Commands:',from,green); cb.sendNotice( '/addword: This command is usable by broadcasters and moderators only.' + '\nThe syntax for using the command is "/addword [X]", where [X] is the word you want to add to the Blocked Word list.' + '\nAdding a word to the Blocked Word list will cause a message containing that word to be blocked and not posted to the chat.' + '\nWords can be removed from the Blocked Word list by using the command /rmvword.' + '\n/rmvword: This command is usable by broadcasters and moderators only.' + '\nThe syntax for using this command is "/rmvword [X]", where [X] is the word you want to remove from the Blocked Word list.' + '\n/wordlist: Displays the list of words currently in the Blocked Word list, available to all users.' ,from); cb.sendNotice('',from,green); break; } case 'about': { valid = 1; cb.sendNotice('About the Ultra Fembot',from,green); cb.sendNotice('Dorothy\'s Ultra Fembot was written by chelsea2950 mostly based on several existing bots with some tweaks and improvements.' + '\nComments, suggestions, requests, and bug reports can be made by either tweeting @thechelsea2950, or by posting comments on bot help page.' + '\nThe purpose of this Ultra Bot is to serve as one tool that experienced cammers can use for most of the common functions needed during a show. ' + '\nWhereas the "Easy Fembot" contains basic features such as Private Messaging, Leader Board, Silencing users, Silence Level, Graphic Level, Nice List and Notifier, ' + 'the "Ultra Fembot" also adds fancier features such as a Tip Menu, VIP list, Token Poll, icons by user group, blocked wordlist, and additional notifiers. ' + '\nSee the help details for each command for more information on these features.' ,from); cb.sendNotice('',from,green); break; } } if(valid == 0) { cb.sendNotice(option + ' is not a valid subsection of the help menu. Type "/fbhelp" to access the main help menu.',from,green); } } } } // ******************************* Upon user entry of a Message ************************************** { cb.onMessage(function (msg) { var message = msg['m'].split(' '); var cmd = 0; var symbolString = '~`!@#$%^&*()_-+={[}]|\\:;"\'<,>.?/'; var listRegExp = /[,\s]+/; var listRegExpSpc = /[,]+/; var m = msg.m; var u = msg.user; var isMod = msg.is_mod; var isFan = msg.in_fanclub; var isNotGray = msg.has_tokens; var isBC = (u === cb.room_slug); var BC = cb.room_slug; var isNinjaSilenced = cbjs.arrayContains(ninjaListArray, u); var isNice = cbjs.arrayContains(niceListArray, u); var isSilenced = cbjs.arrayContains(silenceListArray, u); if(isMod) { populateModeratorArray(u, "mod"); } if(isFan) { populateFanClubArray(u); } var command = message[0] var commandVar1 = parseInt(message[1]); var commandVar2 = parseInt(message[2]); if(message[0].charAt(0) == '/') { msg['X-Spam'] = true; msg['X-Spam'] = true; var ntc = null; for (var i = 1; i < message.length; i++) { if (i == 1) ntc = message[i]; else ntc += " " + message[i]; } var ntc2 = null; for (var i = 2; i < message.length; i++) { if (i == 2) ntc2 = message[i]; else ntc2 += " " + message[i]; } var cmdval = null; for (var i = 1; i < message.length; i++) { if (i == 1) cmdval = message[i]; else cmdval += " " + message[i]; } switch(command) { //******** Chat Control Commands *********** case '/silencelevel': { cmd = 1; if(isMod || isBC) { setSilenceLevel(message[1], u); } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.\nType "/fbhelp" to see a full list of the available commands.', u, green); } break; } case '/graphiclevel': { cmd = 1; if(isMod || isBC) { setGraphicLevel(message[1], u); } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.\nType "/fbhelp" to see a full list of the available commands.', u, green); } break; } //******** Timer Commands *********** case '/startclock': { cmd = 1; if (isMod || isBC) { if (clockMinsRemain >= 1 || clockSecsRemain >= 1) { cb.sendNotice('A timer is already running, you can type /stopclock to end the current timer or /addtoclock X to add time, where X is the time to add in minutes.', u, green); break; } if (!commandVar1) { cb.sendNotice('Invalid command, you need to specify the starting point for the timer in minutes. Example: use "/startclock 10" to start a 10 minute timer', u, green); break; } commandVar1 = parseInt(commandVar1) if (isNaN (commandVar1)) { cb.sendNotice('Invalid value, the time entered must be a numeric value in minutes. Example: use "/startclock 10" to start a 10 minute timer.', u, green); break; } if (commandVar1 > 120) { cb.sendNotice('The time specified is greater than 2 hours, please use a smaller value.', u, green); break; } clockStartTime = new Date(); clockStopTime = new Date(clockStartTime.getTime() + commandVar1 * 60000); clockMinsRemain = commandVar1; clockTimeAdded = false; cb.sendNotice(u + " has started a timer for " + clockMinsRemain + " minute" + (clockMinsRemain > 1 ? "s" : ""), "", green, "", "bold"); clockTimerMin(); break; } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.\nType "/fbhelp commands" to see a full list of the available commands.', u, green); } break; } case '/addtoclock': { cmd = 1; if (isMod || isBC) { if (!commandVar1) { cb.sendNotice('Invalid command, you need to specify the amount of time to add to the timer in minutes. Example: use "/addtoclock 3" to add 3 minutes to the timer.', u, green); } else if ((clockMinsRemain + 1) + commandVar1 <= 0) { cb.sendNotice('The time to subtract is greater than the amount of time left. You can use "/stopclock" to stop the timer.'); } else if ((clockMinsRemain + 1) + commandVar1 > 120) { cb.sendNotice('The added time will increase the timer to greater than 2 hours, please use a smaller value.'); } else { if (clockMinsRemain >= 1 || clockSecsRemain >= 1) { clockAddTime(commandVar1, u); break; } else { cb.sendNotice('A timer is not running.', msg['user'], green); } } } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.\nType "/fbhelp timer" to see a full list of the timer related commands.', u,green); } break; } case '/timeleft': { cmd = 1; if (isMod || isBC) { if (clockMinsRemain >= 1 || clockSecsRemain >= 1) { cb.sendNotice(timeLeft(), "", yellow, "", "bold"); } else { cb.sendNotice('A timer is not running.', msg['user'], green); } } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.\nType "/fbhelp" to see a full list of the available commands.', u, green); } break; } case '/stopclock': { cmd = 1; if (isMod || isBC) { if (clockMinsRemain >= 1 || clockSecsRemain >= 1) { stopClockTimer(u); } else { cb.sendNotice('A timer is not running.', msg['user'], green); } } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.\nType "/fbhelp" to see a full list of the available commands.', u, green); } break; } //******** Ninja Commands *********** case '/ninja': { cmd = 1; if(isMod || isBC) { if (message[1] != null && message[1] != "" && message[1] != " ") { addRmvNinja(message[1], u, 'a'); } else { cb.sendNotice('No value was specified for the user to ninja, please try again.', msg['user'], green); } } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.\nType "/fbhelp commands" to see a full list of the available commands.', msg['user'], green); } break; } case '/unninja': { cmd = 1; if (isMod || isBC) { addRmvNinja(message[1], u, 'r'); } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.\nType "/fbhelp commands" to see a full list of the available commands.', msg['user'], green); } break; } case '/ninjalist': { cmd = 1; if (isMod || isBC) { cb.sendNotice('Users currently on the Ninja List: ' + ninjaListArray.length, u, green); cb.sendNotice((ninjaListArray.length > 0 == true ? cbjs.arrayJoin(ninjaListArray, ', ') : 'No users.'), u); cb.sendNotice('End of List', u, green); } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.\nType "/fbhelp commands" to see a full list of the available commands.', msg['user'], green); } break; } //******** Silence List Commands *********** case '/silence': { cmd = 1; if (isMod || isBC) { if (message[1] != null && message[1] != "" && message[1] != " ") { addRmvSilence(message[1], u, 'a'); } else { cb.sendNotice('No value was specified for the user to silence, please try again.', msg['user'], green); } } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.\nType "/fbhelp commands" to see a full list of the available commands.', msg['user'], green); } break; } case '/unsilence': { cmd = 1; if (isMod || isBC) { addRmvSilence(message[1], u, 'r'); } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.\nType "/fbhelp commands" to see a full list of the available commands.', msg['user'], green); } break; } case '/silencelist': { cmd = 1; if (isMod || isBC) { cb.sendNotice('Users currently on the Silence List: ' + silenceListArray.length, u, green); cb.sendNotice((silenceListArray.length > 0 == true ? cbjs.arrayJoin(silenceListArray, ', ') : 'No users.'), u); cb.sendNotice('End of List', u, green); } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.\nType "/fbhelp commands" to see a full list of the available commands.', msg['user'], green); } break; } //******** Blocked Word List Commands *********** case '/addword': { cmd = 1; if (isMod || isBC ) { if (cmdval != null) { var cmdvalsplit = cmdval.split(listRegExp); if (cmdvalsplit.length > 1) { cb.sendNotice("Adding multiple words to the Blocked Word list.", u, green); for (var i = 0; i < cmdvalsplit.length; i++) { if (cmdvalsplit[i] != "") { if (!cbjs.arrayContains(wordListArray, cmdvalsplit[i])) { populateWordListArray(cmdvalsplit[i]); cb.sendNotice("Added " + cmdvalsplit[i] + " to the list.", u); } else { cb.sendNotice(cmdvalsplit[i] + " is already on the list. Skipping.", u); } } } cb.sendNotice("All words were added.", u, green) cb.sendNotice(u + " has added multiple words to the Blocked Word list.\n" + "Words added: " + cbjs.arrayJoin(cmdvalsplit, ", "), "", green, "", "normal", "red"); } else { var cmdvalsingle = message[1]; addRmvWord(cmdvalsingle, u, 'a'); } } else { cb.sendNotice("You didn't specify what word(s) you want to add to the Blocked Word list.", u, green); } } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.\nType "/fbhelp" to see a full list of the available commands.', u, green); } break; } case '/rmvword': { cmd = 1; if(isMod || isBC) { addRmvWord(message[1], u, 'r'); } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.\nType "/fbhelp commands" to see a full list of the available commands.', msg['user'], green); } break; } case '/wordlist': { cmd = 1; cb.sendNotice('Words currently on the Blocked Word List: ' + wordListArray.length, u, green); cb.sendNotice((wordListArray.length > 0 == true ? cbjs.arrayJoin(wordListArray, ', ') : 'No users.'), u); cb.sendNotice('End of List', u, green); break; } //******** Nice List Commands *********** case '/addnice': { cmd = 1; if (isMod || isBC ) { if (cmdval != null) { var cmdvalsplit = cmdval.split(listRegExp); if (cmdvalsplit.length > 1) { cb.sendNotice("Adding multiple users to the nice list.", u, green); for (var i = 0; i < cmdvalsplit.length; i++) { if (cmdvalsplit[i] != "") { if (!cbjs.arrayContains(niceListArray, cmdvalsplit[i])) { populateNiceListArray(cmdvalsplit[i]); cb.sendNotice("Added " + cmdvalsplit[i] + " to the list.", u); cb.sendNotice(u + " has added you to the nice list.", cmdvalsplit[i], "#efe"); } else { cb.sendNotice(cmdvalsplit[i] + " is already on the list. Skipping.", u); } } } cb.sendNotice("All users were added and notified.", u, green) cb.sendNotice(u + " has added multiple users to the nice list.\n" + "Users added: " + cbjs.arrayJoin(cmdvalsplit, ", "), "", green, "", "normal", "red"); } else { var cmdvalsingle = message[1]; addRmvNice(cmdvalsingle, u, 'a'); } } else { cb.sendNotice("You didn't specify who you want to add to the nice list.", u, green); } } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.\nType "/fbhelp" to see a full list of the available commands.', u, green); } break; } case '/rmvnice': { cmd = 1; if (isMod || isBC) { addRmvNice(message[1], u, 'r'); } break; } case '/nicelist': { cmd = 1; if (isMod || isBC) { cb.sendNotice('Users currently on the Nice List: ' + niceListArray.length, u, green); cb.sendNotice((niceListArray.length > 0 == true ? cbjs.arrayJoin(niceListArray, ', ') : 'No users.'), u); cb.sendNotice('End of List', u, green); } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.\nType "/fbhelp commands" to see a full list of the available commands.', u, green); } break; } //******** Chat Notice Commands *********** case '/cn': { cmd = 1; if (isMod || isBC) { if (ntc != null && (ntc != "" || ntc != " " || ntc != "\u00a0")) { sendPublicNotice(ntc, u, ""); } else { cb.sendNotice("You can\'t send a blank message.\n" + "The correct syntax for this command is " + '"/cn message"' + ".", u, "#fee"); } } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.\nType "/fbhelp commands" to see a full list of the available commands.', u, green); } break; } case "/cnh": { cmd = 1; if (isMod || isBC) { if (ntc != null && (ntc != "" || ntc != " " || ntc != "\u00a0")) { sendPublicNotice(ntc, u, "h"); } else { cb.sendNotice("You cannot send a blank message.\n" + "The correct syntax for this command is " + '"/cnh message"' + ".", u, "#fee"); } } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.\nType "/fbhelp commands" to see a full list of the available commands.', msg['user'], green); } break; } case "/cnd": { cmd = 1; if (isMod || isBC) { if (ntc != null && (ntc != "" || ntc != " " || ntc != "\u00a0")) { sendPublicNotice(ntc, u, "div"); } else { cb.sendNotice("You cannot send a blank message.\n" + "The correct syntax for this command is " + '"/cnd message"' + ".", u, "#fee"); } } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.\nType "/ubhelp commands" to see a full list of the available commands.', u, green); } break; } case "/cndh": { cmd = 1; if (isMod || isBC) { if (ntc != null && (ntc != "" || ntc != " " || ntc != "\u00a0")) { sendPublicNotice(ntc, u, "divh"); } else { cb.sendNotice("You cannot send a blank message.\n" + "The correct syntax for this command is " + '"/cndh message"' + ".", u, "#fee"); } } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.\nType "/ubhelp commands" to see a full list of the available commands.', u, green); } break; } //******** Private Message Commands *********** case "/bc": { cmd = 1; if (isMod || (isVIP && (cb.settings.enableVIPList == 'PMs' || cb.settings.enableVIPList == 'PMs and Ticket Shows')) || (isExtFan && (cb.settings.enableExtFans == 'PMs' || cb.settings.enableExtFans == 'PMs and Ticket Shows'))) { if (ntc != null && (ntc != "" || ntc != " " || ntc != "\u00a0")) { sendPrivateNotice(ntc, u, "bc", "default"); } else { cb.sendNotice("You cannot send a blank message.\nThe correct syntax for this command is " + '"/bc message"' + ".", u, "#fee"); } } else { cb.sendNotice('Only moderators are able to use that command.\nType "/ubhelp commands" to see a full list of the available commands.', u, green); } break; } case "/tm": { cmd = 1; if (isMod || isBC) { if (ntc != null && (ntc != "" || ntc != " " || ntc != "\u00a0")) { sendPrivateNotice(ntc, u, "tm"); } else { cb.sendNotice("You cannot send a blank message.\nThe correct syntax for this command is " + '"/tm message"' + ".", u, "#fee"); } } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.\nType "/ubhelp commands" to see a full list of the available commands.', u, green); } break; } case "/tbm": { cmd = 1; if (isMod || isBC) { if (ntc != null && (ntc != "" || ntc != " " || ntc != "\u00a0")) { sendPrivateNotice(ntc, u, "tbm", "default"); } else { cb.sendNotice("You cannot send a blank message.\nThe correct syntax for this command is " + '"/tbm message"' + ".", u, "#fee"); } } else { cb.sendNotice('Only moderators are able to use that command.\nType "/ubhelp commands" to see a full list of the available commands.', u, green); } break; } case '/pm': { cmd = 1; if (cb.settings.enablePMs == "Yes") { if (isMod || isBC || (isVIP && (cb.settings.enableVIPList == 'PMs' || cb.settings.enableVIPList == 'PMs and Ticket Shows')) || (isExtFan && (cb.settings.enableExtFans == 'PMs' || cb.settings.enableExtFans == 'PMs and Ticket Shows'))) { if (ntc2 != null && (ntc2 != "" || ntc2 != " " || ntc2 != "\u00a0")) { sendPrivateNotice(ntc2, u, "pm", message[1]); } else { cb.sendNotice('You cannot send a blank message.\nThe correct syntax for this command is ' + '"/pm user message"' + '.', u, '#fee'); } } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.\nType "/ubhelp commands" to see a full list of the available commands.', u, green); } } else { cb.sendNotice('That command has not been enabled by the broadcaster.', u, green); } break; } case '/reply': { cmd = 1; if (cb.settings.enablePMs == "Yes") { sendReply(message, msg['user']); break; } else { cb.sendNotice('That command has not been enabled by the broadcaster.', u, green); } } //******** Tip Leader Commands *********** case '/leaders': { cmd = 1; if (isMod || isBC) { switch (message[1]) { case "all": cb.sendNotice( "SENT TO ALL:", u, '#111111', '#d1eaee', "bold"); showLeaderBoard("", ""); break; case "tbm": cb.sendNotice( "SENT TO BROADCASTER and MODS:", u, '#111111', '#d1eaee', "bold"); showLeaderBoard("", "red");showLeaderBoard(BC,''); break; case "mods": cb.sendNotice( "SENT TO MODS:", u, '#111111', '#d1eaee', "bold"); showLeaderBoard("", "red"); break; case "bc": cb.sendNotice( "SENT TO YOU BY: "+u, BC, '#111111', '#d1eaee' , "bold"); cb.sendNotice( "SENT TO BROADCASTER:", u, '#111111', '#d1eaee', "bold"); showLeaderBoard(BC, ""); break; default: cb.sendNotice( "SENT TO ONLY YOU:", u, '#111111', '#d1eaee', "bold"); showLeaderBoard(u, ""); break; } } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.\nType "/ubhelp commands" to see a full list of the available commands.', u, green); } break; } case '/tippers': { cmd = 1; if (isMod || isBC) { if (ntc2 != null && (ntc2 != "" || ntc2 != " " || ntc2 != "\u00a0")) { if (ntc2 > 100) { cb.sendNotice('List cannot exceed 100, defaulting to 100.', u, green); num = 100 } num = ntc2; } else { num = 20 } switch (ntc) { case "all": cb.sendNotice( "SENT TO ALL:", u, '#111111', '#d1eaee' , "bold"); showTippers("", "", num); break; case "tbm": cb.sendNotice( "SENT TO BROADCASTER and MODS:", u, '#111111', '#d1eaee' , "bold"); showTippers("", "red", num);showTippers(BC,''); break; case "mods": cb.sendNotice( "SENT TO MODS:", u, '#111111', '#d1eaee' , "bold"); showTippers("", "red", num); break; case "bc": cb.sendNotice( "SENT TO YOU BY: "+u, BC, '#111111', lbback , "bold"); cb.sendNotice( "SENT TO BROADCASTER:", u, '#111111', '#d1eaee' , "bold"); showTippers(BC, "", num); break; default: cb.sendNotice( "SENT TO ONLY YOU:", u, '#111111', '#d1eaee' , "bold"); showTippers(u, "", num); break; } } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.\nType "/ubhelp commands" to see a full list of the available commands.', u, green); } break; } case '/useleaderboard': { cmd = 1; if (isMod || isBC) { setLeaderToggle(message[1],msg['user']) } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.\nType "/fbhelp commands" to see a full list of the available commands.',msg['user'],green); } break; } case '/usetipcount': { cmd = 1; if (isMod || isBC) { setTipCountToggle(message[1],msg['user']) } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.\nType "/fbhelp commands" to see a full list of the available commands.',msg['user'],green); } break; } //********* Notifier Commands case '/usenotifier': { cmd = 1; if (isMod || isBC) { setNotifierToggle(message[1],msg['user']) } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.\nType "/fbhelp commands" to see a full list of the available commands.',msg['user'],green); } break; } case '/chgmsg1': { cmd = 1; if (isMod || isBC) { if(message[1] == '' || message[1] == null) { cb.sendNotice('You must enter a new message for the notifier feature. If you want to disable the notifications, enter /usenotifier off.',msg['user'],green) } else { notifierMessage1 = msg['m'].substring(8).trim(); cb.sendNotice('You have set the Notifier 1 message to: ' + notifierMessage1,msg['user'],green); } } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.\nType "/fbhelp commands" to see a full list of the available commands.',msg['user'],green); } break; } case '/chgmsg2': { cmd = 1; if (isMod || isBC) { if(message[1] == '' || message[1] == null) { cb.sendNotice('You must enter a new message for the notifier feature. If you want to disable the notifications, enter /usenotifier off.',msg['user'],green) } else { notifierMessage2 = msg['m'].substring(8).trim(); cb.sendNotice('You have set the Notifier 2 message to: ' + notifierMessage2,msg['user'],green); } } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.\nType "/fbhelp commands" to see a full list of the available commands.',msg['user'],green); } break; } case '/chgmsg3': { cmd = 1; if (isMod || isBC) { if(message[1] == '' || message[1] == null) { cb.sendNotice('You must enter a new message for the notifier feature. If you want to disable the notifications, enter /usenotifier off.',msg['user'],green) } else { notifierMessage3 = msg['m'].substring(8).trim(); cb.sendNotice('You have set the Notifier 3 message to: ' + notifierMessage3,msg['user'],green); } } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.\nType "/fbhelp commands" to see a full list of the available commands.',msg['user'],green); } break; } case '/chgmsg4': { cmd = 1; if (isMod || isBC) { if(message[1] == '' || message[1] == null) { cb.sendNotice('You must enter a new message for the notifier feature. If you want to disable the notifications, enter /usenotifier off.',msg['user'],green) } else { notifierMessage4 = msg['m'].substring(8).trim(); cb.sendNotice('You have set the Notifier 4 message to: ' + notifierMessage4,msg['user'],green); } } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.\nType "/fbhelp commands" to see a full list of the available commands.',msg['user'],green); } break; } case '/chgmsg5': { cmd = 1; if (isMod || isBC) { if(message[1] == '' || message[1] == null) { cb.sendNotice('You must enter a new message for the notifier feature. If you want to disable the notifications, enter /usenotifier off.',msg['user'],green) } else { notifierMessage5 = msg['m'].substring(8).trim(); cb.sendNotice('You have set the Notifier 5 message to: ' + notifierMessage5,msg['user'],green); } } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.\nType "/fbhelp commands" to see a full list of the available commands.',msg['user'],green); } break; } case '/dspmsg': { cmd = 1; if (isMod || isBC) { setNoticeColor(); switch(message[1]) { case('1'): { if(notifierMessage1 == '' || notifierMessage1 == null) { cb.sendNotice('Notifier 1 Message is blank.', msg['user'], green) } else { cb.sendNotice('\u25ba ' + notifierMessage1, "", noticeBgColor, noticeTextColor, "bold"); } break; } case('2'): { if(notifierMessage2 == '' || notifierMessage2 == null) { cb.sendNotice('Notifier 2 Message is blank.', msg['user'], green) } else { cb.sendNotice('\u25ba ' + notifierMessage2, "", noticeBgColor, noticeTextColor, "bold"); } break; } case('3'): { if(notifierMessage3 == '' || notifierMessage3 == null) { cb.sendNotice('Notifier 3 Message is blank.', msg['user'], green) } else { cb.sendNotice('\u25ba ' + notifierMessage3, "", noticeBgColor, noticeTextColor, "bold"); } break; } case('4'): { if(notifierMessage4 == '' || notifierMessage4 == null) { cb.sendNotice('Notifier 4 Message is blank.', msg['user'], green) } else { cb.sendNotice('\u25ba ' + notifierMessage4, "", noticeBgColor, noticeTextColor, "bold"); } break; } case('5'): { if(notifierMessage5 == '' || notifierMessage5 == null) { cb.sendNotice('Notifier 5 Message is blank.', msg['user'], green) } else { cb.sendNotice('\u25ba ' + notifierMessage5, "", noticeBgColor, noticeTextColor, "bold"); } break; } case('all'): { for (let j = 1; j <= 5; j++) { if(this["notifierMessage"+j] != '' && this["notifierMessage"+j] != null) { cb.sendNotice(j + ". " + this["notifierMessage"+j], "", noticeBgColor, noticeTextColor, "bold"); } } break; } default: { cb.sendNotice('Invalid message slot, values must be 1-5 or "all".\nType "/fbhelp notices" to see a full list of the notice related commands.',msg['user'],green); break; } } } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.\nType "/fbhelp notices" to see a full list of the notice related commands.',msg['user'],green); } break; } //********* Change Subject Command case '/chgsubject': case '/newsubject': { cmd = 1; if (isMod || isBC) { newSubject = msg['m'].substring(12).trim() setRoomSubject(newSubject,msg['user']) } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.\nType "/fbhelp commands" to see a full list of the available commands.',msg['user'],green); } break; } //********* Time Locked Gray Chat commands case '/usegraylock': { cmd = 1; if (isMod || isBC) { setGrayLockToggle(message[1], u); } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.', u, green); } break; } case "/cleargraylock": { cmd = 1; if (isMod || isBC) { if (grayLockToggle == 1) { clearGrayLock(u); } else { cb.sendNotice('The Gray Chat Time Lock has not been turned on, you can use the command "/usegraylock on" to enable it. Note the current Gray Chat Time Threshold is ' + grayChatTime + ' minutes.', u, green); } } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.', u, green); } break; } case '/rmvgraylock': { cmd = 1; if (isMod || isBC) { if (grayLockToggle == 1) { if (!cbjs.arrayContains(grayLockList,u)) { addToLockList(u,isBC,isMod,isFan,isNotGray); } addRmvGrayLock('r',message[1], u); } else { cb.sendNotice('The Gray Chat Time Lock has not been turned on, you can use the command "/usegraylock on" to enable it. Note the current Gray Chat Time Threshold is ' + grayChatTime + ' minutes.', u, green); } } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.', u, green); } break; } case '/addgraylock': { cmd = 1; if (isMod || isBC) { if (grayLockToggle == 1) { if (!cbjs.arrayContains(grayLockList,u)) { addToLockList(u,isBC,isMod,isFan,isNotGray); } addRmvGrayLock('a',message[1], u); } else { cb.sendNotice('The Gray Chat Time Lock has not been turned on, you can use the command "/usegraylock on" to enable it. Note the current Gray Chat Time Threshold is ' + grayChatTime + ' minutes.', u, green); } } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.', u, green); } break; } case '/chggraytime': { cmd = 1; if (isMod || isBC) { if (grayLockToggle == 1) { nummin = parseInt(message[1]); if (isNaN(nummin)) { cb.sendNotice('The value entered for the new Gray Chat Time Threshold is not numeric, please try again.', u, green); } else if (nummin < 1 || nummin > 20) { cb.sendNotice('The value entered for the new Gray Chat Time Threshold is outside allowable values from 1 to 20, please try again.', u, green); } else { grayChatTime = nummin; cb.sendNotice('You have updated the Gray Chat Time Threshold to ' + grayChatTime + ' minutes.', u, green); } } else { cb.sendNotice('The Gray Chat Time Lock has not been turned on, you can use the command "/usegraylock on" to enable it. Note the current Gray Chat Time Threshold is ' + grayChatTime + ' minutes.', u, green); } } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.', u, green); } break; } //********* Change the timer Description case '/chgtimerdesc': { cmd = 1; if (isMod || isBC) { if(message[1] != '' && message[1] != null) { timerDesc = msg['m'].substring(14).trim(); cb.sendNotice('The timer description has been updated to "' + timerDesc + '".', u, green); } else { cb.sendNotice('No value was specified for the new timer description.', u, green); } } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.', u, green); } break; } //********* Help Menu case '/fbhelp': { cmd = 1; if (isMod || isBC) { helpModBC(message[1],msg['user']); } else { helpCommon(message[1],msg['user']); } break; } //********* Dump config settings case "/dumpsettings": { cmd = 1; if (isMod || isBC) { cb.sendNotice( 'Dump of all current settings:' + '\n**************** Notices Controls ************************' + '\nenableEntryMessage : ' + cb.settings.enableEntryMessage + '\nentryMessage : ' + cb.settings.entryMessage + '\nenableNotifier : ' + cb.settings.enableNotifier + '\nnotifierMessage1 : ' + cb.settings.notifierMessage1 + '\nnotifierMessage2 : ' + cb.settings.notifierMessage2 + '\nnotifierMessage3 : ' + cb.settings.notifierMessage3 + '\nnotifierMessage4 : ' + cb.settings.notifierMessage4 + '\nnotifierMessage5 : ' + cb.settings.notifierMessage5 + '\nnotifierInterval : ' + cb.settings.notifierInterval + '\nnotifiersTextColor : ' + cb.settings.notifiersTextColor + '\nnotifiersBgColor : ' + cb.settings.notifiersBgColor + '\n**************** Tip Leaders Controls ************************' + '\nenableSubjectChange : ' + cb.settings.enableSubjectChange + '\nenableTipCount : ' + cb.settings.enableTipCount + '\nenableTipLeaderIcons : ' + cb.settings.enableTipLeaderIcons + '\ntipLeaderGif1 : ' + cb.settings.tipLeaderGif1 + '\ntipLeaderGif2 : ' + cb.settings.tipLeaderGif2 + '\ntipLeaderGif3 : ' + cb.settings.tipLeaderGif3 + '\nenableLeaderboard : ' + cb.settings.enableLeaderboard + '\nleaderInterval : ' + cb.settings.leaderInterval + '\nleaderTextColor : ' + cb.settings.leaderTextColor + '\nleaderBgColor : ' + cb.settings.leaderBgColor + '\n**************** Chat Controls ************************' + '\nsilenceList : ' + cb.settings.silenceList + '\nninjaList : ' + cb.settings.ninjaList + '\nniceList : ' + cb.settings.niceList + '\nenablePMs : ' + cb.settings.enablePMs + '\nlockGrayChat : ' + cb.settings.lockGrayChat + '\ngrayChatTime : ' + cb.settings.grayChatTime + '\n**************** Blocked Word List ********************' + '\nenableWordList : ' + cb.settings.enableWordList + '\nwordBlockList : **intentionally hidden**' ,u); cb.sendNotice('',u,green); break; } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.',u,green); } } //********* End of Expected commands } if(message[0] == '/stopshow' || message[0] == '/showend' || message[0] == '/showover' || message[0] == '/starttimer' || message[0] == '/addtime' || message[0] == '/ctn' || message[0] == '/ctnd' || message[0] == '/ctnh' || message[0] == '/ctndh' || message[0] == '/ctsubject' || message[0] == '/subject' || message[0] == '/tickets') { cmd = 1; } if(cmd == 0) { cb.sendNotice(message[0] + ' is not a command.\nType /fbhelp commands to see a full list of the available commands.', msg['user'], green); } } var silencedmsg = 0; //********* Suppress for Silence Level if(silenceLevel > 0 && !isMod && !isBC && !isNice && !isFan) { switch(silenceLevel) { case 1: if(!msg['has_tokens']) { silencedmsg = 1; cb.sendNotice('Your message was not sent because the silence level has been set to only allow members with tokens to chat.',u,green); } break; case 2: if(!cbjs.arrayContains(tipCountArray.name,u)) { silencedmsg = 1; cb.sendNotice('Your message was not sent because the silence level has been set to only allow members who have tipped at least 1 token to chat.',u,green); } break; case 3: if(cbjs.arrayContains(tipCountArray.name,u)) { if(parseInt(tipCountArray.amount[findTipper(u)]) < 10) { silencedmsg = 1; cb.sendNotice('Your message was not sent because the silence level has been set to only allow members who have tipped at least 10 tokens to chat.',u,green); } } else { silencedmsg = 1; cb.sendNotice('Your message was not sent because the silence level has been set to only allow members who have tipped at least 10 tokens to chat.',u,green); } break; } } //********* Suppress for Gray Chat Time-Lock if (grayLockToggle == 1 && !isMod && !isBC && !isNice && !isFan && !isNotGray && silencedmsg == 0) { if (!grayLockCheck(u,isBC,isMod,isFan,isNotGray)) { var left = grayTimeLeft(u); silencedmsg = 1; cb.sendNotice('Your message was not sent because gray chat is time-locked and you have ' + left + ' minute' + (left === 1 ? "" : "s") + ' remaining.',u,green); } } //********* Suppress for Ninja'd or Silenced if(isNinjaSilenced && !isMod && !isBC && silencedmsg == 0) { silencedmsg = 1; } if(isSilenced && !isMod && !isBC && silencedmsg == 0) { silencedmsg = 1; cb.sendNotice('Your message was not sent because you have been silenced',u,green); } //********* Graphic Level if(graphicLevel > 0 && !isMod && !isBC && !isNice && !isFan && silencedmsg == 0) { switch(graphicLevel) { case 1: if(!msg['has_tokens']) { for(var i = 0; i < message.length; i++) { if(message[i].charAt(0) == ':') { silencedmsg = 1; cb.sendNotice('Your message was not displayed because the graphic level has been set to only allow users with tokens to use graphics.',msg['user'],green); } } } break; case 2: if(parseInt(tipCountArray.amount[findTipper(u)]) == 0) { for(var i = 0; i < message.length; i++) { if(message[i].charAt(0) == ':') { silencedmsg = 1; cb.sendNotice('Your message was not displayed because the graphic level has been set to only allow users who have tipped to use graphics.',msg['user'],green); } } } break; case 3: if(cbjs.arrayContains(tipCountArray.name,u)) { if(parseInt(tipCountArray.amount[findTipper(u)]) < 10) { for(var i = 0; i < message.length; i++) { if(message[i].charAt(0) == ':') { silencedmsg = 1; cb.sendNotice('Your message was not displayed because the graphic level has been set to only allow members who have tipped at least 10 tokens to use graphics.',msg['user'],green); } } } } case 4: if(cbjs.arrayContains(tipCountArray.name,u)) { if(parseInt(tipCountArray.amount[findTipper(u)]) < 10) { for(var i = 0; i < message.length; i++) { if(message[i].charAt(0) == ':') { silencedmsg = 1; cb.sendNotice('Your message was not displayed because the graphic level has been set to only allow members who have tipped at least 10 tokens to use graphics.',msg['user'],green); } } } } else { silencedmsg = 1; cb.sendNotice('Your message was not sent because the graphic level has been set to only allow members who have tipped at least 10 tokens to use graphics.',msg['user'],green); } break; } } // ********** Convert to lower case var caps = /[A-Z][A-Z]+/; if (!isMod && !isBC) { if (caps.test(m)) { m = m.toLowerCase(); msg['m'] = m; cb.sendNotice('Message converted to lower case, please do not type in all CAPS!',u,green); } } // ********** Suppress messages containing blocked word if (!isMod && !isBC) { if(cb.settings.enableWordList == 'Yes' && wordListArray.length > 0) { var d = msg['m']; MessageArray = d.split(' '); for (var i = 0; i < MessageArray.length; i++) { if (cbjs.arrayContains(wordListArray, MessageArray[i])) { silencedmsg = 1; cb.sendNotice('Your message was not displayed because it contains words in the blocked word list. Please refrain from rude language. You can view blocked words with the command /wordlist.',msg['user'],green); } } } } // ********** Add message prefix if needed if(cbjs.arrayContains(tipCountArray.name,msg['user']) || isMod || isFan) { if(message[0].charAt(0) != "/" && message[0].charAt(0) != "!") { grp = null; posn = 0; tipcount = 0; if(tipCountToggle == 1 && cbjs.arrayContains(tipCountArray.name,u)) { tipcount = parseInt(tipCountArray.amount[findTipper(u)]); } if (tipLeaderIconsToggle == 1 && cbjs.arrayContains(tipCountArray.name,u)) { sortTippers(); for (var i = 1; i <= tipCountArray.name.length; i++) { if(tipCountArray.name[i-1] == u) { break; } } lbposn = i; if (lbposn >= 1 && lbposn <= 3) { posn = lbposn; } } if (tipcount > 0 || posn > 0) { pfxcount = null; pfxtipleader = null; switch (posn) { case 1: pfxtipleader = cb.settings.tipLeaderGif1; break; case 2: pfxtipleader = cb.settings.tipLeaderGif2; break; case 3: pfxtipleader = cb.settings.tipLeaderGif3; break; } if (tipcount > 0) { pfxcount = '|' + tipCountArray.amount[findTipper(u)] + '| '; } msg.m = (pfxtipleader != null ? pfxtipleader + " " : "") + (pfxcount != null ? pfxcount : "") + msg.m; } } } if(silencedmsg == 1) { msg['X-Spam'] = true; } return msg; }); } // *********************************** Actions on user entering ************************************** { cb.onEnter(function(user) { // Variables var u = user.user; var isMod = user.is_mod; var isBC = (u === cb.room_slug); var isFan = user.in_fanclub; var isNotGray = user.has_tokens; if(isMod) { populateModeratorArray(u, "mod"); } if(isFan) { populateFanClubArray(u); } if(cb.limitCam_userHasAccess(u)) { if (!cbjs.arrayContains(ticketShowViewerList,u)) { ticketShowViewerList.push(u); } } // **** General Entry Message if(cb.settings.enableEntryMessage == 'Yes') { cb.sendNotice(cb.settings.entryMessage,u,green,"","bold"); } // **** Entry message if on the nice list if(cbjs.arrayContains(niceListArray,u)) { cb.sendNotice('Welcome ' + u + ', you are on the nice list, so you will still be able to chat when the silence level is elevated. Thank you for not making rude and demanding comments in your chat.',u,"","","bold"); } // **** Track Grays for Time Lock if (grayLockToggle == 1) { if (!cbjs.arrayContains(grayLockList,u)) { addToLockList(u,isBC,isMod,isFan,isNotGray); } if (grayLockStatus.canChat[grayLockList.indexOf(u)] === false) { cb.sendNotice('Welcome, gray chat is locked for the first ' + grayChatTime + ' minutes in the room, once that time expires, you will be able to chat.', u, '', '', "bold"); } } }); } // *********************************** Actions upon leaving ************************************** { cb.onLeave(function(user) { var u = user.user; }); } // *********************************** Actions upon tipping ************************************** { cb.onTip(function (tip) { var tipAmount = Number.parseInt(tip.amount, 10); var u = tip.from_user var isFan = tip.from_user_in_fanclub; var voteAmount = 1; // ***** Tip Count Array if (!cbjs.arrayContains(tipCountArray.name, u)) { populateTipCountArray(u,tipAmount); } else { tipCountArray.amount[findTipper(u)] += tipAmount; } }); } // *********************************** Initialize ************************************** { if(initialize == 0) { // *** Init Features using toggle functions if(cb.settings.enableGroupIcons == 'Yes') { groupIconsToggle = 1; } if(cb.settings.enableTipLeaderIcons == 'Yes') { tipLeaderIconsToggle = 1; } if(cb.settings.enableLeaderboard == 'Yes') { setLeaderToggle('on',cb.room_slug); } if(cb.settings.enableNotifier == 'Yes') { setNotifierToggle('on',cb.room_slug); } if(cb.settings.enableTipCount == 'Yes') { setTipCountToggle('on',cb.room_slug); } if(cb.settings.lockGrayChat == 'Yes') { setGrayLockToggle('on',cb.room_slug); } // *** Init Lists if(cb.settings.niceList != '' && cb.settings.niceList != null) { var n = cb.settings.niceList; niceListArray = n.split(','); } if(cb.settings.silenceList != '' && cb.settings.silenceList != null) { var n = cb.settings.silenceList; silenceListArray = n.split(','); } if(cb.settings.ninjaList != '' && cb.settings.ninjaList != null) { var n = cb.settings.ninjaList; ninjaListArray = n.split(','); } if(cb.settings.wordBlockList != '' && cb.settings.wordBlockList != null) { var n = cb.settings.wordBlockList; wordListArray = n.split(','); } populateModeratorArray(cb.room_slug, "bc"); cb.sendNotice('Grey users are unable to use graphics by default. If you would like grey users to be able to use graphics, type "/graphiclevel 0" to enable.', cb.room_slug, green); initialize = 1; } }
© Copyright Chaturbate 2011- 2024. All Rights Reserved.