Bots Home
|
Create an App
AllInOneBot_JC
Author:
johncage1024
Description
Source Code
Launch Bot
Current Users
Created by:
Johncage1024
/* Name: AllInOneBot_JC Type: Bot @author johncage1024 <https://chaturbate.com/johncage1024/> @version 1.5 (2017-09-22) Originally forked from Ultra Bot by britney_and_justin Additional development by mike_lovin Heroes Club based on Fan Club Bot by lund0894 Short Description / Summary: This bots purpose is to make the life of host and mods as easy as possible concerning chat management. Compressed for performance reasons and to avoid "Removing bot because it didn't respond to ..." issues. ToDos: - add start parameter dev debug toggle - move entered command before any other output: - Instead of creating output directly based on a command, return output and return everything from onMessage. - add text someone was silenced for to silence array (add dimension) - add filter for messages starting with "|" even after a gif (trying to fake a tipped amount") */ function commandsToHelpList(e){for(var t="",o=0;o<e.length;o++)t+="/"+e[o],o<e.length-1&&(t+="\n");return t}function arrayContains(e,t){return-1!=e.indexOf(t)}function arrayRemove(e,t){e.splice(e.indexOf(t),1)}function addItemToArray(e,t){-1==e.indexOf(t)&&e.push(t)}function removeItemFromArray(e,t){var o=e.indexOf(t);o>-1&&e.splice(o,1)}function addTip(e,t){var o=t;tipArraySorted=!1;for(var i=-1,r=0;r<tipArray.length;r++)if(tipArray[r].sUser===e){i=r;break}return i<0?tipArray.push({sUser:e,nTotal:t}):(tipArray[i].nTotal+=t,o=tipArray[i].nTotal),o}function sortTipArray(){tipArraySorted||(tipArray.sort(function(e,t){return t.nTotal-e.nTotal}),tipArraySorted=!0)}function getUserTotal(e){for(var t=0,o=0;o<tipArray.length;o++)if(tipArray[o].sUser===e){t=tipArray[o].nTotal;break}return t}function findIgnorer(e){for(var t=-1,o=0;o<ignoreArray.length;o++)if(ignoreArray[o][0]==e){t=o;break}return t<0&&(ignoreArray.push([e,cb.settings.whisperLevelRoom?parseInt(cb.settings.whisperLevelRoom.charAt(0)):0]),t=ignoreArray.length-1),t}function findWhisper(e){for(var t=-1,o=0;o<whisArray.length;o++)if(whisArray[o][0]===e){t=o;break}return t<0&&(whisArray.push([e,""]),t=whisArray.length-1),t}function notify(e,t,o,i,r){if(null==o&&(o=bb_light),null==i&&(i=bb_dark),null==r&&(r="bold"),null==t)cb.sendNotice(e,"",o,i,r);else if(t==nDestinationRoomHost)cb.sendNotice(e,roomHost,o,i,r);else if(t==nDestinationMods)cb.sendNotice(e,"",o,i,r,"red");else if(t==nDestinationModsAndEmods){for(n=0;n<modArray.length;n++)cb.sendNotice(e,modArray[n],o,i,r);for(var n=0;n<emodArray.length;n++)cb.sendNotice(e,emodArray[n],o,i,r)}else t==nDestinationModsAndHost?(cb.sendNotice(e,"",o,i,r,"red"),cb.sendNotice(e,roomHost,o,i,r)):cb.sendNotice(e,t,o,i,r)}function notifyPlain(e,t,o){notify(e,t,white,null==o?bb_dark:o)}function notifyBold(e,t,o,i){notify(e,t,null==o?bb_dark:o,null==i?white:i,"bold")}function notifyTheme(e,t,o,i){notify(e,t,null==o?theme_light:o,null==i?theme_dark:i,"bold")}function notifyThemeBold(e,t,o,i){notify(e,t,null==o?theme_dark:o,null==i?white:i,"bold")}function notifyThemePlain(e,t,o){notify(e,t,white,null==o?theme_dark:o)}function notifyError(e,t){notify(e,t,error_light,error_dark)}function notifyErrorBold(e,t){notify(e,t,error_dark,white)}function levelConditions(e){var t=null;switch(parseInt(e)){case 0:t="All members";break;case 1:t='Only "color" names';break;case 2:t='Only "dark blue" names and higher';break;case 3:t="Only members who have tipped in the room";break;case 4:t="Noone"}return t}function setSilenceLevel(e,t){var o=parseInt(e);!isNaN(o)&&o>=0&&o<=4?notify("The silence level has been set to "+(silenceLevel=o)+".\n"+levelConditions(silenceLevel)+" can talk in chat.",nDestinationModsAndHost):notifyError('You did not enter a valid silence level.\nType "'+helpCommand+' silencelevel" to see how to use /silencelevel.',t)}function setGraphicLevel(e,t){var o=parseInt(e);!isNaN(o)&&o>=0&&o<=4?notify("The graphic level has been set to "+(graphicLevel=o)+".\n"+levelConditions(graphicLevel)+" can use graphics in chat.",nDestinationModsAndHost):notifyError('You did not enter a valid graphic level.\nType "'+helpCommand+' graphiclevel" to see how to use /graphiclevel.',t)}function setIgnoreLevel(e,t){e>=0&&e<=4?(ignoreArray[findIgnorer(t)][1]=e,notify("You have set your whisper ignore level to "+e+".\n"+levelConditions(e)+" can send you whispers.\nRemember, the room host, moderators, and fan club members will always be able to whisper you!",t)):notifyError('You did not enter a valid ignore level.\nType "'+helpCommand+' ignorelevel" to see how to use /ignorelevel.',t)}function silence(e,t){e==t?notifyError("You can not silence yourself.",t):e==roomHost?notifyError("You can not silence the broadcaster.",t):arrayContains(modArray,e)?notifyError("Broadcaster must revoke "+e+"'s moderator status before silencing him.",t):arrayContains(emodArray,e)?(emod("remove",e,t),silence(e,t)):arrayContains(niceArray,e)?(addToRemoveFromOverrideColorSettingList(niceArray,niceListName,e,t,"r"),silence(e,t)):null==e?notify("You must specify a user to silence.",t):(e=e.toLowerCase(),arrayContains(silenceArray,e)?null!=t&¬ifyError(e+" has already been silenced.",t):(addItemToArray(silenceArray,e),notify((null!=t?t:"Bot")+" has silenced "+e+".",nDestinationModsAndEmods)))}function unsilence(e,t){null==e?notify("You must specify a user to unsilence.",t):(e=e.toLowerCase(),arrayContains(silenceArray,e)?(removeItemFromArray(silenceArray,e),notify(t+" has unsilenced "+e+".",nDestinationModsAndEmods)):notifyError(e+" does not need to be unsilenced.",t))}function silenceLast(e){lastBlocked.length>0?null==lastToUseSL||lastToUseSL==e?(lastToUseSL=e,silence(lastToGetSLed=lastBlocked.pop(),e),cb.setTimeout(function(){lastToUseSL=null,lastToGetSLed=null},silenceLastTimeout)):notifyError(lastToUseSL+" has just silenced "+lastToGetSLed+" using the /silencelast command. Please wait at least 5 seconds before using this command again.",e):notifyError("The bot has not automatically silenced anyone yet, or they have all been silenced already.",e)}function doubleDigit(e){return(e<10?"0":"")+e}function clearTimeout(e){null!=e&&(e.cancelled=!0)}function setTimer(e){clearTimeout(fiveTimeout),clearTimeout(oneTimeout),clearTimeout(timerTimeout),0==e?(startTime=null,timerDuration=0):(startTime=new Date,timerDuration=e,e>300&&(fiveTimeout=setTimeout(function(){notifyThemeBold("Five minutes remaining!")},1e3*(e-300))),e>60&&(oneTimeout=setTimeout(function(){notifyThemeBold("One minute remaining!")},1e3*(e-60))),timerTimeout=setTimeout(function(){notifyThemeBold(bullets+" Timer is up! "+bullets),startTime=null,timerDuration=0},1e3*e))}function startTimer(e,t){var o=parseInt(e),i=60*o;null==startTime?o>0&&Number.isInteger(o)?(setTimer(i),null!=t&¬ifyThemeBold(t+" has set a timer for "+o+" minutes!")):null!=e?notifyError("'"+e+"' is not a valid option for /starttimer.\nType \""+helpCommand+' starttimer" to see how to use /starttimer.',t):null==e&¬ifyError('You did not enter a valid option for /starttimer.\nType "'+helpCommand+' starttimer" to see how to use /starttimer.',t):null!=t&¬ifyError("There is a timer running already.",t)}function addTime(e,t){var o=parseInt(e),i=60*o;if(o>0&&Number.isInteger(o))if(null!=startTime){var r=new Date(startTime.getTime()+1e3*timerDuration-(new Date).getTime());setTimer(3600*r.getUTCHours()+60*r.getUTCMinutes()+r.getUTCSeconds()+i),notifyThemeBold(t+" has has added "+o+" minute"+(1==o?"":"s")+" to the timer!")}else notifyError("There is no timer running.",t);else null!=e?notifyError("'"+e+"' is not a valid option for /addtime.\nType \""+helpCommand+' addtime" to see how to use /addtime.',t):null==e&¬ifyError('You did not enter a valid option for /addtime.\nType "'+helpCommand+' addtime" to see how to use /addtime.',t)}function stopTimer(e){null!=startTime?(setTimer(0),notifyThemeBold(e+" has cancelled the timer.")):notifyError("There is no timer running.",e)}function timeLeft(e){if(null!=startTime){var t=new Date(startTime.getTime()+1e3*timerDuration-(new Date).getTime());notify("Time remaining: "+doubleDigit(t.getUTCHours())+":"+doubleDigit(t.getUTCMinutes())+":"+doubleDigit(t.getUTCSeconds()),e)}else notifyError("There is no timer running.",e)}function sendNote(e,t){for(var o=e.split(/\s+/g),i="",r=0;r<o.length;r++)o[r].match(/^((\\|\/)n(ote)*|\{newline\})$/gi)?i+="\n":i+=" "+o[r];notifyThemePlain(i)}function doWhisper(e,t,o,i){var r="",n=0;if(n=i?1:2,cb.log("message: "),cb.log(e),whisArray[findWhisper(t)][1]=o,null!=t){for(var s=n;s<e.length;s++)r+=(s>n?" ":"")+e[s];""!=r?(cb.log("whisper: "),cb.log(r),notifyBold(":bb-darkbubble [Whisper from: "+o+"] "+r,t)):notifyError("You did not specify a message.",o)}}function textReplaceWhisper(e,t,o){var i="",r=0;cb.log("message: "),cb.log(e);var n=null;if(o?(n=whisArray[findWhisper(t)][1],r=1):(n=e[1],r=2),null!=n){for(var s=r;s<e.length;s++)i+=(s>r?" ":"")+e[s];""!=i?(cb.log("whisper: "),cb.log(i),i=":bb-darkbubble [Whisper to: "+n.toLowerCase()+"] "+i):notifyError("You did not specify a message.",t)}return null!=n&&null!=i||(i=1==o?"Reply not sent.":"Whisper not sent."),i}function sendWhisper(e,t,o,i){var r=null;if(null!=e[1])if((r=e[1].toLowerCase())!=t)if(arrayContains(silenceArray,t))notifyError("You do not have whispering privileges. Your message was not sent.",t);else if(o||!arrayContains(ignoreArray[findIgnorer(r)],t))switch(ignoreArray[findIgnorer(r)][1]){case 0:doWhisper(e,r,t);break;case 1:o||i>1?doWhisper(e,r,t):notifyError(r+" is ignoring whispers from greys.",t);break;case 2:o||i>2?doWhisper(e,r,t):notifyError(r+" is ignoring whispers from greys and light blues who haven't tipped in the room.",t);break;case 3:o||i>3?doWhisper(e,r,t):notifyError(r+" is ignoring whispers from all members who haven't tipped in the room.",t);break;case 4:o?doWhisper(e,r,t):notifyError(r+" is ignoring whispers.",t)}else notifyError(r+" is ignoring whispers from you. Your message was not sent.",t);else notifyError("Talking to yourself is a little odd ...",t);else notifyError("You did not enter a whisper recipient.",t)}function sendReply(e,t){var o=whisArray[findWhisper(t)][1];""!=o?arrayContains(silenceArray,t)?notifyError("You do not have whispering privileges. Your message was not sent.",t):arrayContains(ignoreArray[findIgnorer(o)],t)?notifyError(o+" is ignoring whispers from you. Your message was not sent.",t):doWhisper(e,o,t,!0):notifyError("No one has whispered you.",t)}function ignoreUser(e,t){null==e?notifyError('You did not specify a user to ignore. Type "'+helpCommand+' ignore" to see how to use /ignore.',t):arrayContains(ignoreArray[findIgnorer(t)],e)?e==t?notifyError("You can't ignore yourself. You may want to consult a therapist.",t):notifyError("You are already ignoring that user's whispers.",t):(ignoreArray[findIgnorer(t)].push(e),notify("You are now ignoring whispers from "+e+".",t),notify("Remember, the room host, moderators, and fan club members will always be able to whisper you!",t))}function unignoreUser(e,t){null==e?notifyError('You did not specify a user to unignore. Type "'+helpCommand+' unignore" to see how to use /unignore.',t):e==t?notifyError("You can't unignore yourself.",t):arrayContains(ignoreArray[findIgnorer(t)],e)?(arrayRemove(ignoreArray[findIgnorer(t)],e),notify("You are no longer ignoring whispers from "+e+".",t)):notifyError(e+" is not ignored.",t)}function emod(e,t,o){null!=t&&(t=t.toLowerCase()),"add"==e?arrayContains(emodArray,t)?notifyError(t+" has already been granted emergency moderator powers.",o):(addItemToArray(emodArray,t),addItemToArray(modBlockMsgArray,t),notify("Emergency moderator powers have been granted to user "+t,o),notify("You have been granted emergency moderator powers by "+o,t)):"remove"==e?arrayContains(emodArray,t)?(removeItemFromArray(emodArray,t),removeItemFromArray(modBlockMsgArray,t),notify("Emergency moderator powers have been removed from user "+t,o),notify("Your emergency moderator powers have been removed by "+o,t)):notifyError(t+" has not been granted emergency moderator powers.",o):notifyError('You did not enter a valid option for /emod. Type "'+helpCommand+' emod" to see how to use /emod.',o)}function blockNotice(e,t){"on"==e?arrayContains(modBlockMsgArray,t)?notifyError("Your Blocked Message notices are already turned on.",t):(addItemToArray(modBlockMsgArray,t),notify("You have turned ON Blocked Message notices. To turn them back off again, type: /blocknotice off",t)):"off"==e?arrayContains(modBlockMsgArray,t)?(removeItemFromArray(modBlockMsgArray,t),notify("You have turned OFF Blocked Message notices. To turn them back on again, type: /blocknotice on",t)):notifyError("Your Blocked Message notices are already turned off.",t):notifyError('You did not enter a valid option for /blocknotice. Type "'+helpCommand+' blocknotice" to see how to use /blocknotice.',t)}function kingSpam(){clearTimeout(kingTimeout),kingTimeout=setTimeout(kingSpamTimer,kingTipperInterval*minuteMS)}function kingSpamTimer(){var e=0;e=kingTip<kingTipperMin?kingTipperMin:kingTip+1,1==kingTipperSpam&&(notifyTheme(":"+cb.settings.kingTipperIcon+" Tip a total of "+e+" to become the new king!"),kingSpam())}function showLeaders(e,t){var o="";if(null==tipArray||0==tipArray.length)notifyError("No tips yet.",t);else{for(var i=0;i<e&&i<tipArray.length;i++)o+=i+1+". "+tipArray[i].sUser+" ("+tipArray[i].nTotal+" tokens)"+(i<e-1?"\n":"");notifyThemeBold(bullets+"Leader Board"+bullets,t),notifyTheme(o,t)}}function ldrSpam(){clearTimeout(ldrTimeout),ldrTimeout=setTimeout(ldrSpamTimer,ldrTimer*minuteMS)}function ldrSpamTimer(){"Yes"==cb.settings.leaderBoard&&1==leaderboardSpam&&(tipArray.length>0&&showLeaders(3,""),ldrSpam())}function showLeaderBoard(e){"Yes"==cb.settings.leaderBoard?showLeaders(10,e):notifyError("The room host has decided not to use the leaderboard feature.",e)}function notifierSpam(){notifierTimeout=setTimeout(function(){1==notifierSpamTGL&&(noticeArray.length>0&&sendNextNotice(),notifierSpam())},notifierTimer*minuteMS)}function addNotice(e){isBlank(e)||noticeArray.push(e.replace(/(\\n|\{newline\})/gi,"\n"))}function splitTipMenuItem(e){isBlank(e)||tipMenu.push(e.split("-",2))}function parseTipMenu(){splitTipMenuItem(cb.settings.tipMenuItem1),splitTipMenuItem(cb.settings.tipMenuItem2),splitTipMenuItem(cb.settings.tipMenuItem3),splitTipMenuItem(cb.settings.tipMenuItem4),splitTipMenuItem(cb.settings.tipMenuItem5),splitTipMenuItem(cb.settings.tipMenuItem6),splitTipMenuItem(cb.settings.tipMenuItem7),splitTipMenuItem(cb.settings.tipMenuItem8),splitTipMenuItem(cb.settings.tipMenuItem9),splitTipMenuItem(cb.settings.tipMenuItem10),splitTipMenuItem(cb.settings.tipMenuItem11),splitTipMenuItem(cb.settings.tipMenuItem12),splitTipMenuItem(cb.settings.tipMenuItem13),splitTipMenuItem(cb.settings.tipMenuItem14),splitTipMenuItem(cb.settings.tipMenuItem15),splitTipMenuItem(cb.settings.tipMenuItem16),splitTipMenuItem(cb.settings.tipMenuItem17),splitTipMenuItem(cb.settings.tipMenuItem18),splitTipMenuItem(cb.settings.tipMenuItem19),splitTipMenuItem(cb.settings.tipMenuItem20);for(var e=(isBlank(cb.settings.tipMenuMessage1)?"Tip menu:":cb.settings.tipMenuMessage1)+" "+cb.settings.tipMenuSeparatorChar+" ",t=0;t<tipMenu.length;t++)e+=tipMenu[t][1]+" "+tipMenu[t][0],t<tipMenu.length-1&&(e+=" "+cb.settings.tipMenuSeparatorChar+" ");noticeArray.push(e)}function parseRotating(){addNotice(cb.settings.spamMessage1),addNotice(cb.settings.spamMessage2),addNotice(cb.settings.spamMessage3),addNotice(cb.settings.spamMessage4),addNotice(cb.settings.spamMessage5),addNotice(cb.settings.spamMessage6),addNotice(cb.settings.spamMessage7),addNotice(cb.settings.spamMessage8),addNotice(cb.settings.spamMessage9)}function sendNextNotice(){var e=noticeArray.length;e>0&&(noticeNum<e&¬ifyThemePlain(noticeArray[noticeNum]),++noticeNum>=e&&(noticeNum=0))}function parseWordlist(){isBlank(cb.settings.customWordlist)||(customWordlistRegex=cb.settings.customWordlist.replace(/^(\s|,|\|)+|(\s|,|\|)+$/gm,""),customWordlistRegex=customWordlistRegex.replace(/\s*(,|\|)\s*/gm,"|"),customWordlistRegex=customWordlistRegex.replace(/[^\w|\s]/gm," "),customWordlistRegex=customWordlistRegex.replace(/(\w)/gm,"$1+"),customWordlistRegex=customWordlistRegex.replace(/\s+/gm,"\\s*"))}function doWordlist(e){var t=e.trim().replace(/([^\w\s\u0027\u2019\[\]]|_)/gi," "),o="\\b(w+a+n|g+o+i*n|n+e+e+d|(c+a+n+|m+a+y+)\\s(i+|w+e+|[^\\s]*u+)|l+e+t*s*\\s*m+e+(\\s*(s+e+e+|c+))*|g+i+(m+|v+e+)\\s*m+e|p+l+a+y\\w*\\s*w|p+u+t|e+a+t|s+h+o+w|m+o+r+e|f+l+a+s+h|f+e+e+l|r+i+d+e|s+l+i+d|t+a+k+e+so+u+t|o+p+e+n|c+l+o+s|c+u+m|s+h+a+k|d+o+g+(y|i)|s+p+(a|u)+n+k|s+q+u*e*z|p+o+u+n+d|s+h+o+v+e|s+m+a+c+k|f+i+n+g+e+r|b+l+o+w|(f|s)+u+c*k|f+c+k|l+i+c+k|k+i+s+s|m+a+s+t\\w*b+a+t|w+a+n+k|j+e+r+k|(j+|w+h*)a+c+k)\\w*\\b",i="\\b(p+u+s|v+a+(g|j)|t+w+a+t|(c|s)+l+i+t|l+i+p|b+o+b|n+i+p|t+i+t|[^w\\s]*h+o+l+e|c+u+n+t|f+i+n+g+e+r|m+o+u+t+h|t+o+n+g+u|t+o*u+n+g|a+r+m+\\s*p+i+t)\\w*\\b|";i+="\\b(a+s+s|b+u+t+t|m+u+f+f|b+o+o+t+(y|i)|a+n+u+s|l+e+g+s*)\\b";var r="\\b(d+i+c+k|b+o+n+e+r|c+o+c*(c|k)|p+e+n+i+s|m+e+a+t|bbc)\\w*\\b",n="\\b(d+i+l+d+o|t+o+y|b+u+t+t+s*p+l+u+g|v+i+b|h*i*t+a+c+h+i)\\w*\\b",s="\\b(n+a*k+e*d+|n+u+d+e+|b+a+r+e+)\\b",a="(c+l+o+t+h|b+r+a+|(p+a+n+t+(i|y)*|s+(h|k)+i+r+t|d+r+e+s|s+t*o+(c+k|x)|s+h+o+e)\\w*\\b)",l="(r+e+m+o+v+e+|t+a+k+e\\s*o+f+f+)",m="\\b(i+.{0,1}a*m+|i+|a+m+|i+s+|s+o+)\\b",d="\\b(h+a*r+d|w+e+t|h+o+r+n|t+h+i+c+k)\\w*\\b",c="\\b((l+o+v+e|l+u+v|g+o+i+n)\\w*\\s*(2+|t+o+)|l+e+(t|m)+\\s*m+e+|m+a+y+|c+a+n+)\\b|";c+="\\b(g+o+t+|w+a+n|g+o+n|w+i+s+h)\\w*\\b";var h="\\b(m+a+s+t\\w*b+a+t|w+a+n+k|j+e+r+k|(j+|w+h*)a+c+k|t+a+s+t|e+a+t|c+u+m|i+n+s+i+d+e|s+m+e+l+l|s+n+i+f+f|l+i+c+k|(f|s)+u+c*k|f+c+k)\\w*\\b",u="\\b(c+u+m|s+e+m+e+n|s+p+e+r+m|b+u+s+t.*n+u+t)\\w*\\b",g=new RegExp("((^|\\s)[^\\s]\\s[^\\s]\\s[^\\s]($|\\s))","i"),p=new RegExp("\\b("+i+"|"+r+"|"+o+"|"+s+"|"+h+"|"+u+"|p+l+e*a*i*(s|z)+e*)\\b","i"),y=new RegExp("[^\\x00-\\xAE\\u2000-\\u206F]"),f=new RegExp("\\b(b+(a|e)*b+(y|e)*)\\b","i"),b=new RegExp("\\b(h+o+e+s*)\\b|(c+u+n+t|s+l+u+t|s+k+a+n+k|w+h+o+r+e|b+i+t+c+h|n+i+g+g+e+r|n+i+g+g+a|b+o+r+e+d|b+o+r+i+n+g|t+r+a+n+n+(y|i))","i"),v=new RegExp("\\b([a-g|i-z]*(h+u+)*m+m+h*|u+f+)\\b","i"),w=new RegExp("(s+k+(y|i)*p+e|s+k+y*p|(f+r+e+e|unlimited).*t+o+k+e+n|t+o+k+e+n.*(f+r+e+e|generator)|erotimo|freecambook|webcam23|hotjenny|fucktubate|gaysexrooms|fastsexnow|alva lanus|Delorge942|Glasford597|sk .*y p e)","i"),T=new RegExp("\\b(p+\\s*m+|p+v+t|p+l+e*a*i*(s|z)+|a+n+a+l+|(m+a+s+t\\w*b|s+q\\w*r+t|f+i+s+t|q+u*e+a*f+)\\w*|("+o+"|p+l+e*a*i*(s|z)+e*)\\s*(i+t+|(t+h+|d+)a+t+|.*(y*o*u+r*|(f+o*r+|4+)*\\s*m+(y|e|i)+|"+i+"|"+r+"|"+n+")|p+l+e*a*i*(s|z)+e*)|("+i+"|"+r+"|"+n+"|"+s+"|g+e+t+|m+(y|e|i)+|p+l+e*a*i*(s|z)+e*).*("+o+"|"+s+"|p+l+e*a*i*(s|z)+e*))\\b|("+l+".*"+a+")|("+a+".*"+l+")|(t+a+k+e.*"+a+".*o+f+f)|(z+o+o+m|s+p+r+e+a+d|f+a+r+t|c+2+c|(w+a+t+c+h|l+o+o+k|o+p+e+n|v+i+e+w|c+l+i+c+k).*(c+a+m|p+r+o+f|r+o+o+m)\\w*)","i"),k=new RegExp("\\b(\\d\\s*(i+n|c+m)\\w*|("+o+").*("+u+")|("+m+").*("+d+")|("+d+").*f+o*r+\\s*y*o*u+r*|("+m+"|"+c+"|m+(y|e|i)+).*("+h+"|"+u+"|"+r+"|\\bs+i+s\\w*))\\b|(s+t+r+o+k|t+h+r+o+b|c+i+r+c+u+m)","i"),C=new RegExp("\\b(s+o+l+e+s*|t+o+e+s*)\\b|(f+e+e+t|p+e+d+i+c+u|f+o+t+j+o+b)","i"),S=new RegExp("(d+a+d|(s+t+e+p+)*d+a+u+g+h+t+e+r)","i"),L=new RegExp("\\b(p+o+o+p*\\w*|p+e+e+(i+n+g)*)\\b|(t+u+r+d|e+n+e+m+a|d+e+f+e+c+a+t|(s+h+i+t|c+r+a+p|p+i+s+s+)\\w*\\s*(o|i)+n)","i"),M=new RegExp("t.?k.?n.?wh.?r.?_c.?nt.?","i"),A=new RegExp("\\[LEAK(ED)*\\]|\\[GET\\]|go to webcam|webcam23|kikcams|kikfuck|swipegirls|getdrugsfast","i"),E=new RegExp(".*_{3}.*_{3}.*","i"),x=null;return e.length<2||e.length>500?x="Length":-1!=t.search(A)?x="SpamBot":-1!=t.search(E)?x="SpamBot":-1!=t.search(g)?x="Workaround":-1!=t.search(p)&&(e.match(/\s+/gi)||[]).length<3?x="Directness":-1!=t.search(y)?x="Non-English":-1!=t.search(f)?x="BB":-1!=t.search(b)?x="Rudeness":-1!=t.search(v)?x="Annoying":-1!=t.search(w)?x="Spam":-1!=t.search(T)?x="Demands":-1!=t.search(k)?x="TMI":-1!=t.search(C)?x="Feet":-1!=t.search(S)?x="Creepy":-1!=t.search(L)?x="Poo/Pee":-1!=t.search(M)&&(x="Insult"),x}function doCustomWordlist(e,t){var o=new RegExp("("+customWordlistRegex+")","i"),i=null;return(o.test(e.replace(/[^a-zA-Z0-9]/gi,""))||o.test(t.replace(/[^a-zA-Z]/gi,"")))&&(i="Blocked"),i}function addWord(e){cb.settings.customWordlist+=","+e,parseWordlist()}function addToRemoveFromOverrideColorSettingList(e,t,o,i,r){o?(o=o.toLowerCase(),"a"==r?arrayContains(e,o)?notifyError(o+" is already on the "+t+".",i):(addItemToArray(e,o),notify("You have added "+o+" to the "+t+".",i),t==niceListName&¬ify(i+" has added you to the "+t+". You will be able to chat and use graphics regardless of the global room settings. Thank you for being nice!",o)):"r"==r&&(arrayContains(e,o)?(removeItemFromArray(e,o),notify("You have removed "+o+" from the "+t+".",i),t==niceListName&¬ify(i+" has removed you from the "+t+".",o)):notifyError(o+" is not on the "+t+".",i))):notifyError("You didn't specify a user.\nType \""+helpCommand+' nicelist" to see how to use the nice list.',i)}function kingSpamToggle(e,t){"Yes"!=cb.settings.kingTipper?notifyError("The room host has decided not to use the King Tipper feature.",t):"on"==e?1==kingTipperSpam?notifyError("The King Tipper spam is already turned on.",t):(kingTipperSpam=1,kingSpam(),notify("You have turned on King Tipper spam.",t)):"off"==e?0==kingTipperSpam?notifyError("The King Tipper spam is already turned off.",t):(kingTipperSpam=0,notify("You have turned off the King Tipper spam.",t)):notifyError('You did not enter a valid option for /kingspam.\nType "'+helpCommand+' kingspam" to see how to use /kingspam.',t)}function notifierSpamToggle(e,t){"on"==e?1==notifierSpamTGL?notifyError("The Notifier spam is already turned on.",t):(notifierSpamTGL=1,notify("You have turned on the Notifier spam.",t)):"off"==e?0==notifierSpamTGL?notifyError("The Notifier spam is already turned off.",t):(notifierSpamTGL=0,notify("You have turned off the Notifier spam.",t)):notifyError('You did not enter a valid option for /notifierspam.\nType "'+helpCommand+' notifierspam" to see how to use /notifierspam.',t)}function leaderboardSpamToggle(e,t){"on"==e?1==leaderboardSpam?notifyError("The Leaderboard spam is already turned on.",t):(leaderboardSpam=1,ldrSpam(),notify("You have turned on the Leaderboard spam.",t)):"off"==e?0==leaderboardSpam?notifyError("The Leaderboard spam is already turned off.",t):(leaderboardSpam=0,notify("You have turned off the Leaderboard spam.",t)):notifyError('You did not enter a valid option for /leaderboardspam.\nType "'+helpCommand+' leaderboardspam" to see how to use /leaderboardspam.',t)}function isBlank(e){return null==e||""==e||e.startsWith(optionalParamIdentifier)}function isValidColor(e){var t=e,o=!0;if("#"==t.charAt(0)&&(t=t.substr(1)),t&&6==t.length)for(var i=0;i<6;i++)-1=="0123456789abcdefABCDEF".indexOf(t.charAt(i))&&(o=!1);else o=!1;return!!o||(notifyErrorBold('"'+e+'" is not a valid color option.',roomHost),notifyError("Use html-color-codes.info to find the code for the color you want.\nReverting to default color.",roomHost),!1)}function setColor(){var e=cb.settings.colorscheme,t=cb.settings.darkcolor.trim(),o=cb.settings.lightcolor.trim();!isBlank(e)&&e.startsWith("Custom")?isBlank(o)&&isBlank(t)?notifyErrorBold("Whoops. You selected a custom color scheme but you didn't fill in the colors. Reverted to default color scheme.",roomHost):isBlank(t)?notifyErrorBold("Whoops. You selected a custom color scheme but you didn't select a text color. Reverted to default color scheme.",roomHost):isBlank(o)?isValidColor(t)&&(theme_dark=("#"!=t.charAt(0)?"#":"")+t,theme_light=white):isValidColor(t)&&isValidColor(o)&&(theme_dark=("#"!=t.charAt(0)?"#":"")+t,theme_light=("#"!=o.charAt(0)?"#":"")+o):(isBlank(t)&&isBlank(o)||notifyErrorBold('You defined custom colors, but your color scheme is set to "'+e+'". In order to use your custom colors, please set your color scheme to "Custom".',roomHost),"Purple"==e?(theme_dark=purple_dark,theme_light=purple_light):"Pink"==e?(theme_dark=pink_dark,theme_light=pink_light):"Blue"==e?(theme_dark=blue_dark,theme_light=blue_light):"Red"==e?(theme_dark=red_dark,theme_light=red_light):"Green"==e?(theme_dark=green_dark,theme_light=green_light):"Halloween"==e?(theme_dark=halloween_dark,theme_light=halloween_light):"Christmas"==e&&(theme_dark=christmas_dark,theme_light=christmas_light))}function isHero(e){return heroesClubMembers.indexOf(e)>-1}function addUserToHeroesClub(e){addItemToArray(heroesClubMembers,e)}function removeUserFromHeroesClub(e){arrayRemove(heroesClubMembers,e)}function showBlockNoticeInfo(e){if("Yes"==cb.settings.wordlistToggle){notifyThemeBold(bullets+botName+" - MODERATOR NOTICE"+bullets,e);var t="Welcome to "+cb.room_slug+"'s room. "+cb.room_slug+" is running "+botName+". This bot automatically blocks certain messages that contain words and phrases that are deemed abusive, inappropriate, or annoying.\nYour blocked message notices are currently ";arrayContains(modBlockMsgArray,e)?t+="ON. To stop seeing them, type: /blocknotice off.\n":t+="OFF. To see them again, type: /blocknotice on.\n",notifyTheme(t+="To view commands type "+helpCommand+".",e)}}function help(e,t){null==e&&(e="");var o=t===dev,i=t===cb.room_slug,r=arrayContains(modArray,t),n=arrayContains(emodArray,t);switch(e){case"":notifyBold(botName+" Help Menu",t),notify('Type "'+helpCommand+" x\", where x is one of the following choices, for more detailed information, e.g. '"+helpCommand+" commands'\ncommands\n"+(o||i||r||n?"nicelist\ngreylist\nheroesclub\n":"")+"about",t);break;case"commands":notifyBold(botName+" Command List",t),notify('Type "'+helpCommand+" x\", where x is one of the following commands, for more detailed information, e.g. '"+helpCommand+" silencelevel'\n"+(o?commandsLevel0Help+"\n":"")+(o||i||r?commandsLevel1Help+"\n":"")+(o||i||r||n?commandsLevel2Help+"\n":"")+commandsLevel3Help,t);break;case"nicelist":(o||i||r||n)&&(notifyBold("The Nice List",t),notify("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 includes 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.",t));break;case"greylist":(o||i||r||n)&&(notifyBold("The Grey List",t),notify("Sometimes, there are users whose comments are annoying, in spite of the fact that they may have tokens or even tip. It isn't always desireable 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 greys, 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 grey list. Users who are on the grey list will have their messages subjected to the wordlists that apply to greys.",t));break;case"heroesclub":(o||i||r)&&(notifyBold("The Heroes Club",t),notify("The Heroes Club is an exclusive club users can get in by tipping a specific amount. Heroes club members get a special icon in front of their message in chat.\n/addhero <user_name> : Adds user to heroes club.\n/removehero <user_name> : Removes user from heroes club.\n/showheroes: Lists members of heroes club.\nREMEMBER TO ADD HEROES CLUB MEMBERS IN THE BOT'S CONFIGURATION PAGE BEFORE LAUNCH!",t));break;case"about":notifyBold("About "+botName,t),notify(botName+"'s purpose is to make the life of host and mods as easy as possible concerning chat management.\nThe bot is open source as per CB rule all CB apps and bots. Current author: johncage1024.\nIt is a fork of Ultra Bot, modified by different people including johncage1024, lund0894, mike_lovin, britney_and_justin.\nIt adds popular features such as king tipper, leaderboard, notifier, pre-silences abusive messages, \ngrants quite a bit of power to moderators, and allows whisper messages to be sent in the main chat window.\nComments, suggestions, requests, and bug reports can be communicated by posting a comment\non the Bot's page at chaturbate.com/apps/app_details/allinonebot_jc/.",t);break;case"showvar":o&&(notifyBold("/showvar Help",t),notify('/showvar is a command that is usable by developers.\nSyntax: "/showvar". Shows the value of a program variable.',t));break;case"emod":(o||i||r)&&(notifyBold("/emod Help",t),notify('/emod is a command that is usable by room host and moderators.\nSyntax: "/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 some 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.',t));break;case"tiptotal":(o||i||r)&&(notifyBold("/tiptotal Help",t),notify('/tiptotal is a command that is usable by room host and moderators.\nSyntax: "/tiptotal". Shows the total number of tokens tipped since the start of the bot.',t));break;case"addhero":(o||i||r)&&(notifyBold("/addhero Help",t),notify('/addhero is a command that is usable by room host and moderators.\nSyntax: "/addhero x", where x is a user to be added to the heroes club.\nREMEMBER TO ADD HEROES CLUB MEMBERS IN THE BOT\'S CONFIGURATION PAGE BEFORE LAUNCH TO BE PERMANENT!',t));break;case"removehero":(o||i||r)&&(notifyBold("/removehero Help",t),notify('/removehero is a command that is usable by room host and moderators.\nSyntax: "/removehero x", where x is a user to be removed from the heroes club.REMEMBER TO REMOVE HEROES CLUB MEMBERS IN THE BOT\'S CONFIGURATION PAGE BEFORE LAUNCH TO BE PERMANENT!',t));break;case"showheroes":(o||i||r)&&(notifyBold("/showheroes Help",t),notify('/showheroes is a command that is usable by room host and moderators.\nSyntax: "/showheroes". Shows a list of the heroes club members.',t));break;case"blocknotice":(o||i||r||n)&&(notifyBold("/blocknotice Help",t),notify('/blocknotice is a command that is usable by room host and moderators.\nSyntax: "/blocknotice x", where x is either "on" or "off".\nIt activates / deactivates the blocked message notices that appear by default for moderators when the wordlist is being used.\nThe blocked message notifications are toggled on a per-user basis. (Toggling it for yourself does not toggle it for everyone.)',t));break;case"silencelevel":(o||i||r||n)&&(notifyBold("/silencelevel Help",t),notify('/silencelevel is a command that is usable by room host and moderators.\nSyntax: "/silencelevel x", where x is a number between 0 and 3.\nSetting the Silence Level to 0 will grant chatting rights to all users, setting it to 1 will revoke chatting rights for greys, setting it to 2 will revoke chatting rights for greys and light blues, setting it to 3 will revoke chatting rights for users who have not tipped,and setting it to 4 will revoke chatting rights for everyone other than mods and fans.\nThe default setting for /silencelevel is 0.\nRoom hosts, moderators, and fan club members are unaffected by the silence level.',t));break;case"graphiclevel":(o||i||r||n)&&(notifyBold("/graphiclevel Help",t),notify('/graphiclevel is a command that is usable by room host and moderators.\nSyntax: "/graphiclevel x", where x is a number between 0 and 3.\nSetting the Graphic Level to 0 will grant image using rights to all users, setting it to 1 will revoke image using rights for greys, setting it to 2 will revoke image using rights for greys and light blues, setting it to 3 will revoke image using rights for users who have not tipped,and setting it to 4 will revoke image using rights for everyone other than mods and fans.\nThe default setting for /graphiclevel is 1.\nRoom hosts, moderators, and fan club members are unaffected by the graphic level.',t));break;case"silence":(o||i||r||n)&&(notifyBold("/silence Help",t),notify('/silence is a command that is usable by room host and moderators.\nSyntax: "/silence x", where x is the username of the user you want to silence.\nThe effect of /silence is similar to 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.',t));break;case"unsilence":(o||i||r||n)&&(notifyBold("/unsilence Help",t),notify('/unsilence is a command that is usable by room host and moderators.\nSyntax: "/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!',t));break;case"silencelast":(o||i||r||n)&&(notifyBold("/silencelast Help",t),notify('/silencelast is a command that is usable by room host and moderators.\nSyntax: "/silencelast". Silences the user which message was automatically blocked last by this bot (to prevent them to write additional annoying messages which might not get automatically blocked.)',t));break;case"addnice":(o||i||r||n)&&(notifyBold("/addnice Help",t),notify('/addnice is a command that is usable by room host and moderators.\nSyntax: "/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 chat 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.',t));break;case"removenice":(o||i||r||n)&&(notifyBold("/removenice Help",t),notify('/removenice is a command that is usable by room host and moderators.\nSyntax: "/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.',t));break;case"shownice":(o||i||r||n)&&(notifyBold("/shownice Help",t),notify('/shownice is a command that is usable by room host and moderators.\nSyntax: "/shownice". Shows the users on the nice list.',t));break;case"addgrey":case"addgray":(o||i||r||n)&&(notifyBold("/addgrey Help",t),notify('/addgrey is a command that is usable by room host and moderators.\nSyntax: "/addgrey x", where x is the username of the user you want to add to the grey list.\nAdding a user to the grey list subjects them to the same wordlists that apply to greys. \nUsers can be removed from the grey list by using the command /removegrey.\nSee the help sections for silencelevel, graphiclevel, and ignorelevel for more information on the global settings or the help section for greylist for more information on the grey list.',t));break;case"removegrey":case"removegray":(o||i||r||n)&&(notifyBold("/removegrey Help",t),notify('/removegrey is a command that is usable by room host and moderators.\nSyntax: "/removegrey x", where x is the username of the user you want to remove from the grey list.\nSee the help section for greylist for more information on the grey list.',t));break;case"showgrey":(o||i||r||n)&&(notifyBold("/showgrey Help",t),notify('/showgrey is a command that is usable by room host and moderators.\nSyntax: "/showgrey". Shows the users on the grey list.',t));break;case"showsilenced":(o||i||r||n)&&(notifyBold("/showsilenced Help",t),notify('/showsilenced is a command that is usable by room host and moderators.\nSyntax: "/showsilenced". Shows the users on the silenced list.',t));break;case"starttimer":(o||i||r||n)&&(notifyBold("/starttimer Help",t),notify('/starttimer is a command that is usable by room host and moderators.\nSyntax: "/starttimer x", where x is the desired duration of the timer in minutes.\n/starttimer will accept whole numbers only.\nThe timer will make an announcement at five minutes remaining, at one minute remaining and when it expires.\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.',t));break;case"stoptimer":(o||i||r||n)&&(notifyBold("/stoptimer Help",t),notify('/stoptimer is a command that is usable by room host and moderators.\nSyntax: "/stoptimer". Stops the timer started with /starttimer.',t));break;case"addtime":(o||i||r||n)&&(notifyBold("/addtime Help",t),notify('/addtime is a command that is usable by room host and moderators.\nSyntax: "/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.',t));break;case"kingspam":(o||i||r||n)&&(notifyBold("/kingspam Help",t),notify('/kingspam is a command that is usable by room host and moderators.\nSyntax: "/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!"',t));break;case"notifierspam":(o||i||r||n)&&(notifyBold("/notifierspam Help",t),notify('/notifierspam is a command that is usable by room host and moderators.\nSyntax: "/notifierspam x", where x is either on or off. Using this command toggles the spamming of the periodic messages defined by the host.',t));break;case"leaderboardspam":(o||i||r||n)&&(notifyBold("/leaderboardspam Help",t),notify('/leaderboardspam is a command that is usable by room host and moderators.\nSyntax: "/leaderboardspam x", where x is either on or off. Using this command toggles the spamming of the top three tippers.',t));break;case"notice":(o||i||r||n)&&(notifyBold("/note Help",t),notify('/note is a command that is usable by room host and moderators.\nSyntax: "/note x", where x is the message you want to send.\n/note, /notice, and /n are all available commands that will send a one time notice.\nA note is a public notification prefixed with "Notice:" that will be sent to everyone in the main chat window.',t));break;case"shownotices":(o||i||r||n)&&(notifyBold("/shownotices Help",t),notify('/shownotices is a command that is usable by room host and moderators.\nSyntax: "/shownotices".\nShows a list of all active notices including their ID.',t));break;case"addnotice":(o||i||r||n)&&(notifyBold("/addnotice Help",t),notify('/addnotice is a command that is usable by room host and moderators.\nSyntax: "/addnotice x", where x is the notice to add.\nAdds a new notice to the list of notices.',t));break;case"removenotice":(o||i||r||n)&&(notifyBold("/removenotice Help",t),notify("/removenotice is a command that is usable by room host and moderators.\nSyntax: \"/removenotice x\", where x is the ID of the notice to remove.\nRemoves a notice from the list of active notices based on its ID (visible in the result of '/shownotices').",t));break;case"noticetimer":(o||i||r||n)&&(notifyBold("/noticetimer Help",t),notify('/noticetimer is a command that is usable by room host and moderators.\nSyntax: "/noticetimer x", where x is the number of minutes between two notices shown.\n.Sets the number of minutes between showing notices.',t));break;case"addword":(o||i||r||n)&&(notifyBold("/addword Help",t),notify('/addword is a command that is usable by room host and moderators.\nSyntax: "/addword x", where x is the word to add to the custom list of words to filter.\n.Adds a word to the custom list of words to filter.',t));break;case helpCommand.substring(1):case"ubhelp":notifyBold(helpCommand+" Help",t),notify(helpCommand+' is a command that is usable by everyone.\nSyntax: "'+helpCommand+' x", where x is the command or the subsection of the help menu that you want to access.',t);break;case"leaderboard":notifyBold("/leaderboard Help",t),notify('/leaderboard is a command that is usable by everyone.\nSyntax: "/leaderboard". Shows the top 3 tippers of the current session.',t);break;case"timeleft":notifyBold("/timeleft Help",t),notify('/timeleft is a command that is usable by everyone.\nSyntax: "/timeleft". Shows the amount of time left on the timer in the format hh:mm:ss,\nSee the help section for starttimer for more information on timers.',t);break;case"whisper":notifyBold("/whisper Help",t),notify('/whisper is a command that is usable by everyone.\nSyntax: "/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.',t);break;case"reply":notifyBold("/reply Help",t),notify('/reply is a command that is usable by everyone.\nSyntax: "/reply x", where x is a 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.',t);break;case"ignore":notifyBold("/ignore Help",t),notify('/ignore is a command that is usable by everyone.\nSyntax: "/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.',t);break;case"unignore":notifyBold("/unignore Help",t),notify('/unignore is a command that is usable by everyone.\nSyntax: "/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.',t);break;case"ignorelevel":notifyBold("/ignorelevel Help",t),notify('/ignorelevel is a command that determines which users you accept whispers from. It is usable by everyone.\nSyntax: "/ignorelevel x", where x is a number between 0 and 4.\nSetting it to 0 will allow all users to send you whispers.\nSetting it to 1 will prevent greys from sending you whispers.\nSetting it to 2 will prevent greys and light blues from sending you whispers.\nSetting it to 3 will prevent users who have not tipped in the room from sending you whispers.\nSetting it to 4 will prevent all users from sending you whispers.\nModerators and fan club members can send whispers regardless of whisper level.\nThe default setting for /ignorelevel is 4 for the broadcaster, and 0 for everyone else. (This broadcaster\'s level is set higher by default to prevent abuse of this feature.)\nSee the help section for whisper for more information on whispers\nOther related commands are /whisper, /reply, /ignore, and /unignore.',t);break;default:notifyError(e+' is not a valid subsection of the help menu. Type "'+helpCommand+'" to access the main help menu.',t)}}function init(){if(cb.settings.colorscheme&&setColor(),"Yes"==cb.settings.wordlistToggle&&parseWordlist(),cb.settings.defaultSilenceLevel&&4==(silenceLevel=parseInt(cb.settings.defaultSilenceLevel))&¬ifyErrorBold('No one will be able to chat except for your mods and fan club members. Did you mean to do this?\nFor more information, type "'+helpCommand+' silencelevel" ',cb.room_slug),cb.settings.defaultGraphicLevel&&(graphicLevel=parseInt(cb.settings.defaultGraphicLevel)),"Yes"==cb.settings.notifierSpam&&(parseRotating(),notifierSpamTGL=1,cb.setTimeout(function(){sendNextNotice(),notifierSpam()},notifierTimer*minuteMS)),"Yes"==cb.settings.tipMenuToggle&&parseTipMenu(),"Yes"==cb.settings.kingTipper&&"Yes"==cb.settings.kingTipperSpam&&(kingTipperSpam=1,cb.setTimeout(kingSpamTimer(),Math.floor(Math.random()*kingTipperInterval+1)*minuteMS/3)),"Yes"==cb.settings.leaderBoard&&"Yes"==cb.settings.leaderBoardSpam&&(leaderboardSpam=1,cb.setTimeout(ldrSpamTimer(),Math.floor(Math.random()*ldrTimer+1)*minuteMS*2/3)),"Yes"==cb.settings.wordlistShowBroadcaster&&addItemToArray(modBlockMsgArray,cb.room_slug),isBlank(cb.settings.silenceList)||(silenceArray=cb.settings.silenceList.replace(/\s+/g,"").split(",")),isBlank(cb.settings.niceList)||(niceArray=cb.settings.niceList.replace(/\s+/g,"").split(",")),isBlank(cb.settings.wordlistGreyList)||(greyArray=cb.settings.wordlistGreyList.replace(/\s+/g,"").split(",")),isBlank(cb.settings.whisperLevelHost)||(ignoreArray[findIgnorer(cb.room_slug)][1]=parseInt(cb.settings.whisperLevelHost.charAt(0))),"Yes"==cb.settings.wordlistToggle&&(showBlockNoticeInfo(nDestinationMods),"Yes"==cb.settings.wordlistShowBroadcaster)){notifyThemeBold(bullets+botName+" - BROADCASTER NOTICE"+bullets,nDestinationRoomHost);notifyTheme('You have chosen to see blocked message notices. This has the potential to be distracting. It is recommended that let your moderators handle these blocked messages instead.\nTo stop seeing them, type "/blocknotice off"\nor set "Notify broadcaster" to "No" under Section 3 of the bot launch screen.',nDestinationRoomHost)}cb.settings.heroesClubMemberList&&(heroesClubMembers=cb.settings.heroesClubMemberList.replace(/\s/g,"").toLowerCase().split(",")),initialized=!0}var botName="AllInOneBot_JC",roomHost=cb.room_slug,dev="johncage1024",optionalParamIdentifier="[Optional - ";cb.settings_choices=[{name:"colorscheme",label:"1.) PERSONALIZATION ........................................... Color Scheme:",type:"choice",choice1:"Purple",choice2:"Pink",choice3:"Blue",choice4:"Red",choice5:"Green",choice6:"Halloween",choice7:"Christmas",choice8:"Custom (Please define below)",required:!1},{name:"darkcolor",label:"Custom Text Color (HTML #rrggbb)",type:"str",defaultValue:optionalParamIdentifier+'Set color scheme to "Custom" above]',required:!1},{name:"lightcolor",label:"Custom Highlight Color (HTML #rrggbb)",type:"str",defaultValue:optionalParamIdentifier+'Set color scheme to "Custom" above]',required:!1},{name:"enterMessage",label:"Welcome Message",type:"str",minLength:1,maxLength:1e3,defaultValue:optionalParamIdentifier+"Leave blank in busy rooms, as it can cause CB bots to crash]",required:!1},{name:"capsToggle",label:"2.) ROOM CONTROL ................ Convert ALL CAPS to lowercase?",type:"choice",choice1:"Yes",choice2:"No",choice3:"Only for greys",defaultValue:"Only for greys",required:!1},{name:"stickyToggle",label:"Prevent sticky keyyyyyyyyyyyyys?",type:"choice",choice1:"Yes",choice2:"No",choice3:"Only for greys",defaultValue:"Only for greys",required:!1},{name:"defaultGraphicLevel",label:"Default Graphic Level (Who can use graphics?)",type:"choice",choice1:"0 - Everyone",choice2:"1 - Color names only",choice3:"2 - Dark blue names and higher",choice4:"3 - Users who have tipped",choice5:"4 - Only mods and fans",defaultValue:"1 - Color names only",required:!1},{name:"defaultSilenceLevel",label:"Default Silence Level (Who can talk in chat?)",type:"choice",choice1:"0 - Everyone",choice2:"1 - Color names only",choice3:"2 - Dark blue names and higher",choice4:"3 - Users who have tipped",choice5:"4 - Only mods and fans",defaultValue:"0 - Everyone",required:!1},{name:"niceList",label:"Nice List (Users who can always talk/use graphics)",type:"str",minLength:1,maxLength:1e3,defaultValue:optionalParamIdentifier+"Exact usernames, separated by commas]",required:!1},{name:"silenceList",label:"Silence List (Users who are permanently silenced)",type:"str",minLength:1,maxLength:1e3,defaultValue:optionalParamIdentifier+"Exact usernames, separated by commas]",required:!1},{name:"wordlistToggle",label:"3.) BLOCKED WORDLIST .............. Use blocked wordlist feature?",type:"choice",choice1:"Yes",choice2:"No (Skip to section 4)",defaultValue:"Yes",required:!1},{name:"wordlistNotice",label:"Notify sender when his/her message gets blocked?",type:"choice",choice1:"Yes",choice2:"No",defaultValue:"No",required:!1},{name:"wordlistShowModerators",label:"Notify moderators of blocked messages?",type:"choice",choice1:"Yes",choice2:"No",defaultValue:"Yes",required:!1},{name:"wordlistShowBroadcaster",label:"Notify broadcaster of blocked messages?",type:"choice",choice1:"Yes",choice2:"No",defaultValue:"No",required:!1},{name:"wordlistLevel",label:"Blocked wordlist applies to",type:"choice",choice1:"Only greys",choice2:"Everyone",defaultValue:"Only greys",required:!1},{name:"wordlistGreyList",label:"Grey list (Users who should always be subject to wordlist indep. of color)",type:"str",minLength:1,maxLength:1e3,defaultValue:optionalParamIdentifier+"Exact usernames, separated by commas]",required:!1},{name:"customWordlistToggle",label:"4.) CUSTOM WORDLIST ................ Use custom wordlist feature?",type:"choice",choice1:"Yes",choice2:"No (Skip to section 5)",defaultValue:"Yes",required:!1},{name:"customWordlist",label:"Custom wordlist",type:"str",minLength:1,maxLength:1e3,defaultValue:optionalParamIdentifier+"Exact words or phrases, separated by commas]",required:!1},{name:"customWordlistLevel",label:"Custom wordlist applies to",type:"choice",choice1:"Only greys",choice2:"Everyone",defaultValue:"Everyone",required:!1},{name:"whisperToggle",label:"5.) WHISPERS ............................................... Use whisper feature?",type:"choice",choice1:"Yes",choice2:"No (Skip to section 6)",defaultValue:"Yes",required:!1},{name:"whisperLevelRoom",label:"Default whisper level (Who can send whispers?)",type:"choice",choice1:"0 - Everyone",choice2:"1 - Color names only",choice3:"2 - Dark blue names and higher",choice4:"3 - Users who have tipped",choice5:"4 - Only mods and fans",defaultValue:"4 - Only mods and fans",required:!1},{name:"whisperLevelHost",label:"Broadcaster whisper level (Who can send YOU whispers?)",type:"choice",choice1:"0 - Everyone",choice2:"1 - Color names only",choice3:"2 - Dark blue names and higher",choice4:"3 - Users who have tipped",choice5:"4 - Only mods and fans",defaultValue:"4 - Only mods and fans",required:!1},{name:"kingTipper",label:"6.) KING TIPPER ................................... Use KingTipper feature?",type:"choice",choice1:"Yes",choice2:"No (Skip to section 7)",defaultValue:"Yes",required:!1},{name:"kingTipperMin",label:"Minimum tip amount to become King:",type:"int",minValue:1,maxValue:1e3,defaultValue:25,required:!1},{name:"kingTipperSpam",label:"Periodically announce tip required to become King?",type:"choice",choice1:"Yes",choice2:"No (Skip to section 7)",defaultValue:"Yes",required:!1},{name:"kingTipperInterval",label:"Interval (in mins) for king announcement",type:"int",minValue:1,maxValue:60,defaultValue:7,required:!1},{name:"kingTipperIcon",label:"Crown Icon: used for King tipper (do not use a (:) colon)",type:"str",minLength:0,maxLength:20,required:!1,defaultValue:"crown01"},{name:"leaderBoard",label:"7.) LEADERBOARD .............................. Use Leaderboard feature?",type:"choice",choice1:"Yes",choice2:"No (Skip to section 8)",defaultValue:"Yes",required:!1},{name:"leaderBoardSpam",label:"Periodically announce top 3 tippers?",type:"choice",choice1:"Yes",choice2:"No (Skip to section 8)",defaultValue:"Yes",required:!1},{name:"leaderBoardTimer",label:"Interval (in mins) for leaderboard announcement",type:"int",minValue:1,maxValue:60,defaultValue:7,required:!1},{name:"notifierTip",label:"8.) TIP MESSAGES ..................... Show message when a user tips?",type:"choice",choice1:"Yes",choice2:"Privately to tipper only",choice3:"No (Skip to section 9)",defaultValue:"Yes",required:!1},{name:"tipMessage",label:"Message to display",type:"str",minLength:1,maxLength:1e3,defaultValue:":pitykittythankyou2",required:!1},{name:"tipMessageMin",label:"Minimum tip to trigger message",type:"int",minValue:1,maxValue:1e6,defaultValue:15,required:!1},{name:"notifierSpam",label:"9.) ROTATING NOTIFIER ............................. Use rotating notifier?",type:"choice",choice1:"Yes",choice2:"No (Skip to section 10)",defaultValue:"Yes",required:!1},{name:"notifierTimer",label:"Interval (in mins) for rotating notices",type:"int",minValue:1,maxValue:60,defaultValue:3,required:!1},{name:"spamMessage1",label:"Notice #1",type:"str",minLength:1,maxLength:1e3,defaultValue:optionalParamIdentifier+"use {newline} for line break]",required:!1},{name:"spamMessage2",label:"Notice #2",type:"str",minLength:1,maxLength:1e3,defaultValue:optionalParamIdentifier+"use {newline} for line break]",required:!1},{name:"spamMessage3",label:"Notice #3",type:"str",minLength:1,maxLength:1e3,defaultValue:optionalParamIdentifier+"use {newline} for line break]",required:!1},{name:"spamMessage4",label:"Notice #4",type:"str",minLength:1,maxLength:1e3,defaultValue:optionalParamIdentifier+"use {newline} for line break]",required:!1},{name:"spamMessage5",label:"Notice #5",type:"str",minLength:1,maxLength:1e3,defaultValue:optionalParamIdentifier+"use {newline} for line break]",required:!1},{name:"spamMessage6",label:"Notice #6",type:"str",minLength:1,maxLength:1e3,defaultValue:optionalParamIdentifier+"use {newline} for line break]",required:!1},{name:"spamMessage7",label:"Notice #7",type:"str",minLength:1,maxLength:1e3,defaultValue:optionalParamIdentifier+"use {newline} for line break]",required:!1},{name:"spamMessage8",label:"Notice #8",type:"str",minLength:1,maxLength:1e3,defaultValue:optionalParamIdentifier+"use {newline} for line break]",required:!1},{name:"spamMessage9",label:"Notice #9",type:"str",minLength:1,maxLength:1e3,defaultValue:optionalParamIdentifier+"use {newline} for line break]",required:!1},{name:"tipTitles",label:"10.) TIP TITLES ........................... Display users' tip totals as titles?",type:"choice",choice1:"Yes",choice2:"No",defaultValue:"Yes",required:!1},{name:"invalidToggle",label:"11.) MISC ................... Send error message for invalid commands?",type:"choice",choice1:"Yes",choice2:"No",defaultValue:"Yes",required:!1},{name:"heroesClubToggle",label:"12.) HEROES CLUB...................................................... Use HEROES CLUB?",type:"choice",choice1:"Yes",choice2:"No",defaultValue:"Yes",required:!0},{name:"heroesClubName",label:"Name of heroes club",type:"str",minLength:0,maxLength:30,required:!0,defaultValue:roomHost+"'s Heroes"},{name:"heroesClubTipToggle",label:"Tip to join heroes club?",type:"choice",choice1:"Yes",choice2:"No",defaultValue:"Yes",required:!0},{name:"heroesClubTip",label:"Tip amount to join heroes club",type:"int",minValue:1,defaultValue:"699"},{name:"heroesClubReBGColor",label:"Room Enter/Leave Background color for heroes club - HTML color code (without #)",type:"str",minLength:0,maxLength:6,required:!1,defaultValue:"FFFFFF"},{name:"heroesClubReTextColor",label:"Room Enter/Leave Text color for heroes club - HTML color code (without #)",type:"str",minLength:0,maxLength:6,required:!1,defaultValue:"008EC0"},{name:"heroesClubMemberList",label:"List of current heroes club members, separated by commas (and they need to be the CB username exactly)",type:"str",minLength:0,maxLength:10240,required:!1,defaultValue:""},{name:"heroesClubIcon",label:"Heroes club member icon: (do not use a (:) colon)",type:"str",minLength:0,maxLength:20,required:!1,defaultValue:"pityhero2"},{name:"tipMenuToggle",label:"13.) TIP MENU ...................................................... Use Tip Menu feature?",type:"choice",choice1:"Yes",choice2:"No",defaultValue:"No",required:!0},{name:"tipMenuSeparatorChar",label:"Separator char or small(!) image",type:"str",required:!1,defaultValue:":heart2"},{name:"tipMenuMessage1",label:"Tip menu message 1",type:"str",required:!1,defaultValue:"Tip Menu is active:"},{name:"tipMenuItem1",label:'Tip menu item 1 (format: <amount>-<prize>, e.g. "30-3 spanks")',type:"str",required:!1},{name:"tipMenuItem2",label:"Tip menu item 2",type:"str",required:!1},{name:"tipMenuItem3",label:"Tip menu item 3",type:"str",required:!1},{name:"tipMenuItem4",label:"Tip menu item 4",type:"str",required:!1},{name:"tipMenuItem5",label:"Tip menu item 5",type:"str",required:!1},{name:"tipMenuItem6",label:"Tip menu item 6",type:"str",required:!1},{name:"tipMenuItem7",label:"Tip menu item 7",type:"str",required:!1},{name:"tipMenuItem8",label:"Tip menu item 8",type:"str",required:!1},{name:"tipMenuItem9",label:"Tip menu item 9",type:"str",required:!1},{name:"tipMenuItem10",label:"Tip menu item 10",type:"str",required:!1},{name:"tipMenuItem11",label:"Tip menu item 11",type:"str",required:!1},{name:"tipMenuItem12",label:"Tip menu item 12",type:"str",required:!1},{name:"tipMenuItem13",label:"Tip menu item 13",type:"str",required:!1},{name:"tipMenuItem14",label:"Tip menu item 14",type:"str",required:!1},{name:"tipMenuItem15",label:"Tip menu item 15",type:"str",required:!1},{name:"tipMenuItem16",label:"Tip menu item 16",type:"str",required:!1},{name:"tipMenuItem17",label:"Tip menu item 17",type:"str",required:!1},{name:"tipMenuItem18",label:"Tip menu item 18",type:"str",required:!1},{name:"tipMenuItem19",label:"Tip menu item 19",type:"str",required:!1},{name:"tipMenuItem20",label:"Tip menu item 20",type:"str",required:!1}];var initialized=!1,helpCommand="/aiohelp",tipArray=new Array,tipArraySorted=!0,tipTotal=0,nDestinationMods="onlyMods",nDestinationRoomHost="roomHost",nDestinationModsAndHost="modsAndHost",nDestinationModsAndEmods="modsAndEmods",modArray=[dev],emodArray=new Array,modBlockMsgArray=new Array,lastBlockedLimit=10,lastBlocked=new Array,niceArray=new Array,greyArray=new Array,silenceArray=new Array,lastToUseSL=null,lastToGetSLed=null,ignoreArray=new Array,whisArray=new Array,silenceLevel=0,graphicLevel=1,startTime=null,timerDuration=0,timerTimeout=0,oneTimeout=0,fiveTimeout=0,currentKing="",kingTip=0,kingTipperMin=parseInt(cb.settings.kingTipperMin),kingTipperInterval=parseInt(cb.settings.kingTipperInterval),kingTimeout=0,kingTipperSpam=0,ldrArray=[["",0],["",0],["",0]],ldrTimer=parseInt(cb.settings.leaderBoardTimer),ldrTimeout=0,leaderboardSpam=0,noticeArray=[],noticeNum=0,notifierTimer=parseInt(cb.settings.notifierTimer),notifierTimeout=0,notifierSpamTGL=0,customWordlistRegex="",minuteMS=6e4,black="#000000",white="#FFFFFF",purple_dark="#A900B2",purple_light="#E9D5DF",blue_dark="#000000",blue_light="#98CBFC",pink_dark="#A900B2",pink_light="#FFDFFE",red_dark="#000000",red_light="#FF8989",green_dark="#000000",green_light="#00FF89",black_dark="#000000",black_light="#FFFFFF",halloween_dark="#F87217",halloween_light="#000000",christmas_dark="#FF0000",christmas_light="#4CD000",bb_dark="#000000",bb_light="#E7E7E7",bb_lt_dark="#000000",bb_lt_light="#E7E7E7",theme_dark=purple_dark,theme_light=purple_light,error_dark=red_dark,error_light=red_light,success_dark=green_dark,success_light=green_light,mod_yellow="#000000",bulletPoint="•",bullets=" "+bulletPoint+" "+bulletPoint+" "+bulletPoint+" ",crown=":crown01",heroesClubMembers=new Array,symbolString="~`!@#$%^&*()_-+={[}]|\\:;\"'<,>.?/",niceListName="nice list",greyListName="grey list",silenceLastTimeout=5e3,tipMenu=new Array,commandsLevel0=["showvar"],commandsLevel1=["emod","tiptotal","addhero","removehero","showheroes"],commandsLevel2=["blocknotice","silencelevel","graphiclevel","silence","unsilence","silencelast","addnice","removenice","shownice","addgrey","removegrey","showgrey","showsilenced","starttimer","stoptimer","addtime","kingspam","notifierspam","leaderboardspam","notice","shownotices","addnotice","removenotice","noticetimer","addword"],commandsLevel3=[helpCommand.substring(1),"leaderboard","timeleft","whisper","reply","ignore","unignore","ignorelevel"],commandsLevel0Help=commandsToHelpList(commandsLevel0),commandsLevel1Help=commandsToHelpList(commandsLevel1),commandsLevel2Help=commandsToHelpList(commandsLevel2),commandsLevel3Help=commandsToHelpList(commandsLevel3),setTimeout=function e(t,o){if(!(this instanceof e))return new e(t,o);var i=this;cb.setTimeout(function(){i.cancelled||t()},o<1e3?1e3:o)};cb.onMessage(function(msg){function doSilenceLevel(e){msg["X-Spam"]=!0,silenced=1,notifyError("I'm sorry, but the current silence level doesn't allow your level to send messages.\nPlease enjoy the show. :smile",u)}function replaceImage(){var e=!1;return":"==msg.m.charAt(0)?(msg.m=msg.m.replace(/:[^\s]+/g,"[IMG]"),msg["X-Spam"]=!0,imageReplaced=1,e=!0):e=!1,e}function doGraphicLevel(e){replaceImage()&&(notifyError("I'm sorry, but the graphic level has been set to "+e+'. Your message was not sent.\nFor more information about graphic levels, type "'+helpCommand+' graphiclevel"\nPlease enjoy the show :smile',u),graphicsBlocked=1)}function notifyModsAboutBlockedMessage(e,t,o){for(var i=null,r=0;r<e.length;r++)i=e[r],arrayContains(modBlockMsgArray,i)&&(notifyErrorBold(bullets+"MESSAGE BLOCKED: "+o+bullets,i),notifyError(msg.user+": "+t,i))}function blockMessage(e){if(msg["X-Spam"]=!0,messageBlocked=1,!isCommand&&!isSilenced&&0==silenced){silenced=1,"SpamBot"==e&&silence(msg.user,null),0==imageReplaced&&replaceImage();var t=msg.m.substring(0,200);msg.m.length>200&&(t+="...");notifyModsAboutBlockedMessage(modArray,t,e),notifyModsAboutBlockedMessage(emodArray,t,e),"Yes"==cb.settings.wordlistNotice&¬ifyError("Your message was not sent because it was flagged by the wordlist. Be nice and don't make demands.",u),lastBlocked.push(msg.user),lastBlocked.length>lastBlockedLimit&&lastBlocked.shift()}}cb.log("onMessage msg: "),cb.log(msg);var silenced=0,messageBlocked=0,graphicsBlocked=0,imageReplaced=0,symbolString="~`!@#$%^&*()_-+={[}]|\\:;\"'<,>.?/",m=msg.m,msgString=m.trim(),isCommand=msgString.startsWith("/"),isKenoCmd=msgString.startsWith("!"),message=msgString.split(/\s+/g),u=msg.user,isHost=u===cb.room_slug,isDev=u===dev,isMod=msg.is_mod,isFan=msg.in_fanclub,isEmod=arrayContains(emodArray,u),isNice=arrayContains(niceArray,u),isGreyish=arrayContains(greyArray,u),isSilenced=arrayContains(silenceArray,u),hasTipped=getUserTotal(u)>0,isGrey=!msg.has_tokens&&!hasTipped&&!msg.tipped_recently,isBlueUp=msg.tipped_recently||hasTipped;if(isMod&&(arrayContains(modArray,u)||(addItemToArray(modArray,u),"Yes"==cb.settings.wordlistShowModerators&&addItemToArray(modBlockMsgArray,u))),isSilenced&&!(isHost||isMod||isEmod||isNice||isDev)&&0==silenced&&(msg["X-Spam"]=!0,silenced=1),silenceLevel>0&&!(isHost||isMod||isEmod||isFan||isNice||isDev)&&0==silenced)switch(silenceLevel){case 1:isGrey&&doSilenceLevel(silenceLevel);break;case 2:isBlueUp||doSilenceLevel(silenceLevel);break;case 3:hasTipped||doSilenceLevel(silenceLevel);break;case 4:doSilenceLevel(silenceLevel)}if(graphicLevel>0&&!(isHost||isMod||isEmod||isFan||isNice||isDev)&&0==silenced)switch(graphicLevel){case 1:(isGrey||isGreyish)&&doGraphicLevel(graphicLevel);break;case 2:isBlueUp&&!isGreyish||doGraphicLevel(graphicLevel);break;case 3:hasTipped&&!isGreyish||doGraphicLevel(graphicLevel);break;case 4:doGraphicLevel(graphicLevel)}var blockReason=null;if(isHost||isMod||isEmod||isFan||isNice||("Yes"==cb.settings.customWordlistToggle&&""!=customWordlistRegex&&(isGrey||isGreyish||"Everyone"==cb.settings.customWordlistLevel)&&(blockReason=doCustomWordlist(msgString,u)),null==blockReason&&"Yes"==cb.settings.wordlistToggle&&(isGrey||isGreyish||"Everyone"==cb.settings.wordlistLevel)&&(blockReason=doWordlist(msgString)),null!=blockReason&&blockMessage(blockReason)),isCommand){msg["X-Spam"]=!0,msg.background=bb_lt_light,msg.c=bb_lt_dark;var validCmd=!1,command=null,param=null,split_index=msgString.indexOf(" ");if(split_index>-1?(command=msgString.substr(0,split_index).toLowerCase(),param=msgString.substring(split_index+1)):(command=msgString.toLowerCase(),param=null),!validCmd&&isDev)switch(command){case"/showvar":try{notifyPlain(param+": "+eval(param),dev)}catch(e){notifyPlain("No such variable: "+param,dev)}validCmd=!0}if(!validCmd&&(isHost||isMod||isDev))switch(command){case"/n":case"/note":case"/notice":param?(sendNote(param,u),msg.m=bullets+"NOTICE CREATED"+bullets,msg.c=theme_dark):notifyError("Uh oh! You didn't write a note",u),validCmd=!0;break;case"/emod":emod(message[1],message[2],u),validCmd=!0;break;case"/tiptotal":notify("Total tips: "+tipTotal+" tokens",u),validCmd=!0;break;case"/addhero":"Yes"==cb.settings.heroesClubToggle&&(cb.sendNotice("Adding "+param+" to "+cb.settings.heroesClubName),addUserToHeroesClub(param)),validCmd=!0;break;case"/removehero":"Yes"==cb.settings.heroesClubToggle&&(cb.sendNotice("Removing "+param+" from "+cb.settings.heroesClubName),removeUserFromHeroesClub(param)),validCmd=!0;break;case"/showheroes":if(cb.log("heroesClubMembers: "),cb.log(heroesClubMembers),"Yes"==cb.settings.heroesClubToggle&&(isHost||isMod||isEmod||isDev)){var n="Members of "+cb.settings.heroesClubName+": ";if(0==heroesClubMembers.length)n+="-";else for(var i=0;i<heroesClubMembers.length;i++)n+=heroesClubMembers[i]+(i<heroesClubMembers.length-1?",":"");cb.sendNotice(n,u)}validCmd=!0}if(!validCmd&&(isHost||isMod||isEmod||isDev))switch(command){case"/blocknotice":blockNotice(param,u),validCmd=!0;break;case"/silencelevel":setSilenceLevel(param,u),validCmd=!0;break;case"/graphiclevel":setGraphicLevel(param,u),validCmd=!0;break;case"/greysoff":case"/greyoff":case"/graysoff":case"/grayoff":case"/silencegreys":case"/silencegrays":setSilenceLevel(1,u),validCmd=!0;break;case"/greyson":case"/greyon":case"/grayson":case"/grayon":case"/unsilencegreys":case"/unsilencegrays":setSilenceLevel(0,u),validCmd=!0;break;case"/silence":silence(param,u),validCmd=!0;break;case"/unsilence":unsilence(param,u),validCmd=!0;break;case"/sl":case"/silencelast":silenceLast(u),validCmd=!0;break;case"/addnice":addToRemoveFromOverrideColorSettingList(niceArray,niceListName,param,u,"a"),validCmd=!0;break;case"/removenice":addToRemoveFromOverrideColorSettingList(niceArray,niceListName,param,u,"r"),validCmd=!0;break;case"/shownice":var niceString="";if(niceArray.length>0){for(var i=0;i<niceArray.length;i++)niceString+=niceArray[i],i<niceArray.length-1&&(niceString+=", ");notifyPlain(niceString,u)}else notifyPlain("There are no users on the nice list.",u);validCmd=!0;break;case"/addgrey":case"/addgray":addToRemoveFromOverrideColorSettingList(greyArray,greyListName,param,u,"a"),validCmd=!0;break;case"/removegrey":case"/removegray":addToRemoveFromOverrideColorSettingList(greyArray,greyListName,param,u,"r"),validCmd=!0;break;case"/showgrey":var greyString="";if(greyArray.length>0){for(var i=0;i<greyArray.length;i++)greyString+=greyArray[i],i<greyArray.length-1&&(greyString+=", ");notifyPlain(greyString,u)}else notifyPlain("There are no users on the grey list.",u);validCmd=!0;break;case"/showsilenced":var silencedString="";if(silenceArray.length>0){for(var i=0;i<silenceArray.length;i++)silencedString+=silenceArray[i],i<silenceArray.length-1&&(silencedString+=", ");notifyPlain(silencedString,u)}else notifyPlain("There are no users on the silenced list.",u);validCmd=!0;break;case"/starttimer":startTimer(param,u),validCmd=!0;break;case"/stoptimer":stopTimer(u),validCmd=!0;break;case"/addtime":addTime(param,u),validCmd=!0;break;case"/kingspam":kingSpamToggle(param,u),validCmd=!0;break;case"/notifierspam":notifierSpamToggle(param,u),validCmd=!0;break;case"/leaderboardspam":leaderboardSpamToggle(param,u),validCmd=!0;break;case"/shownotices":var noticeString="";if(noticeArray.length>0){for(var i=0;i<noticeArray.length;i++)i>0&&(noticeString+="\n-------------------------\n"),noticeString+=bulletPoint+" Rotating Notice #"+(i+1)+": \n",noticeString+=noticeArray[i];notifyPlain(noticeString,u)}else notifyPlain("There are no rotating notices set.",u);validCmd=!0;break;case"/addnotice":case"/addnote":param?(addNotice(param),notify("You have successfully added a new notice!",u)):notifyError("You did not enter a valid notice.",u),validCmd=!0;break;case"/removenotice":case"/removenote":var n=parseInt(param);n>0&&n<=noticeArray.length?(noticeArray.splice(n-1,1),notify("You have removed notice #"+n,u)):notifyError("You did not enter a valid notice number.",u),validCmd=!0;break;case"/noticetimer":var n=parseInt(param);n>0?(notifierTimer=n,notify("Rotating notices will now display every "+n+" minutes.",u)):param?notifyError("'"+param+"' is not a valid value for /noticetimer.",u):notifyError("You did not enter a valid value for /noticetimer.",u),validCmd=!0;break;case"/addword":null!=param?(addWord(param),notify("You have successfully added '"+param+"' to the custom wordlist!",u)):notifyError("You did not enter a valid word.",u),validCmd=!0}if(!validCmd)switch(command){case helpCommand:case"/ubhelp":help(param,u),validCmd=!0;break;case"/leaderboard":showLeaderBoard(u),validCmd=!0;break;case"/timeleft":timeLeft(msg.user),validCmd=!0;break;case"/w":case"/whisper":case"/tell":case"/t":case"/pm":case"/r":case"/reply":case"/ignore":case"/unignore":case"/ignorelevel":if("No"==cb.settings.whisperToggle.substr(0,2))notifyError('The broadcaster has disabled the "whisper" feature',u);else if(command.match(/\b(whisper|w|tell|t|pm)\b/gi)){var whisperLevel;whisperLevel=isGrey&&0==silenced?1:isBlueUp||0!=silenced?hasTipped||0!=silenced?4:3:2,isHost||isMod||isEmod||isFan||isNice||isDev?(sendWhisper(message,u,!0,whisperLevel),msg.m=textReplaceWhisper(message,u),msg.background=bb_light,msg.c=bb_dark):0==messageBlocked&&0==graphicsBlocked?(sendWhisper(message,u,!1,whisperLevel),msg.m=textReplaceWhisper(message,u),msg.background=bb_light,msg.c=bb_dark):(msg.m="Whisper not sent.",msg.background="#EEE",msg.c="#AAA")}else command.match(/\b(reply|r)\b/gi)?0==messageBlocked&&0==graphicsBlocked?(sendReply(message,u),msg.m=textReplaceWhisper(message,u,!0),msg.background=bb_light,msg.c=bb_dark):(msg.m="Reply not sent.",msg.background="#EEE",msg.c="#AAA"):"/ignorelevel"==command?setIgnoreLevel(parseInt(param),u):"/ignore"==command?ignoreUser(param,u):"/unignore"==command&&unignoreUser(param,u);validCmd=!0}validCmd||(msg.background="#EEE",msg.c="#AAA",commandsLevel0.indexOf(command)>=0?notifyError('Only developers are able to use the "'+command+'" command.\nType "'+helpCommand+' commands" to see a list of the available commands.',u):commandsLevel1.indexOf(command)>=0?notifyError('Only the developers, host, and mods are able to use the "'+command+'" command.\nType "'+helpCommand+' commands" to see a list of the available commands.',u):commandsLevel2.indexOf(command)>=0?notifyError('Only the developers, host, mods and emods are able to use the "'+command+'" command.\nType "'+helpCommand+' commands" to see a list of the available commands.',u):command.match(/\b(b|p|lb|rewards|prizes|winners|startshow|showtimeleft|printtime|addshowtime|adduser|changegoal|hide|unhide|selltickets|uacommands|luhelp|levels)\b/gi)||"Yes"==cb.settings.invalidToggle&¬ifyError('Invalid command "'+command+'".\nType "'+helpCommand+' commands" to see a list of the commands available to you.',u))}else if(!(isHost||isMod||isEmod||isFan||isNice||isDev)){if(("Yes"==cb.settings.capsToggle||"Only for greys"==cb.settings.capsToggle&&(isGrey||isGreyish))&&msg.m==msg.m.toUpperCase()&&msg.m.toUpperCase()!=msg.m.toLowerCase())for(var i=0;i<msg.m.length;i++)-1==symbolString.indexOf(msg.m.charAt(i))&&(msg.m=msg.m.replace(/[^\s]+/g,function(e){return 0==e.indexOf(":")?e:e.toLowerCase()}));if(("Yes"==cb.settings.stickyToggle||"Only for greys"==cb.settings.stickyToggle&&(isGrey||isGreyish))&&msg.m.match(/(.)\1{3,}/gi)){message=msg.m.trim().split(/\s+/g);for(var m="",i=0;i<message.length;i++)i>=0&&(m+=" "),":"==message[i].charAt(0)?m+=message[i]:m+=message[i].replace(/(.)\1{3,}/gi,"$1$1$1");msg.m=m}}return"Yes"!=cb.settings.tipTitles||!hasTipped||isCommand||isKenoCmd||(msg.m="|"+getUserTotal(u)+"| "+msg.m),"Yes"==cb.settings.kingTipper&&u==currentKing&&(msg.m=":"+cb.settings.kingTipperIcon+" "+msg.m),isHero(u)&&"Yes"==cb.settings.heroesClubToggle&&(msg.m=":"+cb.settings.heroesClubIcon+" "+msg.m),msg}),cb.onTip(function(e){var t=parseInt(e.amount),o=e.from_user,i=addTip(o,t);if(tipTotal+=t,sortTipArray(),t!=cb.settings.heroesClubTip||isHero(o)||"Yes"!=cb.settings.heroesClubTipToggle||"Yes"!=cb.settings.heroesClubToggle||(addUserToHeroesClub(o),cb.chatNotice(o+" has joined "+cb.settings.heroesClubName)),"No"!=cb.settings.notifierTip.substr(0,2)&&t>=cb.settings.tipMessageMin){var r="";tipMessage=cb.settings.tipMessage.replace("{username}",o),"Privately to tipper only"==cb.settings.notifierTip&&(r=o),notify(tipMessage,r,black_light,mod_yellow)}"Yes"==cb.settings.kingTipper&&(o==currentKing?kingTip=i:i>kingTip&&i>=kingTipperMin&&(currentKing=o,kingTip=i,notifyTheme(":"+cb.settings.kingTipperIcon+" We have a new "+("f"===e.from_user_gender?"Queen":"King")+"! All hail "+o+"! :"+cb.settings.kingTipperIcon,"")));for(var n=0;n<tipMenu.length;n++)t==tipMenu[n][0]&¬ifyTheme('User "'+o+'" tipped for '+tipMenu[n][1],nDestinationModsAndHost)}),cb.onEnter(function(e){cb.log("onEnter user: "),cb.log(e);var t=e.user;isHero(t)&&"Yes"==cb.settings.heroesClubToggle&&cb.chatNotice("Heroes Club member "+t+" has entered the room!","","#"+cb.settings.heroesClubReBGColor,"#"+cb.settings.heroesClubReTextColor,""),isBlank(cb.settings.enterMessage)||notifyTheme(cb.settings.enterMessage.replace(/{newline}/gi,"\n"),t),e.is_mod&&(arrayContains(modArray,t)||(addItemToArray(modArray,t),"Yes"==cb.settings.wordlistShowModerators&&addItemToArray(modBlockMsgArray,t)),showBlockNoticeInfo(t))}),cb.onLeave(function(e){cb.log("onLeave user: "),cb.log(e);var t=e.user;isHero(t)&&"Yes"==cb.settings.heroesClubToggle&&cb.chatNotice("Heroes Club member "+t+" has left the room!","","#"+cb.settings.heroesClubReBGColor,"#"+cb.settings.heroesClubReTextColor,"")}),initialized||init();
© Copyright Chaturbate 2011- 2024. All Rights Reserved.