Bots Home
|
Create an App
testing me ultra
Author:
219yearoldcouple
Description
Source Code
Launch Bot
Current Users
Created by:
219yearoldcouple
/* -------------------------------------------------------------------- * Name: "18YearOldCouple's Ultra Bot" * Author: Shaggy ("18YearOldCouple" on cb) * Sourced by: Mr. De Haan ("dehaan__" on cb) * Also Sourced by: Emily Grey ("theemilygrey" on cb) * -------------------------------------------------------------------- * Version: 2.4 revision 2 * Built on: 5 May 2016 * -------------------------------------------------------------------- * Additional notes: * - Created by request of "Mr Likes It" for "18YearOldCouple" * --------------------------------------------------------------------*/ /* --------------------------------------------------*/ /* Variables*/ /* --------------------------------------------------*/ var FLAG = { price : cb.settings.buyin != null, advance : cb.settings.advance == "Yes", email : cb.settings.email == "Yes", initialize : false, invalidCodeDetected : false, isYOC : cb.room_slug == "19yearoldcouple"||cb.room_slug == "18yearoldcouple"||cb.room_slug == "119yearoldcouple"||cb.room_slug == "219yearoldcouple" }; var RN = { switchToRN2 : cb.settings.switch1 == 'Yes', switchToRN3 : cb.settings.switch2 == 'Yes', switchOFFRN3 : cb.settings.switch3 == 'Yes', rn1 : true, rn2 : false, rn3 : false, notifierMessage : cb.settings.spamMessage, msgTimeOut : Number.parseFloat(cb.settings.messagetimeout), msgTimeOut2 : Number.parseFloat(cb.settings.messagetimeout2), msgTimeOut3 : Number.parseFloat(cb.settings.messagetimeout3), R1 : 1, R2 : 1, R3 : 1 }; var COMMAND = { CN : "/cn", /* Send general notice to the public */ CNH : "/cnh", CND : "/cnd", CNDH : "/cndh", BC : "/bc", /* Send private notice to the broadcaster (mods only) */ TM : "/tm", /* Send private notice to mods as a group */ TBM : "/tbm", /* Send private notice to mods and broadcaster */ TV : "/tv", /* Send private notice to s viewer */ CNHELP : "/cnhelp", /* Send command list to mod/broadcaster */ TPRICE : "/tprice", /* Assign ticket price. */ NEXT : "/next", /* Assign ticket price. */ ADD : "/add", /* Add one or more viewers to ticket list */ AU : "/au", /* Add user(s) alias */ DEL : "/del", /* Delete a user */ DU : "/du", /* Delete alias */ TLIST : "/tlist", /* Lists users who paid for a ticket */ ADDLIST : "/addlist", /* Lists users who paid for a ticket with "/add" in-front*/ EMAIL : "/email", /* Detect email in tip note */ EMLIST : "/emlist", /* List recorded emails */ SIL : "/sil", UNSIL : "/unsil", SLIST : "/slist", EXPORT : "/export", PRELIST : "/prelist", STARTSHOW: "/startshow", SAVE : "/save", LOAD : "/load", RN1START: "/rn1start", /* Starts first rotating notifier */ RN1STOP : "/rn1stop", /* Stops first rotating notifier */ RN2START: "/rn2start", /* Starts second rotating notifier */ RN2STOP : "/rn2stop" , /* Stops second rotating notifier */ RN3START: "/rn3start", /* Starts third rotating notifier */ RN3STOP : "/rn3stop" , /* Stops third rotating notifier */ RN1TO2 : "/rn1to2" , /* Stops first and starts second rotating notifier */ RN2TO3 : "/rn2to3" /* Stops second and starts third rotating notifier */ }; var COLOR = { DEVELOPER : "#D9F7F7", NOTICE : "#6900CC", /* Chat notice colour - Blue-purple */ RED : "#FF1407", MRED : "#D80A00", HLRED : "#FFE5E5", HILITE : "#EEE5FF", /* Ticket holder Highlight colour -Pastel purple */ SYNTAX : "#995B00", /* Usage notice colour - Brownish */ AMBER : "#E56B00", /* Amber */ MOD : "#DC0000", /* Moderator red */ HVTEXT : "#D80A00", /* Text colour for hi-vis notices - Red */ BCTEXT : "#FFFFFF", /* Text colour for hi-vis notices - White */ BCBACK : "#B600E3", /* Text colour for hi-vis notices - purple */ HVBACK : "#FFFFBF", /* Background colour for hi-vis notices - Yellow */ TBMBACK : "#E0EEFF", TBMTEXT : "#12447A", HELP : "#144D8C", /* Text colour for help - Blue-grey */ INFO : "#144D8C", /* neutral notice - Blue-grey */ MAG : "#E509E5", /* Magenta */ BLI : "#DDFFCC", /* Pastel green - Birdy */ BF : "#FFE0EA", /* Pastel pink - Blaze */ BLUE : "#000099", EZ : "#ffddf4", /* Pink "lace" - Ezra (?)*/ USTARTCOLOR : "#007BFF", DEFAULT : "#ffddf4", HTAT : "#ffddf4", MSG : "#ffddf4", HILITE : "#ffddf4", ROTATE : ["#9900cc","#6666ff","#00cc66","#cccc00","#ffb84d","#ff6666","#ff99ff"] }; var APP = { NAME : "\"18yearoldcouple's UltraBot\"", /* Script name */ VERSION : "2.2", /* Internal: Script version number */ BUILD : ".001", /* Internal: Script build number */ DATE : "OCT 15, 2016", /* Internal: Script build date */ YOC : "18yearoldcouple", /* Developer who modified this bot */ ROOMHOST: cb.room_slug }; var CRAZY = { TICKETLIST : ["18yearoldcouple"], SILLIST : [], TICKETPRICE : parseInt(cb.settings.buyin,10), TICKETPRICE2 : parseInt(cb.settings.buyin2,10), TICKETPRICE2SAFE : 2, TICKETPRICE3 : parseInt(cb.settings.buyin3,10), TICKETPRICE3SAFE : 2, TICKETNUMBER : parseInt(cb.settings.preNumber1,10), TICKETNUMBER2 : parseInt(cb.settings.preNumber2,10), STAGEPRICE : 1, PRENOTE : true }; var emList = {name : [],email : []}; var GROUP = { TIPPER : [], NUMTIPPERS : 0, MOD : [], EMOD : [], SILLYMOD : [], NICE : [], GREY : [], FREETICKET : [], BLOCKMSG : [], NINJA : [], SILENCE : [], SILENCELEVEL : 0, IGNORE : [], NUMIGNORERS : 0, WHISPER : [], NUMWHISPER : 0, GRAPHICLEVEL : 0 };var tipperList = {name: [],amount: []}; var BTIME = { STARTTIME : 0, DURATION : 0, ADDED : 0 }; var CTTIME = { STARTTIME : 0, DURATION : 0, ADDED : 0, CRAZYTICKETTIMER : parseInt(cb.settings.crazyTicketStartTimer,10) }; var LB = { kingTip : 0, kingTimer : Number.parseFloat(cb.settings.kingTimer), leaderTimer : Number.parseFloat(cb.settings.leaderTimer), currentKing : "", htAllTime : cb.settings.htat, kingTipper : cb.settings.kingTipper == "Yes", kingTipperSpam : cb.settings.kingTipperSpam == "Yes", notifierSpamTGL : cb.settings.notifierSpam == "Yes", leaderboardSpam : cb.settings.leaderBoardSpam == "Yes", wordListTgl : cb.settings.wordlistToggle == "Yes", wordListNtc : cb.settings.wordlistNotice == "Yes" }; /* --------------------------------------------------*/ /* 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} var dashLine3 = "------------------------------------------------------------"; var dashLine2 = "\u2014".repeat(28); var dashLine = new Array(61).join("-"); /* Cleaner way to do the dash line*/ var bubbles = "OoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoO"; /* --------------------------------------------------*/ /* User settings*/ /* --------------------------------------------------*/ cb.settings_choices = [ {name:"902",label:"HEY "+cb.room_slug.toUpperCase()+" ~~~ If you have app suggestions/bugs, email me... or need your bio done... or cammer advice.. you know. the usual.",required:!1,type:"choice"}, {name:"002",label:bubbles+"--------------------------------------------------------------------------------------------------- "+"--------------------> Everything is disabled by default :) <------------------------ "+"-------------------> "+APP.NAME.toUpperCase()+" <----------------------- "+"--------------------------------------> BUILD "+APP.VERSION+" <----------------------------------------- "+"----------------------------------> "+APP.DATE+" <-------------------------------------- "+"----------------------------------------------------------------------------------------------------- "+bubbles,required:!1,type:"choice"}, {name:"900",label:"",required:!1,type:"choice"}, {name:"000",label:">>> RECENT UPDATE: Patched Age-Old UltraBot Whisper Spam Hack <<<",required:!1,type:"choice"}, {name:"901",label:"",required:!1,type:"choice"}, {name:"001",label:bubbles+"------------------------------> PRE-SALE <------------------------------------------- "+bubbles,required:!1,type:"choice"}, { name: "advance", type: "choice", choice1: "Yes", choice2: "No", defaultValue: "No", /* I don't mind having to escape all these double quotes*/ label: "Want to sell advanced \"CrazyTickets\"?" }, { name: "buyin", type: "int", /* minValue: 1,*/ /* defaultValue: 25,*/ label: "Enter ticket price ONLY if used for advance ticket sales." + "HINT: If you aren't sure if you're doing a show today yet, set to 9999 and then use /tprice command to lower price later.", required: false }, {name:"003",label:bubbles+"------------------------------> ADVANCED PRE-SALE <------------------------ "+bubbles,required:!1,type:"choice"}, { name: "preNumber1", type: "int", /* minValue: 1,*/ defaultValue: 0, label: "How many FIRST pre-sale tickets until auto switch to SECOND Pre-sale Price (leave 0 for unlimited pre-sale tickets, manually switch with \"/tprice\" command)", required: true }, { name: "switch1", type: "choice", choice1: "Yes", choice2: "No", defaultValue: "No", label: "Automatically switch to second rotating notifier when first presale tickets sell out?" }, { name: "buyin2", type: "int", minValue: 1, defaultValue: 75, label: "Second Presale Ticket Price (optional, this is the 2nd highest price.)", required: false }, { name: "preNumber2", type: "int", /* minValue: 1,*/ defaultValue: 0, label: "How many Second pre-sale tickets until auto switch to Full Price (optional, leave 0 to skip directly to Full Price)", required: true }, { name: "switch2", type: "choice", choice1: "Yes", choice2: "No", defaultValue: "No", label: "Automatically switch to third rotating notifier when second pre-sale tickets sell out?" }, { name: "buyin3", type: "int", minValue: 1, defaultValue: 100, label: "Final Ticket Price (optional, this is the highest price.)", required: false }, { name: "crazyTicketStartTimer", type: "int", /* minValue: 1,*/ defaultValue: 0, label: "How long until show starts after Last Presale Tickets Sold out? (optional, leave 0 to disable auto timer)", required: true }, { name: "switch3", type: "choice", choice1: "Yes", choice2: "No", defaultValue: "No", label: "Automatically switch OFF third rotating notifier when timer ends?" }, { name: "email", type: "choice", choice1: "Yes", choice2: "No", defaultValue: "No", label: "Record ticket buyer's email address if including a bonus in ticket price?" }, {name:"004",label:bubbles+"------------------------------> COLORS <----------------------------------------- "+bubbles,required:!1,type:"choice"}, { name: "generalBgColor", label: "Enter the hex color code you would like to use for the general background highlight. " + "Shortened hex codes (e.g. #3ff) are also accepted.", type: "str", maxLength: 7, defaultValue: "#01a9db" }, { name: "ubstartcolor", label: "Ultra-Bot start-up message text color. ", type: "str", maxLength: 7, defaultValue: "#007BFF" }, { name: "lbtextcolor", label: "LEADERBOARD text color (enter hex code). ", type: "str", maxLength: 7, defaultValue: "#111111" }, { name: "lbbackcolor", label: "LEADERBOARD background color (enter hex code). ", type: "str", maxLength: 7, defaultValue: "#88FFBB" }, { name: "messagecolor", type: "str", label: "Message text 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: "htat_color", label: "Highest tipper of all time - highlight color (put color code - with or without starting # - here).", type: "str", required: false }, {name: "005",label: bubbles+"------------------------------> VIEWER PRIVLAGES <------------------------- " + bubbles,required: !1,type: "choice"}, { 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: "No" }, {name: "006",label: bubbles+"------------------------------> TIPPER PERKS <----------------------------- " + bubbles,required: !1,type: "choice"}, { name: 'tipTitles', label: 'Do you want to display users\' tip totals as titles?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'No' }, { name: 'kingTipper', label: 'Do you want to use the "King Tipper" feature?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'No' }, { name: 'kingTipperSpam', label: 'Do you want to periodically announce the tip required to become King?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'No' }, { 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: "20" }, { name: 'leaderBoard', label: 'Would you like to use the Leader Board feature?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'No' }, { name: 'lbhilite', label: 'Would you like to hilite leaderboard members?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes' }, { name: 'leaderBoardSpam', label: 'Do you want to periodically announce the top five tippers?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'No' }, { name: 'leaderTimer', label: 'Change this value if you would like the Leaderboard announcement to happen at a different interval:', type: "str", defaultValue: "15" }, {name: "007",label: bubbles+"------------------------------> SPECIAL NOTICES <-------------------------- " + bubbles,required: !1,type: "choice"}, { name: 'notifierEnter', label: 'Would you like to display a message for users when they enter the room?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'No' }, { 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: 'No' }, { name: 'spamMessage', label: 'Enter the message you would like to display.', type: 'str', minLength: 1, maxLength: 1000, defaultValue: 'Check out our Amazon Wishlist!' }, { 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: 12 }, { name: 'notifierTip', label: 'Would you like to display a message when a user tips?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'No' }, { name: 'notifierPrivate', label: 'Send Tip Thank you Public or Private?', type: 'choice', choice1: 'Public', choice2: 'Private', defaultValue: 'Public' }, { 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: "008",label: bubbles+"------------------------------> LISTS & CLUBS <---------------------------- " + bubbles,required: !1,type: "choice"}, { 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: "rotnot_header", label: "**** Rotating notifier settings ****", type: "choice", choice1: "", choice2: "", required: false }, {name: "009",label: bubbles+"------------------------------> ROTATING NOTIFIERS <-------------------- " + bubbles,required: !1,type: "choice"}, { name: "use_rn1", label: "Would you like to use Rotating Notifiers? " + "NOTE: Only the first rotating notifier will start with the bot. " + "Use commands /rn1start, /rn1stop, /rn2start, /rn2stop, /rn3start, /rn3stop, /rn1to2, /rn2to3 to control notifiers in show", type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'No' }, { name: "msg1onentry", type: "choice", choice1: "Yes", choice2: "No", defaultValue: "Yes", label: "Display Message 1 of Rotating Notifier 1 privately on entry? (Disable this function for busy rooms, in order to avoid bot crashes.)" }, { name: "message1", label: "RN(1) ---> Message 1", type: "str", required: false, defaultValue: 'Welcome and Follow us!' }, { name: "message2", label: "RN(1) ---> Message 2", type: "str", required: false }, { name: "message3", label: "RN(1) ---> Message 3", type: "str", required: false }, { name: "message4", label: "RN(1) ---> Message 4", type: "str", required: false }, { name: "message5", label: "RN(1) ---> Message 5", type: "str", required: false }, { name: "message6", label: "RN(1) ---> Message 6", type: "str", required: false }, { name: "message7", label: "RN(1) ---> Message 7", type: "str", required: false }, { name: "message8", label: "RN(1) ---> Message 8", type: "str", required: false }, { name: "message9", label: "RN(1) ---> Message 9", type: "str", required: false }, { name: "message10", label: "RN(1) ---> Message 10", type: "str", required: false }, /* Rotating Notifier 2 Messages*/ { name: "rotnot_header22", label: "**** Rotating Notifier 2: ****", type: "choice", choice1: "", choice2: "", required: false }, { name: "rotnot_header2", label: "NOTE: Only the first rotating notifier will start with the bot. Use commands /rn1start, /rn1stop, /rn2start, /rn2stop, /rn3start, /rn3stop, /rn1to2, /rn2to3 to control notifiers in show", type: "choice", choice1: "", choice2: "", required: false }, { name: "msg1onentry_", type: "choice", choice1: "Yes", choice2: "No", defaultValue: "Yes", label: "Display Message 1 of Rotating Notifier 2 privately on entry? (Disable this function for busy rooms, in order to avoid bot crashes.)" + "PS: Will only send welcome message while RN2 is active. Activate with /rn2start or /rn1to2" }, { name: "messageb1", label: "RN(2) ---> Message 1", type: "str", required: false, defaultValue: 'Welcome and Follow us!' }, { name: "messageb2", label: "RN(2) ---> Message 2", type: "str", required: false }, { name: "messageb3", label: "RN(2) ---> Message 3", type: "str", required: false }, { name: "messageb4", label: "RN(2) ---> Message 4", type: "str", required: false }, { name: "messageb5", label: "RN(2) ---> Message 5", type: "str", required: false }, { name: "messageb6", label: "RN(2) ---> Message 6", type: "str", required: false }, { name: "messageb7", label: "RN(2) ---> Message 7", type: "str", required: false }, { name: "messageb8", label: "RN(2) ---> Message 8", type: "str", required: false }, { name: "messageb9", label: "RN(2) ---> Message 9", type: "str", required: false }, { name: "messageb10", label: "RN(2) ---> Message 10", type: "str", required: false }, /* Rotating Notifier 3 Messages*/ { name: "rotnot_header33", label: "**** Rotating Notifier 3: ****", type: "choice", choice1: "", choice2: "", required: false }, { name: "rotnot_header3", label: "NOTE: Only the first rotating notifier will start with the bot. Use commands /rn1start, /rn1stop, /rn2start, /rn2stop, /rn3start, /rn3stop, /rn1to2, /rn2to3 to control notifiers in show", type: "choice", choice1: "", choice2: "", required: false }, { name: "msg1onentryc", type: "choice", choice1: "Yes", choice2: "No", defaultValue: "Yes", label: "Display Message 1 of Rotating Notifier 3 privately on entry? (Disable this function for busy rooms, in order to avoid bot crashes.)" + "PS: Will only send welcome message while RN3 is active. Activate with /rn3start or /rn2to3" }, { name: "messagec1", label: "RN(3) ---> Message 1", type: "str", required: false, defaultValue: 'Welcome and Follow us!' }, { name: "messagec2", label: "RN(3) ---> Message 2", type: "str", required: false }, { name: "messagec3", label: "RN(3) ---> Message 3", type: "str", required: false }, { name: "messagec4", label: "RN(3) ---> Message 4", type: "str", required: false }, { name: "messagec5", label: "RN(3) ---> Message 5", type: "str", required: false }, { name: "messagec6", label: "RN(3) ---> Message 6", type: "str", required: false }, { name: "messagec7", label: "RN(3) ---> Message 7", type: "str", required: false }, { name: "messagec8", label: "RN(3) ---> Message 8", type: "str", required: false }, { name: "messagec9", label: "RN(3) ---> Message 9", type: "str", required: false }, { name: "messagec10", label: "RN(3) ---> Message 10", type: "str", required: false }, { name: "messagetimeout", type: "str", label: "Rotating Notifier 1's Delay (in minutes) between notices being displayed. Fractions (seconds) are accepted, e.g. \"0.5\" for 30 seconds.", defaultValue: "3" }, { name: "messagetimeout2", type: "str", label: "Rotating Notifier 2's Delay (in minutes) between notices being displayed. Fractions (seconds) are accepted, e.g. \"0.5\" for 30 seconds.", defaultValue: "2" }, { name: "messagetimeout3", type: "str", label: "Rotating Notifier 3's Delay (in minutes) between notices being displayed. Fractions (seconds) are accepted, e.g. \"0.5\" for 30 seconds.", defaultValue: "2" } ]; /* --------------------------------------------------*/ /* Functions*/ /* --------------------------------------------------*/ function chatCleanUp() { var chatcleanup = "* Cleaning up chat..."; var blank = "*"; cb.sendNotice(chatcleanup, "", "", COLOR.NOTICE, "bold"); for (var i = 1; i <= 30; i++) { cb.sendNotice(blank, "", "", COLOR.NOTICE, "bold"); } return cb.sendNotice("* Chat cleaned up.", "", "", COLOR.NOTICE, "bold"); } function user(command,user,sendpass){ if ((command == 'add') && (!cbjs.arrayContains(CRAZY.TICKETLIST,user))) CRAZY.TICKETLIST.push(user); if ((command == 'del') && (cbjs.arrayContains(CRAZY.TICKETLIST,user))) cbjs.arrayRemove(CRAZY.TICKETLIST,user);} /* end function user*/ function init(){ /*user('add',APP.ROOMHOST,false); // add broadcaster to the CRAZY.TICKETLIST*/ var appInfo = dashLine + "\n* "+APP.NAME+" by 18yearoldcouple\n* Version: " + APP.VERSION + APP.BUILD + " (" + APP.DATE + ")"; appInfo += "\n* Type \"/ubhelp commands\" for a list of available commands.\n\n* Email: \"" + APP.YOC + "\" for help & bugs.\n" + dashLine; cb.sendNotice(appInfo, APP.ROOMHOST, "", COLOR.INFO, "bold"); this.callCbHandlers = (function() { cb.onEnter( function (viewer) { onEnterHandler(viewer); }); cb.onTip( function (tip) { onTipHandler(tip); }); cb.onMessage( function (msg) { onMessageHandler(msg); }); })(); var setupStr = ""; if (FLAG.price) setupStr += "\n* Backup mode for \"CrazyTicket\" is enabled."; if (FLAG.advance) setupStr += "\n* Advance ticket sales are enabled."; if (FLAG.email) setupStr += "\n* Email address recording is enabled."; if (setupStr) cb.sendNotice(dashLine+setupStr+"\n"+dashLine,APP.ROOMHOST,COLOR.HVBACK,COLOR.HVTEXT,'bold'); cb.sendNotice(dashLine + "\n* Broadcaster \"" + APP.ROOMHOST + "\" is running " + APP.NAME + ".\n\n* Type /cnhelp for a list of available commands.\n* NEW COMMAND: /tbm\n" + dashLine, '', "", COLOR.NOTICE, "bold", "red");} /*end crazynote functions */ /*start ultrabot functions part 1 (and there are tons of them)*/ function tipperPopulate(user) { GROUP.TIPPER[GROUP.NUMTIPPERS] = []; GROUP.TIPPER[GROUP.NUMTIPPERS][0] = user; GROUP.TIPPER[GROUP.NUMTIPPERS][1] = 0; GROUP.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 < GROUP.TIPPER.length; i++) { if (GROUP.TIPPER[i][0] == user) { break; } } /* The user is not in the array. Add him and call findTipper.*/ if (i == GROUP.TIPPER.length) { tipperPopulate(user); findTipper(user); } return i;} function modPopulate(user) { if (!cbjs.arrayContains(GROUP.MOD, user)) GROUP.MOD.push(user); else return;} function emodPopulate(user) { if (!cbjs.arrayContains(GROUP.EMOD, user)) GROUP.EMOD.push(user); else return;} function sillyPopulate(user) { if (!cbjs.arrayContains(GROUP.SILLYMOD, user)) GROUP.SILLYMOD.push(user); else return;} function nicePopulate(user) { if (!cbjs.arrayContains(GROUP.NICE, user)) GROUP.NICE.push(user); else return;} function greyPopulate(user) { if (!cbjs.arrayContains(GROUP.GREY, user)) GROUP.GREY.push(user); else return;} function freeticketPopulate(user) { if (!cbjs.arrayContains(GROUP.FREETICKET, user)) GROUP.FREETICKET.push(user); else return;} function blockmsgPopulate(user) { if (!cbjs.arrayContains(GROUP.BLOCKMSG, user)) GROUP.BLOCKMSG.push(user); else return;} function ninjaPopulate(user) { if (!cbjs.arrayContains(GROUP.NINJA, user)) GROUP.NINJA.push(user); else return;} function silencePopulate(user) { if (!cbjs.arrayContains(GROUP.SILENCE, user)) GROUP.SILENCE.push(user); else return;} function ignorePopulate(user) { GROUP.IGNORE[GROUP.NUMIGNORERS] = []; GROUP.IGNORE[GROUP.NUMIGNORERS][0] = user; GROUP.IGNORE[GROUP.NUMIGNORERS][1] = 0; GROUP.NUMIGNORERS++;} function findIgnorer(user) { for (var i = 0; i < GROUP.IGNORE.length; i++) { if (GROUP.IGNORE[i][0] == user) { break; } } if (i == GROUP.IGNORE.length) { ignorePopulate(user); findIgnorer(user); } return i;} function whisperPopulate(user) { GROUP.WHISPER[GROUP.NUMWHISPER] = []; GROUP.WHISPER[GROUP.NUMWHISPER][0] = user; GROUP.WHISPER[GROUP.NUMWHISPER][1] = ""; GROUP.NUMWHISPER++;} function findWhisper(user) { /* Find the index of the user*/ for (var i = 0; i < GROUP.WHISPER.length; i++) { if (GROUP.WHISPER[i][0] == user) { break; } } /* The user is not in the array. Add him and call findWhisper.*/ if (i == GROUP.WHISPER.length) { whisperPopulate(user); findWhisper(user); } return i;} /* First Rotating notifier counter*/ function rotateNotices() {if(cb.settings.use_rn1 == 'Yes'){ var msg; while (cb.settings["message" + RN.R1] == 0) { /* Skip empty messages*/ RN.R1++; if (RN.R1 > 10) { /* Loop back to the first message*/ RN.R1 = 1; } } msg = cb.settings["message" + RN.R1]; msg=msg.replace(/{newline}/g, "\n"); RN.R1++; if (RN.R1 > 10) { /* Loop back to the first message*/ RN.R1 = 1; }if(RN.rn1){ cb.sendNotice(msg, "", COLOR.HILITE, COLOR.MSG, "bold");} cb.setTimeout(rotateNotices, (RN.msgTimeOut * 60000));}}cb.setTimeout(rotateNotices, (RN.msgTimeOut * 60000)); /*second rotating notifier*/ /* Second Rotating notifier counter*/ function rotateNotices2() { var msg2; while (cb.settings["messageb" + RN.R2] == 0) { /* Skip empty messages*/ RN.R2++; if (RN.R2 > 10) { /* Loop back to the first message*/ RN.R2 = 1; } } msg2 = cb.settings["messageb" + RN.R2]; msg2=msg2.replace(/{newline}/g, "\n"); if(RN.rn2){ RN.R2++; } if (RN.R2 > 10) { /* Loop back to the first message*/ RN.R2 = 1; } if(RN.rn2){ cb.sendNotice(msg2, "", COLOR.HILITE, COLOR.MSG, "bold");} cb.setTimeout(rotateNotices2, (RN.msgTimeOut2 * 60000));}cb.setTimeout(rotateNotices2, (RN.msgTimeOut2 * 60000)); /*second rotating notifier*/ /* Second Rotating notifier counter*/ function rotateNotices3() { var msg3; while (cb.settings["messagec" + RN.R3] == 0) { /* Skip empty messages*/ RN.R3++; if (RN.R3 > 10) { /* Loop back to the first message*/ RN.R3 = 1; } } msg3 = cb.settings["messagec" + RN.R3]; msg3=msg3.replace(/{newline}/g, "\n"); if(RN.rn3){ RN.R3++; } if (RN.R3 > 10) { /* Loop back to the first message*/ RN.R3 = 1; } if(RN.rn3){ cb.sendNotice(msg3, "", COLOR.HILITE, COLOR.MSG, "bold");} cb.setTimeout(rotateNotices3, (RN.msgTimeOut3 * 60000));}cb.setTimeout(rotateNotices3, (RN.msgTimeOut3 * 60000)); function setSilenceLevel(s, mod) { if (s != null) { var newLevel = Number.parseInt(s, 10); if (newLevel >= 0 && newLevel <= 5) { GROUP.SILENCELEVEL = newLevel; cb.sendNotice("The silence level has been set to " + newLevel + ".", cb.room_slug, COLOR.DEFAULT); cb.sendNotice("The silence level has been set to " + newLevel + ".", "", COLOR.DEFAULT, "", "", "red"); switch (newLevel) { case 0: cb.sendNotice("All members can talk in chat.", cb.room_slug, COLOR.DEFAULT); cb.sendNotice("All members can talk in chat.", "", COLOR.DEFAULT, "", "", "red"); break; case 1: cb.sendNotice('Only members with tokens can talk in chat.', cb.room_slug, COLOR.DEFAULT); cb.sendNotice('Only members with tokens can talk in chat.', "", COLOR.DEFAULT, "", "", "red"); break; case 2: cb.sendNotice('Only members who have tipped can talk in chat.', cb.room_slug, COLOR.DEFAULT); cb.sendNotice('Only members who have tipped can talk in chat.', "", COLOR.DEFAULT, "", "", "red"); break; case 3: cb.sendNotice('Only members who have tipped at least 10 tokens can talk in chat.', cb.room_slug, COLOR.DEFAULT); cb.sendNotice('Only members who have tipped at least 10 tokens can talk in chat.', "", COLOR.DEFAULT, "", "", "red"); break; case 4: cb.sendNotice('Only members who have tipped at least 100 tokens can talk in chat.', cb.room_slug, COLOR.DEFAULT); cb.sendNotice('Only members who have tipped at least 100 tokens can talk in chat.', "", COLOR.DEFAULT, "", "", "red"); break; case 5: cb.sendNotice('Only moderators, emergency moderators, and fan club members can talk in chat.', cb.room_slug, COLOR.DEFAULT); cb.sendNotice('Only moderators, emergency moderators, and fan club members can talk in chat.', "", COLOR.DEFAULT, "", "", "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 " + GROUP.SILENCELEVEL + ".\nType \"/ubhelp silencelevel\" to see how to use /silencelevel.", mod, COLOR.DEFAULT); }} function setGraphicLevel(s, mod) { if (s != null) { var newLevel = Number.parseInt(s); if (newLevel >= 0 && newLevel <= 5) { GROUP.GRAPHICLEVEL = newLevel; cb.sendNotice("The graphic level has been set to " + newLevel + ".", cb.room_slug, COLOR.DEFAULT); cb.sendNotice("The graphic level has been set to " + newLevel + ".", "", COLOR.DEFAULT, "", "", "red"); switch (newLevel) { case 0: cb.sendNotice("All members can use graphics in chat.", cb.room_slug, COLOR.DEFAULT); cb.sendNotice("All members can use graphics in chat.", "", COLOR.DEFAULT, "", "", "red"); break; case 1: cb.sendNotice('Only members with tokens can use graphics in chat.', cb.room_slug, COLOR.DEFAULT); cb.sendNotice('Only members with tokens can use graphics in chat.', "", COLOR.DEFAULT, "", "", "red"); break; case 2: cb.sendNotice('Only members who have tipped can use graphics in chat.', cb.room_slug, COLOR.DEFAULT); cb.sendNotice('Only members who have tipped can use graphics in chat.', "", COLOR.DEFAULT, "", "", "red"); break; case 3: cb.sendNotice('Only members who have tipped at least 10 tokens can use graphics in chat.', cb.room_slug, COLOR.DEFAULT); cb.sendNotice('Only members who have tipped at least 10 tokens can use graphics in chat.', "", COLOR.DEFAULT, "", "", "red"); break; case 4: cb.sendNotice('Only members who have tipped at least 100 tokens can use graphics in chat.', cb.room_slug, COLOR.DEFAULT); cb.sendNotice('Only members who have tipped at least 100 tokens can use graphics in chat.', "", COLOR.DEFAULT, "", "", "red"); break; case 5: cb.sendNotice('Only moderators, emergency moderators, and fan club members can use graphics in chat.', cb.room_slug, COLOR.DEFAULT); cb.sendNotice('Only moderators, emergency moderators, and fan club members can use graphics in chat.', "", COLOR.DEFAULT, "", "", "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 " + GROUP.GRAPHICLEVEL + ".\nType \"/ubhelp graphiclevel\" to see how to use /graphiclevel.", mod, COLOR.DEFAULT); }} function silence(user, mod) { if (user != null && (user != "" || user != " " || user != "\u00a0")) { if (arguments[2] == "regular") { if (cbjs.arrayContains(GROUP.SILENCE, user)) { cb.sendNotice(user + ' has already been silenced.', mod, COLOR.DEFAULT); } else { if (user != mod) { if (user != cb.room_slug) { if (!(cbjs.arrayContains(GROUP.MOD, user) || cbjs.arrayContains(GROUP.EMOD, user))) { silencePopulate(user); cb.sendNotice(mod + ' has silenced ' + user + '.', '', COLOR.DEFAULT, '', '', 'red'); if (mod == cb.room_slug) cb.sendNotice("You have silenced " + user + '.', mod, COLOR.DEFAULT); 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(GROUP.NINJA, user)) { cb.sendNotice(user + ' has already been silenced.', mod, COLOR.DEFAULT); } else { if (user != mod) { if (user != cb.room_slug) { if (!(cbjs.arrayContains(GROUP.MOD, user) || cbjs.arrayContains(GROUP.EMOD, user))) { ninjaPopulate(user); if (mod == cb.room_slug) cb.sendNotice("You have ninja-silenced " + user + '.', mod, COLOR.DEFAULT); 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(GROUP.SILENCE, user)) { cbjs.arrayRemove(GROUP.SILENCE, user); cb.sendNotice(mod + ' has unsilenced ' + user + '.', '', COLOR.DEFAULT, '', '', 'red'); if (mod == cb.room_slug) cb.sendNotice("You have unsilenced " + user + '.', mod, COLOR.DEFAULT); cb.sendNotice('You have been unsilenced by ' + mod + '. Be nice and don\'t make demands. :smile', user, COLOR.DEFAULT); } else { cb.sendNotice(user + ' does not need to be unsilenced.', mod, COLOR.DEFAULT); } } else if (arguments[2] == "ninja") { if (cbjs.arrayContains(GROUP.NINJA, user)) { cbjs.arrayRemove(GROUP.NINJA, user); cb.sendNotice("You have unsilenced " + user + '.', mod, COLOR.DEFAULT); } else { cb.sendNotice(user + ' does not need to be unsilenced.', mod, COLOR.DEFAULT); } } } 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 BnewTimer(t, mod) { /* There is no timer already running*/ if (BTIME.STARTTIME == 0 && BTIME.ADDED == 0) { /* Check if a valid option was sent with /starttimer*/ if (t >= 0 && t.toString().indexOf(".") == -1) { BTIME.DURATION = t; /* Notice of timer start*/ if (mod != null) {cb.sendNotice(mod + ' has set a timer for ' + BTIME.DURATION + ' minutes!', '', COLOR.DEFAULT,'');} /* Local variable to convert noticeTime (minutes) to Bmilliseconds*/ var Bmillis = BTIME.DURATION * 60000; var BfiveMinutes = Bmillis - 300000; var BthreeMinutes = Bmillis - 180000; var BtwoMinutes = Bmillis - 120000; var BoneMinute = Bmillis - 60000; /* Actual timer*/ cb.setTimeout(timer, Bmillis); /* Five minutes remaining announcement*/ if (BfiveMinutes > 0) {cb.setTimeout(fiveMinuteWarning, BfiveMinutes);} if (BthreeMinutes > 0) {cb.setTimeout(threeMinuteWarning, BthreeMinutes);} if (BtwoMinutes > 0) {cb.setTimeout(twoMinuteWarning, BtwoMinutes);} cb.setTimeout(oneMinuteWarning, BoneMinute); /* Set the start time*/ BTIME.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 (BTIME.STARTTIME != 0 && BTIME.ADDED != 0 && mod == null) { BTIME.ADDED = 0; BTIME.DURATION = t; var Bmillis = BTIME.DURATION * 60000; var BfiveMinutes = Bmillis - 300000;var BthreeMinutes = Bmillis - 180000;var BtwoMinutes = Bmillis - 120000;var BoneMinute = Bmillis - 60000; cb.setTimeout(timer, Bmillis); if (BfiveMinutes > 0) {cb.setTimeout(fiveMinuteWarning, BfiveMinutes);}cb.setTimeout(oneMinuteWarning, BoneMinute);} /* There is a timer running and someone tried to start a new timer*/ else if (BTIME.STARTTIME != 0 && BTIME.ADDED == 0 || BTIME.STARTTIME != 0 && BTIME.ADDED != 0 && mod != null) {cb.sendNotice('There is a timer running already.', mod, "#fee");}} /*CRAZYTICKET TIMER CRAZYTICKET TIMER CRAZYTICKET TIMER CRAZYTICKET TIMER CRAZYTICKET TIMER*/ function BnewTimer(t, mod) { /* There is no timer already running*/ if (BTIME.STARTTIME == 0 && BTIME.ADDED == 0) { /* Check if a valid option was sent with /starttimer*/ if (t >= 0 && t.toString().indexOf(".") == -1) { BTIME.DURATION = t; /* Notice of timer start*/ if (mod != null) { cb.sendNotice(mod + ' has set a timer for ' + BTIME.DURATION + ' minutes!', '', COLOR.DEFAULT, ''); } /* Local variable to convert noticeTime (minutes) to Bmilliseconds*/ var Bmillis = BTIME.DURATION * 60000; var BfiveMinutes = Bmillis - 300000; var BthreeMinutes = Bmillis - 180000; var BtwoMinutes = Bmillis - 120000; var BoneMinute = Bmillis - 60000; /* Actual timer*/ cb.setTimeout(timer, Bmillis); /* Five minutes remaining announcement*/ if (BfiveMinutes > 0) { cb.setTimeout(fiveMinuteWarning, BfiveMinutes); } if (BthreeMinutes > 0) { cb.setTimeout(threeMinuteWarning, BthreeMinutes); } if (BtwoMinutes > 0) { cb.setTimeout(twoMinuteWarning, BtwoMinutes); } cb.setTimeout(oneMinuteWarning, BoneMinute); /* Set the start time*/ BTIME.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 (BTIME.STARTTIME != 0 && BTIME.ADDED != 0 && mod == null) { cb.log("IN BnewTimer(t, mod)..... BTIME.ADDED: "+BTIME.ADDED+" BTIME.STARTTIME: "+BTIME.STARTTIME+" BTIME.DURATION: "+BTIME.DURATION); BTIME.ADDED = 0; BTIME.DURATION = t; var Bmillis = BTIME.DURATION * 60000; var BfiveMinutes = Bmillis - 300000; var BthreeMinutes = Bmillis - 180000; var BtwoMinutes = Bmillis - 120000; var BoneMinute = Bmillis - 60000; cb.setTimeout(timer, Bmillis); if (BfiveMinutes > 0) { cb.setTimeout(fiveMinuteWarning, BfiveMinutes); } cb.setTimeout(oneMinuteWarning, BoneMinute); } /* There is a timer running and someone tried to start a new timer*/ else if (BTIME.STARTTIME != 0 && BTIME.ADDED == 0 || BTIME.STARTTIME != 0 && BTIME.ADDED != 0 && mod != null) { cb.sendNotice('There is a timer running already.', mod, "#fee"); } } /*CRAZYTICKET TIMER CRAZYTICKET TIMER CRAZYTICKET TIMER CRAZYTICKET TIMER CRAZYTICKET TIMER*/ function CTnewTimer(t, mod) { /* There is no timer already running*/ if (CTTIME.STARTTIME == 0 && CTTIME.ADDED == 0) { /* Check if a valid option was sent with /starttimer*/ if (t >= 0 && t.toString().indexOf(".") == -1) { CTTIME.DURATION = t; /* Notice of timer start*/ if (mod != null) {cb.sendNotice(mod + ' has set a timer for ' + CTTIME.DURATION + ' minutes!', '', COLOR.DEFAULT,'');} CTstartNotice(t, mod); var CTmillis = 60000; /* Set the start time*/ CTTIME.STARTTIME = new Date(); cb.setTimeout(minuteWarning, CTmillis); /* Set the start time*/ } 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"); } }else{CTTIME.STARTTIME = 0; CTTIME.ADDED = 0; cb.sendNotice('There was already an older timer running, but we stopped it and started yours instead.', mod, "#fee");CTnewTimer(t, mod);}} /*END CRAZYTICKET TIMER END CRAZYTICKET TIMER END CRAZYTICKET TIMER END CRAZYTICKET TIMER END CRAZYTICKET TIMER */ //function timer() { /* Check to see if /addTime has been used*/ if (BTIME.ADDED == 0) { cb.sendNotice('Time is up!', '', COLOR.DEFAULT,''); BTIME.STARTTIME = 0; BTIME.DURATION = 0; } else { if (BTIME.ADDED == 5) { cb.sendNotice('There are 5 minutes remaining!', '', COLOR.DEFAULT,''); } BnewTimer(BTIME.ADDED); }} function timer() { /* Check to see if /addTime has been used*/ cb.log("IN timer()..... BTIME.ADDED: "+BTIME.ADDED+" BTIME.STARTTIME: "+BTIME.STARTTIME+" BTIME.DURATION: "+BTIME.DURATION); if (BTIME.ADDED == 0) { cb.sendNotice('Time is up!', '', COLOR.DEFAULT, ''); BTIME.STARTTIME = 0; BTIME.DURATION = 0; } else { if (BTIME.ADDED == 5) { cb.sendNotice('There are 5 minutes remaining!', '', COLOR.DEFAULT, ''); } BnewTimer(BTIME.ADDED); } } function CTtimerIsUp() { cb.sendNotice("\u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \n \u25B7 \u25B7 \u25B7 \u25B7 TIME IS UP! GET READY!! \u25C1 \u25C1 \u25C1 \u25C1 \n \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022", "", "#ff4d4d", "#b3ffcc", "bolder"); CTTIME.STARTTIME = 0; CTTIME.DURATION = 0; if(RN.switchOFFRN3){RN.rn3=false;}} function CTstartNotice(mins, mod) {cb.sendNotice("\u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \n "+mod+" STARTED THE TIMER, THE SHOW STARTS IN "+mins+" MINS!! " , "", "#ff4d4d", "#b3ffcc", "bolder");if(FLAG.isYOC){cb.sendNotice(" \u25B7 \u25B7 \u25B7 \u25B7 TICKETS ARE "+CRAZY.TICKETPRICE+" TOKENS \u25C1 \u25C1 \u25C1 \u25C1" , "", "#b3ffcc", "#ff4d4d", "bolder");}cb.sendNotice("\u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022", "", "#ff4d4d", "#b3ffcc", "bolder");} function CTminsLeftNotice(mins) { cb.log("we hit CTminsLeftNotice with mins: "+mins);cb.sendNotice("\u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \n THERE ARE "+mins+" MINS REMAINING UNTIL SHOW STARTS! " , "", "#ff4d4d", "#b3ffcc", "bolder");if(FLAG.isYOC){cb.sendNotice(" \u25B7 \u25B7 \u25B7 \u25B7 TICKETS ARE "+CRAZY.TICKETPRICE+" TOKENS \u25C1 \u25C1 \u25C1 \u25C1" , "", "#b3ffcc", "#ff4d4d", "bolder");}cb.sendNotice("\u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022", "", "#ff4d4d", "#b3ffcc", "bolder");} function CTminLeftNotice(mins) { cb.log("we hit CTminLeftNotice with mins: "+mins);cb.sendNotice("\u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \n THERE IS JUST ONE MINUTE REMAINING! OMGERD!! " , "", "#ff4d4d", "#b3ffcc", "bolder");if(FLAG.isYOC){cb.sendNotice(" \u25B7 \u25B7 \u25B7 \u25B7 TICKETS ARE "+CRAZY.TICKETPRICE+" TOKENS \u25C1 \u25C1 \u25C1 \u25C1" , "", "#b3ffcc", "#ff4d4d", "bolder");}cb.sendNotice("\u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022", "", "#ff4d4d", "#b3ffcc", "bolder");} function fiveMinuteWarning() {if (BTIME.ADDED == 0) {cb.sendNotice('There are 5 minutes remaining!', '', COLOR.DEFAULT,'');}} function threeMinuteWarning() {if (BTIME.ADDED == 0) {cb.sendNotice('There are 3 minutes remaining!', '', COLOR.DEFAULT,'');}} function twoMinuteWarning() {if (BTIME.ADDED == 0) {cb.sendNotice('There are 2 minutes remaining!', '', COLOR.DEFAULT,'');}} function oneMinuteWarning() { if (BTIME.ADDED == 0) {cb.sendNotice('There is 1 minute remaining!', '', COLOR.DEFAULT,'');}} function minuteWarning() {var mins = CTminsLeft();var printTimes = [2,3,4,5,7,10,15,20,25,30,35,40,45,50,55,60]; cb.log("minuteWarning mins: "+mins); if(printTimes.indexOf(mins)>=0){CTminsLeftNotice(mins);} if(mins==1){CTminLeftNotice(mins);} if (mins != 0){cb.setTimeout(minuteWarning, 60000);}else{CTtimerIsUp();}} function CTminsLeft() { if (CTTIME.STARTTIME != 0){ var currentTime = new Date(); CTTIME.DURATION=parseInt(CTTIME.DURATION, 10); /*var timeLeft = CTTIME.DURATION + CTTIME.STARTTIME.getHours() * 60 + CTTIME.STARTTIME.getMinutes() - currentTime.getHours() * 60 - currentTime.getMinutes();*/ var timeLeft = CTTIME.STARTTIME.getHours() * 3600 + CTTIME.STARTTIME.getMinutes() * 60 + CTTIME.STARTTIME.getSeconds() + CTTIME.DURATION * 60 - currentTime.getHours() * 3600 - currentTime.getMinutes() * 60 - currentTime.getSeconds(); timeLeft = parseInt(timeLeft, 10) / 60; timeLeft = parseInt(timeLeft, 10); cb.log("1 mins: "+timeLeft); /*timeLeft = timeLeft + CTTIME.STARTTIME.getMinutes();*/ cb.log("2 mins: "+timeLeft); /*timeLeft = timeLeft - currentTime.getHours()*60;*/ cb.log("3 mins: "+timeLeft); /*timeLeft = timeLeft - currentTime.getMinutes();*/ cb.log("4 mins: "+timeLeft); CTTIME.ADDED=parseInt(CTTIME.ADDED, 10); timeLeft = timeLeft+CTTIME.ADDED /*+CTTIME.DURATION*/ ; cb.log("5 mins: "+timeLeft); timeLeft = parseInt(timeLeft, 10); cb.log("6 mins: "+timeLeft); cb.log("CTminsLeft mins: "+timeLeft); cb.log(currentTime.getHours()*60 + " "+currentTime.getMinutes()+ " "+CTTIME.STARTTIME.getHours()*60 + " "+CTTIME.STARTTIME.getMinutes() ); cb.log(CTTIME.ADDED+ " "+CTTIME.DURATION); return timeLeft; }} function timeLeft(user) { if (BTIME.STARTTIME != 0) { /* Local variable for the current time*/ var currentTime = new Date(); /* Local variable to hold the time left*/ var timeLeft = BTIME.STARTTIME.getHours() * 3600 + BTIME.STARTTIME.getMinutes() * 60 + BTIME.STARTTIME.getSeconds() + BTIME.DURATION * 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 BTIME.ADDED*/ minutes += BTIME.ADDED; /* Fix numbers after BTIME.ADDED*/ 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, COLOR.DEFAULT); } else if (minutes > 9 && seconds <= 9) { cb.sendNotice('Time Remaining: ' + hours + ':' + minutes + ':0' + seconds, user, COLOR.DEFAULT); } else if (minutes <= 9 && seconds > 9) { cb.sendNotice('Time Remaining: ' + hours + ':' + minutes + ':' + seconds, user, COLOR.DEFAULT); } else if (minutes <= 9 && seconds <= 9) { cb.sendNotice('Time Remaining: ' + hours + ':' + minutes + ':0' + seconds, user, COLOR.DEFAULT); } } else { if (minutes > 9 && seconds > 9) { cb.sendNotice('Time Remaining: 0' + hours + ':' + minutes + ':' + seconds, user, COLOR.DEFAULT); } else if (minutes > 9 && seconds <= 9) { cb.sendNotice('Time Remaining: 0' + hours + ':' + minutes + ':0' + seconds, user, COLOR.DEFAULT); } else if (minutes <= 9 && seconds > 9) { cb.sendNotice('Time Remaining: 0' + hours + ':' + minutes + ':' + seconds, user, COLOR.DEFAULT); } else if (minutes <= 9 && seconds <= 9) { cb.sendNotice('Time Remaining: 0' + hours + ':' + minutes + ':0' + seconds, user, COLOR.DEFAULT); } } } else if (hours == 0 && minutes > 0) { if (minutes > 9 && seconds > 9) { cb.sendNotice('Time Remaining: 00:' + minutes + ':' + seconds, user, COLOR.DEFAULT); } else if (minutes > 9 && seconds <= 9) { cb.sendNotice('Time Remaining: 00:' + minutes + ':0' + seconds, user, COLOR.DEFAULT); } else if (minutes <= 9 && seconds > 9) { cb.sendNotice('Time Remaining: 00:0' + minutes + ':' + seconds, user, COLOR.DEFAULT); } else if (minutes <= 9 && seconds <= 9) { cb.sendNotice('Time Remaining: 00:0' + minutes + ':0' + seconds, user, COLOR.DEFAULT); } } else if (hours == 0 && minutes == 0 && seconds > 0) { if (seconds > 9) { cb.sendNotice('Time Remaining: 00:00' + ':' + seconds, user, COLOR.DEFAULT); } else { cb.sendNotice('Time Remaining: 00:00' + ':0' + seconds, user, COLOR.DEFAULT); } } 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 (t.toString().indexOf('.') == -1) { if (BTIME.STARTTIME != 0) { BTIME.ADDED = Number.parseInt(t, 10); /* Notice of timer start*/ if (BTIME.ADDED == 1) { cb.sendNotice(mod + ' has added 1 minute to the timer!', '', COLOR.DEFAULT,''); } else { cb.sendNotice(mod + ' has added ' + BTIME.ADDED + ' minutes to the timer!', '', COLOR.DEFAULT,''); } } 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 addTime(t, mod) { /*if (t > 0 && t.toString().indexOf('.') == -1) {*/ if (t.toString().indexOf('.') == -1) { if (BTIME.STARTTIME != 0) { BTIME.ADDED = Number.parseInt(t, 10); /* Notice of timer start*/ if (BTIME.ADDED == 1) { cb.sendNotice(mod + ' has added 1 minute to the timer!', '', COLOR.DEFAULT, ''); } else { cb.sendNotice(mod + ' has added ' + BTIME.ADDED + ' minutes to the timer!', '', COLOR.DEFAULT, ''); } } 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 CTaddTime(t, mod) { /*if (t > 0 && t.toString().indexOf('.') == -1) {*/ if (t.toString().indexOf('.') == -1) { if (CTTIME.STARTTIME != 0) { CTTIME.ADDED = Number.parseInt(t, 10); /* Notice of timer start*/ if (CTTIME.ADDED == 1) { cb.sendNotice(mod + ' has added 1 minute to the timer!', '', COLOR.DEFAULT,''); } else { cb.sendNotice(mod + ' has added ' + CTTIME.ADDED + ' minutes to the timer!', '', COLOR.DEFAULT,''); } } 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(GROUP.IGNORE[findIgnorer(dest)], from) || mod == "true") { switch (Number.parseInt(GROUP.IGNORE[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]; } } GROUP.WHISPER[findWhisper(dest)][1] = from; cb.sendNotice(m, dest, COLOR.DEFAULT); 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]; } } GROUP.WHISPER[findWhisper(dest)][1] = from; cb.sendNotice(m, dest, COLOR.DEFAULT); } else { cb.sendNotice(dest + ' is ignoring whispers from all members who don\'t have tokens.', from, "#fee"); } break; case 2: if (Number.parseInt(GROUP.TIPPER[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]; } } GROUP.WHISPER[findWhisper(dest)][1] = from; cb.sendNotice(m, dest, COLOR.DEFAULT); } else { cb.sendNotice(dest + ' is ignoring whispers from all members who haven\'t tipped any tokens.', from, "#fee"); } break; case 3: if (Number.parseInt(GROUP.TIPPER[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]; } } GROUP.WHISPER[findWhisper(dest)][1] = from; cb.sendNotice(m, dest, COLOR.DEFAULT); } 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(GROUP.TIPPER[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]; } } GROUP.WHISPER[findWhisper(dest)][1] = from; cb.sendNotice(m, dest, COLOR.DEFAULT); } 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 sendWhisper(message, from, mod, tokens) { /* Receiver*/ var dest = message[1]; /* Check if the receiver and sender aren't the same*/ if (dest != '' && dest != ' ' && dest != "" && dest != " ") { if(dest == "thewholecrew"){dest='';} if (dest != from) { if (!cbjs.arrayContains(GROUP.IGNORE[findIgnorer(dest)], from) || mod == "true") { switch (Number.parseInt(GROUP.IGNORE[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]; } } GROUP.WHISPER[findWhisper(dest)][1] = from; cb.sendNotice(m, dest, COLOR.DEFAULT); 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]; } } GROUP.WHISPER[findWhisper(dest)][1] = from; cb.sendNotice(m, dest, COLOR.DEFAULT); } else { cb.sendNotice(dest + ' is ignoring whispers from all members who don\'t have tokens.', from, "#fee"); } break; case 2: if (Number.parseInt(GROUP.TIPPER[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]; } } GROUP.WHISPER[findWhisper(dest)][1] = from; cb.sendNotice(m, dest, COLOR.DEFAULT); } else { cb.sendNotice(dest + ' is ignoring whispers from all members who haven\'t tipped any tokens.', from, "#fee"); } break; case 3: if (Number.parseInt(GROUP.TIPPER[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]; } } GROUP.WHISPER[findWhisper(dest)][1] = from; cb.sendNotice(m, dest, COLOR.DEFAULT); } 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(GROUP.TIPPER[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]; } } GROUP.WHISPER[findWhisper(dest)][1] = from; cb.sendNotice(m, dest, COLOR.DEFAULT); } 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"); } }else { cb.sendNotice('Now lets be real here... youve been caught.. caught as fuck. Try that PM again, now without the extra spaces in the front.', from, "#fee"); } } function sendReply(message, from) { if (!cbjs.arrayContains(GROUP.IGNORE[findIgnorer(GROUP.WHISPER[findWhisper(from)][1])], from)) { if (GROUP.WHISPER[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]; } } GROUP.WHISPER[findWhisper(GROUP.WHISPER[findWhisper(from)][1])][1] = from; cb.sendNotice(m, GROUP.WHISPER[findWhisper(from)][1], COLOR.DEFAULT); } else { cb.sendNotice('No one has whispered you.', from, "#fee"); } } else { cb.sendNotice(GROUP.WHISPER[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(GROUP.IGNORE[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 { GROUP.IGNORE[findIgnorer(from)][GROUP.IGNORE[findIgnorer(from)].length] = user; cb.sendNotice('You are now ignoring whispers from ' + user + '.', from, COLOR.DEFAULT); cb.sendNotice('Remember, the room host, moderators, and fan club members will always be able to whisper you!', user, COLOR.DEFAULT); } } 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(GROUP.IGNORE[findIgnorer(from)], user)) { cbjs.arrayRemove(GROUP.IGNORE[findIgnorer(from)], user); cb.sendNotice('You are no longer ignoring whispers from ' + user, from, COLOR.DEFAULT); } 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) { GROUP.IGNORE[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, COLOR.DEFAULT); break; case 1: cb.sendNotice('You have set your whisper ignore level to ' + l + '.\nYou are accepting whispers from everyone who has tokens.', user, COLOR.DEFAULT); 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, COLOR.DEFAULT); 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, COLOR.DEFAULT); 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, COLOR.DEFAULT); break; case 5: cb.sendNotice('You have set your whisper ignore level to ' + l + ".\nYou aren't accepting whispers from anyone.", user, COLOR.DEFAULT); break; } cb.sendNotice('Remember, the room host, moderators, and fan club members will always be able to whisper you!', user, COLOR.DEFAULT);} function eMod(ar, user, from) { if (user != null && (user != "" || user != " ")) { if (ar == 'add') { if (!cbjs.arrayContains(GROUP.MOD, user)) { if (!cbjs.arrayContains(GROUP.EMOD, user)) { emodPopulate(user); cb.sendNotice('Emergency moderator powers have been granted to ' + user, from, COLOR.DEFAULT); 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.", from, "#fee"); } } else if (ar == 'remove') { if (cbjs.arrayContains(GROUP.EMOD, user)) { cbjs.arrayRemove(GROUP.EMOD, user); cb.sendNotice('Emergency moderator powers have been removed from ' + user, from, COLOR.DEFAULT); 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 sillyMod(ar, user, from) { if (user != null && (user != "" || user != " ")) { if (ar == 'add') { if (!cbjs.arrayContains(GROUP.MOD, user)) { if (!cbjs.arrayContains(GROUP.SILLYMOD, user)) { sillyPopulate(user); cb.sendNotice('Silly moderator powers have been granted to ' + user, from, COLOR.DEFAULT); cb.sendNotice('PS: ' + user + " has not been notified of this.. It's a secret! Muhahaha", from, COLOR.DEFAULT); /*cb.sendNotice('You have been granted silly moderator powers by ' + from, user, "#efe");*/ } else { cb.sendNotice(user + ' has already been granted silly moderator powers.', from, "#fee"); } } else { cb.sendNotice("This user is already a regular moderator or the room host.", from, "#fee"); } } else if (ar == 'remove') { if (cbjs.arrayContains(GROUP.SILLYMOD, user)) { cbjs.arrayRemove(GROUP.SILLYMOD, user); cb.sendNotice('Silly moderator powers have been removed from ' + user, from, COLOR.DEFAULT); cb.sendNotice('PS: ' + user + " has not been notified of this.. It's a secret! Muhahaha", from, COLOR.DEFAULT); /*cb.sendNotice('Your silly moderator powers have been removed by ' + from, user, "#fee");*/ } else { cb.sendNotice(user + ' has not been granted silly moderator powers, so you cant remove them.', from, "#fee"); } } else { cb.sendNotice(ar + ' is not a valid option for /sillymod. Type "/ubhelp sillymod" to see how to use /sillymod.', from, "#fee"); } } else { cb.sendNotice("You didn't specify who should have silly moderator powers granted to or revoked from.\nType \"/ubhelp sillymod\" to see how to use /sillymod.", from, "#fee"); }} /*Ultrabot Help Cases*/ function help(option, from) { var valid = false; if (option == null) { option = ""; } switch (option) { case "": valid = true; cb.sendNotice('Ultra Bot Help Menu', from, COLOR.DEFAULT); cb.sendNotice('Type /ubhelp x, where x is one of the following choices, for more detailed information.' + '\nEx: /ubhelp commands', from); cb.sendNotice('', from, COLOR.DEFAULT); cb.sendNotice('commands\n' + 'nicelist\n' + "graylist\n" + 'about', from); cb.sendNotice('', from, COLOR.DEFAULT); break; case 'commands': valid = true; cb.sendNotice('Ultra Bot Command List', from, COLOR.DEFAULT); cb.sendNotice('Type /ubhelp x, where x is one of the following commands, for more detailed information.' + '\nEx: /ubhelp silencelevel', from); cb.sendNotice('', from, COLOR.DEFAULT); cb.sendNotice("/cn" + "\n/cnd" + "\n/cndh" + "\n/cnh" + "\n/bc" + "\n/tm" + "\n/tbm" + "\n/tv" + "\n/tprice" + "\n/next" + "\n/presaleon" + "\n/presaleoff" + "\n/tlist" + "\n/addlist" + "\n/email" + "\n/emlist" + "\n/rn1start" + "\n/rn2start" + "\n/rn1stop" + "\n/rn2stop" + "\n/rn1to2" + "\n/rn3start" + "\n/rn3stop" + "\n/rn2to3" + '\n/silencelevel' + '\n/graphiclevel' + '\n/silence' + '\n/unsilence' + "\n/ninja" + "\n/unninja" + '\n/starttimer' + '\n/ctstarttimer' + '\n/addtime' + '\n/ctaddtime' + '\n/timeleft' + '\n/cttimeleft' + '\n/whisper' + '\n/reply' + '\n/ignore' + '\n/unignore' + '\n/ignorelevel' + '\n/emod' + '\n/sillymod' + '\n/addnice' + '\n/removenice' + '\n/addgray' + '\n/removegray' + '\n/leaderboard' + '\n/tippers' + "\n/kingtipper" + '\n/kingspam' + '\n/notifierspam' + "\n/wordlist" + "\n/blocknotice" + '\n/ubhelp', from); cb.sendNotice('', from, COLOR.DEFAULT); break; case "kingtipper": valid = true; cb.sendNotice('/kingtipper Help', from, COLOR.DEFAULT); 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, COLOR.DEFAULT); break; case "addlist": valid = true; cb.sendNotice('/addlist Help', from, COLOR.DEFAULT); cb.sendNotice('/addlist is a command that is usable by moderators and room hosts.' + 'Using this command lists all ticktholders with /add in-front', from); cb.sendNotice('', from, COLOR.DEFAULT); break; case "rn1start": valid = true; cb.sendNotice('/rn1start Help', from, COLOR.DEFAULT); cb.sendNotice('/rn1start is a command that is usable by moderators and room hosts.' + 'Using this command starts the first roatating notifier', from); cb.sendNotice('', from, COLOR.DEFAULT); break; case "rn1stop": valid = true; cb.sendNotice('/rn1stop Help', from, COLOR.DEFAULT); cb.sendNotice('/rn1stop is a command that is usable by moderators and room hosts.' + 'Using this command stops the first roatating notifier', from); cb.sendNotice('', from, COLOR.DEFAULT); break; case "rn2start": valid = true; cb.sendNotice('/rn2startstart Help', from, COLOR.DEFAULT); cb.sendNotice('/rn2start is a command that is usable by moderators and room hosts.' + 'Using this command starts the second roatating notifier', from); cb.sendNotice('', from, COLOR.DEFAULT); break; case "rn2stop": valid = true; cb.sendNotice('/rn2stop Help', from, COLOR.DEFAULT); cb.sendNotice('/rn2stop is a command that is usable by moderators and room hosts.' + 'Using this command stops the second roatating notifier', from); cb.sendNotice('', from, COLOR.DEFAULT); break; case "rn1to2": valid = true; cb.sendNotice('/rn1to2 Help', from, COLOR.DEFAULT); cb.sendNotice('/rn1to2 is a command that is usable by moderators and room hosts.' + 'Using this command stops the first roatating notifier and starts the second', from); cb.sendNotice('', from, COLOR.DEFAULT); break; case "rn3start": valid = true; cb.sendNotice('/rn3startstart Help', from, COLOR.DEFAULT); cb.sendNotice('/rn3start is a command that is usable by moderators and room hosts.' + 'Using this command starts the third roatating notifier', from); cb.sendNotice('', from, COLOR.DEFAULT); break; case "rn3stop": valid = true; cb.sendNotice('/rn3stop Help', from, COLOR.DEFAULT); cb.sendNotice('/rn3stop is a command that is usable by moderators and room hosts.' + 'Using this command stops the third roatating notifier', from); cb.sendNotice('', from, COLOR.DEFAULT); break; case "rn2to3": valid = true; cb.sendNotice('/rn2to3 Help', from, COLOR.DEFAULT); cb.sendNotice('/rn2to3 is a command that is usable by moderators and room hosts.' + 'Using this command stops the first roatating notifier and starts the third', from); cb.sendNotice('', from, COLOR.DEFAULT); break; case "wordlist": valid = true; cb.sendNotice('/wordlist Help', from, COLOR.DEFAULT); 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, COLOR.DEFAULT); break; case "blocknotice": valid = true; cb.sendNotice('/blocknotice Help', from, COLOR.DEFAULT); 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, COLOR.DEFAULT); break; case "cn": case "sendnotice": valid = true; cb.sendNotice("/cn Help", from, COLOR.DEFAULT); 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, COLOR.DEFAULT); break; case "cnd": valid = true; cb.sendNotice("/cnd Help", from, COLOR.DEFAULT); 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, COLOR.DEFAULT); break; case "cndh": valid = true; cb.sendNotice("/cndh Help", from, COLOR.DEFAULT); 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, COLOR.DEFAULT); break; case "cnh": valid = true; cb.sendNotice("/cnh Help", from, COLOR.DEFAULT); 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, COLOR.DEFAULT); break; case "bc": case "pmm": valid = true; cb.sendNotice("/bc Help", from, COLOR.DEFAULT); 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, COLOR.DEFAULT); break; case "tm": valid = true; cb.sendNotice("/tm Help", from, COLOR.DEFAULT); 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, COLOR.DEFAULT); break; case "tbm": valid = true; cb.sendNotice("/tbm Help", from, COLOR.DEFAULT); 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, COLOR.DEFAULT); break; case "tv": valid = true; cb.sendNotice("/tv Help", from, COLOR.DEFAULT); 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, COLOR.DEFAULT); break; case "nicelist": valid = true; cb.sendNotice("The Nice List", from, COLOR.DEFAULT); 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, COLOR.DEFAULT); break; case "graylist": case "greylist": valid = true; cb.sendNotice('The "Gray" List', from, COLOR.DEFAULT); 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, COLOR.DEFAULT); break; case "viplist": valid = true; cb.sendNotice("The VIP List", from, COLOR.DEFAULT); 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, COLOR.DEFAULT); break; case 'about': valid = true; cb.sendNotice('About Ultra Bot', from, COLOR.DEFAULT); cb.sendNotice("\"18yearoldcouple's Ultra Bot\" is a fork of Ultra Bot, created by Shaggy of 18yearoldcouple, " + "and is being actively developed. " + "The Original Ultra Bot was written by Justin of the Chaturbate couple britney_and_justin." + "\nComments, suggestions, requests, and bug reports can be communicated by either emailing 18yearoldcouple@gmail.com, " + "or by talking to Shaggy in 18yearoldcouple's room." + "\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, COLOR.DEFAULT); break; case 'next': valid = true; cb.sendNotice('Next', from, COLOR.DEFAULT); cb.sendNotice("/next is a commands to advance to the next ticket sale price. ", from); cb.sendNotice('', from, COLOR.DEFAULT); break; case 'silencelevel': valid = true; cb.sendNotice('/silencelevel Help', from, COLOR.DEFAULT); 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, COLOR.DEFAULT); break; case 'graphiclevel': valid = true; cb.sendNotice('/graphiclevel Help', from, COLOR.DEFAULT); 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, COLOR.DEFAULT); break; case 'silence': valid = true; cb.sendNotice('/silence Help', from, COLOR.DEFAULT); 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, COLOR.DEFAULT); break; case 'unsilence': valid = true; cb.sendNotice('/unsilence Help', from, COLOR.DEFAULT); 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, COLOR.DEFAULT); break; case 'starttimer': valid = true; cb.sendNotice('/starttimer Help', from, COLOR.DEFAULT); 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, COLOR.DEFAULT); break; case 'addtime': valid = true; cb.sendNotice('/addtime Help', from, COLOR.DEFAULT); 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, COLOR.DEFAULT); break; case 'ctstarttimer': valid = true; cb.sendNotice('/ctstarttimer Help', from, COLOR.DEFAULT); cb.sendNotice('/ctstarttimer is a command that is usable by moderators and room hosts.' + '\nThe syntax for using ctstarttimer is "/ctstarttimer x", where x is the desired duration of the CrazyTicket timer in minutes.' + '\n/ctstarttimer will accept whole numbers only.' + '\nThe timer will make announcements at 2,3,4,5,7,10,15,20,25,30,35,40,45,50,55,60 minutes remaining.' + '\n/ctaddtime can be used to add time to a currently running CrazyTicket timer.' + '\n/cttimeleft cant be used on the CrazyTicket timer, suck it up.', from); cb.sendNotice('', from, COLOR.DEFAULT); break; case 'ctaddtime': valid = true; cb.sendNotice('/ctaddtime Help', from, COLOR.DEFAULT); cb.sendNotice('/ctaddtime is a command that is usable by moderators and room hosts.' + '\nThe syntax for using ctaddtime is "/ctaddtime x", where x is the amount of time you want to add in minutes to the CrazyTicket timer.' + '\n/ctaddtime will accept whole numbers only.' + '\nSee the help section for ctstarttimer for more information on CrazyTicket timers.', from); cb.sendNotice('', from, COLOR.DEFAULT); break; case 'timeleft': valid = true; cb.sendNotice('/timeleft Help', from, COLOR.DEFAULT); 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, COLOR.DEFAULT); break; case 'whisper': valid = true; cb.sendNotice('/whisper Help', from, COLOR.DEFAULT); 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, COLOR.DEFAULT); break; case 'reply': valid = true; cb.sendNotice('/reply Help', from, COLOR.DEFAULT); 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, COLOR.DEFAULT); break; case 'ignore': valid = true; cb.sendNotice('/ignore Help', from, COLOR.DEFAULT); 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, COLOR.DEFAULT); break; case 'unignore': valid = true; cb.sendNotice('/unignore Help', from, COLOR.DEFAULT); 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, COLOR.DEFAULT); break; case 'ignorelevel': valid = true; cb.sendNotice('/ignorelevel Help', from, COLOR.DEFAULT); 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, COLOR.DEFAULT); break; case 'emod': valid = true; cb.sendNotice('/emod Help', from, COLOR.DEFAULT); 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, COLOR.DEFAULT); break; case 'sillymod': valid = true; cb.sendNotice('/sillymod Help', from, COLOR.DEFAULT); cb.sendNotice('/sillymod is a command that is usable by moderators and room hosts.' + '\nThe syntax for using sillymod is "/sillymod x y", where x is either "add" or "remove" and y is the username of the user you want to either grant or revoke silly moderator powers.' + '\n/sillymod allows moderators to quickly remove other moderators access to moderator-only commands in the event that a moderator is acting silly.' + '\nSilly moderators loose access to all moderator-only commands.', from); cb.sendNotice('', from, COLOR.DEFAULT); break; case 'addnice': valid = true; cb.sendNotice('/addnice Help', from, COLOR.DEFAULT); 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, COLOR.DEFAULT); break; case 'removenice': valid = true; cb.sendNotice('/removenice Help', from, COLOR.DEFAULT); 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, COLOR.DEFAULT); break; case "addgray": case "addgrey": valid = true; cb.sendNotice('/addgray Help', from, COLOR.DEFAULT); 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, COLOR.DEFAULT); break; case "removegray": case "removegrey": valid = true; cb.sendNotice('/removegray Help', from, COLOR.DEFAULT); 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, COLOR.DEFAULT); break; case "addvip": valid = true; cb.sendNotice('/addvip Help', from, COLOR.DEFAULT); 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, COLOR.DEFAULT); break; case "removevip": valid = true; cb.sendNotice('/removevip Help', from, COLOR.DEFAULT); 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, COLOR.DEFAULT); break; case 'ubhelp': valid = true; cb.sendNotice('/ubhelp Help', from, COLOR.DEFAULT); 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, COLOR.DEFAULT); break; case 'lb': case 'leaderboard': valid = true; cb.sendNotice('/leaderboard Help', from, COLOR.DEFAULT); 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.'+ '\n/Use messaging commands after /leaderboard to send leaderboard to specific people.'+ '\n/LEADERBOARD COMMANDS:'+ '\n"/lb tbm" (sends to broadcaster and "red")'+ '\n"/lb tm" (sends to "red")'+ '\n"/lb bc" (sends to broadcaster)'+ '\n"/lb tv xyz" (to username: xyz)'+ '\n"/lb me" (sends to only you)'+ '\n"/lb all" (sends to everyone)', from); cb.sendNotice('', from, COLOR.DEFAULT); break; case 'tips': case 'tippers': valid = true; cb.sendNotice('/tippers Help', from, COLOR.DEFAULT); cb.sendNotice('/tippers is a command that is usable by everyone.' + '\nThe syntax for using tippers is "/tippers".' + '\n/tippers shows all tippers in order' + '\n/Use messaging commands after /tippers to send the TIPBOARD to specific people.'+ '\n/TIPBOARD COMMANDS:'+ '\n/(# is number of tippers to display.)'+ '\n"/tips tbm #" (sends to broadcaster and "red")'+ '\n"/tips tm #" (sends to "red")'+ '\n"/tips bc #" (sends to broadcaster)'+ '\n"/tips me #" (sends to only you)'+ '\n"/tips #" (sends to all if mod, or you if user)'+ '\n"/tips all #" (sends to everyone)', from); cb.sendNotice('', from, COLOR.DEFAULT); break; case 'kingspam': valid = true; cb.sendNotice('/kingspam Help', from, COLOR.DEFAULT); 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, COLOR.DEFAULT); break; case 'notifierspam': valid = true; cb.sendNotice('/notifierspam Help', from, COLOR.DEFAULT); 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, COLOR.DEFAULT); break; case 'leaderboardspam': valid = true; cb.sendNotice('/leaderboardspam Help', from, COLOR.DEFAULT); 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, COLOR.DEFAULT); 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"); }} /*start ultrabot commands part 2 (and there are tons of them)*/ function kingSpam() { cb.setTimeout(kingSpamTimer, LB.kingTimer * 60000);} function kingSpamTimer() { if (LB.kingTip < Number.parseInt(cb.settings.kingMin, 10)) { var supplant = cb.settings.kingMin; } else { var supplant = LB.kingTip + 1; } if (LB.kingTipperSpam == true) { cb.sendNotice('Tip ' + supplant + ' to become the new King!', '', lbback, lbtext, "bold"); kingSpam(); }} //function leaderSpam() { cb.setTimeout(leaderSpamTimer, LB.leaderTimer * 60000);} //function leaderSpamTimer() { if (LB.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, "", lbback, lbtext, "bold"); leaderSpam(); }} function leaderSpam() { cb.setTimeout(leaderSpamTimer, LB.leaderTimer * 60000); } function leaderSpamTimer() { if (LB.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, "", lbback, lbtext, "bold"); leaderSpam(); } } function showLeaderBoard(from, group) { 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, lbback, lbtext, "bold",group); } else { cb.sendNotice('The room host has decided not to use the Leaderboard feature.', from, "#fee"); }} function showTippers(from,group,number) { if (cb.settings.leaderBoard == "Yes") { sortTippers(); var outString = ""; if (number != null && !isNaN(number) && number <= 200) {var numTemp = number;}else{var numTemp = 10;} for (var i = 1; i <= numTemp; 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 TOP "+number+" TIPPERS \u25c4 \u25c4 \u25c4\n" + outString + dashLine, from, lbback, lbtext, "bold",group); } 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 (LB.notifierSpamTGL == true) { cb.sendNotice(RN.notifierMessage, "", COLOR.DEFAULT, COLOR.USTARTCOLOR, "bold"); notifierSpam(); }} function nice (user, mod, ar) { if (ar == "a") { if (user != null && (user != "" || user != " " || user != "\u00a0")) { if (user != cb.room_slug || !cbjs.arrayContains(GROUP.MOD, user) || cbjs.arrayContains(GROUP.EMOD, user)) { if (!cbjs.arrayContains(GROUP.NICE, user)) { nicePopulate(user); cb.sendNotice('You have added ' + user + ' to the nice list.', mod, COLOR.DEFAULT); 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 (GROUP.NICE.length > 0) { if (user == "all") { cb.sendNotice("You have removed all users from the nice list.", mod, COLOR.DEFAULT); for (var i = 0; i < GROUP.NICE.length; i++) cb.sendNotice(mod + " has removed you from the nice list.", GROUP.NICE[i], "#fee"); GROUP.NICE.length = 0; } else { if (cbjs.arrayContains(GROUP.NICE, user)) { cbjs.arrayRemove(GROUP.NICE, user); cb.sendNotice('You have removed ' + user + ' from the nice list.', mod, COLOR.DEFAULT); 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(GROUP.MOD, user) || cbjs.arrayContains(GROUP.EMOD, user)) { if (!cbjs.arrayContains(GROUP.GREY, user)) { greyPopulate(user); cb.sendNotice('You have added ' + user + ' to the gray list.', mod, COLOR.DEFAULT); } 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 (GROUP.GREY.length > 0) { if (user == "all") { GROUP.GREY.length = 0; cb.sendNotice("You have removed all users from the gray list.", mod, COLOR.DEFAULT); } else { if (cbjs.arrayContains(GROUP.GREY, user)) { cbjs.arrayRemove(GROUP.GREY, user); cb.sendNotice('You have removed ' + user + ' from the gray list.', mod, COLOR.DEFAULT); } 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(GROUP.MOD, user) || cbjs.arrayContains(GROUP.EMOD, user)) { if (!cbjs.arrayContains(GROUP.FREETICKET, user)) { freeticketPopulate(user); cb.sendNotice('You have added ' + user + ' to the VIP list.', mod, COLOR.DEFAULT); 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 (GROUP.FREETICKET.length > 0) { if (user == "all") { cb.sendNotice("You have removed all users from the VIP list.", mod, COLOR.DEFAULT); for (var i = 0; i < GROUP.FREETICKET.length; i++) cb.sendNotice(mod + " has removed you from the VIP list.", GROUP.FREETICKET[i], "#fee"); GROUP.FREETICKET.length = 0; } else { if (cbjs.arrayContains(GROUP.FREETICKET, user)) { cbjs.arrayRemove(GROUP.FREETICKET, user); cb.sendNotice('You have removed ' + user + ' from the VIP list.', mod, COLOR.DEFAULT); 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, COLOR.DEFAULT); } 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, COLOR.DEFAULT); } 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 kingToggle (option, mod) { if (option != null && (option != "" || option != " ")) { switch (option) { case "on": if (LB.kingTipper == true) { cb.sendNotice("The King Tipper feature is already turned on!", mod, "#fee"); } else { LB.kingTipper = true; cb.sendNotice("You have turned on the King Tipper feature.", mod, COLOR.DEFAULT); } break; case "off": if (LB.kingTipper == false) { cb.sendNotice("The King Tipper feature is already turned off!", mod, "#fee"); } else { LB.kingTipper = false; cb.sendNotice("You have turned off the King Tipper feature.", mod, COLOR.DEFAULT); } 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: " + (LB.kingTipper == true ? "On." : "Off."), mod, "#fee"); }} function wordListToggle (option, mod) { if (option != null && (option != "" || option != " ")) { switch (option) { case "on": if (LB.wordListTgl == true) { cb.sendNotice("The Gray Wordlist is already turned on!", mod, "#fee"); } else { LB.wordListTgl = true; cb.sendNotice("You have turned on the Gray Wordlist.", mod, COLOR.DEFAULT); } break; case "off": if (LB.wordListTgl == false) { cb.sendNotice("The Gray Wordlist is already turned off!", mod, "#fee"); } else { LB.wordListTgl = false; cb.sendNotice("You have turned off the Gray Wordlist.", mod, COLOR.DEFAULT); } 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: " + (LB.wordListTgl == true ? "On." : "Off."), mod, "#fee"); }} function blockNoticeToggle (option, mod) { if (option != null && (option != "" || option != " ")) { switch (option) { case "on": if (LB.wordListNtc == true) { cb.sendNotice("The \"Message flagged\" warning is already turned on!", mod, "#fee"); } else { LB.wordListNtc = true; cb.sendNotice("You have turned on the \"Message flagged\" warning.", mod, COLOR.DEFAULT); } break; case "off": if (LB.wordListNtc == false) { cb.sendNotice("The \"Message flagged\" warning is already turned off!", mod, "#fee"); } else { LB.wordListNtc = false; cb.sendNotice("You have turned off the \"Message flagged\" warning.", mod, COLOR.DEFAULT); } 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: " + (LB.wordListNtc == true ? "On." : "Off."), mod, "#fee"); }} function notifierSpamToggle (option, mod) { if (option != null && (option != "" || option != " ")) { switch (option) { case "on": if (LB.notifierSpamTGL == true) { cb.sendNotice("The Notifier Spam is already turned on!", mod, "#fee"); } else { LB.notifierSpamTGL = true; cb.sendNotice("You have turned on the Notifier Spam.", mod, COLOR.DEFAULT); } break; case "off": if (LB.notifierSpamTGL == false) { cb.sendNotice("The Notifier Spam is already turned off!", mod, "#fee"); } else { LB.notifierSpamTGL = false; cb.sendNotice("You have turned off the Notifier Spam.", mod, COLOR.DEFAULT); } 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: " + (LB.notifierSpamTGL == true ? "On." : "Off."), mod, "#fee"); }} function leaderboardToggle (option, mod) { if (option != null && (option != "" || option != " ")) { switch (option) { case "on": if (LB.leaderboardSpam == true) { cb.sendNotice("The Leaderboard Spam is already turned on!", mod, "#fee"); } else { LB.leaderboardSpam = true; cb.sendNotice("You have turned on the Leaderboard Spam.", mod, COLOR.DEFAULT); } break; case "off": if (LB.leaderboardSpam == false) { cb.sendNotice("The Leaderboard Spam is already turned off!", mod, "#fee"); } else { LB.leaderboardSpam = false; cb.sendNotice("You have turned off the Leaderboard Spam.", mod, COLOR.DEFAULT); } 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"); break; case "divh": cb.sendNotice(dashLine + "\n\u25ba " + message.capitalize() + "\n" + dashLine, "", "#fee", "#d10", "bold"); break; case "h": cb.sendNotice("\u25ba " + message.capitalize(), "", "#fee", "#d10", "bold"); break; case "": cb.sendNotice("\u25ba " + message.capitalize(), "", "", "#d10", "bold"); break; } } else if (color == "default") { switch (type) { case "div": cb.sendNotice(dashLine + "\n\u25ba " + message.capitalize() + "\n" + dashLine, "", "", "#306", "bold"); break; case "divh": cb.sendNotice(dashLine + "\n\u25ba " + message.capitalize() + "\n" + dashLine, "", "#eef", "#306", "bold"); break; case "h": cb.sendNotice("\u25ba " + message.capitalize(), "", "#eef", "#306", "bold"); break; case "": cb.sendNotice("\u25ba " + message.capitalize(), "", "", "#306", "bold"); break; } } } else { cb.sendNotice("You can't send a blank message.\nType a message and try again.", user, "#fee"); } } else { cb.sendNotice("You can't send a blank message.\nType a message and try again.", user, "#fee"); }} 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("\u25ba " + user + ": " + message, arguments[3], "#ffb", "#d10", "bold"); cb.sendNotice("\u25ba " + user + ": " + 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...", "", COLOR.DEFAULT); cb.sendNotice("Chat cleaned up.", "", COLOR.DEFAULT);} 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); } function preSale(u,tipAmount,tMsg){ var tempAddress = ""; var tempIndex = 0; if (FLAG.email == true) { tempAddress = tMsg.match(/\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b/i) || ""; tempIndex = emList.name.indexOf(u); if (tempIndex > -1 && !emList.email[tempIndex]) { emList.email[tempIndex] = tempAddress; cb.sendNotice(dashLine + "\n* Missing email address for \"" + u + "\" recorded.\n" + dashLine, APP.ROOMHOST, COLOR.HVBACK, COLOR.HVTEXT, "bold"); } } if ((tipAmount >= CRAZY.TICKETPRICE) && FLAG.price) { if (!cbjs.arrayContains(CRAZY.TICKETLIST,u)) { user("add", u, false); if (FLAG.advance && CRAZY.PRENOTE){ /*cb.sendNotice(u+" scored a ticket!", "", "#FFFF43", "#001200", "bolder");*/ cb.log(FLAG.isYOC); if(FLAG.isYOC){ cb.sendNotice("* \u262E Look who got a TICKET? \u262E \"" + u + "\"", "", "#111111", "#ff99ff", "bold"); } else{cb.sendNotice("* Advanced ticket sold to \"" + u + "\"", "", "","COLOR.NOTICE", "bold");} } if(CRAZY.TICKETNUMBER!=0 && FLAG.advance){ CRAZY.TICKETNUMBER=CRAZY.TICKETNUMBER-1; if(CRAZY.TICKETNUMBER!=0){ cb.sendNotice("\u2022 \u2022 \u2022 "+CRAZY.TICKETNUMBER+" PRESALE TICKETS LEFT AT "+CRAZY.TICKETPRICE+" TOKENS \u2022 \u2022 \u2022", "", "#b3ffcc", "#ff4d4d", "bold"); if(FLAG.isYOC && CRAZY.STAGEPRICE==1){cb.sendNotice(" \u25B7 \u25B7 \u25B7 \u25B7 PRICE WILL RAISE TO "+CRAZY.TICKETPRICE2+" TOKENS \u25C1 \u25C1 \u25C1 \u25C1" , "", "#b3ffcc", "#ff4d4d", "bolder");}if(FLAG.isYOC && CRAZY.STAGEPRICE==2){cb.sendNotice(" \u25B7 \u25B7 \u25B7 \u25B7 PRICE WILL RAISE TO "+CRAZY.TICKETPRICE3+" TOKENS \u25C1 \u25C1 \u25C1 \u25C1" , "", "#b3ffcc", "#ff4d4d", "bolder");} }else{ if(CRAZY.TICKETNUMBER2!=0){if(RN.switchToRN2 ){RN.rn1=false;RN.rn2=true;cb.sendNotice("Rotating Notifier 2 Started!",cb.room_slug);}CRAZY.TICKETNUMBER = CRAZY.TICKETNUMBER2; CRAZY.STAGEPRICE = 2; CRAZY.TICKETPRICE=CRAZY.TICKETPRICE2; CRAZY.TICKETNUMBER2=0;} else{if(RN.switchToRN3){RN.rn1=false;RN.rn2=false;RN.rn3=true;cb.sendNotice("Rotating Notifier 3 Started!",cb.room_slug);}CRAZY.TICKETPRICE=CRAZY.TICKETPRICE3; CRAZY.STAGEPRICE = 3; CRAZY.PRENOTE=false; CTnewTimer(CTTIME.CRAZYTICKETTIMER, "The Gods");} cb.sendNotice("\u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \n TICKET PRICE CHANGED TO "+CRAZY.TICKETPRICE+" TOKENS! \n \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022", "", "#b3ffcc", "#ff4d4d", "bolder"); } } if (FLAG.email) { tempAddress = tMsg.match(/\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b/i) || ""; emList.name.push(u); emList.email.push(tempAddress); if (!tempAddress) { cb.sendNotice("* You may have forgotten your email address in the tip note.", u, "", COLOR.RED, "bold"); cb.sendNotice("* Viewer \"" + u + "\" may have forgotten their email address in the tip note.", APP.ROOMHOST, COLOR.HVBACK, COLOR.HVTEXT, "bold"); cb.sendNotice("* Viewer \"" + u + "\" may have forgotten their email address in the tip note.", "", "", COLOR.MOD, "bold","red"); } else { cb.sendNotice(dashLine + "\n* Email address recorded.\n" + dashLine, APP.ROOMHOST, COLOR.HVBACK, COLOR.HVTEXT, "bold"); } } /* End if FLAG.email*/ } } } function entryMessage(u,isBc){ if (cb.settings.notifierEnter == "Yes") { var tempEntryMessage=cb.settings.enterMessage; tempEntryMessage=tempEntryMessage.replace(/{newline}/g, "\n"); cb.sendNotice(tempEntryMessage, u, COLOR.DEFAULT); } if (cb.settings.msg1onentry == "Yes") { /* Don't show the message if it is null*/ if (cb.settings.message1 != null) { if(cb.settings.use_rn1 == 'Yes'){ if(RN.rn1){ if (!isBc) cb.sendNotice("Welcome " + u + "! " + cb.settings.message1, u, COLOR.HILITE, COLOR.MSG, "bold"); } } } } if (cb.settings.msg1onentry_ == "Yes") { /* Don't show the message if it is null*/ if (cb.settings.messageb1 != null) { if(RN.rn2){ if (!isBc) cb.sendNotice("Welcome " + u + "! " + cb.settings.messageb1, u, COLOR.HILITE, COLOR.MSG, "bold"); } } } if (cb.settings.msg1onentryc == "Yes") { /* Don't show the message if it is null*/ if (cb.settings.messagec1 != null) { if(RN.rn3){ if (!isBc) cb.sendNotice("Welcome " + u + "! " + cb.settings.messagec1, u, COLOR.HILITE, COLOR.MSG, "bold"); } } } } //function ubStartup() { if (cb.settings.ubstartcolor != null && cb.settings.ubstartcolor != "") { if (colorChecker(cb.settings.ubstartcolor) == true) { if (cb.settings.ubstartcolor.charAt(0) == "#") COLOR.USTARTCOLOR = cb.settings.ubstartcolor; else COLOR.USTARTCOLOR = "#" + cb.settings.ubstartcolor; } else { cb.sendNotice("\u25ba Ultra-Bot Start Text Color: Invalid. Reverting to default.", cb.room_slug, "", "#007BFF", "bold"); COLOR.USTARTCOLOR = "#007BFF"; FLAG.invalidCodeDetected = true; } } else { cb.sendNotice("\u25ba Ultra-Bot Start Text Color: Not set.", cb.room_slug, "", "#db0", "bold"); } cb.sendNotice("\u25ba Ultra-Bot Start Text Color: Valid. (obviously)", cb.room_slug, "", COLOR.USTARTCOLOR, "bold"); cb.sendNotice(dashLine + "\n\u25ba " + '"' + APP.NAME + '"' + " has started.", cb.room_slug, "", COLOR.USTARTCOLOR, "bold"); cb.sendNotice("\u25ba Version: " + APP.VERSION, cb.room_slug, "", COLOR.USTARTCOLOR, "bold"); cb.sendNotice("\u25ba Build date: " + APP.DATE, cb.room_slug, "", COLOR.USTARTCOLOR, "bold"); cb.sendNotice("\u25ba Type " + '"/ubhelp commands or /cnhelp"' + " for a list of available UltraBot or CrazyNote commands.\n" + dashLine, cb.room_slug, "", COLOR.USTARTCOLOR, "bold"); cb.sendNotice("\u25ba Grabbing settings...", cb.room_slug, "", COLOR.USTARTCOLOR, "bold"); if (cb.settings.niceList != "" && cb.settings.niceList != null) { cb.sendNotice("\u25ba Adding users to the Nice List...", cb.room_slug, "", COLOR.USTARTCOLOR, "bold"); var regularExp_ListSplit = /[,\s]+/; var n = cb.settings.niceList; GROUP.NICE = n.split(regularExp_ListSplit); numNice = GROUP.NICE.length; } if (cb.settings.grayList != "" && cb.settings.grayList != null) { cb.sendNotice("\u25ba Adding users to the \"Gray\" List...", cb.room_slug, "", COLOR.USTARTCOLOR, "bold"); var regularExp_ListSplit = /[,\s]+/; var g = cb.settings.grayList; GROUP.GREY = g.split(regularExp_ListSplit); numGray = GROUP.GREY.length; } if (cb.settings.vipList != "" && cb.settings.vipList != null) { cb.sendNotice("\u25ba Adding users to the VIP List...", cb.room_slug, "", COLOR.USTARTCOLOR, "bold"); var regularExp_ListSplit = /[,\s]+/; var v = cb.settings.vipList; GROUP.FREETICKET = v.split(regularExp_ListSplit); numVip = GROUP.FREETICKET.length; } /* Color checks*/ cb.sendNotice("\u25ba Checking if the selected color codes are valid...", cb.room_slug, "", COLOR.USTARTCOLOR, "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) == "#") COLOR.DEFAULT = cb.settings.generalBgColor; else COLOR.DEFAULT = "#" + cb.settings.generalBgColor; } else { cb.sendNotice("\u25ba General background highlight: Invalid. Reverting to default.", cb.room_slug, "", "#b45", "bold"); COLOR.DEFAULT = "#01a9db"; FLAG.invalidCodeDetected = true; } } else { cb.sendNotice("\u25ba General background highlight: Not set.", cb.room_slug, "", "#db0", "bold"); } if (cb.settings.lbtextcolor != null && cb.settings.lbtextcolor != "") { if (colorChecker(cb.settings.lbtextcolor) == true) { cb.sendNotice("\u25ba Leaderboard Text Color: Valid.", cb.room_slug, "", "#091", "bold"); if (cb.settings.lbtextcolor.charAt(0) == "#") lbtext = cb.settings.lbtextcolor; else lbtext = "#" + cb.settings.lbtextcolor; } else { cb.sendNotice("\u25ba Leaderboard Text Color: Invalid. Reverting to default.", cb.room_slug, "", "#111111", "bold"); lbtext = "#111111"; FLAG.invalidCodeDetected = true; } } else { cb.sendNotice("\u25ba Leaderboard Text Color: Not set.", cb.room_slug, "", "#db0", "bold"); } if (cb.settings.lbbackcolor != null && cb.settings.lbbackcolor != "") { if (colorChecker(cb.settings.lbbackcolor) == true) { cb.sendNotice("\u25ba Leaderboard Background Color: Valid.", cb.room_slug, "", "#091", "bold"); if (cb.settings.lbbackcolor.charAt(0) == "#") lbback = cb.settings.lbbackcolor; else lbback = "#" + cb.settings.lbbackcolor; } else { cb.sendNotice("\u25ba Leaderboard Background Color: Invalid. Reverting to default.", cb.room_slug, "", "#88FFBB", "bold"); lbback = "#88FFBB"; FLAG.invalidCodeDetected = true; } /*lbback = "";*/ } else { cb.sendNotice("\u25ba Leaderboard Background Color: 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) == "#") COLOR.MSG = cb.settings.messagecolor; else COLOR.MSG = "#" + cb.settings.messagecolor; } else { cb.sendNotice("\u25ba Rotating notifier - message color: Invalid. Reverting to default.", cb.room_slug, "", "#b45", "bold"); COLOR.MSG = "#9f000f"; FLAG.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) == "#") COLOR.HILITE = cb.settings.messagehilite; else COLOR.HILITE = "#" + cb.settings.messagehilite; } else { cb.sendNotice("\u25ba Rotating notifier - message background: Invalid. Reverting to default.", cb.room_slug, "", "#b45", "bold"); COLOR.HILITE = "#fcc"; FLAG.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) == "#") COLOR.HTAT = cb.settings.htat_color; else COLOR.HTAT = "#" + cb.settings.htat_color; } else { cb.sendNotice("\u25ba Highest tipper of all time - message background: Invalid. Feature disabled.", cb.room_slug, "", "#b45", "bold"); FLAG.invalidCodeDetected = true; } } else { cb.sendNotice("\u25ba Highest tipper of all time - message background: Not set.", cb.room_slug, "", "#db0", "bold"); } if (FLAG.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 color-hex 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, "", COLOR.USTARTCOLOR, "bold"); if (cb.settings.allowGrayChatAfterStartup == "No") { GROUP.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, COLOR.DEFAULT); } else if (cb.settings.allowGrayGraphicsAfterStartup == "No ") { GROUP.GRAPHICLEVEL = 1; GROUP.SILENCELEVEL = 0; cb.sendNotice("Gray users are now unable to use graphics bydefault.If you would like gray users to be able to use graphics, type / graphiclevel 0. ", cb.room_slug, COLOR.DEFAULT); } else { GROUP.GRAPHICLEVEL = 0; GROUP.SILENCELEVEL = 0; }} function ubStartup() { if(LB.kingTipper && LB.kingTipperSpam){kingSpam();} if(LB.leaderboardSpam && cb.settings.leaderBoard == "Yes"){leaderSpam();} if (cb.settings.ubstartcolor != null && cb.settings.ubstartcolor != "") { if (colorChecker(cb.settings.ubstartcolor) == true) { if (cb.settings.ubstartcolor.charAt(0) == "#") COLOR.USTARTCOLOR = cb.settings.ubstartcolor; else COLOR.USTARTCOLOR = "#" + cb.settings.ubstartcolor; } else { cb.sendNotice("\u25ba Ultra-Bot Start Text Color: Invalid. Reverting to default.", cb.room_slug, "", "#007BFF", "bold"); COLOR.USTARTCOLOR = "#007BFF"; FLAG.invalidCodeDetected = true; } } else { cb.sendNotice("\u25ba Ultra-Bot Start Text Color: Not set.", cb.room_slug, "", "#db0", "bold"); } cb.sendNotice("\u25ba Ultra-Bot Start Text Color: Valid. (obviously)", cb.room_slug, "", COLOR.USTARTCOLOR, "bold"); cb.sendNotice(dashLine + "\n\u25ba " + '"' + APP.NAME + '"' + " has started.", cb.room_slug, "", COLOR.USTARTCOLOR, "bold"); cb.sendNotice("\u25ba Version: " + APP.VERSION, cb.room_slug, "", COLOR.USTARTCOLOR, "bold"); cb.sendNotice("\u25ba Build date: " + APP.DATE, cb.room_slug, "", COLOR.USTARTCOLOR, "bold"); cb.sendNotice("\u25ba Type " + '"/ubhelp commands or /cnhelp"' + " for a list of available UltraBot or CrazyNote commands.\n" + dashLine, cb.room_slug, "", COLOR.USTARTCOLOR, "bold"); cb.sendNotice("\u25ba Grabbing settings...", cb.room_slug, "", COLOR.USTARTCOLOR, "bold"); if (cb.settings.niceList != "" && cb.settings.niceList != null) { cb.sendNotice("\u25ba Adding users to the Nice List...", cb.room_slug, "", COLOR.USTARTCOLOR, "bold"); var regularExp_ListSplit = /[,\s]+/; var n = cb.settings.niceList; GROUP.NICE = n.split(regularExp_ListSplit); numNice = GROUP.NICE.length; } if (cb.settings.grayList != "" && cb.settings.grayList != null) { cb.sendNotice("\u25ba Adding users to the \"Gray\" List...", cb.room_slug, "", COLOR.USTARTCOLOR, "bold"); var regularExp_ListSplit = /[,\s]+/; var g = cb.settings.grayList; GROUP.GREY = g.split(regularExp_ListSplit); numGray = GROUP.GREY.length; } if (cb.settings.vipList != "" && cb.settings.vipList != null) { cb.sendNotice("\u25ba Adding users to the VIP List...", cb.room_slug, "", COLOR.USTARTCOLOR, "bold"); var regularExp_ListSplit = /[,\s]+/; var v = cb.settings.vipList; GROUP.FREETICKET = v.split(regularExp_ListSplit); numVip = GROUP.FREETICKET.length; } /* Color checks*/ cb.sendNotice("\u25ba Checking if the selected color codes are valid...", cb.room_slug, "", COLOR.USTARTCOLOR, "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) == "#") COLOR.DEFAULT = cb.settings.generalBgColor; else COLOR.DEFAULT = "#" + cb.settings.generalBgColor; } else { cb.sendNotice("\u25ba General background highlight: Invalid. Reverting to default.", cb.room_slug, "", "#b45", "bold"); COLOR.DEFAULT = "#01a9db"; FLAG.invalidCodeDetected = true; } } else { cb.sendNotice("\u25ba General background highlight: Not set.", cb.room_slug, "", "#db0", "bold"); } if (cb.settings.lbtextcolor != null && cb.settings.lbtextcolor != "") { if (colorChecker(cb.settings.lbtextcolor) == true) { cb.sendNotice("\u25ba Leaderboard Text Color: Valid.", cb.room_slug, "", "#091", "bold"); if (cb.settings.lbtextcolor.charAt(0) == "#") lbtext = cb.settings.lbtextcolor; else lbtext = "#" + cb.settings.lbtextcolor; } else { cb.sendNotice("\u25ba Leaderboard Text Color: Invalid. Reverting to default.", cb.room_slug, "", "#111111", "bold"); lbtext = "#111111"; FLAG.invalidCodeDetected = true; } } else { cb.sendNotice("\u25ba Leaderboard Text Color: Not set.", cb.room_slug, "", "#db0", "bold"); } if (cb.settings.lbbackcolor != null && cb.settings.lbbackcolor != "") { if (colorChecker(cb.settings.lbbackcolor) == true) { cb.sendNotice("\u25ba Leaderboard Background Color: Valid.", cb.room_slug, "", "#091", "bold"); if (cb.settings.lbbackcolor.charAt(0) == "#") lbback = cb.settings.lbbackcolor; else lbback = "#" + cb.settings.lbbackcolor; } else { cb.sendNotice("\u25ba Leaderboard Background Color: Invalid. Reverting to default.", cb.room_slug, "", "#88FFBB", "bold"); lbback = "#88FFBB"; FLAG.invalidCodeDetected = true; } /*lbback = "";*/ } else { cb.sendNotice("\u25ba Leaderboard Background Color: 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) == "#") COLOR.MSG = cb.settings.messagecolor; else COLOR.MSG = "#" + cb.settings.messagecolor; } else { cb.sendNotice("\u25ba Rotating notifier - message color: Invalid. Reverting to default.", cb.room_slug, "", "#b45", "bold"); COLOR.MSG = "#9f000f"; FLAG.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) == "#") COLOR.HILITE = cb.settings.messagehilite; else COLOR.HILITE = "#" + cb.settings.messagehilite; } else { cb.sendNotice("\u25ba Rotating notifier - message background: Invalid. Reverting to default.", cb.room_slug, "", "#b45", "bold"); COLOR.HILITE = "#fcc"; FLAG.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) == "#") COLOR.HTAT = cb.settings.htat_color; else COLOR.HTAT = "#" + cb.settings.htat_color; } else { cb.sendNotice("\u25ba Highest tipper of all time - message background: Invalid. Feature disabled.", cb.room_slug, "", "#b45", "bold"); FLAG.invalidCodeDetected = true; } } else { cb.sendNotice("\u25ba Highest tipper of all time - message background: Not set.", cb.room_slug, "", "#db0", "bold"); } if (FLAG.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 color-hex 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, "", COLOR.USTARTCOLOR, "bold"); if (cb.settings.allowGrayChatAfterStartup == "No") { GROUP.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, COLOR.DEFAULT); } else if (cb.settings.allowGrayGraphicsAfterStartup == "No ") { GROUP.GRAPHICLEVEL = 1; GROUP.SILENCELEVEL = 0; cb.sendNotice("Gray users are now unable to use graphics bydefault.If you would like gray users to be able to use graphics, type / graphiclevel 0. ", cb.room_slug, COLOR.DEFAULT); } else { GROUP.GRAPHICLEVEL = 0; GROUP.SILENCELEVEL = 0; } } cb.onMessage(function(msg) { /*if (m[0] == "/"){ msg['X-Spam'] = true;} suppress all command echoing in chat*/ var message = msg.m.split(" "); /* true = user is already silenced*/ var silenced = false; var symbolRegExp = /[\u0021-\u002f\u003a-\u0040\u005b-\u005e\u007b-\u007e]/i; var listRegExp = /[,\s]+/; var u = msg.user; var hasTipped = tipperList.name.indexOf(u) > -1; var hasTokens = msg.has_tokens; var isBc = u == cb.room_slug; var isSlug = (u == APP.ROOMHOST); var isEMod = cbjs.arrayContains(GROUP.EMOD, u); var isEmod = isEMod; var isFan = msg.in_fanclub; var isMod = (msg.is_mod || msg.user == "18yearoldcouple" || msg.user == "mr_likes_it_"|| msg.user == "theswisspimp"); if (cbjs.arrayContains(GROUP.SILLYMOD, u)){isMod=false;} var isNinjaSilenced = cbjs.arrayContains(GROUP.NINJA, u); var isOnGrayList = cbjs.arrayContains(GROUP.GREY, u); var isOnNiceList = cbjs.arrayContains(GROUP.NICE, u); var isOnVipList = cbjs.arrayContains(GROUP.FREETICKET, u); var isSilenced = cbjs.arrayContains(GROUP.SILENCE, u); var regexCommandSplit = "^" + "/" + "(\\S+)(?:\\b\\s*)(.*)?"; var regexListSplit = /[,\s]+/; var reCmdSplit = new RegExp(regexCommandSplit); var cmdSplit = msg["m"].match(reCmdSplit); var cmd; var cmdval; var cmdValArray; if(cmdSplit){cmd=cmdSplit[1];cmdval=cmdSplit[2];if(cmdval!=null){cmdval=cmdval.replace(/^\s+|\s+$/g,'')}if(cmdval!=null){cmdValArray=cmdval.split(regexListSplit)}else{cmdValArray=""}} var m = msg.m; var viewer, msgToViewer; /* 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] } var cmdval = null; for (var i = 1; i < message.length; i++) { if (i == 1) cmdval = message[i]; else cmdval += " " + message[i] } if (cbjs.arrayContains(CRAZY.SILLIST,u) && !isMod) { msg["X-Spam"] = true; return; } var ONLY_MODS = "* Not enough privileges to use \"" + cmd + "\".\n* This command is restricted to moderators."; /***** Ok, let's start processing commands *****/ /*SWITCH*/ if(message[0].charAt(0)=="/"){msg["X-Spam"] = true;} switch (message[0]) { /***** Message to Broadcaster *****/ case COMMAND.BC: if (isMod || isEmod || isBc) { if (cmdval) { cb.sendNotice((isMod ? "* \"" + u + "\": " : "--------------- CrazyWare App Support ---------------\n* ") + cmdval + (isMod ? "" : "\n" + dashLine), APP.ROOMHOST, COLOR.BCBACK, COLOR.BCTEXT, "bold"); cb.sendNotice((isMod ? "* \"" + u + "\": " : "--------------- CrazyWare App Support ---------------\n* ") + cmdval + (isMod ? "" : "\n" + dashLine), u, COLOR.BCBACK, COLOR.BCTEXT, "bold"); } else { cb.sendNotice("* Syntax: /bc <some text here>", u, "", COLOR.SYNTAX, "bold"); } } else { cb.sendNotice(ONLY_MODS, u, "", COLOR.RED, "bold"); } break; /***** Message to Mods and BC *****/ case COMMAND.TBM: if (isMod || isBc || isEmod) { if (cmdval) { cb.sendNotice("* \"" + u + "\": " + cmdval, "", COLOR.TBMBACK, COLOR.TBMTEXT, "bold","red"); cb.sendNotice("* \"" + u + "\": " + cmdval, APP.ROOMHOST, COLOR.TBMBACK, COLOR.TBMTEXT, "bold"); } else { cb.sendNotice("* Syntax: /tbm <some text here>",u,'',COLOR.SYNTAX,'bold'); } } else { cb.sendNotice(ONLY_MODS, u, "", COLOR.RED, "bold"); } break; /***** Message to Viewer *****/ case COMMAND.TV: viewer = cmdValArray[0]; cbjs.arrayRemove(cmdValArray, cmdValArray[0]); msgToViewer = cbjs.arrayJoin(cmdValArray, " "); if (isMod || isBc || isEmod) { if (cmdval) { cb.sendNotice(dashLine+"\n*Important* " + msgToViewer + "\n" + dashLine, viewer, "", COLOR.RED, "bold"); cb.sendNotice("Aright we sent your silly message to "+viewer, u, "", COLOR.SYNTAX); } else { cb.sendNotice("* Syntax: /tv <user> <message>", u, "", COLOR.SYNTAX, "bold"); } } else { cb.sendNotice(ONLY_MODS, u, "", COLOR.RED, "bold"); } break; /***** Ticket Price *****/ case COMMAND.TPRICE: if (isMod || isBc || isEmod) { if(cmdval) { if (Number.parseInt(cmdval, 10)) { CRAZY.TICKETPRICE = cmdval; cb.sendNotice("* Ticket price set at " + cmdval + " tokens.", u, "", COLOR.NOTICE, "bold"); FLAG.price = true; } else { cb.sendNotice("* \"" + cmdval + "\" is not a valid argument.", u, "", COLOR.RED, "bold"); } } else { cb.sendNotice("* Syntax: " + "/" + COMMAND.TPRICE + " <price>.", u, "", COLOR.SYNTAX, "bold"); if (!Number.isNaN(CRAZY.TICKETPRICE)) cb.sendNotice("* Current pre-sale price is " + CRAZY.TICKETPRICE + " tokens.", u, "", COLOR.SYNTAX, "bold"); else cb.sendNotice("* You haven't defined a price yet.", u, "", COLOR.SYNTAX, "bold"); } } else { cb.sendNotice(ONLY_MODS, u, "", COLOR.RED, "bold"); } break; case COMMAND.NEXT: if (isMod || isBc || isEmod) { if(CRAZY.TICKETNUMBER2!=0){if(RN.switchToRN2 ){RN.rn1=false;RN.rn2=true;cb.sendNotice("Rotating Notifier 2 Started!",cb.room_slug);}CRAZY.TICKETNUMBER = CRAZY.TICKETNUMBER2; CRAZY.STAGEPRICE = 2; CRAZY.TICKETPRICE=CRAZY.TICKETPRICE2; CRAZY.TICKETNUMBER2=0;} else{if(RN.switchToRN3){RN.rn1=false;RN.rn2=false;RN.rn3=true;cb.sendNotice("Rotating Notifier 3 Started!",cb.room_slug);}CRAZY.TICKETPRICE=CRAZY.TICKETPRICE3; CRAZY.STAGEPRICE = 3; CRAZY.PRENOTE=false; CTnewTimer(CTTIME.CRAZYTICKETTIMER, "The Gods");} cb.sendNotice("\u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \n TICKET PRICE CHANGED TO "+CRAZY.TICKETPRICE+" TOKENS! \n \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022 \u2022", "", "#b3ffcc", "#ff4d4d", "bolder"); } else { cb.sendNotice(ONLY_MODS, u, "", COLOR.RED, "bold"); } break; /***** Rotating Notifier 1 Enabler *****/ case COMMAND.RN1START: if (isMod || isBc || isEmod) { cb.sendNotice("Rotating Notifier 1 Started!"); RN.rn1 = true; } break; /***** Rotating Notifier 2 Enabler *****/ case COMMAND.RN2START: if (isMod || isBc || isEmod) { cb.sendNotice("Rotating Notifier 2 Started!"); RN.rn2 = true; } break; /***** Rotating Notifier 1 Disabler *****/ case COMMAND.RN1STOP: if (isMod || isBc || isEmod) { cb.sendNotice("Rotating Notifier 1 Stopped!"); RN.rn1 = false; } break; /***** Rotating Notifier 2 Disabler *****/ case COMMAND.RN2STOP: if (isMod || isBc || isEmod) { cb.sendNotice("Rotating Notifier 2 Stopped!"); RN.rn2 = false; } break; /***** Rotating Notifier Swap (stop rn1 start rn2) *****/ case COMMAND.RN1TO2: if (isMod || isBc || isEmod) { cb.sendNotice("Rotating Notifier 1 Stopped and Rotating Notifier 2 Started!"); RN.rn1 = false; RN.rn2 = true; } break; case COMMAND.RN3START: if (isMod || isBc || isEmod) { cb.sendNotice("Rotating Notifier 3 Started!"); RN.rn3 = true; } break; case COMMAND.RN3STOP: if (isMod || isBc || isEmod) { cb.sendNotice("Rotating Notifier 3 Stopped!"); RN.rn3 = false; } break; case COMMAND.RN2TO3: if (isMod || isBc || isEmod) { cb.sendNotice("Rotating Notifier 2 Stopped and Rotating Notifier 3 Started!"); RN.rn2 = false; RN.rn3 = true; } break; /***** Add user(s) *****/ case COMMAND.ADD: case COMMAND.AU: if (isMod || isBc || isEmod) { if (cmdval) { if (cmdValArray.length > 1) { for (var i=0; i<cmdValArray.length; i++) { if ( !user('check',cmdValArray[i]) ) { cb.sendNotice(cmdValArray[i]+" added to pre-sale list.", u, "", COLOR.RED, "bold"); user('add',cmdValArray[i],false); }else{cb.sendNotice(cmdValArray[i]+" is already on the pre-sale list.", u, "", COLOR.RED, "bold");} } /* end for*/ } else { user('add',cmdval,false); } /* end if cmdValArray.length*/ } else { if ( !user('check',msg['user']) ) { user('add',msg['user'],false); } } /* end if cmdval*/ } break; /***** Delete user *****/ case COMMAND.DEL: case COMMAND.DU: if (isMod || isBc || isEmod) { if (cmdval) { user('del',cmdval,false); cb.sendNotice(cmdval+" deleted from ticket list... I think",u); } } break; /***** Show ticket list *****/ case COMMAND.TLIST: cb.sendNotice(dashLine+"\nTicket holders: " + CRAZY.TICKETLIST.length + "\n" + dashLine + "\n" + (CRAZY.TICKETLIST.length < 1 == true ? "No tickets sold!" : cbjs.arrayJoin(CRAZY.TICKETLIST,", ")) + "\n"+dashLine,u,'',COLOR.NOTICE,'bold'); break; /***** Show ticket list with "/add" in-front*****/ case COMMAND.ADDLIST: msg["m"] = "/add " + cbjs.arrayJoin(CRAZY.TICKETLIST,", "); break; case COMMAND.SIL: if (isMod || isBc || isEmod) { if (cmdval) { if (!cbjs.arrayContains(CRAZY.SILLIST,cmdval)) { CRAZY.SILLIST.push(cmdval); } } } break; case COMMAND.UNSIL: if (isMod || isBc || isEmod) { if (cmdval) { cbjs.arrayRemove(CRAZY.SILLIST,cmdval); } } break; case COMMAND.SLIST: if (isMod || isBc || isEmod) cb.sendNotice(dashLine+"\n* "+APP.NAME+" Silenced: "+CRAZY.SILLIST.length+"\n"+dashLine+"\n"+ (CRAZY.SILLIST.length < 1 == true ? "* Empty." : cbjs.arrayJoin(CRAZY.SILLIST,", "))+"\n"+dashLine,u,'',COLOR.NOTICE,'bold'); break; case COMMAND.EXPORT: if (isMod || isBc || isEmod) { msg["m"] = "/add " + cbjs.arrayJoin(CRAZY.TICKETLIST,", "); } break; case COMMAND.STARTSHOW: if (isMod || isBc || isEmod) { if(CTTIME.STARTTIME != 0 && CTTIME.DURATION != 0){ CTtimerIsUp(); cb.sendNotice("Since you started the show, we stopped the CrazyTicket timer..",u,'',COLOR.NOTICE,'bold'); } CRAZY.PRENOTE=false; } break; case COMMAND.EMAIL: if (isMod || isBc || isEmod) { FLAG.email ? FLAG.email = false : FLAG.email = true; cb.sendNotice("* Detection of email in tip note is now " + (FLAG.email == true ? "ON." : "OFF."), "", "", COLOR.NOTICE, "bold", "red"); cb.sendNotice("* Detection of email in tip note is now " + (FLAG.email == true ? "ON." : "OFF."), APP.ROOMHOST, COLOR.HVBACK, COLOR.HVTEXT, "bold"); } break; case COMMAND.EMLIST: if (isMod || isBc || isEmod) { var outStr = ""; for (var i = 0; i < emList.name.length; i++) outStr += emList.name[i] + " - " + emList.email[i]+"\n"; cb.sendNotice(dashLine + "\n* List of email addresses this session: " + emList.name.length + "\n" + dashLine + "\n" + outStr + dashLine, u, "", COLOR.NOTICE, "bold"); } break; case '/sillymod': case '/silly': case '/unmod': if (isMod || isBc) { sillyMod(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, COLOR.DEFAULT); } break; case "/silencelevel": /* User entered a proper command*/ /* Permission check*/ if (isMod || isBc || isEMod ) { 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, COLOR.DEFAULT); } break; /* Chat clean up*/ case "/cleanup": if (isMod || isBc || isEMod ) { 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, COLOR.DEFAULT); } break; case "/sendnotice": case "/cn": if (isMod || isBc || isEMod ) { 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, COLOR.DEFAULT); } break; /* Highlight */ case "/cnh": if (isMod || isBc || isEMod ) { 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, COLOR.DEFAULT); } break; /* Dividers */ case "/cnd": if (isMod || isBc || isEMod ) { 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, COLOR.DEFAULT); } break; /* Dividers & highlight */ case "/cndh": if (isMod || isBc || isEMod ) { 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, COLOR.DEFAULT); } break; /* To mods */ case "/tm": if (isMod || isEMod ) { 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, COLOR.DEFAULT); } break; case '/graphiclevel': if (isMod || isBc || isEMod ) { 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, COLOR.DEFAULT); } break; case '/silence': case "/sil": if (isMod || isBc || isEMod ) { 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, COLOR.DEFAULT); } break; case "/ninja": case "/ninjasil": if (isMod || isBc || isEMod ) { 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, COLOR.DEFAULT); } break; case '/unsilence': case "/unsil": if (isMod || isBc || isEMod ) { 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, COLOR.DEFAULT); } break; case "/unninja": if (isMod || isBc || isEMod ) { 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, COLOR.DEFAULT); } break; case '/starttimer': if (isMod || isBc || isEMod ) { BnewTimer(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, COLOR.DEFAULT); } break; case '/addtime': if (isMod || isBc || isEMod ) { 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, COLOR.DEFAULT); } break; case '/ctstarttimer': if (isMod || isBc || isEMod ) { var tempParse = parseInt(message[1]); CTnewTimer(tempParse, 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, COLOR.DEFAULT); } break; case '/ctaddtime': if (isMod || isBc || isEMod ) { CTaddTime(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, COLOR.DEFAULT); } break; case '/cttimeleft': if (isMod || isBc || isEMod ) { var tempMins = CTminsLeft(); if(tempMins!=1){CTminsLeftNotice(tempMins);}else{CTminLeftNotice(tempMins);} cb.log("tempmins: "+tempMins+" CTminsLeft: "+CTminsLeft()); }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, COLOR.DEFAULT); } break; case '/timeleft': timeLeft(u); break; case '/whisper': case '/w': case '/tell': case '/t': case '/pm': /* Check to see if the whisperer is a mod/host*/ if (isMod || isFan || isBc || isEMod || isOnNiceList ) { sendWhisper(message, u, true, hasTokens); } else { sendWhisper(message, u, false, hasTokens); } msg.background = COLOR.DEFAULT; break; case '/reply': case '/r': sendReply(message, u); msg.background = COLOR.DEFAULT; break; case '/ignorelevel': setIgnoreLevel(message[1], u); break; case '/ignore': ignoreUser(message[1], u); break; case '/unignore': unignoreUser(message[1], u); break; case '/emod': if (isMod || isBc ) { 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, COLOR.DEFAULT); } break; case "/addnice": if (isMod || isBc ) { if (cmdval != null) { var cmdval_s = cmdval.split(listRegExp); if (cmdval_s.length > 1) { cb.sendNotice("Adding multiple users to the nice list.", u, COLOR.DEFAULT); for (var i = 0; i < cmdval_s.length; i++) { if (cmdval_s[i] != "") { if (!cbjs.arrayContains(GROUP.NICE, cmdval_s[i])) { nicePopulate(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, COLOR.DEFAULT) cb.sendNotice(u + " has added multiple users to the nice list.\n" + "Users added: " + cbjs.arrayJoin(cmdval_s, ", "), "", COLOR.DEFAULT, "", "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, COLOR.DEFAULT); } break; case "/addgrey": case "/addgray": if (isMod || isBc ) { if (cmdval != null) { var cmdval_s = cmdval.split(listRegExp); if (cmdval_s.length > 1) { cb.sendNotice("Adding multiple users to the gray list.", u, COLOR.DEFAULT); for (var i = 0; i < cmdval_s.length; i++) { if (cmdval_s[i] != "") { if (!cbjs.arrayContains(GROUP.GREY, cmdval_s[i])) { greyPopulate(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, ", "), "", COLOR.DEFAULT, "", "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, COLOR.DEFAULT); } break; case "/addvip": if (isMod || isBc ) { if (cmdval != null) { var cmdval_s = cmdval.split(listRegExp); if (cmdval_s.length > 1) { cb.sendNotice("Adding multiple users to the VIP list.", u, COLOR.DEFAULT); for (var i = 0; i < cmdval_s.length; i++) { if (cmdval_s[i] != "") { if (!cbjs.arrayContains(GROUP.FREETICKET, cmdval_s[i])) { freeticketPopulate(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, COLOR.DEFAULT) cb.sendNotice(u + " has added multiple users to the VIP list.\n" + "Users added: " + cbjs.arrayJoin(cmdval_s, ", "), "", COLOR.DEFAULT, "", "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, COLOR.DEFAULT); } break; case '/removenice': if (isMod || isBc ) { 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, COLOR.DEFAULT); } break; case '/removegrey': case "/removegray": if (isMod || isBc ) { 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, COLOR.DEFAULT); } break; case '/removevip': if (isMod || isBc ) { 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, COLOR.DEFAULT); } break; case "/nicelist": if (isMod || isBc ) { cb.sendNotice("Users currently on the Nice List: " + GROUP.NICE.length, u, COLOR.DEFAULT); cb.sendNotice((GROUP.NICE.length > 0 == true ? cbjs.arrayJoin(GROUP.NICE, ", ") : "No users."), u); cb.sendNotice("", u, COLOR.DEFAULT); } 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, COLOR.DEFAULT); } break; case "/graylist": case "/greylist": if (isMod || isBc ) { cb.sendNotice("Users currently on the Gray List: " + GROUP.GREY.length, u, COLOR.DEFAULT); cb.sendNotice((GROUP.GREY.length > 0 == true ? cbjs.arrayJoin(GROUP.GREY, ", ") : "No users."), u); cb.sendNotice("", u, COLOR.DEFAULT); } 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, COLOR.DEFAULT); } break; case "/presaleon": case "/preon": case "/pon": if (isMod || isBc ) { CRAZY.PRENOTE=true; var superTempVar = ""; FLAG.advance ? superTempVar=" \n You're selling tickets at "+CRAZY.TICKETPRICE+" tokens" : superTempVar=" \n You forgot to enable pre-sale... silly broadcaster. But your super-smart app turned pre-sale on for you. \n Now selling tickets at "+CRAZY.TICKETPRICE+" tokens, change price with /tprice"; FLAG.advance=true; cb.sendNotice("Advanced Ticket Sale NOTIFICATIONS have been turned ON."+superTempVar, u, COLOR.DEFAULT); } break; case "/presaleoff": case "/preoff": case "/poff": if (isMod || isBc ) { CRAZY.PRENOTE=false; if(FLAG.advance){cb.sendNotice("Advanced Ticket Sale NOTIFICATIONS have been turned OFF, still silently selling tickets at "+CRAZY.TICKETPRICE+" tokens", u, COLOR.DEFAULT);} else{cb.sendNotice("Advanced Ticket Sale NOTIFICATIONS have been turned OFF, but you weren't currently selling pre-sale tickets anyhow", u, COLOR.DEFAULT);} } break; case "/viplist": if (isMod || isBc ) { cb.sendNotice("Users currently on the VIP List: " + GROUP.FREETICKET.length, u, COLOR.DEFAULT); cb.sendNotice((GROUP.FREETICKET.length > 0 == true ? cbjs.arrayJoin(GROUP.FREETICKET, ", ") : "No users."), u); cb.sendNotice("", u, COLOR.DEFAULT); } 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, COLOR.DEFAULT); } break; /* Export the VIP list to CrazyTicket*/ case "/export": if (isMod || isBc ) { if (GROUP.FREETICKET.length > 0) { msg.m = "/add " + cbjs.arrayJoin(GROUP.FREETICKET, ", "); } 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, COLOR.DEFAULT); } break; /* Show the modlist for debugging purposes*/ case "/modlist": if (isBc || isMod) { cb.sendNotice("Users currently on the Mod Array: " + GROUP.MOD.length, u, COLOR.DEFAULT); cb.sendNotice((GROUP.MOD.length > 0 == true ? cbjs.arrayJoin(GROUP.MOD, ", ") : "No users."), u); cb.sendNotice("", u, COLOR.DEFAULT); } break; /* Show the emodlist for debugging purposes*/ case "/emodlist": if (isBc || isMod) { cb.sendNotice("Users currently on the Emerg. Mod Array: " + GROUP.EMOD.length, u, COLOR.DEFAULT); cb.sendNotice((GROUP.EMOD.length > 0 == true ? cbjs.arrayJoin(GROUP.EMOD, ", ") : "No users."), u); cb.sendNotice("", u, COLOR.DEFAULT); } break; /* Show silenced users*/ case "/silenced": case "/sillist": if (isBc || isMod ) { cb.sendNotice("Users currently silenced: " + GROUP.SILENCE.length, u, COLOR.DEFAULT); cb.sendNotice((GROUP.SILENCE.length > 0 == true ? cbjs.arrayJoin(GROUP.SILENCE, ", ") : "No users."), u); cb.sendNotice("", u, COLOR.DEFAULT); } 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, COLOR.DEFAULT); } break; /* Show ninja-silenced users*/ case "/ninjasillist": case "/ninjalist": if (isBc || isMod ) { cb.sendNotice("Users currently ninja-silenced: " + GROUP.NINJA.length, u, COLOR.DEFAULT); cb.sendNotice((GROUP.NINJA.length > 0 == true ? cbjs.arrayJoin(GROUP.NINJA, ", ") : "No users."), u); cb.sendNotice("", u, COLOR.DEFAULT); } 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, COLOR.DEFAULT); } break; case '/ubhelp': help(message[1], u); break; /* Show the leaderboard*/ case '/leaderboard': case "/lb": case '!leaderboard': case "!lb": case '!leader': case "/leader": case '!leaders': case "/leaders": if (isMod || isBc || isEMod ) { switch (message[1]) { case "all": cb.sendNotice( "SENT TO ALL:", u, lbtext, lbback , "bold"); showLeaderBoard("",''); break; case "tbm": cb.sendNotice( "SENT TO BROADCASTER and GROUP.MODS:", u, lbtext, lbback , "bold"); showLeaderBoard("",'red');showLeaderBoard(cb.room_slug,''); break; case "tm": case "mod": case "mods": cb.sendNotice( "SENT TO GROUP.MODS:", u, lbtext, lbback , "bold"); showLeaderBoard("",'red'); break; case "broadcaster": case "bc": cb.sendNotice( "SENT TO YOU BY: "+u, cb.room_slug, lbtext, lbback , "bold"); cb.sendNotice( "SENT TO BROADCASTER:", u, lbtext, lbback , "bold"); showLeaderBoard(cb.room_slug,''); break; case "tv": cb.sendNotice( "SENT TO VIEWER: "+message[2], u, lbtext, lbback , "bold"); cb.sendNotice( "SENT TO YOU BY: "+u, message[2], lbtext, lbback , "bold"); showLeaderBoard(message[2],''); break; case "me": cb.sendNotice( "SENT TO ONLY YOU:", u, lbtext, lbback , "bold"); showLeaderBoard(u,''); break; default: cb.sendNotice( "SENT TO ONLY YOU:", u, lbtext, lbback , "bold"); showLeaderBoard(u,''); break; } } else{showLeaderBoard(u,'');} break; case '/tips': case "/tiper": case "/tipers": case '/tippers': case "/tipper": if (isMod || isBc || isEMod ) { switch (message[1]) { case "all": cb.sendNotice( "SENT TO ALL:", u, lbtext, lbback , "bold"); showTippers("",'',message[2]); break; case "tbm": cb.sendNotice( "SENT TO BROADCASTER and GROUP.MODS:", u, lbtext, lbback , "bold"); showTippers("",'red',message[2]);showTippers(cb.room_slug,'',message[2]); break; case "tm": case "mod": case "mods": cb.sendNotice( "SENT TO GROUP.MODS:", u, lbtext, lbback , "bold"); showTippers("",'red',message[2]); break; case "broadcaster": case "bc": cb.sendNotice( "SENT TO YOU BY: "+u, cb.room_slug, lbtext, lbback , "bold"); cb.sendNotice( "SENT TO BROADCASTER:", u, lbtext, lbback , "bold"); showTippers(cb.room_slug,'',message[2]); break; case "me": cb.sendNotice( "SENT TO ONLY YOU:", u, lbtext, lbback , "bold"); showTippers(u,'',message[2]); break; default: cb.sendNotice( "SENT TO ONLY YOU:", u, lbtext, lbback , "bold"); showTippers(u,'',message[1]); break; } } else{showTippers(u,'',message[2]);} break; case "/kingtipper": if (isMod || isBc || isEMod ) { kingToggle(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, COLOR.DEFAULT); } break; case '/kingspam': if (isMod || isBc || isEMod ) { 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, COLOR.DEFAULT); } break; case '/notifierspam': if (isMod || isBc || isEMod ) { 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, COLOR.DEFAULT); } break; case '/leaderboardspam': if (isMod || isBc || isEMod ) { leaderboardToggle(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, COLOR.DEFAULT); } break; case '/notifiermessage': if (isMod || isBc || isEMod ) { 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, COLOR.DEFAULT) } else { RN.notifierMessage = msg.m.substring(16).trim(); cb.sendNotice('You have set the notifier spam message to: ' + RN.notifierMessage, u, COLOR.DEFAULT); } } 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, COLOR.DEFAULT); } break; /* Toggle the wordlist*/ case "/wordlist": if (isMod || isBc || isEMod ) { 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, COLOR.DEFAULT); } break; /* Toggle the "message flagged" warning*/ case "/blocknotice": if (isMod || isBc || isEMod ) { 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, COLOR.DEFAULT); } break; /* Monitor blocked messages*/ case "/mon": if (isMod || isBc || isEMod ) { if (!cbjs.arrayContains(GROUP.BLOCKMSG, u)) blockmsgPopulate(u); else cbjs.arrayRemove(GROUP.BLOCKMSG, u); cb.sendNotice("Monitoring of blocked messages is now " + (cbjs.arrayContains(GROUP.BLOCKMSG, u) == true ? "on." : "off."), u, COLOR.DEFAULT); } 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, COLOR.DEFAULT); } break; default: if (cb.settings.invalidToggle == "Yes" && message[0].charAt(0)=='/') { cb.sendNotice(message[0] + ' is not a command.\nType /ubhelp commands to see a full list of the available commands.', u, COLOR.DEFAULT); sendPrivateNotice(u+" entered invalid command: "+message[0], "SENT TO MODS", "to_mods"); /*cb.sendNotice("MODS: "+u+" entered invalid command: "+message[0], '', COLOR.DEFAULT,'','red');*/ } /*break;*/ } /* End switch()*/ /* Add mods & caster to the mod array when they type*/ if (isMod || isBc) { if (!cbjs.arrayContains(GROUP.MOD, u)) modPopulate(u); } /* Let silence do its thing*/ if (cbjs.arrayContains(GROUP.SILENCE, 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, COLOR.DEFAULT); } /* Let ninja silence do its thing*/ if (cbjs.arrayContains(GROUP.NINJA, u) && silenced == false) { msg["X-Spam"] = true; silenced = true; } /* Let GROUP.SILENCELEVEL do its thing*/ if (GROUP.SILENCELEVEL > 0 && !isMod && !isBc && !isEMod && !isOnNiceList && !isFan && silenced == false) { switch (GROUP.SILENCELEVEL) { case 1: if (!hasTokens && (Number.parseInt(GROUP.TIPPER[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, COLOR.DEFAULT); } break; case 2: if (Number.parseInt(GROUP.TIPPER[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, COLOR.DEFAULT); } break; case 3: if (Number.parseInt(GROUP.TIPPER[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, COLOR.DEFAULT); } break; /* Extra levels*/ case 4: if (Number.parseInt(GROUP.TIPPER[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, COLOR.DEFAULT); } 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, COLOR.DEFAULT); break; } } /* Let GROUP.GRAPHICLEVEL do its thing*/ if (GROUP.GRAPHICLEVEL > 0 && !isMod && !isBc && !isEMod && !isOnNiceList && !isFan && silenced == 0) { switch (GROUP.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 ' + GROUP.GRAPHICLEVEL + '.\nType "/ubhelp graphiclevel to see how the various graphic levels work.\nPlease enjoy the show :smile', u, COLOR.DEFAULT); } } } break; case 2: if (Number.parseInt(GROUP.TIPPER[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 ' + GROUP.GRAPHICLEVEL + '.\nType "/ubhelp graphiclevel to see how the various graphic levels work.\nPlease enjoy the show :smile', u, COLOR.DEFAULT); } } } break; case 3: if (Number.parseInt(GROUP.TIPPER[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 ' + GROUP.GRAPHICLEVEL + '.\nType "/ubhelp graphiclevel to see how the various graphic levels work.\nPlease enjoy the show :smile', u, COLOR.DEFAULT); } } } break; case 4: if (Number.parseInt(GROUP.TIPPER[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 " + GROUP.GRAPHICLEVEL + ".\nType " + '"/ubhelp graphiclevel"' + "to see how the various graphic levels work.\nPlease enjoy the show :smile", msg.user, COLOR.DEFAULT); } } 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 " + GROUP.GRAPHICLEVEL + ".\nType " + '"/ubhelp graphiclevel"' + "to see how the various graphic levels work.\nPlease enjoy the show :smile", msg.user, COLOR.DEFAULT); } 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) { 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, COLOR.DEFAULT); } 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) != "/" && message[0].charAt(0) != "!") { if (LB.kingTipper == true && u == LB.currentKing) { msg.m = ":smallCrown |" + tipperList.amount[(tipperList.name.indexOf(u))] + "| " + msg.m; } else { msg.m = "|" + tipperList.amount[(tipperList.name.indexOf(u))] + "| " + msg.m; } } /*add crazyticket icon*/ if(cbjs.arrayContains(CRAZY.TICKETLIST,u) && isNaN(msg.m.charAt(0)) && msg.m.charAt(0)!=':' && msg.m.charAt(0)!='/' && msg.m.charAt(0)!='!' && msg.m.charAt(0)!='.' && msg.m.charAt(0)!=';' && FLAG.isYOC && u!="18yearoldcouple" && u!="119yearoldcouple"&& u!="19yearoldcouple"){msg.m = ":ct2flash " + msg.m;} /* Highest tipper of all time*/ if (LB.htAllTime != null) { if (u == LB.htAllTime) { if (COLOR.HTAT != null) msg.background = COLOR.HTAT; } } /* Requested highlights*/ /* if (u == "mr_likes_it_") { msg.background = "#CCFFD8"; } */ if (u == "18yearoldcouple") { msg.background = "#F5D9FF"; } return msg; }); /*Just more code*/ cb.onTip(function(tip) { /*Crazynotevars*/ var tMsg = tip.message; var address = ""; var idx = 0; /* 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; GROUP.TIPPER[findTipper(u)][1] += tipAmount; if (!cbjs.arrayContains(tipperList.name, u)) { tipperListPopulate(u, tipAmount); } else { var index = tipperList.name.indexOf(u); tipperList.amount[index] += tipAmount; } preSale(u,tipAmount,tMsg); if (LB.kingTipper == true) { if (u != LB.currentKing && Number.parseInt(GROUP.TIPPER[findTipper(u)][1], 10) > LB.kingTip && Number.parseInt(GROUP.TIPPER[findTipper(u)][1], 10) >= Number.parseInt(cb.settings.kingMin, 10)) { if (LB.currentKing != "") { cb.sendNotice("You have been dethroned by " + u + ", but revenge is sweet...", LB.currentKing, COLOR.DEFAULT); } cb.sendNotice(":smallCrown WHOOHOO! We have a new King! All hail " + u + "!", "", COLOR.DEFAULT, COLOR.USTARTCOLOR, "bold"); /* ":smallCrown" +*/ LB.currentKing = u; LB.kingTip = Number.parseInt(GROUP.TIPPER[findTipper(u)][1], 10); } else if (u == LB.currentKing) { LB.kingTip = Number.parseInt(GROUP.TIPPER[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, (cb.settings.notifierPrivate == "Private"? u: ""), COLOR.DEFAULT, COLOR.USTARTCOLOR, "bold"); } }); /* cb.onEnter()*/ cb.onEnter(function(user) { /* User vars*/ var u = user.user; var isBc = u == cb.room_slug; var isMod = (user.is_mod || user.user == "18yearoldcouple"|| user.user == "mr_likes_it_"|| user.user == "theswisspimp"); if (isMod || isBc) { if (!cbjs.arrayContains(GROUP.MOD, u)) modPopulate(u); } entryMessage(u,isBc); }); /* Init*/ function main() { if (FLAG.initialize == false) { ubStartup(); FLAG.initialize = true; } } main();
© Copyright Chaturbate 2011- 2024. All Rights Reserved.