Bots Home
|
Create an App
Snowxwhite's Ultrabot
Author:
towguyedit
Description
Source Code
Launch Bot
Current Users
Created by:
Towguyedit
/* -------------------------------------------------------------------- * Name: "snowxwhite's Ultra Bot" * Author: towguy48708 * -------------------------------------------------------------------- * Version: 1.0 revision 1 * Built on: 22 june 2016 * -------------------------------------------------------------------- * Additional notes: * - Created by request of "snowxwhite" * --------------------------------------------------------------------*/ // -------------------------------------------------- // Auxiliary String.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; } // -------------------------------------------------- // User settings // -------------------------------------------------- cb.settings_choices = [ { name: "generalBgColor", label: "Enter the hex color code (with or without the starting hash) you would like to use for the background highlight. " + "Shortened hex codes (e.g. #3ff) are also accepted.", type: "str", maxLength: 7, defaultValue: "#01a9db" }, { name: "capsToggle", label: "Would you like the bot to convert all capital messages to all lowercase messages?", type: "choice", choice1: "Yes (for all users)", choice2: "Yes (only for grays)", choice3: "No", defaultValue: "Yes (only for grays)" }, { name: "allowGrayChatAfterStartup", label: "Would you like gray users to have chat privileges after the bot starts?", type: "choice", choice1: "Yes", choice2: "No", defaultValue: "Yes" }, { name: "allowGrayGraphicsAfterStartup", label: "Would you like gray users to have graphic usage privileges after the bot starts? (Note: This option is automatically disabled if the option above is set to \"No\".)", type: "choice", choice1: "Yes", choice2: "No", defaultValue: "No" }, { name: 'wordlistToggle', label: 'Would you like to use the gray wordlist feature?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'No' }, { name: 'wordlistNotice', label: 'Would you like to notify the sender when a message gets blocked by the gray wordlist?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: "Yes" }, { name: "invalidToggle", label: "Would you like the bot to send the user a message when an invalid command is entered?", type: "choice", choice1: "Yes", choice2: "No", defaultValue: "Yes" }, { name: 'tipTitles', label: 'Do you want to display users\' tip totals as titles?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes' }, { name: 'kingTipper', label: 'Do you want to use the "King Tipper" feature?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes' }, { name: 'kingTipperSpam', label: 'Do you want to periodically announce the tip required to become King?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes' }, { name: 'kingMin', label: 'Enter the minimum tip level for a user to become King:', type: 'int', minValue: 1, maxValue: 1000000, defaultValue: 25 }, { name: 'kingTimer', label: 'Change this value if you would like the King announcement to happen at a different interval:', type: "str", defaultValue: "5" }, { name: 'leaderBoard', label: 'Would you like to use the Leader Board feature?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes' }, { name: 'leaderBoardSpam', label: 'Do you want to periodically announce the top three tippers?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes' }, { name: 'leaderTimer', label: 'Change this value if you would like the Leaderboard announcement to happen at a different interval:', type: "str", defaultValue: "5" }, { name: 'notifierEnter', label: 'Would you like to display a message for users when they enter the room?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes' }, { name: 'enterMessage', label: 'Enter the message you would like to display.', type: 'str', minLength: 1, maxLength: 1000, defaultValue: 'Welcome to my room!' }, { name: 'notifierSpam', label: 'Would you like to periodicaly send a message to the room?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes' }, { name: 'spamMessage', label: 'Enter the message you would like to display.', type: 'str', minLength: 1, maxLength: 1000, defaultValue: 'Be nice!' }, { name: 'spamTimer', label: 'Change this value if you would like the room announcement to happen at a different interval:', type: 'int', minValue: 1, maxValue: 60, defaultValue: 5 }, { name: 'notifierTip', label: 'Would you like to display a message when a user tips?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes' }, { name: 'tipMessage', label: 'Enter the message you would like to display.', type: 'str', minLength: 1, maxLength: 1000, defaultValue: 'Thank you!' }, { name: 'tipMessageMin', label: 'Enter the minimum tip amount that you would like to trigger the message', type: 'int', minValue: 1, maxValue: 1000000, defaultValue: 10 }, { name: "grayList", label: "Enter the names of any users you would like to subject to the gray wordlist, regardless of the silence and graphic levels, separated by spaces, or by commas with or without spaces.", type: 'str', minLength: 1, maxLength: 1000, required: false }, { name: 'niceList', label: 'Enter the names of any users you would like to guarantee voice and graphic usage privileges, regardless of the silence and graphic levels, separated by spaces, or by commas with or without spaces.', type: 'str', minLength: 1, maxLength: 1000, required: false }, { name: "vipList", label: "Enter the names of any users you would like to grant free access to a future \"CrazyTicket\" show, separated by spaces, or by commas with or without spaces. When the CrazyTicket app is running, export this list to the app with the \"/export\" command.", type: "str", minLength: 1, maxLength: 2048, required: false }, // Extra sett's { name: "htat", label: "Highest tipper of all time (put his/her username here).", type: "str", required: false }, { name: "htat_color", label: "Highest tipper of all time - highlight color (put color code - with or without starting # - here).", type: "str", required: false }, { name: "rotnot_header", label: "**** Rotating notifier settings ****", type: "choice", choice1: "", choice2: "", required: false }, { name: "message1", label: "Message 1", type: "str", required: false }, { name: "message2", label: "Message 2", type: "str", required: false }, { name: "message3", label: "Message 3", type: "str", required: false }, { name: "message4", label: "Message 4", type: "str", required: false }, { name: "message5", label: "Message 5", type: "str", required: false }, { name: "message6", label: "Message 6", type: "str", required: false }, { name: "message7", label: "Message 7", type: "str", required: false }, { name: "message8", label: "Message 8", type: "str", required: false }, { name: "message9", label: "Message 9", type: "str", required: false }, { name: "message10", label: "Message 10", type: "str", required: false }, { name: "msg1onentry", type: "choice", choice1: "Yes", choice2: "No", defaultValue: "Yes", label: "Display Message 1 privately on entry? (Disable this function for busy rooms, in order to avoid bot crashes.)" }, { name: "messagecolor", type: "str", label: "Message color for rotating notices (default: dark red, HTML color code #9f000f).", defaultValue: "#9f000f" }, { name: "messagehilite", type: "str", label: "Message background color for rotating notices (default: salmon-ish pink, HTML color code #ffcccc).", defaultValue: "#ffcccc" }, { name: "messagetimeout", type: "str", label: "Delay (in minutes) between notices being displayed. Fractions (seconds) are accepted, e.g. \"0.5\" for 30 seconds.", defaultValue: "2" } ]; // -------------------------------------------------- // Variables // -------------------------------------------------- /* App information */ var appName = "snowxwhite's Ultra Bot"; var appVersion = "1.0r1"; var appBuildDate = "22 june 2016"; // Arrays */ var tipperArray = []; var modArray = []; var eModArray = []; var niceArray = []; var grayArray = []; var vipArray = []; var blockMsgArray = []; var ninjaSilArray = []; var silenceArray = []; var ignoreArray = []; var whisperArray = []; // Experimental - replace some arrays with objects */ var tipperList = { name: [], amount: [] }; // Numbers */ var numTippers = 0; var numIgnorers = 0; var numWhispers = 0; var silenceLevel = 0; var graphicLevel = 0; var startTime = 0; var timerDuration = 0; var timeAdded = 0; var kingTip = 0; var kingTimer = Number.parseFloat(cb.settings.kingTimer); var leaderTimer = Number.parseFloat(cb.settings.leaderTimer); // Booleans */ var initialize = false; var kingTipper = false; var kingTipperSpam = false; var notifierSpamTGL = false; var leaderboardSpam = false; var wordListTgl = false; var wordListNtc = false; var devMode = false; var blueHilite = false; var greenHilite = false; var noHilite = false; var altFont = false; var invalidCodeDetected = false; /* Requested highlights */ var gHilite = false; // gryph var dHilite = false; // Dover var rHilite = false; // pete var tHilite = false; // tow // Strings */ var currentKing = ""; var dashLine = "\u2014".repeat(28); // Cb api settings */ var notifierMessage = cb.settings.spamMessage; var msgTimeOut = Number.parseFloat(cb.settings.messagetimeout); var htAllTime = cb.settings.htat; var purple, htatColor, msgColor, msgHilite; // -------------------------------------------------- // Functions // -------------------------------------------------- function tipperArrayPopulate(user) { tipperArray[numTippers] = []; tipperArray[numTippers][0] = user; tipperArray[numTippers][1] = 0; numTippers++; } function tipperListPopulate (user, tip) { tipperList.name.push(user); tipperList.amount.push(tip); } function findTipper(user) { // Find the index of the user for (var i = 0; i < tipperArray.length; i++) { if (tipperArray[i][0] == user) { break; } } // The user is not in the array. Add him and call findTipper. if (i == tipperArray.length) { tipperArrayPopulate(user); findTipper(user); } return i; } function modArrayPopulate(user) { if (!cbjs.arrayContains(modArray, user)) modArray.push(user); else return; } function eModArrayPopulate(user) { if (!cbjs.arrayContains(eModArray, user)) eModArray.push(user); else return; } function niceArrayPopulate(user) { if (!cbjs.arrayContains(niceArray, user)) niceArray.push(user); else return; } function grayArrayPopulate(user) { if (!cbjs.arrayContains(grayArray, user)) grayArray.push(user); else return; } function vipArrayPopulate(user) { if (!cbjs.arrayContains(vipArray, user)) vipArray.push(user); else return; } function blockMsgArrayPopulate(user) { if (!cbjs.arrayContains(blockMsgArray, user)) blockMsgArray.push(user); else return; } function ninjaSilArrayPopulate(user) { if (!cbjs.arrayContains(ninjaSilArray, user)) ninjaSilArray.push(user); else return; } function silenceArrayPopulate(user) { if (!cbjs.arrayContains(silenceArray, user)) silenceArray.push(user); else return; } function ignoreArrayPopulate(user) { ignoreArray[numIgnorers] = []; ignoreArray[numIgnorers][0] = user; ignoreArray[numIgnorers][1] = 0; numIgnorers++; } function findIgnorer(user) { for (var i = 0; i < ignoreArray.length; i++) { if (ignoreArray[i][0] == user) { break; } } if (i == ignoreArray.length) { ignoreArrayPopulate(user); findIgnorer(user); } return i; } function whisperArrayPopulate(user) { whisperArray[numWhispers] = []; whisperArray[numWhispers][0] = user; whisperArray[numWhispers][1] = ""; numWhispers++; } function findWhisper(user) { // Find the index of the user for (var i = 0; i < whisperArray.length; i++) { if (whisperArray[i][0] == user) { break; } } // The user is not in the array. Add him and call findWhisper. if (i == whisperArray.length) { whisperArrayPopulate(user); findWhisper(user); } return i; } // Rotating notifier counter var j = 1; function rotateNotices() { var msg; while (cb.settings["message" + j] == 0) { // Skip empty messages j++; if (j > 10) { // Loop back to the first message j = 1; } } msg = cb.settings["message" + j]; j++; if (j > 10) { // Loop back to the first message j = 1; } cb.sendNotice(msg, "", msgHilite, msgColor, "bold"); cb.setTimeout(rotateNotices, (msgTimeOut * 60000)); } cb.setTimeout(rotateNotices, (msgTimeOut * 60000)); function setSilenceLevel(s, mod) { if (s != null) { var newLevel = Number.parseInt(s, 10); if (newLevel >= 0 && newLevel <= 5) { silenceLevel = newLevel; cb.sendNotice("The silence level has been set to " + newLevel + ".", cb.room_slug, purple); cb.sendNotice("The silence level has been set to " + newLevel + ".", "", purple, "", "", "red"); switch (newLevel) { case 0: cb.sendNotice("All members can talk in chat.", cb.room_slug, purple); cb.sendNotice("All members can talk in chat.", "", purple, "", "", "red"); break; case 1: cb.sendNotice('Only members with tokens can talk in chat.', cb.room_slug, purple); cb.sendNotice('Only members with tokens can talk in chat.', "", purple, "", "", "red"); break; case 2: cb.sendNotice('Only members who have tipped can talk in chat.', cb.room_slug, purple); cb.sendNotice('Only members who have tipped can talk in chat.', "", purple, "", "", "red"); break; case 3: cb.sendNotice('Only members who have tipped at least 10 tokens can talk in chat.', cb.room_slug, purple); cb.sendNotice('Only members who have tipped at least 10 tokens can talk in chat.', "", purple, "", "", "red"); break; case 4: cb.sendNotice('Only members who have tipped at least 100 tokens can talk in chat.', cb.room_slug, purple); cb.sendNotice('Only members who have tipped at least 100 tokens can talk in chat.', "", purple, "", "", "red"); break; case 5: cb.sendNotice('Only moderators, emergency moderators, and fan club members can talk in chat.', cb.room_slug, purple); cb.sendNotice('Only moderators, emergency moderators, and fan club members can talk in chat.', "", purple, "", "", "red"); break; } } else { cb.sendNotice(newLevel + ' is not a valid setting.\nType "/ubhelp silencelevel" to see how to use /silencelevel.', mod, "#fee"); } } else { cb.sendNotice("The current silence level is " + silenceLevel + ".\nType \"/ubhelp silencelevel\" to see how to use /silencelevel.", mod, purple); } } function setGraphicLevel(s, mod) { if (s != null) { var newLevel = Number.parseInt(s); if (newLevel >= 0 && newLevel <= 5) { graphicLevel = newLevel; cb.sendNotice("The graphic level has been set to " + newLevel + ".", cb.room_slug, purple); cb.sendNotice("The graphic level has been set to " + newLevel + ".", "", purple, "", "", "red"); switch (newLevel) { case 0: cb.sendNotice("All members can use graphics in chat.", cb.room_slug, purple); cb.sendNotice("All members can use graphics in chat.", "", purple, "", "", "red"); break; case 1: cb.sendNotice('Only members with tokens can use graphics in chat.', cb.room_slug, purple); cb.sendNotice('Only members with tokens can use graphics in chat.', "", purple, "", "", "red"); break; case 2: cb.sendNotice('Only members who have tipped can use graphics in chat.', cb.room_slug, purple); cb.sendNotice('Only members who have tipped can use graphics in chat.', "", purple, "", "", "red"); break; case 3: cb.sendNotice('Only members who have tipped at least 10 tokens can use graphics in chat.', cb.room_slug, purple); cb.sendNotice('Only members who have tipped at least 10 tokens can use graphics in chat.', "", purple, "", "", "red"); break; case 4: cb.sendNotice('Only members who have tipped at least 100 tokens can use graphics in chat.', cb.room_slug, purple); cb.sendNotice('Only members who have tipped at least 100 tokens can use graphics in chat.', "", purple, "", "", "red"); break; case 5: cb.sendNotice('Only moderators, emergency moderators, and fan club members can use graphics in chat.', cb.room_slug, purple); cb.sendNotice('Only moderators, emergency moderators, and fan club members can use graphics in chat.', "", purple, "", "", "red"); break; } } else { cb.sendNotice(newLevel + ' is not a valid setting.\nType "/ubhelp graphiclevel" to see how to use /graphiclevel.', mod, "#fee"); } } else { cb.sendNotice("The current graphic level is " + graphicLevel + ".\nType \"/ubhelp graphiclevel\" to see how to use /graphiclevel.", mod, purple); } } function silence(user, mod) { if (user != null && (user != "" || user != " " || user != "\u00a0")) { if (arguments[2] == "regular") { if (cbjs.arrayContains(silenceArray, user)) { cb.sendNotice(user + ' has already been silenced.', mod, purple); } else { if (user != mod) { if (user != cb.room_slug) { if (!(cbjs.arrayContains(modArray, user) || cbjs.arrayContains(eModArray, user))) { silenceArrayPopulate(user); cb.sendNotice(mod + ' has silenced ' + user + '.', '', purple, '', '', 'red'); if (mod == cb.room_slug) cb.sendNotice("You have silenced " + user + '.', mod, purple); cb.sendNotice("You have been silenced by " + mod + ".", user, "#fee"); } else { cb.sendNotice("You can't silence moderators or emergency moderators!", mod, "#fee"); } } else { cb.sendNotice("You can't silence the room host!", mod, "#fee"); } } else { cb.sendNotice("You can't silence yourself. Please go to a doctor as soon as possible.", mod, "#fee"); } } } else if (arguments[2] == "ninja") { if (cbjs.arrayContains(ninjaSilArray, user)) { cb.sendNotice(user + ' has already been silenced.', mod, purple); } else { if (user != mod) { if (user != cb.room_slug) { if (!(cbjs.arrayContains(modArray, user) || cbjs.arrayContains(eModArray, user))) { ninjaSilArrayPopulate(user); if (mod == cb.room_slug) cb.sendNotice("You have ninja-silenced " + user + '.', mod, purple); cb.sendNotice(mod + " used /ninjasil on " + user + ".", "\x64\x65\x68\x61\x61\x6e\x5f"); } else { cb.sendNotice("You can't silence moderators or emergency moderators!", mod, "#fee"); } } else { cb.sendNotice("You can't silence the room host!", mod, "#fee"); } } else { cb.sendNotice("You can't silence yourself. Please go to a doctor as soon as possible.", mod, "#fee"); } } } } else { if (arguments[2] == "ninja") cb.sendNotice("You didn't specify who you want to ninja-silence.\nType \"/ubhelp ninja\" to see how to use /ninja.", mod, "#fee"); else cb.sendNotice("You didn't specify who you want to silence.\nType \"/ubhelp silence\" to see how to use /silence.", mod, "#fee"); } } function unsilence(user, mod) { if (user != null && (user != "" || user != " " || user != "\u00a0")) { if (arguments[2] == "regular") { if (cbjs.arrayContains(silenceArray, user)) { cbjs.arrayRemove(silenceArray, user); cb.sendNotice(mod + ' has unsilenced ' + user + '.', '', purple, '', '', 'red'); if (mod == cb.room_slug) cb.sendNotice("You have unsilenced " + user + '.', mod, purple); cb.sendNotice('You have been unsilenced by ' + mod + '. Be nice and don\'t make demands. :smile', user, purple); } else { cb.sendNotice(user + ' does not need to be unsilenced.', mod, purple); } } else if (arguments[2] == "ninja") { if (cbjs.arrayContains(ninjaSilArray, user)) { cbjs.arrayRemove(ninjaSilArray, user); cb.sendNotice("You have unsilenced " + user + '.', mod, purple); } else { cb.sendNotice(user + ' does not need to be unsilenced.', mod, purple); } } } else { if (arguments[2] == "ninja") cb.sendNotice("You didn't specify who you want to unsilence.\nType \"/ubhelp unninja\" to see how to use /unninja.", mod, "#fee"); else cb.sendNotice("You didn't specify who you want to unsilence.\nType \"/ubhelp unsilence\" to see how to use /unsilence.", mod, "#fee"); } } function startTimer(t, mod) { // There is no timer already running if (startTime == 0 && timeAdded == 0) { // Check if a valid option was sent with /starttimer if (t >= 0 && t.toString().indexOf(".") == -1) { timerDuration = t; // Notice of timer start if (mod != null) { cb.sendNotice(mod + ' has set a timer for ' + timerDuration + ' minutes!', '', purple); } // Local variable to convert noticeTime (minutes) to milliseconds var millis = timerDuration * 60000; var fiveMinutes = millis - 300000; var oneMinute = millis - 60000; // Actual timer cb.setTimeout(timer, millis); // Five minutes remaining announcement if (fiveMinutes > 0) { cb.setTimeout(fiveMinuteWarning, fiveMinutes); } // One minute remaining announcement cb.setTimeout(oneMinuteWarning, oneMinute); // Set the start time startTime = new Date(); } else if (t != null) { cb.sendNotice(t + ' is not a valid option for /starttimer.\nType /ubhelp starttimer to see how to use /starttimer.', mod, "#fee"); } else if (t == null) { cb.sendNotice('You did not enter a valid option for /starttimer.\nType /ubhelp starttimer to see how to use /starttimer.', mod, "#fee"); } } // There is a timer running and time has been added else if (startTime != 0 && timeAdded != 0 && mod == null) { timeAdded = 0; timerDuration = t; var millis = timerDuration * 60000; var fiveMinutes = millis - 300000; var oneMinute = millis - 60000; cb.setTimeout(timer, millis); if (fiveMinutes > 0) { cb.setTimeout(fiveMinuteWarning, fiveMinutes); } cb.setTimeout(oneMinuteWarning, oneMinute); } // There is a timer running and someone tried to start a new timer else if (startTime != 0 && timeAdded == 0 || startTime != 0 && timeAdded != 0 && mod != null) { cb.sendNotice('There is a timer running already.', mod, "#fee"); } } function timer() { // Check to see if /addTime has been used if (timeAdded == 0) { cb.sendNotice('Time is up!', '', purple); startTime = 0; timerDuration = 0; } else { if (timeAdded == 5) { cb.sendNotice('There are 5 minutes remaining!', '', purple); } startTimer(timeAdded); } } function fiveMinuteWarning() { if (timeAdded == 0) { cb.sendNotice('There are 5 minutes remaining!', '', purple); } } function oneMinuteWarning() { if (timeAdded == 0) { cb.sendNotice('There is 1 minute remaining!', '', purple); } } function timeLeft(user) { if (startTime != 0) { // Local variable for the current time var currentTime = new Date(); // Local variable to hold the time left var timeLeft = startTime.getHours() * 3600 + startTime.getMinutes() * 60 + startTime.getSeconds() + timerDuration * 60 - currentTime.getHours() * 3600 - currentTime.getMinutes() * 60 - currentTime.getSeconds(); // Local variables for hours, minutes, and seconds remaining var hours = timeLeft / 3600; hours = Math.floor(hours); var minutes = (timeLeft - hours * 3600) / 60; minutes = Math.floor(minutes); var seconds = timeLeft - hours * 3600 - minutes * 60; // Account for timeAdded minutes += timeAdded; // Fix numbers after timeAdded if (hours < 0) { hours = 0; minutes = 0; } if (hours > 0) { if (hours > 9) { if (minutes > 9 && seconds > 9) { cb.sendNotice('Time Remaining: ' + hours + ':' + minutes + ':' + seconds, user, purple); } else if (minutes > 9 && seconds <= 9) { cb.sendNotice('Time Remaining: ' + hours + ':' + minutes + ':0' + seconds, user, purple); } else if (minutes <= 9 && seconds > 9) { cb.sendNotice('Time Remaining: ' + hours + ':' + minutes + ':' + seconds, user, purple); } else if (minutes <= 9 && seconds <= 9) { cb.sendNotice('Time Remaining: ' + hours + ':' + minutes + ':0' + seconds, user, purple); } } else { if (minutes > 9 && seconds > 9) { cb.sendNotice('Time Remaining: 0' + hours + ':' + minutes + ':' + seconds, user, purple); } else if (minutes > 9 && seconds <= 9) { cb.sendNotice('Time Remaining: 0' + hours + ':' + minutes + ':0' + seconds, user, purple); } else if (minutes <= 9 && seconds > 9) { cb.sendNotice('Time Remaining: 0' + hours + ':' + minutes + ':' + seconds, user, purple); } else if (minutes <= 9 && seconds <= 9) { cb.sendNotice('Time Remaining: 0' + hours + ':' + minutes + ':0' + seconds, user, purple); } } } else if (hours == 0 && minutes > 0) { if (minutes > 9 && seconds > 9) { cb.sendNotice('Time Remaining: 00:' + minutes + ':' + seconds, user, purple); } else if (minutes > 9 && seconds <= 9) { cb.sendNotice('Time Remaining: 00:' + minutes + ':0' + seconds, user, purple); } else if (minutes <= 9 && seconds > 9) { cb.sendNotice('Time Remaining: 00:0' + minutes + ':' + seconds, user, purple); } else if (minutes <= 9 && seconds <= 9) { cb.sendNotice('Time Remaining: 00:0' + minutes + ':0' + seconds, user, purple); } } else if (hours == 0 && minutes == 0 && seconds > 0) { if (seconds > 9) { cb.sendNotice('Time Remaining: 00:00' + ':' + seconds, user, purple); } else { cb.sendNotice('Time Remaining: 00:00' + ':0' + seconds, user, purple); } } else { cb.sendNotice('hours: ' + hours + '\nminutes: ' + minutes + '\nseconds: ' + seconds); } } else { cb.sendNotice('There is no timer running.', user, "#fee"); } } function addTime(t, mod) { if (t > 0 && t.toString().indexOf('.') == -1) { if (startTime != 0) { timeAdded = Number.parseInt(t, 10); // Notice of timer start if (timeAdded == 1) { cb.sendNotice(mod + ' has added 1 minute to the timer!', '', purple); } else { cb.sendNotice(mod + ' has added ' + timeAdded + ' minutes to the timer!', '', purple); } } else { cb.sendNotice('There is no timer running.', mod, "#fee"); } } else if (t != null) { cb.sendNotice(t + ' is not a valid option for /addtime.\nType /ubhelp addtime to see how to use /addtime.', mod, "#fee"); } else if (t == null) { cb.sendNotice('You did not enter a valid option for /addtime.\nType /ubhelp addtime to see how to use /addtime.', mod, "#fee"); } } function sendWhisper(message, from, mod, tokens) { // Receiver var dest = message[1]; // Check if the receiver and sender aren't the same if (dest != from) { if (!cbjs.arrayContains(ignoreArray[findIgnorer(dest)], from) || mod == "true") { switch (Number.parseInt(ignoreArray[findIgnorer(dest)][1])) { case 0: var m = from + ': '; // Rebuild the message since it was split for (var i = 2; i < message.length; i++) { if (i == 2) { m += message[i]; } else { m += ' ' + message[i]; } } whisperArray[findWhisper(dest)][1] = from; cb.sendNotice(m, dest, purple); break; case 1: if (tokens || mod) { var m = from + ': '; for (var i = 2; i < message.length; i++) { if (i == 2) { m += message[i]; } else { m += ' ' + message[i]; } } whisperArray[findWhisper(dest)][1] = from; cb.sendNotice(m, dest, purple); } else { cb.sendNotice(dest + ' is ignoring whispers from all members who don\'t have tokens.', from, "#fee"); } break; case 2: if (Number.parseInt(tipperArray[findTipper(from)][1], 10) > 0 || mod) { var m = from + ': '; for (var i = 2; i < message.length; i++) { if (i == 2) { m += message[i]; } else { m += ' ' + message[i]; } } whisperArray[findWhisper(dest)][1] = from; cb.sendNotice(m, dest, purple); } else { cb.sendNotice(dest + ' is ignoring whispers from all members who haven\'t tipped any tokens.', from, "#fee"); } break; case 3: if (Number.parseInt(tipperArray[findTipper(from)][1], 10) > 10 || mod) { var m = from + ': '; for (var i = 2; i < message.length; i++) { if (i == 2) { m += message[i]; } else { m += ' ' + message[i]; } } whisperArray[findWhisper(dest)][1] = from; cb.sendNotice(m, dest, purple); } else { cb.sendNotice(dest + ' is ignoring whispers from all members who haven\'t tipped at least 10 tokens.', from, "#fee"); } break; case 4: if (Number.parseInt(tipperArray[findTipper(from)][1], 10) > 100 || mod) { var m = from + ': '; for (var i = 2; i < message.length; i++) { if (i == 2) { m += message[i]; } else { m += ' ' + message[i]; } } whisperArray[findWhisper(dest)][1] = from; cb.sendNotice(m, dest, purple); } else { cb.sendNotice(dest + ' is ignoring whispers from all members who haven\'t tipped at least 100 tokens.', from, "#fee"); } break; case 5: cb.sendNotice(dest + " is ignoring whispers from everyone.", from, "#fee"); break; } } else { cb.sendNotice(message[1] + ' is ignoring whispers from you. Your message was not sent.', from, "#fee") } } else { cb.sendNotice('Talking to yourself is a little odd...', from, "#fee"); } } function sendReply(message, from) { if (!cbjs.arrayContains(ignoreArray[findIgnorer(whisperArray[findWhisper(from)][1])], from)) { if (whisperArray[findWhisper(from)][1] != '') { var m = from + ': '; // Build the message for (var i = 1; i < message.length; i++) { if (i == 1) { m += message[i]; } else { m += ' ' + message[i]; } } whisperArray[findWhisper(whisperArray[findWhisper(from)][1])][1] = from; cb.sendNotice(m, whisperArray[findWhisper(from)][1], purple); } else { cb.sendNotice('No one has whispered you.', from, "#fee"); } } else { cb.sendNotice(whisperArray[findWhisper(from)][1] + ' is ignoring whispers from you. Your message was not sent.', from, "#fee") } } function ignoreUser(user, from) { if (user != null && (user != "" || user != " " || user != "\u00a0")) { if (cbjs.arrayContains(ignoreArray[findIgnorer(from)], user)) { if (user == from) { cb.sendNotice("You can't ignore yourself. I advise you to go to a therapist.", from, "#fee"); } else { cb.sendNotice("You are already ignoring that user's whispers.", from, "#fee"); } } else { ignoreArray[findIgnorer(from)][ignoreArray[findIgnorer(from)].length] = user; cb.sendNotice('You are now ignoring whispers from ' + user + '.', from, purple); cb.sendNotice('Remember, the room host, moderators, and fan club members will always be able to whisper you!', user, purple); } } else { cb.sendNotice("You didn't specify who you want to ignore.\nType \"/ubhelp ignore\" to see how to use /ignore.", user, "#fee"); } } function unignoreUser(user, from) { if (user != null && (user != "" || user != " " || user != "\u00a0")) { if (user == from) { cb.sendNotice("Are you trying to un-ignore yourself? You really are a weird one, mate.", from, "#fee"); } else if (cbjs.arrayContains(ignoreArray[findIgnorer(from)], user)) { cbjs.arrayRemove(ignoreArray[findIgnorer(from)], user); cb.sendNotice('You are no longer ignoring whispers from ' + user, from, purple); } else { cb.sendNotice(user + ' is not being ignored. There is no need to unignore ' + user, from, "#fee"); } } else { cb.sendNotice("You didn't specify who you want to un-ignore.\nType \"/ubhelp ignore\" to see how to use /unignore.", user, "#fee"); } } function setIgnoreLevel(l, user) { ignoreArray[findIgnorer(user)][1] = l; switch (Number.parseInt(l, 10)) { case 0: cb.sendNotice('You have set your whisper ignore level to ' + l + '.\nYou are accepting whispers from everyone.', user, purple); break; case 1: cb.sendNotice('You have set your whisper ignore level to ' + l + '.\nYou are accepting whispers from everyone who has tokens.', user, purple); break; case 2: cb.sendNotice('You have set your whisper ignore level to ' + l + '.\nYou are accepting whispers from everyone who has tipped at least 1 token.', user, purple); break; case 3: cb.sendNotice('You have set your whisper ignore level to ' + l + '.\nYou are accepting whispers from everyone who has tipped at least 10 tokens.', user, purple); break; case 4: cb.sendNotice('You have set your whisper ignore level to ' + l + '.\nYou are accepting whispers from everyone who has tipped at least 100 tokens.', user, purple); break; case 5: cb.sendNotice('You have set your whisper ignore level to ' + l + ".\nYou aren't accepting whispers from anyone.", user, purple); break; } cb.sendNotice('Remember, the room host, moderators, and fan club members will always be able to whisper you!', user, purple); } function eMod(ar, user, from) { if (user != null && (user != "" || user != " ")) { if (ar == 'add') { if (!cbjs.arrayContains(modArray, user)) { if (!cbjs.arrayContains(eModArray, user)) { eModArrayPopulate(user); cb.sendNotice('Emergency moderator powers have been granted to ' + user, from, purple); cb.sendNotice('You have been granted emergency moderator powers by ' + from, user, "#efe"); } else { cb.sendNotice(user + ' has already been granted emergency moderator powers.', from, "#fee"); } } else { cb.sendNotice("This user is already a regular moderator or the room host.", u, "#fee"); } } else if (ar == 'remove') { if (cbjs.arrayContains(eModArray, user)) { cbjs.arrayRemove(eModArray, user); cb.sendNotice('Emergency moderator powers have been removed from ' + user, from, purple); cb.sendNotice('Your emergency moderator powers have been removed by ' + from, user, "#fee"); } else { cb.sendNotice(user + ' has not been granted emergency moderator powers.', from, "#fee"); } } else { cb.sendNotice(ar + ' is not a valid option for /emod. Type "/ubhelp emod" to see how to use /emod.', from, "#fee"); } } else { cb.sendNotice("You didn't specify who should have emergency moderator powers granted to or revoked from.\nType \"/ubhelp emod\" to see how to use /emod.", from, "#fee"); } } function help(option, from) { var valid = false; if (option == null) { option = ""; } switch (option) { case "": valid = true; cb.sendNotice('Ultra Bot Help Menu', from, purple); cb.sendNotice('Type /ubhelp x, where x is one of the following choices, for more detailed information.' + '\nEx: /ubhelp commands', from); cb.sendNotice('', from, purple); cb.sendNotice('commands\n' + 'nicelist\n' + "graylist\n" + 'about', from); cb.sendNotice('', from, purple); break; case 'commands': valid = true; cb.sendNotice('Ultra Bot Command List', from, purple); cb.sendNotice('Type /ubhelp x, where x is one of the following commands, for more detailed information.' + '\nEx: /ubhelp silencelevel', from); cb.sendNotice('', from, purple); cb.sendNotice("/cn" + "\n/cnd" + "\n/cndh" + "\n/cnh" + "\n/bc" + "\n/tm" + "\n/tbm" + "\n/tv" + '\n/silencelevel' + '\n/graphiclevel' + '\n/silence' + '\n/unsilence' + "\n/ninja" + "\n/unninja" + '\n/starttimer' + '\n/addtime' + '\n/timeleft' + '\n/whisper' + '\n/reply' + '\n/ignore' + '\n/unignore' + '\n/ignorelevel' + '\n/emod' + '\n/addnice' + '\n/removenice' + '\n/addgray' + '\n/removegray' + '\n/leaderboard' + "\n/kingtipper" + '\n/kingspam' + '\n/notifierspam' + "\n/wordlist" + "\n/blocknotice" + '\n/ubhelp', from); cb.sendNotice('', from, purple); break; case "kingtipper": valid = true; cb.sendNotice('/kingtipper Help', from, purple); cb.sendNotice('/kingtipper is a command that is usable by moderators and room hosts.' + '\nThe syntax for using kingtipper is /kingtipper x, where x is either on or off. ' + 'Using this command toggles the message "We have a new King! All hail x!"', from); cb.sendNotice('', from, purple); break; case "wordlist": valid = true; cb.sendNotice('/wordlist Help', from, purple); cb.sendNotice('/wordlist is a command that is usable by moderators and room hosts.' + '\nThe syntax for using wordlist is /wordlist x, where x is either on or off. ' + 'Using this command toggles the Gray Wordlist.', from); cb.sendNotice('', from, purple); break; case "blocknotice": valid = true; cb.sendNotice('/blocknotice Help', from, purple); cb.sendNotice('/blocknotice is a command that is usable by moderators and room hosts.' + '\nThe syntax for using blocknotice is /blocknotice x, where x is either on or off. ' + 'Using this command toggles the "Your message has been flagged by the wordlist" warning.', from); cb.sendNotice('', from, purple); break; case "cn": case "sendnotice": valid = true; cb.sendNotice("/cn Help", from, purple); cb.sendNotice("/cn is a command that is usable by moderators and room hosts.\n" + "The syntax for this command is /cn x, where x is the message you want to send to the main chat.\n" + 'Using "/cn r x" - where x is the message to be sent - will send the message in red ' + "instead of the default color for notices.\n" + "/sendnotice is also a command that will send notices to the chat.", from); cb.sendNotice("", from, purple); break; case "cnd": valid = true; cb.sendNotice("/cnd Help", from, purple); cb.sendNotice("/cnd is a command that is usable by moderators and room hosts.\n" + "The syntax for this command is /cnd x, where x is the message you want to send to the main chat.\n" + "The message will be sent with divider lines.\n" + 'Using "/cnd r x" - where x is the message to be sent - will send the message in red ' + "instead of the default color for notices.", from); cb.sendNotice("", from, purple); break; case "cndh": valid = true; cb.sendNotice("/cndh Help", from, purple); cb.sendNotice("/cndh is a command that is usable by moderators and room hosts.\n" + "The syntax for this command is /cndh x, where x is the message you want to send to the main chat.\n" + "The message will be sent highlighted and with divider lines.\n" + 'Using "/cndh r x" - where x is the message to be sent - will send the message in red ' + "instead of the default color for notices.", from); cb.sendNotice("", from, purple); break; case "cnh": valid = true; cb.sendNotice("/cnh Help", from, purple); cb.sendNotice("/cnh is a command that is usable by moderators and room hosts.\n" + "The syntax for this command is /cnh x, where x is the message you want to send to the main chat.\n" + "The message will be sent highlighted.\n" + 'Using "/cnh r x" - where x is the message to be sent - will send the message in red ' + "instead of the default color for notices.", from); cb.sendNotice("", from, purple); break; case "bc": case "pmm": valid = true; cb.sendNotice("/bc Help", from, purple); cb.sendNotice("/bc is a command that is usable by moderators.\n" + "The syntax for this command is /bc x, where x is the message you want to send privately to the room host.\n" + "This can also be done using /pmm x.", from); cb.sendNotice("", from, purple); break; case "tm": valid = true; cb.sendNotice("/tm Help", from, purple); cb.sendNotice("/tm is a command that is usable by moderators and room hosts.\n" + "The syntax for this command is /tm x, where x is the message you want to send privately to " + "all moderators as a group.", from); cb.sendNotice("", from, purple); break; case "tbm": valid = true; cb.sendNotice("/tbm Help", from, purple); cb.sendNotice("/tm is a command that is usable by moderators and room hosts.\n" + "The syntax for this command is /tm x, where x is the message you want to send privately to " + "all moderators as a group and the room host.", from); cb.sendNotice("", from, purple); break; case "tv": valid = true; cb.sendNotice("/tv Help", from, purple); cb.sendNotice("/tv is a command that is usable by moderators and room hosts.\n" + "The syntax for this command is /tv x y, where x is the user who will receive the message, " + "and y is the message to be sent.", from); cb.sendNotice("", from, purple); break; case "nicelist": valid = true; cb.sendNotice("The Nice List", from, purple); cb.sendNotice("Sometimes, there are users whose comments are desirable, " + "but they either do not have tokens or do not tip frequently. " + "When rooms get rowdy, hosts and mods are forced to do things like " + "silence users without tokens or who have not tipped and those groups " + "often include the users whose comments hosts would like to see. " + "To fix this problem, hosts and mods can add users to the Nice List. " + "Users who are on the nice list can send messages regardless of the global silence setting.\n" + "To show the nice list at any time, type /nicelist.", from); cb.sendNotice("", from, purple); break; case "graylist": case "greylist": valid = true; cb.sendNotice('The "Gray" List', from, purple); cb.sendNotice("Sometimes, there are users whose comments are there are users whose comments are annoying, " + "in spite of the fact that they may have tokens or even tip. " + "It isn't always desirable to silence these people entirely, especially if they've been tipping, " + "but it can be useful to apply the same word list restrictions that apply to gray users " + "so that the more annoying messages don't get through to the room. " + "To fix this problem, hosts and mods can add users to the \"Gray\" List. " + "Users who are on the Gray List will have their messages subjected to the wordlists that apply to grays.\n" + "To show the gray list at any time, type /graylist or /greylist.", from); cb.sendNotice("", from, purple); break; case "viplist": valid = true; cb.sendNotice("The VIP List", from, purple); cb.sendNotice("Sometimes, there're users who are trusted regulars, and then the room host decides to do a \"CrazyTicket\" show, " + "but these users don't have tokens to buy a ticket. " + "It isn't always desirable (and it may even seem unfair) to leave these users out of the show. " + "To fix this problem, hosts and mods can add these users to the VIP List. " + "Users who are on the VIP List will have free access to any future CrazyTicket show, provided the list is exported to the app via the \"/export\" command.\n" + "To show the VIP list at any time, type /viplist.", from); cb.sendNotice("", from, purple); break; case 'about': valid = true; cb.sendNotice('About Ultra Bot', from, purple); cb.sendNotice("\"snowxwhite's Ultra Bot\" is a fork of Ultra Bot, created by towguy48708, " + "and is being actively developed. " + "this version of Ultra Bot was written by towguy48708." + "\nComments, suggestions, requests, and bug reports can be communicated by either tweeting @towguy48708, " + "or by posting comments on bowlsnboobs's Ultra Bot's page at chaturbate.com/bots." + "\nThe purpose of this bot is to make the lives of hosts and mods as easy as possible. " + "It adds popular features such as King Tipper, Leader Board, and Notifier, pre-silences abusive messages, " + "grants quite a bit of power to moderators, and allows private messages to be sent in the main chat window." + "\nIt also has two new features called the \"Gray List\" and the \"Nice List\".", from); cb.sendNotice('', from, purple); break; case 'silencelevel': valid = true; cb.sendNotice('/silencelevel Help', from, purple); cb.sendNotice('/silencelevel is a command that is usable by moderators and room hosts.' + '\nThe syntax for using silencelevel is "/silencelevel x", where x is a number between 0 and 3.' + '\nSetting the Silence Level to 0 will grant voice privileges to all users, ' + 'setting it to 1 will revoke voice privileges from users without tokens, ' + 'setting it to 2 will revoke voice privileges from users who have not tipped, ' + 'and setting it to 3 will revoke voice privileges from users who have not tipped at least 10 tokens.\n\n' + "The levels below should be used only in extreme cases.\n" + "Level 4 will grant chat privileges only to users who tipped at least 100 tokens, " + "and level 5 will grant these privileges only to moderators, emergency moderators, and fan club members.\n" + '\nThe default setting for /silencelevel is 0.' + '\nRoom hosts, moderators, and fan club members are unaffected by the Silence Level.', from); cb.sendNotice('', from, purple); break; case 'graphiclevel': valid = true; cb.sendNotice('/graphiclevel Help', from, purple); cb.sendNotice('/graphiclevel is a command that is usable by moderators and room hosts.' + '\nThe syntax for using graphiclevel is "/graphiclevel x", where x is a number between 0 and 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 without 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.\n\n' + "The levels below should be used only in extreme cases.\n" + "Level 4 will grant graphic usage privileges only to users who tipped at least 100 tokens, " + "and level 5 will grant these privileges only to moderators, emergency moderators, and fan club members.\n" + '\nThe default setting for /graphiclevel is 0.' + '\nRoom hosts, moderators, and fan club members are unaffected by the Graphic Level.', from); cb.sendNotice('', from, purple); break; case 'silence': valid = true; cb.sendNotice('/silence Help', from, purple); cb.sendNotice('/silence is a command that is usable by moderators and room hosts.' + '\nThe syntax for using silence is "/silence x", where x is the username of the user you want to silence.' + "\nThe effect of /silence is the same as Chaturbate's silence feature, " + 'except that it lasts for the duration of the current session instead of for six hours.' + '\nThe effect of /silence can be reversed by using the command /unsilence.', from); cb.sendNotice('', from, purple); break; case 'unsilence': valid = true; cb.sendNotice('/unsilence Help', from, purple); cb.sendNotice('/unsilence is a command that is usable by moderators and room hosts.' + '\nThe syntax for using unsilence is "/unsilence x", where x is the username of the user you want to unsilence.' + '\nunsilence simply grants voice privileges back to a user who was previously silenced.' + '\nNOTE: /unsilence WILL NOT undo the effect of Chaturbate\'s silence feature!' + '\n/unsilence WILL ONLY reverse the effect of /silence!', from); cb.sendNotice('', from, purple); break; case 'starttimer': valid = true; cb.sendNotice('/starttimer Help', from, purple); cb.sendNotice('/starttimer is a command that is usable by moderators and room hosts.' + '\nThe syntax for using starttimer is "/starttimer x", where x is the desired duration of the timer in minutes.' + '\n/starttimer will accept whole numbers only.' + '\nThe timer will make announcements at five minutes remaining and at one minute remaining.' + '\n/addtime can be used to add time to a currently running timer.' + '\n/timeleft can be used to display the amount of time remaining on the timer.', from); cb.sendNotice('', from, purple); break; case 'addtime': valid = true; cb.sendNotice('/addtime Help', from, purple); cb.sendNotice('/addtime is a command that is usable by moderators and room hosts.' + '\nThe syntax for using addtime is "/addtime x", where x is the amount of time you want to add in minutes.' + '\n/addtime will accept whole numbers only.' + '\nSee the help section for starttimer for more information on timers.', from); cb.sendNotice('', from, purple); break; case 'timeleft': valid = true; cb.sendNotice('/timeleft Help', from, purple); cb.sendNotice('/timeleft is a command that is usable by everyone.' + '\nThe syntax for using timeleft is /timeleft' + '\n/timeleft will display the amount of time left on the timer in the format 00:00:00' + '\nSee the help section for starttimer for more information on timers.', from); cb.sendNotice('', from, purple); break; case 'whisper': valid = true; cb.sendNotice('/whisper Help', from, purple); cb.sendNotice('/whisper is a command that is usable by everyone.' + '\nThe syntax for using whisper is "/whisper x y", where x is the username of the user you want to send a whisper and y is the message you want to send.' + '\n/whisper, /w, /tell, /t, and /pm are all available commands that will send a whisper.' + '\nA whisper is a private message that will be sent in the main chat window.' + '\nOther related commands are /reply, /ignore, /unignore, and /ignorelevel.', from); cb.sendNotice('', from, purple); break; case 'reply': valid = true; cb.sendNotice('/reply Help', from, purple); cb.sendNotice('/reply is a command that is usable by everyone.' + '\nThe syntax for using whisper is "/reply x", where x is message that you want to whisper to the user who most recently sent a whisper to you.' + '\n/reply and /r are available commands that will send a whisper in reply.' + '\nSee the help section for whisper for more information on whispers.' + '\nOther related commands are /whisper, /ignore, /unignore, and /ignorelevel.', from); cb.sendNotice('', from, purple); break; case 'ignore': valid = true; cb.sendNotice('/ignore Help', from, purple); cb.sendNotice('/ignore is a command that is usable by everyone.' + '\nThe syntax for using ignore is "/ignore x", where x is the user from whom you wish to ignore whispers.' + '\nIgnoring a user will prevent him from sending you whispers, but it will not prevent him from talking normally in chat.' + '\n/unignore will reverse the effect of /ignore.' + '\nSee the help section for whisper for more information on whispers.' + '\nOther related commands are /whisper, /reply, /unignore, and /ignorelevel.', from); cb.sendNotice('', from, purple); break; case 'unignore': valid = true; cb.sendNotice('/unignore Help', from, purple); cb.sendNotice('/unignore is a command that is usable by everyone.' + '\nThe syntax for using unignore is "/unignore x", where x is the user you wish to remove from your ignore list.' + '\nSee the help section for ignore for more information on ignoring users.' + '\nSee the help section for whisper for more information on whispers.' + '\nOther related commands are /whisper, /reply, /ignore, and /ignorelevel.', from); cb.sendNotice('', from, purple); break; case 'ignorelevel': valid = true; cb.sendNotice('/ignorelevel Help', from, purple); cb.sendNotice('/ignorelevel is a command that is usable by everyone.' + '\nThe syntax for using ignorelevel is "/ignorelevel x", where x is a number between 0 and 3.' + '\nSetting the Ignore Level to 0 will allow all users to send you whispers, ' + 'setting it to 1 will only allow users with tokens to send you whispers, ' + 'setting it to 2 will only allow users who have tipped to send you whispers, ' + 'and setting it to 3 will only allow users who have tipped at least 10 tokens to send you whispers.' + '\nThe default setting for /ignorelevel is 0.' + '\nSee the help section for whisper for more information on whispers' + '\nOther related commands are /whisper, /reply, /ignore, and /unignore.', from); cb.sendNotice('', from, purple); break; case 'emod': valid = true; cb.sendNotice('/emod Help', from, purple); cb.sendNotice('/emod is a command that is usable by moderators and room hosts.' + '\nThe syntax for using emod is "/emod x y", where x is either "add" or "remove" and y is the username of the user you want to either grant or revoke emergency moderator powers.' + '\n/emod allows moderators to quickly grant other users access to moderator-only commands in the event that he is having difficulty controlling the room by himself.' + '\nEmergency moderators have access to all moderator-only commands with the exceptions of /emod, /addnice, and /removenice.', from); cb.sendNotice('', from, purple); break; case 'addnice': valid = true; cb.sendNotice('/addnice Help', from, purple); cb.sendNotice('/addnice is a command that is usable by moderators and room hosts.' + '\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, graphic, and ignore level settings. ' + 'Using /silence or /ignore will still silence or ignore a user on the nice list.' + '\nUsers can be removed from the nice list by using the command /removenice.' + '\nSee the help sections for silencelevel, graphiclevel, and ignorelevel for more information on the global settings or the help section for nicelist for more information on the nice list.', from); cb.sendNotice('', from, purple); break; case 'removenice': valid = true; cb.sendNotice('/removenice Help', from, purple); cb.sendNotice('/removenice is a command that is usable by moderators and room hosts.' + '\nThe syntax for using removenice is "/removenice x", where x is the username of the user you want to remove from the nice list.' + '\nSee the help section for nicelist for more information on the nice list.', from); cb.sendNotice('', from, purple); break; case "addgray": case "addgrey": valid = true; cb.sendNotice('/addgray Help', from, purple); cb.sendNotice('/addgray is a command that is usable by moderators and room hosts.' + '\nThe syntax for using addgray is "/addgray x", where x is the username of the user you want to add to the gray list.' + '\nAdding a user to the gray list subjects them to the same wordlists that apply to grays. ' + '\nUsers can be removed from the gray list by using the command /removegray.' + '\nSee the help section for graylist for more information on the gray list.', from); cb.sendNotice('', from, purple); break; case "removegray": case "removegrey": valid = true; cb.sendNotice('/removegray Help', from, purple); cb.sendNotice('/removegray is a command that is usable by moderators and room hosts.' + '\nThe syntax for using removegray is "/removegray x", where x is the username of the user you want to remove from the gray list.' + '\nSee the help section for graylist for more information on the gray list.', from); cb.sendNotice('', from, purple); break; case "addvip": valid = true; cb.sendNotice('/addvip Help', from, purple); cb.sendNotice('/addvip is a command that is usable by moderators and room hosts.' + '\nThe syntax for using addvip is "/addvip x", where x is the username of the user you want to add to the VIP list.' + '\nAdding a user to the VIP list grants them free access to a future "CrazyTicket" show. ' + '\nUsers can be removed from the VIP list by using the command /removevip.' + '\nSee the help section for viplist for more information on the VIP list.', from); cb.sendNotice('', from, purple); break; case "removevip": valid = true; cb.sendNotice('/removevip Help', from, purple); cb.sendNotice('/removevip is a command that is usable by moderators and room hosts.' + '\nThe syntax for using removevip is "/removevip x", where x is the username of the user you want to remove from the VIP list.' + '\nSee the help section for viplist for more information on the VIP list.', from); cb.sendNotice('', from, purple); break; case 'ubhelp': valid = true; cb.sendNotice('/ubhelp Help', from, purple); cb.sendNotice('/ubhelp is a command that is usable by everyone.' + '\nThe syntax for using ubhelp is "/ubhelp x", where x is the subsection of the help menu that you want to access.', from); cb.sendNotice('', from, purple); break; case 'leaderboard': valid = true; cb.sendNotice('/leaderboard Help', from, purple); cb.sendNotice('/leaderboard is a command that is usable by everyone.' + '\nThe syntax for using leaderboard is "/leaderboard".' + '\n/leaderboard shows the top 3 tippers of the current session.', from); cb.sendNotice('', from, purple); break; case 'kingspam': valid = true; cb.sendNotice('/kingspam Help', from, purple); cb.sendNotice('/kingspam is a command that is usable by moderators and room hosts.' + '\nThe syntax for using kingspam is /kingspam x, where x is either on or off. ' + 'Using this command toggles the spamming of the message "Tip x to become the new King!"', from); cb.sendNotice('', from, purple); break; case 'notifierspam': valid = true; cb.sendNotice('/notifierspam Help', from, purple); cb.sendNotice('/notifierspam is a command that is usable by moderators and room hosts.' + '\nThe syntax for using notifierspam is /notifierspam x, where x is either on or off. ' + 'Using this command toggles the spamming of the periodic message defined by the host.', from); cb.sendNotice('', from, purple); break; case 'leaderboardspam': valid = true; cb.sendNotice('/leaderboardspam Help', from, purple); cb.sendNotice('/leaderboardspam is a command that is usable by moderators and room hosts.' + '\nThe syntax for using leaderboardspam is /leaderboardspam x, where x is either on or off. ' + 'Using this command toggles the spamming of the top three tippers.', from); cb.sendNotice('', from, purple); break; } if (valid == false) { cb.sendNotice(option + ' is not a valid subsection of the help menu. Type /ubhelp to access the main help menu.', from, "#fee"); } } function kingSpam() { cb.setTimeout(kingSpamTimer, kingTimer * 60000); } function kingSpamTimer() { if (kingTip < Number.parseInt(cb.settings.kingMin, 10)) { var supplant = cb.settings.kingMin; } else { var supplant = kingTip + 1; } if (kingTipperSpam == true) { cb.sendNotice('Tip ' + supplant + ' to become the new King!', '', "", "#09a", "bold"); kingSpam(); } } function leaderSpam() { cb.setTimeout(leaderSpamTimer, leaderTimer * 60000); } function leaderSpamTimer() { if (leaderboardSpam == true) { sortTippers(); var outString = ""; for (var i = 1; i <= 5; i++) { if (tipperList.name[i - 1] == null) outString += "\u25ba" + i + ". --" + "\n"; else outString += "\u25ba " + i + ". " + '"' + tipperList.name[i - 1] + '"' + ": " + tipperList.amount[i - 1] + "\n"; } cb.sendNotice(dashLine + "\n\u25ba \u25ba \u25ba LEADERBOARD \u25c4 \u25c4 \u25c4\n" + outString + dashLine, "", "#ddd", "#246", "bold"); leaderSpam(); } } function showLeaderBoard(from) { if (cb.settings.leaderBoard == "Yes") { sortTippers(); var outString = ""; for (var i = 1; i <= 5; i++) { if (tipperList.name[i - 1] == null) outString += "\u25ba" + i + ". --" + "\n"; else outString += "\u25ba " + i + ". " + '"' + tipperList.name[i - 1] + '"' + ": " + tipperList.amount[i - 1] + "\n"; } cb.sendNotice(dashLine + "\n\u25ba \u25ba \u25ba LEADERBOARD \u25c4 \u25c4 \u25c4\n" + outString + dashLine, from, "#ddd", "#246", "bold"); } else { cb.sendNotice('The room host has decided not to use the Leaderboard feature.', from, "#fee"); } } function notifierSpam() { cb.setTimeout(notifierSpamTimer, cb.settings.spamTimer * 60000); } function notifierSpamTimer() { if (notifierSpamTGL == true) { cb.sendNotice(notifierMessage, "", "#ddd", "#246", "bold"); notifierSpam(); } } function nice (user, mod, ar) { if (ar == "a") { if (user != null && (user != "" || user != " " || user != "\u00a0")) { if (user != cb.room_slug || !cbjs.arrayContains(modArray, user) || cbjs.arrayContains(eModArray, user)) { if (!cbjs.arrayContains(niceArray, user)) { niceArrayPopulate(user); cb.sendNotice('You have added ' + user + ' to the nice list.', mod, purple); cb.sendNotice(mod + ' has added you to the nice list. You will be able to chat and use graphics regardless of the global room settings. Thank you for being nice!', user, "#efe"); } else { cb.sendNotice(user + ' is already on the nice list.', mod, "#fee"); } } else { cb.sendNotice("Room hosts, moderators, and emergency moderators don't need to be added to the Nice List.", mod, "#fee"); } } else { cb.sendNotice("You didn't specify who you want to add to the nice list.\nType \"/ubhelp addnice\" to see how to use /addnice.\n" + "Additionally, check the nicelist help section for more info.", mod, "#fee"); } } else if (ar == "r") { if (user != null && (user != "" || user != " " || user != "\u00a0")) { if (niceArray.length > 0) { if (user == "all") { cb.sendNotice("You have removed all users from the nice list.", mod, purple); for (var i = 0; i < niceArray.length; i++) cb.sendNotice(mod + " has removed you from the nice list.", niceArray[i], "#fee"); niceArray.length = 0; } else { if (cbjs.arrayContains(niceArray, user)) { cbjs.arrayRemove(niceArray, user); cb.sendNotice('You have removed ' + user + ' from the nice list.', mod, purple); cb.sendNotice(mod + ' has removed you from the nice list.', user, "#fee"); } else { cb.sendNotice(user + ' is not on the nice list.', mod, "#fee"); } } } else { cb.sendNotice("The nice list is currently empty.", mod, "#fee"); } } else { cb.sendNotice("You didn't specify who you want to remove from the nice list.\nType \"/ubhelp removenice\" to see how to use /removenice.\n" + "Additionally, check the nicelist help section for more info.", mod, "#fee"); } } } function gray (user, mod, ar) { if (ar == "a") { if (user != null && (user != "" || user != " " || user != "\u00a0")) { if (user != cb.room_slug || !cbjs.arrayContains(modArray, user) || cbjs.arrayContains(eModArray, user)) { if (!cbjs.arrayContains(grayArray, user)) { grayArrayPopulate(user); cb.sendNotice('You have added ' + user + ' to the gray list.', mod, purple); } else { cb.sendNotice(user + ' is already on the gray list.', mod, "#fee"); } } else { cb.sendNotice("Room hosts, moderators, and emergency moderators cannot be added to the Gray List.", mod, "#fee"); } } else { cb.sendNotice("You didn't specify who you want to add to the gray list.\nType \"/ubhelp addgray\" to see how to use /addgray.\n" + "Additionally, check the graylist help section for more info.", mod, "#fee"); } } else if (ar == "r") { if (user != null && (user != "" || user != " " || user != "\u00a0")) { if (grayArray.length > 0) { if (user == "all") { grayArray.length = 0; cb.sendNotice("You have removed all users from the gray list.", mod, purple); } else { if (cbjs.arrayContains(grayArray, user)) { cbjs.arrayRemove(grayArray, user); cb.sendNotice('You have removed ' + user + ' from the gray list.', mod, purple); } else { cb.sendNotice(user + ' is not on the gray list.', mod, "#fee"); } } } else { cb.sendNotice("The gray list is currently empty.", mod, "#fee"); } } else { cb.sendNotice("You didn't specify who you want to remove from the gray list.\nType \"/ubhelp removegray\" to see how to use /removegray.\n" + "Additionally, check the graylist help section for more info.", mod, "#fee"); } } } function vip (user, mod, ar) { if (ar == "a") { if (user != null && (user != "" || user != " " || user != "\u00a0")) { if (user != cb.room_slug || !cbjs.arrayContains(modArray, user) || cbjs.arrayContains(eModArray, user)) { if (!cbjs.arrayContains(vipArray, user)) { vipArrayPopulate(user); cb.sendNotice('You have added ' + user + ' to the VIP list.', mod, purple); cb.sendNotice(mod + ' has added you to the VIP list. You will have free access to any future "CrazyTicket" show.', user, "#efe"); } else { cb.sendNotice(user + ' is already on the VIP list.', mod, "#fee"); } } else { cb.sendNotice("Room hosts, moderators, and emergency moderators don't need to be added to the VIP List.", mod, "#fee"); } } else { cb.sendNotice("You didn't specify who you want to add to the VIP list.\nType \"/ubhelp addvip\" to see how to use /addvip.\n" + "Additionally, check the viplist help section for more info.", mod, "#fee"); } } else if (ar == "r") { if (user != null && (user != "" || user != " " || user != "\u00a0")) { if (vipArray.length > 0) { if (user == "all") { cb.sendNotice("You have removed all users from the VIP list.", mod, purple); for (var i = 0; i < vipArray.length; i++) cb.sendNotice(mod + " has removed you from the VIP list.", vipArray[i], "#fee"); vipArray.length = 0; } else { if (cbjs.arrayContains(vipArray, user)) { cbjs.arrayRemove(vipArray, user); cb.sendNotice('You have removed ' + user + ' from the VIP list.', mod, purple); cb.sendNotice(mod + ' has removed you from the VIP list.', user, "#fee"); } else { cb.sendNotice(user + ' is not on the VIP list.', mod, "#fee"); } } } else { cb.sendNotice("The VIP list is currently empty.", mod, "#fee"); } } else { cb.sendNotice("You didn't specify who you want to remove from the VIP list.\nType \"/ubhelp removevip\" to see how to use /removevip.\n" + "Additionally, check the viplist help section for more info.", mod, "#fee"); } } } function kingSpamToggle (option, mod) { if (option != null && (option != "" || option != " ")) { switch (option) { case "on": if (kingSpam == true) { cb.sendNotice("The King Tipper Spam is already turned on!", mod, "#fee"); } else { kingSpam = true; cb.sendNotice("You have turned on the King Tipper Spam.", mod, purple); } break; case "off": if (kingSpam == false) { cb.sendNotice("The King Tipper Spam is already turned off!", mod, "#fee"); } else { kingSpam = false; cb.sendNotice("You have turned off the King Tipper Spam.", mod, purple); } break; default: cb.sendNotice(option + ' is not a valid option for /kingspam.\nType /ubhelp kingspam to see how to use /kingspam.', mod, "#fee"); break; } } else { cb.sendNotice("You didn't enter a valid option for /kingspam.\nType /ubhelp kingspam to see how to use /kingspam.\n\n" + "King Tipper Spam status is: " + (kingSpam == true ? "On." : "Off."), mod, "#fee"); } } function kingTipperToggle (option, mod) { if (option != null && (option != "" || option != " ")) { switch (option) { case "on": if (kingTipper == true) { cb.sendNotice("The King Tipper feature is already turned on!", mod, "#fee"); } else { kingTipper = true; cb.sendNotice("You have turned on the King Tipper feature.", mod, purple); } break; case "off": if (kingTipper == false) { cb.sendNotice("The King Tipper feature is already turned off!", mod, "#fee"); } else { kingTipper = false; cb.sendNotice("You have turned off the King Tipper feature.", mod, purple); } break; default: cb.sendNotice(option + ' is not a valid option for /kingtipper.\nType /ubhelp kingspam to see how to use /kingtipper.', mod, "#fee"); break; } } else { cb.sendNotice("You didn't enter a valid option for /kingtipper.\nType /ubhelp kingtipper to see how to use /kingtipper.\n\n" + "King Tipper status is: " + (kingTipper == true ? "On." : "Off."), mod, "#fee"); } } function wordListToggle (option, mod) { if (option != null && (option != "" || option != " ")) { switch (option) { case "on": if (wordListTgl == true) { cb.sendNotice("The Gray Wordlist is already turned on!", mod, "#fee"); } else { wordListTgl = true; cb.sendNotice("You have turned on the Gray Wordlist.", mod, purple); } break; case "off": if (wordListTgl == false) { cb.sendNotice("The Gray Wordlist is already turned off!", mod, "#fee"); } else { wordListTgl = false; cb.sendNotice("You have turned off the Gray Wordlist.", mod, purple); } break; default: cb.sendNotice(option + ' is not a valid option for /wordlist.\nType /ubhelp kingspam to see how to use /wordlist.', mod, "#fee"); break; } } else { cb.sendNotice("You didn't enter a valid option for /wordlist.\nType /ubhelp wordlist to see how to use /wordlist.\n\n" + "Gray Wordlist status is: " + (wordListTgl == true ? "On." : "Off."), mod, "#fee"); } } function blockNoticeToggle (option, mod) { if (option != null && (option != "" || option != " ")) { switch (option) { case "on": if (wordListNtc == true) { cb.sendNotice("The \"Message flagged\" warning is already turned on!", mod, "#fee"); } else { wordListNtc = true; cb.sendNotice("You have turned on the \"Message flagged\" warning.", mod, purple); } break; case "off": if (wordListNtc == false) { cb.sendNotice("The \"Message flagged\" warning is already turned off!", mod, "#fee"); } else { wordListNtc = false; cb.sendNotice("You have turned off the \"Message flagged\" warning.", mod, purple); } break; default: cb.sendNotice(option + ' is not a valid option for /blocknotice.\nType /ubhelp kingspam to see how to use /blocknotice.', mod, "#fee"); break; } } else { cb.sendNotice("You didn't enter a valid option for /blocknotice.\nType /ubhelp blocknotice to see how to use /blocknotice.\n\n" + "\"Message Flagged\" warning status is: " + (wordListNtc == true ? "On." : "Off."), mod, "#fee"); } } function notifierSpamToggle (option, mod) { if (option != null && (option != "" || option != " ")) { switch (option) { case "on": if (notifierSpamTGL == true) { cb.sendNotice("The Notifier Spam is already turned on!", mod, "#fee"); } else { notifierSpamTGL = true; cb.sendNotice("You have turned on the Notifier Spam.", mod, purple); } break; case "off": if (notifierSpamTGL == false) { cb.sendNotice("The Notifier Spam is already turned off!", mod, "#fee"); } else { notifierSpamTGL = false; cb.sendNotice("You have turned off the Notifier Spam.", mod, purple); } break; default: cb.sendNotice(option + ' is not a valid option for /notifierspam.\nType /ubhelp kingspam to see how to use /notifierspam.', mod, "#fee"); break; } } else { cb.sendNotice("You didn't enter a valid option for /notifierspam.\nType /ubhelp notifierspam to see how to use /notifierspam.\n\n" + "Notifier Spam status is: " + (notifierSpamTGL == true ? "On." : "Off."), mod, "#fee"); } } function leaderboardSpamToggle (option, mod) { if (option != null && (option != "" || option != " ")) { switch (option) { case "on": if (leaderboardSpam == true) { cb.sendNotice("The Leaderboard Spam is already turned on!", mod, "#fee"); } else { leaderboardSpam = true; cb.sendNotice("You have turned on the Leaderboard Spam.", mod, purple); } break; case "off": if (leaderboardSpam == false) { cb.sendNotice("The Leaderboard Spam is already turned off!", mod, "#fee"); } else { leaderboardSpam = false; cb.sendNotice("You have turned off the Leaderboard Spam.", mod, purple); } break; default: cb.sendNotice(option + ' is not a valid option for /leaderboardspam.\nType /ubhelp leaderboardspam to see how to use /leaderboardspam.', mod, "#fee"); break; } } else { cb.sendNotice("You didn't enter a valid option for /leaderboardspam.\nType /ubhelp leaderboardspam to see how to use /leaderboardspam.\n\n" + "Leaderboard Spam status is: " + (leaderBoardSpam == true ? "On." : "Off."), mod, "#fee"); } } function sendPublicNotice (message, user, type, color) { if (message != null) { if (message != "" || message != " " || message != "\u00a0") { if (color == "red") { switch (type) { case "div": cb.sendNotice(dashLine + "\n\u25ba " + message.capitalize() + "\n" + dashLine, "", "", "#d10", "bold"); if (devMode == true) cb.log("Message sent to chat: " + message); break; case "divh": cb.sendNotice(dashLine + "\n\u25ba " + message.capitalize() + "\n" + dashLine, "", "#fee", "#d10", "bold"); if (devMode == true) cb.log("Message sent to chat: " + message); break; case "h": cb.sendNotice("\u25ba " + message.capitalize(), "", "#fee", "#d10", "bold"); if (devMode == true) cb.log("Message sent to chat: " + message); break; case "": cb.sendNotice("\u25ba " + message.capitalize(), "", "", "#d10", "bold"); if (devMode == true) cb.log("Message sent to chat: " + message); break; } } else if (color == "default") { switch (type) { case "div": cb.sendNotice(dashLine + "\n\u25ba " + message.capitalize() + "\n" + dashLine, "", "", "#306", "bold"); if (devMode == true) cb.log("Message sent to chat: " + message); break; case "divh": cb.sendNotice(dashLine + "\n\u25ba " + message.capitalize() + "\n" + dashLine, "", "#eef", "#306", "bold"); if (devMode == true) cb.log("Message sent to chat: " + message); break; case "h": cb.sendNotice("\u25ba " + message.capitalize(), "", "#eef", "#306", "bold"); if (devMode == true) cb.log("Message sent to chat: " + message); break; case "": cb.sendNotice("\u25ba " + message.capitalize(), "", "", "#306", "bold"); if (devMode == true) cb.log("Message sent to chat: " + message); 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"); } } function sendPrivateNotice (message, user, type) { // Optional param: dest (only if type is to_viewer) if (message != null) { if (message != "" || message != " " || message != "\u00a0") { switch (type) { case "to_mods": cb.sendNotice("\u25ba " + user + ": " + message, "", "#dfe", "#471", "bold", "red"); break; case "to_caster": cb.sendNotice("\u25ba " + user + ": " + message, cb.room_slug, "#fed", "#741", "bold"); cb.sendNotice("\u25ba " + user + ": " + message, user, "#fed", "#741", "bold"); break; case "to_mods_and_caster": cb.sendNotice("\u25ba " + user + ": " + message, cb.room_slug, "#def", "#147", "bold"); cb.sendNotice("\u25ba " + user + ": " + message, "", "#def", "#147", "bold", "red"); break; case "to_viewer": if (arguments[3] != null && (arguments[3] != "" || arguments[3] != " " || arguments[3] != "\u00a0")) { cb.sendNotice("\u25baUltra Bot\u25c4 " + message, arguments[3], "#ffb", "#d10", "bold"); cb.sendNotice("\u25baUltra Bot\u25c4 " + message, user, "#ffb", "#d10", "bold"); } 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, "#fee"); } } else { cb.sendNotice("You can't send a blank message.\nType a message and try again.", user, "#fee"); } } function cleanUpChat(x) { var n; if (x != null) { if (Number.parseInt(x)) n = x; else n = 30; } else { n = 30; } for (var i = 1; i <= n; i++) cb.sendNotice("Cleaning up chat...", "", purple); cb.sendNotice("Chat cleaned up.", "", purple); } function colorChecker(code) { var validChars = /[A-F0-9]+$/i; // About the RegExp below: All characters till the last char in the unicode range will be invalid var invalidChars = /[\u0021\u0022\u0024-\u002f\u003a-\u0040G-Z\u005b-\u005e\u007b-\uffff]+$/i; if (code != null) { if (code.length == 3 || code.length == 6) { if (validChars.exec(code) && !(invalidChars.exec(code))) { return true; } else if (invalidChars.exec(code)) { return false; } } else if (code.charAt(0) == "#" && (code.length == 4 || code.length == 7)) { if (validChars.exec(code) && !(invalidChars.exec(code))) { return true; } else if (invalidChars.exec(code)) { return false; } } else { return false; } } return null; } function sortTippers() { var swapped, temp1, temp2; do { swapped = false; for (var i = 0; i < tipperList.amount.length - 1; i++) { if (tipperList.amount[i] < tipperList.amount[i + 1]) { temp1 = tipperList.amount[i]; temp2 = tipperList.name[i]; tipperList.amount[i] = tipperList.amount[i + 1]; tipperList.amount[i + 1] = temp1; tipperList.name[i] = tipperList.name[i + 1]; tipperList.name[i + 1] = temp2; swapped = true; } } } while (swapped); } // cb.onMessage() cb.onMessage(function(msg) { // Turn the message into an array var message = msg.m.split(" "); // false = invalid command, true = valid command var cmd = false; // true = user is already silenced var silenced = false; var symbolString = "~`!@#$%^&*()_-+={[}]|\\:;\"'<,>.?/"; var symbolRegExp = /[\u0021-\u002f\u003a-\u0040\u005b-\u005e\u007b-\u007e]/i; var listRegExp = /[,\s]+/; // User vars var u = msg.user; var hasTipped = tipperList.name.indexOf(u) > -1; var hasTokens = msg.has_tokens; var isBc = u == cb.room_slug; // Enable dev access var isDev = (msg.user == "dehaan__" || msg.user == "themountainlion"); var isEMod = cbjs.arrayContains(eModArray, u); var isFan = msg.in_fanclub; var isMod = msg.is_mod; var isNinjaSilenced = cbjs.arrayContains(ninjaSilArray, u); var isOnGrayList = cbjs.arrayContains(grayArray, u); var isOnNiceList = cbjs.arrayContains(niceArray, u); var isOnVipList = cbjs.arrayContains(vipArray, u); var isSilenced = cbjs.arrayContains(silenceArray, u); // Check to see if the user is attempting to use a command if (message[0].charAt(0) == "/") { // Don't print this message to chat msg["X-Spam"] = true; // Rebuild the message for usage with cn 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]; } // Command value var cmdval = null; for (var i = 1; i < message.length; i++) { if (i == 1) cmdval = message[i]; else cmdval += " " + message[i]; } switch (message[0]) { case "/silencelevel": // User entered a proper command cmd = true; // Permission check if (isMod || isBc || isEMod || (isDev && devMode == true)) { setSilenceLevel(message[1], u); } 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, purple); } break; // Chat clean up case "/cleanup": cmd = true; if (isMod || isBc || isEMod || (isDev && devMode == true)) { if (message[1] != null && (message[1] != "" || message[1] != " " || message1 != "\u00a0")) cleanUpChat(message[1]); else cleanUpChat(); } 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, purple); } break; // Dev mode toggle case "/devmode": cmd = true; if (isDev) { if (message[1] == "on") { if (devMode == false) devMode = true, cb.sendNotice("Developer mode on.", u, purple); else cb.sendNotice("Developer mode already on!", u, purple); } else if (message[1] == "off") { if (devMode == true) devMode = false, cb.sendNotice("Developer mode off.", u, purple); else cb.sendNotice("Developer mode already off!", u, purple); } else if (message[1] == "altfont") { altFont ? altFont = false : altFont = true; } } break; // CrazyNote commands /* Regular */ case "/sendnotice": case "/cn": cmd = true; if (isMod || isBc || isEMod || (isDev && devMode == true)) { if (message[1] == "r") { if (ntc2 != null && (ntc2 != "" || ntc2 != " " || ntc2 != "\u00a0")) sendPublicNotice(ntc2, u, "", "red"); else cb.sendNotice("You can't send a blank message.\n" + "The correct syntax for this command is " + '"/cn r message"' + ".", u, "#fee"); } else if (ntc != null && (ntc != "" || ntc != " " || ntc != "\u00a0")) { sendPublicNotice(ntc, u, "", "default"); } 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 "/ubhelp commands" to see a full list of the available commands.', u, purple); } break; /* Highlight */ case "/cnh": cmd = true; if (isMod || isBc || isEMod || (isDev && devMode == true)) { if (message[1] == "r") { if (ntc2 != null && (ntc2 != "" || ntc2 != " " || ntc2 != "\u00a0")) sendPublicNotice(ntc2, u, "h", "red"); else cb.sendNotice("You can't send a blank message.\n" + "The correct syntax for this command is " + '"/cnh r message"' + ".", u, "#fee"); } else if (ntc != null && (ntc != "" || ntc != " " || ntc != "\u00a0")) { sendPublicNotice(ntc, u, "h", "default"); } else { cb.sendNotice("You can't 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 "/ubhelp commands" to see a full list of the available commands.', u, purple); } break; /* Dividers */ case "/cnd": cmd = true; if (isMod || isBc || isEMod || (isDev && devMode == true)) { if (message[1] == "r") { if (ntc2 != null && (ntc2 != "" || ntc2 != " " || ntc2 != "\u00a0")) sendPublicNotice(ntc2, u, "div", "red"); else cb.sendNotice("You can't send a blank message.\n" + "The correct syntax for this command is " + '"/cnd r message"' + ".", u, "#fee"); } else if (ntc != null && (ntc != "" || ntc != " " || ntc != "\u00a0")) { sendPublicNotice(ntc, u, "div", "default"); } else { cb.sendNotice("You can't 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, purple); } break; /* Dividers & highlight */ case "/cndh": cmd = true; if (isMod || isBc || isEMod || (isDev && devMode == true)) { if (message[1] == "r") { if (ntc2 != null && (ntc2 != "" || ntc2 != " " || ntc2 != "\u00a0")) sendPublicNotice(ntc2, u, "divh", "red"); else cb.sendNotice("You can't send a blank message.\n" + "The correct syntax for this command is " + '"/cndh r message"' + ".", u, "#fee"); } else if (ntc != null && (ntc != "" || ntc != " " || ntc != "\u00a0")) { sendPublicNotice(ntc, u, "divh", "default"); } else { cb.sendNotice("You can't 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, purple); } break; /* Private notices */ // To room host */ case "/bc": case "/pmm": cmd = true; if (isMod || isEMod || (isDev && devMode == true)) { if (ntc != null && (ntc != "" || ntc != " " || ntc != "\u00a0")) { sendPrivateNotice(ntc, u, "to_caster"); } else { cb.sendNotice("You can't send a blank message.\n" + "The 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, purple); } break; // To mods */ case "/tm": cmd = true; if (isMod || isEMod || (isDev && devMode == true)) { if (ntc != null && (ntc != "" || ntc != " " || ntc != "\u00a0")) { sendPrivateNotice(ntc, u, "to_mods"); } else { cb.sendNotice("You can't send a blank message.\n" + "The correct syntax for this command is " + '"/tm 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, purple); } break; // To mods and room host */ case "/tbm": cmd = true; if (isMod || isBc || isEMod || (isDev && devMode == true)) { if (ntc != null && (ntc != "" || ntc != " " || ntc != "\u00a0")) { sendPrivateNotice(ntc, u, "to_mods_and_caster"); } else { cb.sendNotice("You can't send a blank message.\n" + "The 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, purple); } break; // To viewer */ case "/tv": cmd = true; if (isMod || isBc || isEMod || (isDev && devMode == true)) { var dest = message[1]; if (dest != null && (dest != "" || dest != " ")) { if (!dest.equalsIgnoreCase(u)) { if (ntc != null && (ntc != "" || ntc != " " || ntc != "\u00a0")) { sendPrivateNotice(ntc, u, "to_viewer", dest.toLowerCase()); } else { cb.sendNotice("You can't send a blank message.\n" + "The correct syntax for this command is " + '"/tv username message"' + ".", u, "#fee"); } } else { cb.sendNotice("Talking to yourself is a little odd...", u, "#fee"); } } else { cb.sendNotice("You didn't specify a username.\n" + "The correct syntax for this command is " + '"/tv username 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, purple); } break; case '/graphiclevel': cmd = true; if (isMod || isBc || isEMod || (isDev && devMode == true)) { setGraphicLevel(message[1], u); } 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, purple); } break; case '/silence': case "/sil": cmd = true; if (isMod || isBc || isEMod || (isDev && devMode == true)) { silence(message[1], u, "regular"); } 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, purple); } break; case "/ninja": case "/ninjasil": cmd = true; if (isMod || isBc || isEMod || (isDev && devMode == true)) { silence(message[1], u, "ninja"); } 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, purple); } break; case '/unsilence': case "/unsil": cmd = true; if (isMod || isBc || isEMod || (isDev && devMode == true)) { unsilence(message[1], u, "regular"); } 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, purple); } break; case "/unninja": cmd = true; if (isMod || isBc || isEMod || (isDev && devMode == true)) { unsilence(message[1], u, "ninja"); } 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, purple); } break; case '/starttimer': cmd = true; if (isMod || isBc || isEMod || (isDev && devMode == true)) { startTimer(message[1], u); } 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, purple); } break; case '/addtime': cmd = true; if (isMod || isBc || isEMod || (isDev && devMode == true)) { addTime(message[1], u); } 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, purple); } break; case '/timeleft': cmd = true; timeLeft(u); break; case '/whisper': case '/w': case '/tell': case '/t': case '/pm': cmd = true; // Check to see if the whisperer is a mod/host if (isMod || isFan || isBc || isEMod || isOnNiceList || (isDev && devMode == true)) { sendWhisper(message, u, true, hasTokens); } else { sendWhisper(message, u, false, hasTokens); } msg.background = purple; break; case '/reply': case '/r': cmd = true; sendReply(message, u); msg.background = purple; break; case '/ignorelevel': cmd = true; setIgnoreLevel(message[1], u); break; case '/ignore': cmd = true; ignoreUser(message[1], u); break; case '/unignore': cmd = true; unignoreUser(message[1], u); break; case '/emod': cmd = true; if (isMod || isBc || (isDev && devMode == true)) { eMod(message[1], message[2], u); } 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, purple); } break; case "/addnice": cmd = true; if (isMod || isBc || (isDev && devMode == true)) { if (cmdval != null) { var cmdval_s = cmdval.split(listRegExp); if (cmdval_s.length > 1) { cb.sendNotice("Adding multiple users to the nice list.", u, purple); for (var i = 0; i < cmdval_s.length; i++) { if (cmdval_s[i] != "") { if (!cbjs.arrayContains(niceArray, cmdval_s[i])) { niceArrayPopulate(cmdval_s[i]); cb.sendNotice("Added " + cmdval_s[i] + " to the list.", u); cb.sendNotice(u + " has added you to the nice list.", cmdval_s[i], "#efe"); } else { cb.sendNotice(cmdval_s[i] + " is already on the list. Skipping.", u); } } } cb.sendNotice("All users were added and notified.", u, purple) cb.sendNotice(u + " has added multiple users to the nice list.\n" + "Users added: " + cbjs.arrayJoin(cmdval_s, ", "), "", purple, "", "normal", "red"); } else { var cmdval_2 = message[1]; nice(cmdval_2, u, "a"); } } else { cb.sendNotice("You didn't specify who you want to add to the nice list.\nType \"/ubhelp addnice\" to see how to use /addnice.\n" + "Additionally, check the nicelist help section for more info.", 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, purple); } break; case "/addgrey": case "/addgray": cmd = true; if (isMod || isBc || (isDev && devMode == true)) { if (cmdval != null) { var cmdval_s = cmdval.split(listRegExp); if (cmdval_s.length > 1) { cb.sendNotice("Adding multiple users to the gray list.", u, purple); for (var i = 0; i < cmdval_s.length; i++) { if (cmdval_s[i] != "") { if (!cbjs.arrayContains(grayArray, cmdval_s[i])) { grayArrayPopulate(cmdval_s[i]); cb.sendNotice("Added " + cmdval_s[i] + " to the list.", u); } else { cb.sendNotice(cmdval_s[i] + " is already on the list. Skipping.", u); } } } cb.sendNotice(u + " has added multiple users to the gray list.\n" + "Users added: " + cbjs.arrayJoin(cmdval_s, ", "), "", purple, "", "normal", "red"); } else { var cmdval_2 = message[1]; gray(cmdval_2, u, "a"); } } else { cb.sendNotice("You didn't specify who you want to add to the gray list.\nType \"/ubhelp addgray\" to see how to use /addgray.\n" + "Additionally, check the graylist help section for more info.", 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, purple); } break; case "/addvip": cmd = true; if (isMod || isBc || (isDev && devMode == true)) { if (cmdval != null) { var cmdval_s = cmdval.split(listRegExp); if (cmdval_s.length > 1) { cb.sendNotice("Adding multiple users to the VIP list.", u, purple); for (var i = 0; i < cmdval_s.length; i++) { if (cmdval_s[i] != "") { if (!cbjs.arrayContains(vipArray, cmdval_s[i])) { vipArrayPopulate(cmdval_s[i]); cb.sendNotice("Added " + cmdval_s[i] + " to the list.", u); cb.sendNotice(u + " has added you to the VIP list.", cmdval_s[i], "#efe"); } else { cb.sendNotice(cmdval_s[i] + " is already on the list. Skipping.", u); } } } cb.sendNotice("All users were added and notified.", u, purple) cb.sendNotice(u + " has added multiple users to the VIP list.\n" + "Users added: " + cbjs.arrayJoin(cmdval_s, ", "), "", purple, "", "normal", "red"); } else { var cmdval_2 = message[1]; vip(cmdval_2, u, "a"); } } else { cb.sendNotice("You didn't specify who you want to add to the VIP list.\nType \"/ubhelp addvip\" to see how to use /addvip.\n" + "Additionally, check the viplist help section for more info.", 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, purple); } break; case '/removenice': cmd = true; if (isMod || isBc || (isDev && devMode == true)) { nice(message[1], u, 'r'); } 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, purple); } break; case '/removegrey': case "/removegray": cmd = true; if (isMod || isBc || (isDev && devMode == true)) { gray(message[1], u, 'r'); } 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, purple); } break; case '/removevip': cmd = true; if (isMod || isBc || (isDev && devMode == true)) { vip(message[1], u, 'r'); } 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, purple); } break; case "/nicelist": cmd = true; if (isMod || isBc || (isDev && devMode == true)) { cb.sendNotice("Users currently on the Nice List: " + niceArray.length, u, purple); cb.sendNotice((niceArray.length > 0 == true ? cbjs.arrayJoin(niceArray, ", ") : "No users."), u); cb.sendNotice("", u, purple); } 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, purple); } break; case "/graylist": case "/greylist": cmd = true; if (isMod || isBc || (isDev && devMode == true)) { cb.sendNotice("Users currently on the Gray List: " + grayArray.length, u, purple); cb.sendNotice((grayArray.length > 0 == true ? cbjs.arrayJoin(grayArray, ", ") : "No users."), u); cb.sendNotice("", u, purple); } 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, purple); } break; case "/viplist": cmd = true; if (isMod || isBc || (isDev && devMode == true)) { cb.sendNotice("Users currently on the VIP List: " + vipArray.length, u, purple); cb.sendNotice((vipArray.length > 0 == true ? cbjs.arrayJoin(vipArray, ", ") : "No users."), u); cb.sendNotice("", u, purple); } 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, purple); } break; // Export the VIP list to CrazyTicket case "/export": cmd = true; if (isMod || isBc || (isDev && devMode == true)) { if (vipArray.length > 0) { msg.m = "/add " + cbjs.arrayJoin(vipArray, ", "); } else{ cb.sendNotice("There's no one on the VIP list.", 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, purple); } break; // Show the modlist for debugging purposes case "/modlist": cmd = true; if (isDev) { cb.sendNotice("Users currently on the Mod Array: " + modArray.length, u, purple); cb.sendNotice((modArray.length > 0 == true ? cbjs.arrayJoin(modArray, ", ") : "No users."), u); cb.sendNotice("", u, purple); } break; // Show the emodlist for debugging purposes case "/emodlist": cmd = true; if (isDev) { cb.sendNotice("Users currently on the Emerg. Mod Array: " + eModArray.length, u, purple); cb.sendNotice((eModArray.length > 0 == true ? cbjs.arrayJoin(eModArray, ", ") : "No users."), u); cb.sendNotice("", u, purple); } break; // Show silenced users case "/silenced": case "/sillist": cmd = true; if (isBc || isMod || (isDev && devMode == true)) { cb.sendNotice("Users currently silenced: " + silenceArray.length, u, purple); cb.sendNotice((silenceArray.length > 0 == true ? cbjs.arrayJoin(silenceArray, ", ") : "No users."), u); cb.sendNotice("", u, purple); } 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, purple); } break; // Show ninja-silenced users case "/ninjasillist": case "/ninjalist": cmd = true; if (isBc || isMod || (isDev && devMode == true)) { cb.sendNotice("Users currently ninja-silenced: " + ninjaSilArray.length, u, purple); cb.sendNotice((ninjaSilArray.length > 0 == true ? cbjs.arrayJoin(ninjaSilArray, ", ") : "No users."), u); cb.sendNotice("", u, purple); } 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, purple); } break; // Show tippers list case "/tippers": cmd = true; if (isBc || isDev) { cb.sendNotice("Users who tipped: " + tipperList.name.length, u, purple); if (tipperList.name.length == 0) { cb.sendNotice("No users.", u); } else { var outString = ""; for (var i = 0; i < tipperList.name.length; i++) { cb.sendNotice('"' + tipperList.name[i] + '"' + ": " + tipperList.amount[i], u); if (i == 179) break; } } cb.sendNotice("", u, purple); } 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, purple); } break; case '/ubhelp': cmd = true; help(message[1], u); break; // Show the leaderboard case '/leaderboard': case "/lb": cmd = true; if (message[1] == "all") { if (isBc || isMod || isDev) { showLeaderBoard(""); } 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, purple); } } else { showLeaderBoard(u); } break; case "/kingtipper": cmd = true; if (isMod || isBc || isEMod || (isDev && devMode == true)) { kingTipperToggle(message[1], u) } 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, purple); } break; case '/kingspam': cmd = true; if (isMod || isBc || isEMod || (isDev && devMode == true)) { kingSpamToggle(message[1], u) } 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, purple); } break; case '/notifierspam': cmd = true; if (isMod || isBc || isEMod || (isDev && devMode == true)) { notifierSpamToggle(message[1], u) } 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, purple); } break; case '/leaderboardspam': cmd = true; if (isMod || isBc || isEMod || (isDev && devMode == true)) { leaderboardSpamToggle(message[1], u) } 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, purple); } break; case '/notifiermessage': cmd = true; if (isMod || isBc || isEMod || (isDev && devMode == true)) { 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 /notifierspam off.', u, purple) } else { notifierMessage = msg.m.substring(16).trim(); cb.sendNotice('You have set the notifier spam message to: ' + notifierMessage, u, purple); } } 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, purple); } break; // Toggle the wordlist case "/wordlist": cmd = true; if (isMod || isBc || isEMod || (isDev && devMode == true)) { wordListToggle(message[1], u); } 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, purple); } break; // Toggle the "message flagged" warning case "/blocknotice": cmd = true; if (isMod || isBc || isEMod || (isDev && devMode == true)) { blockNoticeToggle(message[1], u); } 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, purple); } break; // Monitor blocked messages case "/mon": cmd = true; if (isMod || isBc || isEMod || (isDev && devMode == true)) { if (!cbjs.arrayContains(blockMsgArray, u)) blockMsgArrayPopulate(u); else cbjs.arrayRemove(blockMsgArray, u); cb.sendNotice("Monitoring of blocked messages is now " + (cbjs.arrayContains(blockMsgArray, u) == true ? "on." : "off."), u, purple); } 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, purple); } break; // Developers highlight case "/changehilite": cmd = true; if (isDev) { if (message[1] != null) { if (message[1] == "blue") { if (greenHilite == true) greenHilite = false; if (blueHilite == false) blueHilite = true; if (noHilite == true) noHilite = false; } else if (message[1] == "green") { if (greenHilite == false) greenHilite = true; if (blueHilite == true) blueHilite = false; if (noHilite == true) noHilite = false; } else if (message[1] == "none") { if (greenHilite == true) greenHilite = false; if (blueHilite == true) blueHilite = false; if (noHilite == false) noHilite = true; } } } break; // dovers highlight case "/doverhilite": cmd = true; if (u == "ben_dover_88") { dHilite ? dHilite = false : dHilite = true; cb.sendNotice("Highlight " + (dHilite == true ? "on." : "off."), u, purple); } break; // gryphs highlight case "/gryphhilite": cmd = true; if (u == "gryphonstein") { gHilite ? gHilite = false : gHilite = true; cb.sendNotice("Highlight " + (gHilite == true ? "on." : "off."), u, purple); } break; // petes highlight case "/boathilite": cmd = true; if (u == "redhotpete02") { rHilite ? rHilite = false : rHilite = true; cb.sendNotice("Highlight " + (rHilite == true ? "on." : "off."), u, purple); } break; // tows highlight case "/towhilite": cmd = true; if (u == "towguy48708") { tHilite ? tHilite = false : tHilite = true; cb.sendNotice("Highlight " + (tHilite == true ? "on." : "off."), u, purple); } break; } // Level Up! command support if (message[0] == '/luhelp' || message[0] == '/levels') { cmd = true; } // Ultra App command support if (message[0] == '/startshow' || message[0] == '/showtimeleft' || message[0] == '/printtime' || message[0] == '/addshowtime' || message[0] == '/adduser' || message[0] == '/changegoal' || message[0] == '/hide' || message[0] == '/unhide' || message[0] == '/selltickets' || message[0] == '/uacommands') { cmd = true; } // The user entered an invalid command if (cmd == false && cb.settings.invalidToggle == "Yes") { cb.sendNotice(message[0] + ' is not a command.\nType /ubhelp commands to see a full list of the available commands.', u, purple); } } // Add mods & caster to the mod array when they type if (isMod || isBc) { if (!cbjs.arrayContains(modArray, u)) modArrayPopulate(u); } /* // Let the wordlist do its thing if (wordListTgl == true) { // Remove everything but alphanumeric characters to evaluate it var msgStringOrig = msg.m; var msgString = msgStringOrig.replace(/[^\w\s]|_/gi, ''); var msgStringPartial = msgString.replace(/[\s]/gi, ''); // Reusable RegEx var girlyparts = 'p+u+s\\w*|v+a+(g|j)\\w*|k+i+t+t\\w*|c+l+i+t\\w*|l+i+p\\w*|b+o+b\\w*|n+i+p\\w*|t+i+t\\w*|(\\b)a+s+s|b+u+t+t|(\\b)[^w]*h+o+l+e\\w*|c+u+n+t\\w*|a+r+m+p+i+t\\w*'; var guyparts = 'd+i+c+k\\w*|b+o+n+e+r\\w*|c+o+c+k\\w*|p+e+n+i+s\\w*'; var naked = 'n+a*k+e*d+|n+u+d+e'; // Short messages can't contain... var shortmessage = new RegExp('\\b(' + girlyparts + '|' + guyparts + '|' + naked + ')\\b'); // Workaround (Block anything people try to space out to get around rules) var workaround = new RegExp('\\b\\w\\s\\w\\s\\w\\b', 'i'); // this matches 3 or more single spaced-out characters // Rude var rudeexact = new RegExp('\\b(h+o+e+s*)\\b', 'i'); var rudepartial = new RegExp('(c+u+n+t|s+l+u+t|w+h+o+r+e|b+i+t+c+h|n+i+g+g+e+r|t+r+a+n+n+(y|i))', 'i'); // Sticky/Annoying var stickyexact = new RegExp('\\b(m+m+|u+f+)\\b', 'i'); var stickypartial = new RegExp('(.)\\1{3,}|m+m+m', 'i'); // Spam // var spamexact = new RegExp('\\b( )\\b', 'i'); var spampartial = new RegExp('(s+k+(y|i)+p+e|s+k+y+p|f+r+e+e.*t+o+k+e+n|t+o+k+e+n.*f+r+e+e|erotimo|freecambook)', 'i'); // Demands/Requests var demandsexact = new RegExp('\\b(p+\\s*m+|p+l+(s|z)+|m+a+s+t\\w*b\\w*|s+q\\w*r+t\\w*|a+n+a+l+|f+i+s+t\\w*|(w+a+n\\w*|e+a+t|s+h+o+w|d+o(\\b)|f+l+a+s+h|c+a+n+\\s(i+|.*u+)|o+p+e+n|c+l+o+s+e|c+u+m|s+h+a+k|s+p+a+n+k|s+q+u*e*z|s+h+o+v+e|p+l+a+y.*w+i+t+h|f+i+n+g+e+r|(f|s)+u+c+k|l+i+c+k|k+i+s+s|l+e+t\\w*\\s*s+e+e).*((\\b)i+t+|u+r|' + girlyparts + '|(\\b)c+u+m\\w*))\\b', 'i'); var demandspartial = new RegExp('(a+r+m+p+i+t|a+s+s+h+o+l+e|z+o+o+m|s+p+r+e+a+d|f+a+r+t|c+2+c|(w+a+t+c+h|l+o+o+k|o+p+e+n|v+i+e+w).*c+a+m)', 'i'); // BB var bbexact = new RegExp('\\b(b+(a|e)*b+(y|e)*|b+a+e)\\b', 'i'); // var bbpartial = new RegExp('', 'i'); // TMI var tmiexact = new RegExp('\\b((i+.{0,1}m|i\\s|m+(y|e)+|s+o+|i+s+|a+m+|l+e+t+(\\s)m+e+|l+e+m+m+e+|(l+o+v+e+|l+u+v+)\\s(2+|t+o+)|g+o+t+\\w*|w+a+n\\w*|m+a+y+|c+a+n+|g+o+n\\w*|g+o+i+n\\w*\\st+o+).*(h+a*r+d+\\w*|m+a+s+t\\w*b+a+t\\w*|w+a+n+k\\w*|j+e+r+k\\w*|(j+|w+h*)a+c+k\\w*|w+et+|h+o+r+n\\w*|t+a+s+t\\w*|c+u+m+\\w*|l+i+c+k\\w*|(f|s)+u+c+k\\w*)|\\w*m+e+a+t|bbc)\\b', 'i'); var tmipartial = new RegExp('(' + guyparts + '|s+m+e+l+l|s+n+i+f+f|s+t+r+o+k|t+h+r+o+b|w+o+u+l+d.*u+c+k|\\d\\s*(i+n|c+m))', 'i'); // Feet var feetexact = new RegExp('\\b(s+o+l+e+s*|t+o+e+s*)\\b', 'i'); var feetpartial = new RegExp('(f+e+e+t|p+e+d+i+c+u|f+o+t+j+o+b)', 'i'); // Poo/Pee var poopeeexact = new RegExp('\\b(p+o+o+p*\\w*|p+e+e+)\\b', 'i'); var poopeepartial = new RegExp('(t+u+r+d)', 'i'); // Wildcard silencing for a few bots var wildc = /^26v|27v|28v|29v|30v/i; var wildc2 = /^tastygirlyy/i; // List doesn't apply to mods / caster / fc members / emerg mods / people on nicelist / dev if (!isMod || !isBc || !isDev) { if ((!hasTokens && !hasTipped) || isOnGrayList) { if (!isEMod || !isFan) { if ( (msgString.length <= 1) || // no 1-letter messages (!message[3] && msgString.search(shortmessage) != -1) || // please form an intelligent sentence (msgString.search(workaround) != -1) || (msgString.search(rudeexact) != -1) || (msgStringPartial.search(rudepartial) != -1) || (msgString.search(stickyexact) != -1) || (msgStringPartial.search(stickypartial) != -1) || (msgStringPartial.search(spampartial) != -1) || (msgString.search(demandsexact) != -1) || (msgStringPartial.search(demandspartial) != -1) || (msgString.search(bbexact) != -1) || (msgString.search(tmiexact) != -1) || (msgStringPartial.search(tmipartial) != -1) || (msgString.search(feetexact) != -1) || (msgStringPartial.search(feetpartial) != -1) || (msgString.search(poopeeexact) != -1) || (msgStringPartial.search(poopeepartial) != -1) || (msgString.length > 500) wildc.test(u) || wildc2.test(u) ) { if (!isOnNiceList) { msg["X-Spam"] = true; if ((message[0].charAt(0) != "/" && (!isSilenced || !isNinjaSilenced)) && (!hasTokens && silenceLevel == 0)) { // Replace images -- we may not want to see the images they unsuccessfully try to use var blockedmsg = msg.m.replace(/:[^\s]+/g, function(match) { return "[IMG: " + match.slice(1) + "]"; }); for (var i = 0; i < modArray.length; i++) { var thisMod = modArray[i]; if (cbjs.arrayContains(blockMsgArray, thisMod)) { cb.sendNotice("\u25ba \u25ba \u25ba Ultra Bot - BLOCKED MESSAGE \u25c4 \u25c4 \u25c4", thisMod, "#d00", "#fff", "bold"); cb.sendNotice('"' + u + '": ' + blockedmsg.substring(0, 500), thisMod, "#fcc", "#c00"); } } } if (wordListNtc == true) { cb.sendNotice("Your message was not sent because it was flagged by the wordlist. Be nice and don't make demands!", u, purple); } } } } } } } */ // Let silence do its thing if (cbjs.arrayContains(silenceArray, u) && silenced == false) { msg['X-Spam'] = true; silenced = true; cb.sendNotice('Your message was not sent because you have been silenced. Be nice and don\'t make demands.', u, purple); } // Let ninja silence do its thing if (cbjs.arrayContains(ninjaSilArray, u) && silenced == false) { msg["X-Spam"] = true; silenced = true; } // Let silenceLevel do its thing if (silenceLevel > 0 && !isMod && !isBc && !isEMod && !isOnNiceList && !isFan && silenced == false) { switch (silenceLevel) { case 1: if (!hasTokens && (Number.parseInt(tipperArray[findTipper(u)][1], 10) == 0)) { msg["X-Spam"] = true; silenced = true; cb.sendNotice('I\'m sorry, but the silence level has been set to 1; your message was not sent. Only members who have tokens are currently permitted to talk in chat.\nType "/ubhelp silencelevel" to see how the various silence levels work.\nPlease enjoy the show :smile', u, purple); } break; case 2: if (Number.parseInt(tipperArray[findTipper(u)][1], 10) == 0) { msg["X-Spam"] = true; silenced = true; cb.sendNotice('I\'m sorry, but the silence level has been set to 2; your message was not sent. Only members who have tipped at least 1 token are currently permitted to talk in chat.\nType "/ubhelp silencelevel" to see how the various silence levels work.\nPlease enjoy the show :smile', u, purple); } break; case 3: if (Number.parseInt(tipperArray[findTipper(u)][1], 10) < 10) { msg["X-Spam"] = true; silenced = true; cb.sendNotice('I\'m sorry, but the silence level has been set to 3; your message was not sent. Only members who have tipped at least 10 tokens are currently permitted to talk in chat.\nType "/ubhelp silencelevel" to see how the various silence levels work.\nPlease enjoy the show :smile', u, purple); } break; // Extra levels case 4: if (Number.parseInt(tipperArray[findTipper(u)][1], 10) < 100) { msg["X-Spam"] = true; silenced = true; cb.sendNotice("I'm sorry, but the silence level has been set to 4; your message was not sent. Only members who have tipped at least 100 tokens are currently permitted to talk in chat.\nType " + '"/ubhelp silencelevel"' + " to see how the various silence levels work.\nPlease enjoy the show :smile", msg.user, purple); } break; case 5: msg["X-Spam"] = true; silenced = true; cb.sendNotice("I'm sorry, but the silence level has been set to 5; your message was not sent. Only moderators, emergency moderators, and fan club members are currently permitted to talk in chat.\nType " + '"/ubhelp silencelevel"' + " to see how the various silence levels work.\nPlease enjoy the show :smile", msg.user, purple); break; } } // Let graphicLevel do its thing if (graphicLevel > 0 && !isMod && !isBc && !isEMod && !isOnNiceList && !isFan && silenced == 0) { switch (graphicLevel) { case 1: if (!hasTokens) { for (var i = 0; i < message.length; i++) { if (message[i].charAt(0) == ':') { msg['X-Spam'] = true; cb.sendNotice('Your message was not sent because you tried to use ' + message[i] + ' and the graphic level has been set to ' + graphicLevel + '.\nType "/ubhelp graphiclevel to see how the various graphic levels work.\nPlease enjoy the show :smile', u, purple); } } } break; case 2: if (Number.parseInt(tipperArray[findTipper(u)][1], 10) == 0) { for (var i = 0; i < message.length; i++) { if (message[i].charAt(0) == ':') { msg['X-Spam'] = true; cb.sendNotice('Your message was not sent because you tried to use ' + message[i] + ' and the graphic level has been set to ' + graphicLevel + '.\nType "/ubhelp graphiclevel to see how the various graphic levels work.\nPlease enjoy the show :smile', u, purple); } } } break; case 3: if (Number.parseInt(tipperArray[findTipper(u)][1], 10) < 10) { for (var i = 0; i < message.length; i++) { if (message[i].charAt(0) == ':') { msg['X-Spam'] = true; cb.sendNotice('Your message was not sent because you tried to use ' + message[i] + ' and the graphic level has been set to ' + graphicLevel + '.\nType "/ubhelp graphiclevel to see how the various graphic levels work.\nPlease enjoy the show :smile', u, purple); } } } break; case 4: if (Number.parseInt(tipperArray[findTipper(u)][1], 10) < 100) { for (var i = 0; i < message.length; i++) { if (message[i].charAt(0) == ":") msg["X-Spam"] = true, cb.sendNotice("Your message was not sent because you tried to use " + message[i] + " and the graphic level has been set to " + graphicLevel + ".\nType " + '"/ubhelp graphiclevel"' + "to see how the various graphic levels work.\nPlease enjoy the show :smile", msg.user, purple); } } break; case 5: for (var i = 0; i < message.length; i++) { if (message[i].charAt(0) == ":") msg["X-Spam"] = true, cb.sendNotice("Your message was not sent because you tried to use " + message[i] + " and the graphic level has been set to " + graphicLevel + ".\nType " + '"/ubhelp graphiclevel"' + "to see how the various graphic levels work.\nPlease enjoy the show :smile", msg.user, purple); } break; } } var fullMsg = null; for (var i = 0; i < message.length; i++) { if (i == 0) fullMsg = message[i]; else fullMsg += " " + message[i]; } // Stop people from sending messages in all caps // De Haan's alternate implementation if (fullMsg == fullMsg.toUpperCase() && fullMsg != fullMsg.toLowerCase() && !isMod && !isBc && !isEMod && !(isDev && devMode == true)) { if (cb.settings.capsToggle == "Yes (for all users)" || (cb.settings.capsToggle == "Yes (only for grays)" && !hasTokens && !hasTipped || !isOnGrayList)) { for (var i = 0; i < message.length; i++) { if (symbolRegExp.test(message[i].charAt(0)) == false) { if (i == 0) fullMsg = message[i].toLowerCase(); else fullMsg += " " + message[i].toLowerCase(); cb.sendNotice("I'm sure you didn't actually mean to send that message in all capital letters, so I fixed it for you :smile", u, purple); } else { if (i == 0) fullMsg = message[i]; else fullMsg += " " + message[i]; } } msg.m = fullMsg; } } // Tip titles, if turned on, as well as king's crown if (cb.settings.tipTitles == "Yes" && tipperList.name.indexOf(u) > -1 && message[0].charAt(0) != "/") { if (kingTipper == true && u == currentKing) { msg.m = ":smallCrown |" + tipperList.amount[(tipperList.name.indexOf(u))] + "| " + msg.m; } else { msg.m = "|" + tipperList.amount[(tipperList.name.indexOf(u))] + "| " + msg.m; } } // Highest tipper of all time if (htAllTime != null) { if (u == htAllTime) { if (htatColor != null) msg.background = htatColor; } } // Dev highlight if (isDev) { if (noHilite == false) { if (greenHilite == true) { msg.c = "#054"; msg.background = "#cdc"; } else if (blueHilite == true) { msg.c = "#465258"; msg.background = "#d0d6dd"; } if (altFont == true) msg.f = '"Courier New"'; else msg.f = "default"; msg.c = "#054"; } } // Requested highlights if (u == "ben_dover_88") { if (dHilite == true) msg.background = "#fff6e6"; } if (u == "redhotpete02") { if (rHilite == true) msg.background = "#ceecf5"; } if (u == "gryphonstein") { if (gHilite == true) msg.background = "#81daf5", msg.c = "#0404b4"; } if (u == "towguy48708") { if (tHilite == true) msg.background = "#a9f5a9"; } return msg; }); // cb.onTip() cb.onTip(function(tip) { // User vars var u = tip.from_user; var hasTokens = tip.from_user_has_tokens; var isFan = tip.from_user_in_fanclub; var isMod = tip.from_user_is_mod; // Tip vars var tipAmount = Number.parseInt(tip.amount, 10); var tipNote = tip.message; tipperArray[findTipper(u)][1] += tipAmount; if (!cbjs.arrayContains(tipperList.name, u)) { tipperListPopulate(u, tipAmount); } else { var index = tipperList.name.indexOf(u); tipperList.amount[index] += tipAmount; } if (kingTipper == true) { if (u != currentKing && Number.parseInt(tipperArray[findTipper(u)][1], 10) > kingTip && Number.parseInt(tipperArray[findTipper(u)][1], 10) >= Number.parseInt(cb.settings.kingMin, 10)) { if (currentKing != "") { cb.sendNotice("You have been dethroned by " + u + ", but revenge is sweet...", currentKing, purple); } cb.sendNotice(":smallCrown We have a new King! All hail " + u + "!", "", "#ddd", "#246", "bold"); currentKing = u; kingTip = Number.parseInt(tipperArray[findTipper(u)][1], 10); } else if (u == currentKing) { kingTip = Number.parseInt(tipperArray[findTipper(u)][1], 10); } } // Note from De Haan: That gigantic leaderboard code was gotten rid of. Check sortTippers(), it replaces the old logic if (cb.settings.notifierTip == "Yes" && Number.parseInt(tipAmount) >= cb.settings.tipMessageMin) { cb.sendNotice(cb.settings.tipMessage, "", "#ddd", "#246", "bold"); } }); // cb.onEnter() cb.onEnter(function(user) { // User vars var u = user.user; var isBc = u == cb.room_slug; var isMod = user.is_mod; if (cb.settings.notifierEnter == "Yes") { cb.sendNotice(cb.settings.enterMessage, u, purple); } if (isMod || isBc) { if (!cbjs.arrayContains(modArray, u)) modArrayPopulate(u); } if (cb.settings.msg1onentry == "Yes") { // Don't show the message if it is null if (cb.settings.message1 != null) { if (!isBc) cb.sendNotice("Welcome " + u + "! " + cb.settings.message1, u, "", msgColor, "bold"); } } }); // Init function main() { if (initialize == false) { cb.sendNotice(dashLine + "\n\u25ba " + '"' + appName + '"' + " has started.", cb.room_slug, "", "#456", "bold"); cb.sendNotice("\u25ba Version: " + appVersion, cb.room_slug, "", "#456", "bold"); cb.sendNotice("\u25ba Build date: " + appBuildDate, cb.room_slug, "", "#456", "bold"); cb.sendNotice("\u25ba Type " + '"/ubhelp commands"' + " for a list of available commands.\n" + dashLine, cb.room_slug, "", "#456", "bold"); cb.sendNotice("\u25ba Grabbing settings...", cb.room_slug, "", "#456", "bold"); if (cb.settings.kingTipper == "Yes") { kingTipper = true; } if (cb.settings.kingTipperSpam == "Yes") { kingTipperSpam = true; kingSpam(); } if (cb.settings.leaderBoardSpam == "Yes") { leaderboardSpam = true; leaderSpam(); } if (cb.settings.notifierSpam == "Yes") { notifierSpamTGL = true; notifierSpam(); } if (cb.settings.wordlistToggle == "Yes") { wordListTgl = true; } if (cb.settings.wordlistNotice == "Yes") { wordListNtc = true; } if (cb.settings.niceList != "" && cb.settings.niceList != null) { cb.sendNotice("\u25ba Adding users to the Nice List...", cb.room_slug, "", "#456", "bold"); var regularExp_ListSplit = /[,\s]+/; var n = cb.settings.niceList; niceArray = n.split(regularExp_ListSplit); numNice = niceArray.length; } if (cb.settings.grayList != "" && cb.settings.grayList != null) { cb.sendNotice("\u25ba Adding users to the \"Gray\" List...", cb.room_slug, "", "#456", "bold"); var regularExp_ListSplit = /[,\s]+/; var g = cb.settings.grayList; grayArray = g.split(regularExp_ListSplit); numGray = grayArray.length; } if (cb.settings.vipList != "" && cb.settings.vipList != null) { cb.sendNotice("\u25ba Adding users to the VIP List...", cb.room_slug, "", "#456", "bold"); var regularExp_ListSplit = /[,\s]+/; var v = cb.settings.vipList; vipArray = v.split(regularExp_ListSplit); numVip = vipArray.length; } // Color checks cb.sendNotice("\u25ba Checking if the selected color codes are valid...", cb.room_slug, "", "#456", "bold"); if (cb.settings.generalBgColor != null && cb.settings.generalBgColor != "") { if (colorChecker(cb.settings.generalBgColor) == true) { cb.sendNotice("\u25ba General background highlight: Valid.", cb.room_slug, "", "#091", "bold"); if (cb.settings.generalBgColor.charAt(0) == "#") purple = cb.settings.generalBgColor; else purple = "#" + cb.settings.generalBgColor; } else { cb.sendNotice("\u25ba General background highlight: Invalid. Reverting to default.", cb.room_slug, "", "#b45", "bold"); purple = "#01a9db"; invalidCodeDetected = true; } } else { cb.sendNotice("\u25ba General background highlight: Not set.", cb.room_slug, "", "#db0", "bold"); } if (cb.settings.messagecolor != null && cb.settings.messagecolor != "") { if (colorChecker(cb.settings.messagecolor) == true) { cb.sendNotice("\u25ba Rotating notifier - message color: Valid.", cb.room_slug, "", "#091", "bold"); if (cb.settings.messagecolor.charAt(0) == "#") msgColor = cb.settings.messagecolor; else msgColor = "#" + cb.settings.messagecolor; } else { cb.sendNotice("\u25ba Rotating notifier - message color: Invalid. Reverting to default.", cb.room_slug, "", "#b45", "bold"); msgColor = "#9f000f"; invalidCodeDetected = true; } } else { cb.sendNotice("\u25ba Rotating notifier - message color: Not set.", cb.room_slug, "", "#db0", "bold"); } if (cb.settings.messagehilite != null && cb.settings.messagehilite != "") { if (colorChecker(cb.settings.messagehilite) == true) { cb.sendNotice("\u25ba Rotating notifier - message background: Valid.", cb.room_slug, "", "#091", "bold"); if (cb.settings.messagehilite.charAt(0) == "#") msgHilite = cb.settings.messagehilite; else msgHilite = "#" + cb.settings.messagehilite; } else { cb.sendNotice("\u25ba Rotating notifier - message background: Invalid. Reverting to default.", cb.room_slug, "", "#b45", "bold"); msgHilite = "#fcc"; invalidCodeDetected = true; } } else { cb.sendNotice("\u25ba Rotating notifier - message background: Not set.", cb.room_slug, "", "#db0", "bold"); } if (cb.settings.htat_color != null && cb.settings.htat_color != "") { if (colorChecker(cb.settings.htat_color) == true) { cb.sendNotice("\u25ba Highest tipper of all time - message background: Valid.", cb.room_slug, "", "#091", "bold"); if (cb.settings.htat_color.charAt(0) == "#") htatColor = cb.settings.htat_color; else htatColor = "#" + cb.settings.htat_color; } else { cb.sendNotice("\u25ba Highest tipper of all time - message background: Invalid. Feature disabled.", cb.room_slug, "", "#b45", "bold"); invalidCodeDetected = true; } } else { cb.sendNotice("\u25ba Highest tipper of all time - message background: Not set.", cb.room_slug, "", "#db0", "bold"); } if (invalidCodeDetected == true) { cb.sendNotice("\u25ba One or more invalid color codes have been used. Valid color codes must have between 3 or 6 characters (excluding the hash; 4 or 7 chars if including it) " + "and contain only hexadecimal numbers from 0 to F.\n" + "\u25ba Use http://www.color-hex.com/ to find the code for the color you want. Don't include the starting hash (#).", cb.room_slug, "", "#b45", "bold"); } cb.sendNotice(dashLine, cb.room_slug, "", "#456", "bold"); if (cb.settings.allowGrayChatAfterStartup == "No") { graphicLevel = 1; silencelevel = 1; cb.sendNotice("Gray users are now unable to chat and use graphics by default. If you would like gray users to be able to do both things, type /silencelevel 0, " + "followed by /graphiclevel 0. If you want them to be able only to chat, type /silencelevel 0.", cb.room_slug, purple); } else if (cb.settings.allowGrayGraphicsAfterStartup == "No") { graphicLevel = 1; silenceLevel = 0; cb.sendNotice("Gray users are now unable to use graphics by default. If you would like gray users to be able to use graphics, type /graphiclevel 0.", cb.room_slug, purple); } else { graphicLevel = 0; silenceLevel = 0; } initialize = true; } } main();
© Copyright Chaturbate 2011- 2024. All Rights Reserved.