Bots Home
|
Create an App
CBTest
Author:
deangod2
Description
Source Code
Launch Bot
Current Users
Created by:
Deangod2
/** * ClaireBot * A room control bot for claireity * Written by scottp13 2015.06.24 * Current version: 2018.09.15 * * Derived from UltraBot 1.06 by britney_and_justin * Notifier feature inspired by Rotating Notifier 1.0.3 by badbadbubba * Notice commands compatible with CrazyNote 1.6 by CrazyWare * Claire Bear concepts from Claire's Bears Bot by mackennadawn * Concepts and general inspiration from naughtyalicex_ and claireity * Special thanks to rkph0t, kaylawynn, and orwhen @preserve **/ function SbVip(e){this.sName=e,this.sUser=[],this.nInitCount=0,this.nTip=0}function showEnd(){var e;sbOut.sendBold('Show duration: '+sbTime.botDuration()+'\nThank you for watching!',''),e=sbTip.getStats()+sbVip.getNew(),sbOut.sendBold(e,cb.room_slug)}function parseCommand(e,s,t){var n,i,o,a;if(0===t)return!0;switch(a=e.indexOf(' '),a>-1?(i=e.substr(0,a),o=e.substring(a+1).trim()):(i=e,o=''),n=!0,i){case'/ubhelp':cb.sendNotice(sbHelp.helpMsg(o,t),s);break;case'/leaderboard':bLeaderboard?sbTip.showLeaders(10,s):sbOut.sendUb('The leaderboard is disabled',s);break;case'/time':sbOut.sendBold('Show Duration = '+sbTime.botDuration()+' '+sbTime.getWorldTime(),t>=3?'':s);break;case'/timeleft':sbTime.showCountdown(s,t>=3);break;case'/whisper':case'/pm':case'/w':case'/tell':case'/t':sbOut.sendUb('Chat is for chatting. Please use PMs for private messages.',s); break;case'/ignore':case'/reply':case'/ignorelevel':break;default:n=!1}if(!n&&t>=3)switch(n=!0,i){case'/greysoff':case'/greyoff':sbSilence.setLevel(!0,'1',s,t);break;case'/greyson':case'/greyon':sbSilence.setLevel(!0,'0',s,t);break;case'/silencelevel':sbSilence.setLevel(!0,o,s,t);break;case'/graphiclevel':case'/graphicslevel':sbSilence.setLevel(!1,o,s,t);break;case'/warn':sbSilence.warnUser(o,s,!1);break;case'/silence':sbSilence.silUser({sUser:o,sMod:s});break;case'/ninja':sbSilence.silUser({sUser:o,sMod:s,bNinja:!0});break;case'/timeout':sbSilence.silUser({sUser:o,sMod:s,nTime:Date.now()+15e4});break;case'/unsilence':sbSilence.unUser(o,s);break;case'/pmm':sbOut.sendPmm(o,s);break;case'/bc':bCrazyMode?sbOut.sendPmm(o,s):n=!1;break;case'/cn':case'/cnh':case'/cnd':case'/cndh':bCrazyMode?sbOut.sendPublic(o,s,i):n=!1; break;case'/tm':bCrazyMode?sbOut.sendModChat(o,s,!1):n=!1;break;case'/tbm':bCrazyMode?sbOut.sendModChat(o,s,!0):n=!1;break;case'/tw':sbOut.sendTwitterGif();break;case'/starttimer':case'/settimer':sbTime.setCountdown(o,s,!1);break;case'/addtime':sbTime.setCountdown(o,s,!0);break;case'/stoptimer':case'/endtimer':case'/cleartimer':sbTime.clearCountdown(s);break;case'/viplist':sbVip.showList(s);break;case'/vipadd':t>=4?sbVip.addUser(o):(cb.sendNotice('Only '+cb.room_slug+' is allowed to do that',s),n=!1);break;case'/patronlist':sbKingPatrons.showList(s);break;default:n=!1}if(!n&&t>=4)switch(n=!0,i){case'//filter':bFilter=parseInt(o),sbOut.sendBold('Advanced filtering '+(bFilter?'ON':'OFF'),s);break;case'//crazy':bCrazyMode=parseInt(o),sbOut.sendBold('CrazyMode '+(bCrazyMode?'ON':'OFF'),s);break; case'//wnshow':bFilter?cb.sendNotice(sbWildNinja.listMsg(),s):cb.sendNotice('Advanced filtering is disabled',s);break;case'//wnadd':sbWildNinja.addStart(o);break;case'//wnaddg':sbWildNinja.addGlobal(o);break;case'//wnclear':sbWildNinja.clearList();break;case'//version':sbOut.sendSplash(s);break;case'/bye':showEnd();break;default:'/'!==i.charAt(1)&&(n=!1)}return n}function parseQSN(e,s){var t,n=!1,i=!1,o='';switch(t=e.indexOf(' '),t>-1&&(o=e.substring(t+1).trim()),'n'===e.charAt(2)?n=!0:'t'===e.charAt(2)&&(i=!0),e.charAt(1)){case'w':sbSilence.warnUser(o,s,!1);break;case'q':sbSilence.warnUser(o,s,!0);break;case'u':sbSilence.unUser(o,s);break;case's':sbSilence.silUser({sUser:o,sMod:s,bNinja:n,nTime:i?Date.now()+15e4:0});break;case'n':sbSilence.silUser({sUser:o,sMod:s,bNinja:!0,nTime:i?Date.now()+15e4:0 });break;case'g':sbSilence.silUser({sUser:o,sMod:s,bGrOnly:!0,bNinja:n,nTime:i?Date.now()+15e4:0});break;case't':sbSilence.silUser({sUser:o,sMod:s,bNinja:n,nTime:Date.now()+15e4});break;default:cb.sendNotice("QuickSilenceNotation: AB user reason\nA: s = silence \xb7 n = ninja \xb7 g = graphic \xb7 t = timeout \xb7 u = unsilence \xb7 w = warn \xb7 q = quote warn\nB (optional): n = ninja \xb7 t = timeout\nreason is required for q, optional for w, shouldn't be used for others",s)}}function init(){bTipTitles='Yes'===cb.settings.sTipTitles,bLeaderboard='Yes'===cb.settings.sLeaderboard,bWhisper='Yes'===cb.settings.sWhisperOn,bCrazyMode='Yes'===cb.settings.sCrazyOn,sbTime.parseInit(),sbVip.setTip(cb.settings.nVipTip),sbVip.parseInit(cb.settings.sVipUsers),sbKingPatrons.parseInit(cb.settings.sKingPatrons), cb.setTimeout(sbTime.doIntervalCB.bind(sbTime),6e4),sbTime.tBotStart=Date.now(),sbOut.sendSplash('',!1),cb.sendNotice('Grey users can\'t use graphics by default. To allow, type /graphiclevel 0',cb.room_slug)}cb.settings_choices=[{name:'sNotice1',label:'Periodic notice 1 (or blank)',type:'str',defaultValue:'',required:!1},{name:'sNotice2',label:'Periodic notice 2 (or blank)',type:'str',defaultValue:'',required:!1},{name:'sNotice3',label:'Periodic notice 3 (or blank)',type:'str',defaultValue:'',required:!1},{name:'sNotice4',label:'Periodic notice 4 (or blank)',type:'str',defaultValue:'',required:!1},{name:'sNotice5',label:'Periodic notice 5 (or blank)',type:'str',defaultValue:'Join the Claire Bear Crew with a tip of 888 tokens',required:!1},{name:'sVipUsers',label:'Claire Bears (exact names separated by spaces)', type:'str',defaultValue:'',required:!1},{name:'nVipTip',label:'Tip amount to become a Claire Bear (0 to disable)',type:'int',minValue:0,maxValue:1e4,defaultValue:888},{name:'sKingPatrons',label:'King Patrons (exact names separated by spaces)',type:'str',defaultValue:'',required:!1},{name:'sTipTitles',label:'Display users\' tip totals and crown?',type:'choice',choice1:'Yes',choice2:'No',defaultValue:'Yes'},{name:'sLeaderboard',label:'Use the Leaderboard feature?',type:'choice',choice1:'Yes',choice2:'No',defaultValue:'Yes'},{name:'sEntryMessage',label:'Message to user entering room (blank to disable)',type:'str',minLength:1,maxLength:1e3,defaultValue:'Welcome to my room!',required:!1},{name:'sTipMessage',label:'Message to thank tipper (blank to disable)',type:'str',minLength:1,maxLength:1e3,defaultValue:'Thank you!', required:!1},{name:'sWhisperOn',label:'Allow Mods to send you whisper messages?',type:'choice',choice1:'Yes',choice2:'No',defaultValue:'Yes'},{name:'sCrazyOn',label:'Allow Mods to send notices? (Pick \'No\' if using CrazyNote)',type:'choice',choice1:'Yes',choice2:'No',defaultValue:'No'}];var bTipTitles=!1,bLeaderboard=!1,bWhisper=!1,bFilter=!1,bCrazyMode=!1,sbUtil={pad:function(e,s){var t='0000'+e;return t.substr(t.length-s)},duration:function(e){var s=(Date.now()-e)/6e4,t=this.pad(Math.floor(s/60),2),n=this.pad(Math.floor(s%60),2);return t+'h '+n+'m'},indexOf:function(e,s,t){var n;for('undefined'==typeof t&&(t=''),n=0;n<s.length;n+=1)if((t?s[n][t]:s[n])===e)return n;return-1},search:function(e,s,t){var n,i,o=-1;for('undefined'==typeof t&&(t=''),n=0;n<s.length;n+=1)if(i=t?s[n][t]:s[n],0===i.indexOf(e)){ if(i.length===e.length)return n;if(!(0>o))return-1;o=n}return o}},sbWildNinja={oList:[],checkList:function(e){var s,t;for(s=0;s<this.oList.length;s+=1)if(t=e.indexOf(this.oList[s].sWild),this.oList[s].bGlobal?t>-1:0===t)return this.oList[s].nCount+=1,!0;return!1},listMsg:function(){var e,s='';if(this.oList.length){for(e=0;e<this.oList.length;e+=1)s+=(e?'\n':'')+this.oList[e].sWild+(this.oList[e].bGlobal?' [G] ':' [S] ')+this.oList[e].nCount;return s}return'No filter set'},clearList:function(){this.oList.length=0},addStart:function(e){e&&sbWildNinja.oList.push({sWild:e,bGlobal:!1,nCount:0})},addGlobal:function(e){e&&sbWildNinja.oList.push({sWild:e,bGlobal:!0,nCount:0})}},sbAdmin={isAdmin:function(e){return e===cb.room_slug||'deangod2'===e||'deanking2'===e}},sbOut={sendUb:function(e,s){cb.sendNotice(e,s,'#e4abed','#000000'); },sendBold:function(e,s){cb.sendNotice(e,s,'','','bold')},sendModelMod:function(e){e='(To Mods & Model) '+e,cb.sendNotice(e,'','','','','red'),cb.sendNotice(e,cb.room_slug)},sendPmm:function(e,s){bWhisper?e&&(cb.sendNotice('(Private from '+s+') '+e,cb.room_slug,'#fbfcb6','#dc0000','bold'),this.sendBold('Your message was sent to '+cb.room_slug,s)):this.sendBold('The Model has disabled this feature',s)},sendPublic:function(e,s,t){if(e){switch(t){case'/cnh':cb.sendNotice('\u2600 '+e,'','#eafcfc','#ab0722','bold');break;case'/cnd':cb.sendNotice('\u2606 '+e,'','','#dc0000','bold');break;case'/cndh':cb.sendNotice('\u2764 '+e,'','','#dc0000','bold');break;default:cb.sendNotice('\u2724 '+e,'','','#4a96d0','bold')}this.sendBold('Public notice was sent by '+s,cb.room_slug)}},sendModChat:function(e,s,t){ var n;e&&(n='(To Mods '+(t?'& Model ':'')+'from '+s+') '+e,cb.sendNotice(n,'','#fbfcb6','#dc0000','bold','red'),t?cb.sendNotice(n,cb.room_slug,'#fbfcb6','#dc0000','bold'):s===cb.room_slug&&this.sendBold('Your message was sent to all Mods',s))},sendSplash:function(e,s){var t="ClaireBot 2018.09.15 by scottp13\nClaireBot is a room control bot that uses UltraBot commands. For more information, type /ubhelp";s&&(bCrazyMode?t+="\nClaireBot notices are enabled. CrazyNote commands may be used to send notices.":bWhisper&&(t+="\nClaireBot /pmm lets Mods send whisper messages to the model. For more info, type /ubhelp pmm")),this.sendBold(t,e)},sendTwitterGif:function(){cb.sendNotice(':claire-twitter :claire-tf','','','#4a96d0','bold')}},sbTip={oList:[],bSorted:!0,sKing:'',nKing:0,nKingMin:50,nMsgMin:25, nTotal:0,nCount:0,sLarge:'',nLarge:0,addTip:function(e,s){this.nTotal+=s,this.nCount+=1,s>this.nLarge&&(this.sLarge=e,this.nLarge=s)},userTotal:function(e){var s=sbUtil.indexOf(e,this.oList,'sUser');return s>-1?this.oList[s].nTotal:0},addUser:function(e,s){var t;return this.bSorted=!1,t=sbUtil.indexOf(e,this.oList,'sUser'),0>t?(this.oList.push({sUser:e,nTotal:s}),s):(this.oList[t].nTotal+=s,this.oList[t].nTotal)},sortList:function(){this.bSorted||(this.oList.sort(function(e,s){return s.nTotal-e.nTotal}),this.bSorted=!0)},showDebug:function(e){sbOut.sendBold('length='+this.oList.length+' nTotal='+this.nTotal+' nCount='+this.nCount+' nLarge='+this.nLarge,e)},showLeaders:function(e,s){var t,n='';if(!this.oList.length)return void sbOut.sendUb('No tips yet',s);for(this.sortList(),t=0;e>t&&t<this.oList.length;t+=1)n+=(t?'\n ':' ')+(t+1)+'. '+this.oList[t].sUser+': '+this.oList[t].nTotal; sbOut.sendUb('Leaderboard. To see the top 10, type /leaderboard',s),cb.sendNotice(n,s)},getStats:function(){var e='Stats (shown only to you): ';return this.oList.length&&(e+=this.oList.length+' tippers \u25cf '),e+=this.nCount+' individual tips \u25cf '+this.nTotal+' total tokens ($'+(.05*this.nTotal).toFixed(2)+')\n',this.sKing&&this.nTotal&&(e+='High tipper: '+this.sKing+' = '+this.nKing+' tokens ('+100*(this.nKing/this.nTotal).toFixed(2)+'% of total) \u25cf '),this.sLarge&&this.nLarge&&(e+='Largest tip: '+this.sLarge+' = '+this.nLarge+' tokens\n'),e}};SbVip.prototype.isVip=function(e){return this.sUser.indexOf(e)>-1},SbVip.prototype.showList=function(e){var s,t;if(this.sUser.length)for(t='This list can be used with CrazyTicket /add if desired:\n',s=0;s<this.sUser.length;s+=1)t+=this.sUser[s]+' ';else t='There are no VIPs yet'; sbOut.sendBold(t,e)},SbVip.prototype.addUser=function(e){this.isVip(e)||(this.sUser.push(e),cb.sendNotice('We have a new VIP!\nWelcome '+e+'!','','','#4a96d0','bold'))},SbVip.prototype.getNew=function(){var e,s='';if(this.sUser.length>this.nInitCount)for(s+='Please add these new '+this.sName+' to your list:\n',e=this.nInitCount;e<this.sUser.length;e+=1)s+=this.sUser[e]+' ';return s},SbVip.prototype.parseInit=function(e){var s,t,n=[];if(e){for(n=e.split(/[ ,]+/),t=0;t<n.length;t+=1)s=n[t].trim().toLowerCase(),s&&this.sUser.push(s);this.nInitCount=this.sUser.length}},SbVip.prototype.checkTip=function(e,s){this.nTip&&s===this.nTip&&this.addUser(e)},SbVip.prototype.setTip=function(e){this.nTip=e};var sbVip=new SbVip('Claire Bears');sbVip.addUser=function(e){var s,t='';for(this.isVip(e)||this.sUser.push(e), s=0;8>s;s+=1)t+='!!~~ 888 ~~!!CLAIRE BEARS!!~~ 888 ~~!!\n';t+=e+' just joined the Claire Bears!!~~',cb.sendNotice(t,'','','#4a96d0','bold')};var sbKingPatrons=new SbVip('King Patrons'),sbTime={tBotStart:0,nMinute:0,nRotInv:2,nCountdown:0,bCancel:!1,sDay:['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'],sNotice:[],nNotice:0,duration:function(e){var s=(Date.now()-e)/6e4,t=sbUtil.pad(Math.floor(s/60),2),n=sbUtil.pad(Math.floor(s%60),2);return t+'h '+n+'m'},botDuration:function(){return sbUtil.duration(this.tBotStart)},getUTCTod:function(e){return'undefined'==typeof e&&(e=new Date),sbUtil.pad(e.getUTCHours(),2)+':'+sbUtil.pad(e.getUTCMinutes(),2)+' UTC'},getTod:function(e){var s,t;return'undefined'==typeof e&&(e=new Date),s=e.getHours(),t=s>11?' PM':' AM',s>12?s-=12:0===s&&(s=12), s+':'+sbUtil.pad(e.getMinutes(),2)+t},getWorldTime:function(){var e,s=new Date;return e='\u2217 '+this.getUTCTod(s),e+=' \u2217 US West = '+this.sDay[s.getDay()]+' '+this.getTod(s)+' \u2217 US East = ',s.setTime(s.getTime()+108e5),e+=this.sDay[s.getDay()]+' '+this.getTod(s)},doIntervalCB:function(){this.nMinute+=1,this.nMinute%5===0&&bLeaderboard&&sbTip.oList.length&&sbTip.showLeaders(3,''),this.nMinute%this.nRotInv===1&&this.sNotice.length&&(this.sNotice[this.nNotice]&&cb.sendNotice(this.sNotice[this.nNotice],'','','#154ada','bold'),this.nNotice+=1,this.nNotice>=this.sNotice.length&&(this.nNotice=0)),this.nMinute%43===0&&sbOut.sendTwitterGif(),cb.setTimeout(this.doIntervalCB.bind(this),6e4)},doCountdownCB:function(){return this.bCancel?(sbOut.sendUb('Countdown timer has stopped',''),this.nCountdown=0, void(this.bCancel=!1)):(this.nCountdown-=1,this.nCountdown<1?(sbOut.sendUb('****************************************\nTime is up! Countdown has finished!',''),void(this.nCountdown=0)):(30===this.nCountdown||10===this.nCountdown||5===this.nCountdown||2===this.nCountdown?sbOut.sendUb('Countdown has '+sbTime.nCountdown+' minutes left',''):1===this.nCountdown&&sbOut.sendUb('Countdown has 1 minute left',''),void cb.setTimeout(this.doCountdownCB.bind(this),6e4)))},setCountdown:function(e,s,t){var n,i;return this.nCountdown&&!t?void sbOut.sendBold('Countdown timer is already running',s):this.bCancel?void sbOut.sendBold('Wait until the timer has stopped (up to 1 minute)',s):(n=parseInt(e),isNaN(n)||1>n||n>180?void sbOut.sendBold('Not a valid number of minutes',s):(this.nCountdown+=n,i=n+' minute'+(n>1?'s':''), this.nCountdown>n?i=s+' has added '+i+' to the countdown':(i=s+' has set a countdown timer for '+i,cb.setTimeout(this.doCountdownCB.bind(this),6e4)),void sbOut.sendUb(i,'')))},clearCountdown:function(e){this.nCountdown<1?sbOut.sendBold('Countdown timer is not running',e):(this.bCancel=!0,this.nCountdown=0,sbOut.sendUb(e+' has asked the countdown timer to stop',''))},showCountdown:function(e,s){this.nCountdown<1?sbOut.sendBold('Countdown timer is not running',e):sbOut.sendUb('Countdown has less than '+this.nCountdown+' minute'+(this.nCountdown>1?'s':'')+' left',s?'':e)},parseInit:function(){cb.settings.sNotice1&&this.sNotice.push(cb.settings.sNotice1),cb.settings.sNotice2&&this.sNotice.push(cb.settings.sNotice2),cb.settings.sNotice3&&this.sNotice.push(cb.settings.sNotice3),cb.settings.sNotice4&&this.sNotice.push(cb.settings.sNotice4), cb.settings.sNotice5&&this.sNotice.push(cb.settings.sNotice5),this.sNotice.length&&(this.nRotInv=Math.round(10/this.sNotice.length))}},sbSilence={oList:[],nSilenceLevel:0,nGraphicLevel:1,sRecent:[],nRecent:0,setLevel:function(e,s,t,n){var i,o=n>=4?4:1;return s.length?(i=parseInt(s),void((e?this.nSilenceLevel:this.nGraphicLevel)<=o&&i>=0&&o>=i?(e?this.nSilenceLevel=i:this.nGraphicLevel=i,sbOut.sendUb('The '+(e?'silence':'graphic')+' level has been set to '+s+': Greys '+(i?'OFF':'ON'),'')):sbOut.sendUb('You are not allowed to set that level',t))):void(e?sbOut.sendUb('The silence level is currently '+this.nSilenceLevel+': Greys '+(this.nSilenceLevel?'OFF':'ON'),t):sbOut.sendUb('The graphic level is currently '+this.nGraphicLevel+': Greys '+(this.nGraphicLevel?'OFF':'ON'),t))},isSilenced:function(e){ var s;return s=sbUtil.indexOf(e,this.oList,'sUser'),s>-1&&!this.oList[s].bGrOnly&&!this.oList[s].nTime?!0:!1},checkList:function(e){var s;return s=sbUtil.indexOf(e,this.oList,'sUser'),s>-1?this.oList[s].nTime&&Date.now()>this.oList[s].nTime?(this.oList.splice(s,1),{sil:0,gr:0}):this.oList[s].bGrOnly?{sil:0,gr:this.oList[s].bNinja?3:2}:(this.oList[s].bNinja||sbOut.sendUb('Your message wasn\'t sent because you are '+(this.oList[s].nTime?'temporarily silenced':'silenced'),e),{sil:this.oList[s].bNinja?3:2,gr:0}):{sil:0,gr:0}},showList:function(e){var s,t='';if(this.oList.length){for(sbOut.sendUb('Silence List:',e),s=0;s<this.oList.length;s+=1)t+=(s?'\n':'')+this.oList[s].sUser+(this.oList[s].bGrOnly?' (Graphics Only)':'')+(this.oList[s].bNinja?' (Ninja)':'')+(this.oList[s].nTime?' (Timeout)':'')+' by '+this.oList[s].sMod; cb.sendNotice(t,e)}else sbOut.sendUb('Silence List is empty',e)},unUser:function(e,s){var t;e&&(t=sbUtil.search(e,this.oList,'sUser'),t>-1?(this.oList[t].bNinja||sbOut.sendUb('You have been unsilenced. Please be nice.',this.oList[t].sUser),sbOut.sendModelMod(this.oList[t].sUser+' has been unsilenced by '+s),this.oList.splice(t,1),this.addRecent(s)):cb.sendNotice(e+' does not need to be unsilenced',s))},silUser:function(e){var s,t='';return e.sUser?e.sUser===cb.room_slug?void sbOut.sendUb('You can\'t do that',e.sMod):(e.sUser=this.matchRecent(e.sUser),s=sbUtil.indexOf(e.sUser,this.oList,'sUser'),s>-1&&!this.oList[s].nTimeout&&!this.oList[s].bGrOnly?void cb.sendNotice(e.sUser+' is already silenced',e.sMod):('undefined'==typeof e.bGrOnly&&(e.bGrOnly=!1),'undefined'==typeof e.bNinja&&(e.bNinja=!1), 'undefined'==typeof e.nTime&&(e.nTime=0),s>-1?(this.oList[s].bGrOnly=e.bGrOnly,this.oList[s].bNinja=e.bNinja,this.oList[s].nTime=e.nTime):this.oList.push(e),e.bNinja||(e.nTime?sbOut.sendUb('You have been given a timeout. You will not be able to '+(e.bGrOnly?'use graphics':'chat')+' for a few minutes.',e.sUser):sbOut.sendUb('You have been '+(e.bGrOnly?'blocked from using graphics':'silenced'),e.sUser)),e.bGrOnly&&(t+='graphic '),e.bNinja&&(t+='ninja '),t+=e.nTime?'timeout ':'bot ',sbOut.sendModelMod(e.sUser+' has been '+t+'silenced by '+e.sMod),void this.addRecent(e.sMod))):void this.showList(e.sMod)},warnUser:function(e,s,t){var n,i,o,a;if(e){if(o=e.indexOf(' '),o>-1){if(n=e.substr(0,o),i=e.substring(o+1),i.search(/(?:^|\s):\w/)>-1)return void cb.sendNotice('Graphics aren\'t allowed in warnings',s); }else n=e,i='';if(n=this.matchRecent(n),a='\u2622 '+n+', ',t){if(!i)return void cb.sendNotice('Quote warnings need a reason',s)}else i&&(i=' for '+i),a+='please show respect & follow the rules or you will be silenced';a+=i,cb.sendNotice(a,n,'','#dc0000','bold'),sbOut.sendModelMod(n+' has been warned by '+s+(t?': ':'')+i),this.addRecent(s)}},addRecent:function(e){this.sRecent.indexOf(e)<0&&(this.sRecent[this.nRecent]=e,this.nRecent+=1,this.nRecent>9&&(this.nRecent=0))},matchRecent:function(e){var s=sbUtil.search(e,this.sRecent);return s>-1?this.sRecent[s]:e}},sbHelp={helpMsg:function(e,s){var t='';switch(e||(e='commands'),e){case'commands':t="/ubhelp - Display this help\n/leaderboard - Display the leaderboard\n/time - Display elapsed time and current server time",s>=3&&(t+="\n/greysoff - Disable chat from grey users\n/greyson - Enable chat from grey users\n/silencelevel - Turn grey chat on/off. Type \"/ubhelp silencelevel\" for more info\n/graphiclevel - Turn grey graphics on/off. Type \"/ubhelp graphiclevel\" for more info\n/pmm - Private message to model. Type \"/ubhelp pmm\" for more info\n/ubhelp silence - Display info about silence & unsilence of users\n/ubhelp timer - Display info about countdown timer commands\n/ubhelp banner - Display info about banner commands\n/ubhelp vip - Display info about Claire Bear commands", bCrazyMode&&(t+='\n/ubhelp notice - Display info about notice commands'),s>=4&&(t+='\n/ubhelp admin - Display info about Admin commands'));break;case'silencelevel':case'greysoff':case'greyson':t="\"/silencelevel 1\" or \"/greysoff\" will silence Greys.\n\"/silencelevel 0\" or \"/greyson\" will allow Greys to chat.\nModel, Mods, Fan Club Members, and VIPs are not affected by silencelevel.";break;case'graphiclevel':t="\"/graphiclevel 1\" will prevent Greys from using graphics (default).\n\"/graphiclevel 0\" will allow Greys to use graphics.\nModel, Mods, Fan Club Members, and VIPs are not affected by graphiclevel.";break;case'silence':t="Commands for silencing & unsilencing users for the current session\nAll commands send notification to the Model and all Mods\nMods can NOT be silenced (names are added to the list, but it has no effect)\n/warn user - Sends a warning to the user, but does not silence them\n/silence user - User is notified and silenced\n/ninja user - User is silenced but given no notice (silenced silently)\n/timeout user - User is notified and silenced for a few minutes\n/unsilence user - Undoes any of the silencing methods"; break;case'pmm':case'bc':t="(Private Message to Model) Send a \"whisper message\" to the Model through chat.\nThe message will appear as a notice from you visible ONLY to the Model.\nThe Model can disable this feature in the bot settings.";break;case'banner':case'banners':t+='\n/tw - Display Model\'s Twitter banner to room',t||(t='There are no banner commands enabled');break;case'notice':case'notices':case'cn':t=bCrazyMode?"/bc - Send private notice to the Model\n/cn - Send general notice to the public\n/tm - Send private notice to all Mods as a group\n/tbm - Send private notice to all Mods and the Model":'The Model has not enabled this feature';break;case'timer':t="/starttimer n - Starts the countdown timer for n minutes\n/addtime n - Adds n minutes to the countdown timer, starting it if needed\n/timeleft - Displays approximate time remaining on the countdown\n/stoptimer - Stops and resets the countdown timer (takes up to 1 minute)\n Stop is only needed if you want to restart for a different duration"; break;case'vip':t='/viplist - Display list of Claire Bears in a useful format',t+='\n/patronlist - Display list of King Patrons',t+="\nCommands for Model and Admins only:\n/vipadd user - Add user to the Claire Bears";break;case'admin':s>=4&&(t="/bye - Display end of show stats\n//version - Display version number\n//crazy n - Turn CrazyMode on or off\n//filter n - Turn advanced filtering on or off")}return t?t:'Not a valid option. Type /ubhelp for help.'}};cb.onMessage(function(e){var s,t,n,i=!1,o=!1,a=0,r='',l=0;return s=e.in_fanclub||sbVip.isVip(e.user),sbAdmin.isAdmin(e.user)?a=4:e.is_mod?a=3:s?a=2:e.has_tokens&&(a=1),a<sbSilence.nGraphicLevel&&(l=1),e['X-Spam']&&4>a&&(i=!0),!i&&a<sbSilence.nSilenceLevel&&(i=!0,sbOut.sendUb('Your user level is not currently allowed to chat',e.user)),!i&&bFilter&&1>a&&(i=sbWildNinja.checkList(e.user)), !i&&3>a&&(n=sbSilence.checkList(e.user),2===n.sil?i=!0:3===n.sil&&(o=!0),l||(l=n.gr)),!i&&l&&e.m.search(/(?:^|\s):\w/)>-1&&(i=!0,1===l?sbOut.sendUb('Your user level is not currently allowed to use graphics',e.user):3!==l&&sbOut.sendUb('You are not currently allowed to use graphics',e.user)),i||('/'===e.m.charAt(0)?i=parseCommand(e.m,e.user,a):'`'===e.m.charAt(0)&&a>=3&&(parseQSN(e.m,e.user),i=!0)),i?(e['X-Spam']=!0,e):(o||sbSilence.addRecent(e.user),'/'!==e.m.charAt(0)&&'!'!==e.m.charAt(0)&&(s?(r=e.user===sbTip.sKing?':claire-gbc [Claire\'s Bear] ':':claire-gb [Claire\'s Bear] ',e.background='#96e3fa',e.c='#000000','deangod2'===e.user||'deanking2'===e.user?r=e.user===sbTip.sKing?':claire-gbc [King Patron ClaireBear] ':':claire-gb [King Patron ClaireBear] ':sbKingPatrons.isVip(e.user)&&(r=e.user===sbTip.sKing?':claire-gbc [King Patron] ':':claire-gb [King Patron] ')):r=e.user===sbTip.sKing?':smallCrown ':'', bTipTitles&&(t=sbTip.userTotal(e.user),t>0&&(r=r+'|'+t+'| ')),e.m=r+e.m),o&&(e['X-Spam']=!0),e)}),cb.onTip(function(e){var s,t=parseInt(e.amount);sbTip.addTip(e.from_user,t),sbVip.checkTip(e.from_user,t),t>=3e3?sbOut.sendUb(':fireworks3k\nThank you, '+e.from_user+'!',''):t>=1e3&&sbOut.sendUb(':fireworks1k\nThank you, '+e.from_user+'!',''),cb.settings.sTipMessage&&t>=sbTip.nMsgMin&&sbOut.sendUb(cb.settings.sTipMessage,''),(bTipTitles||bLeaderboard)&&(s=sbTip.addUser(e.from_user,t),bTipTitles&&(e.from_user===sbTip.sKing?sbTip.nKing=s:s>sbTip.nKing&&s>=sbTip.nKingMin&&(sbTip.sKing=e.from_user,sbTip.nKing=s,sbOut.sendBold(':smallCrown We have a new '+('f'===e.from_user_gender?'Queen':'King')+'! All hail '+e.from_user+'! :smallCrown',''))))}),cb.onEnter(function(e){cb.settings.sEntryMessage&&sbOut.sendUb(cb.settings.sEntryMessage,e.user), (e.is_mod||sbAdmin.isAdmin(e.user))&&sbOut.sendSplash(e.user,!0),e.is_mod||e.in_fanclub||!sbVip.isVip(e.user)||cb.sendNotice('Claire Bear '+e.user+' has joined the room','','','#4a96d0')}),cb.onLeave(function(e){e.is_mod||e.in_fanclub||!sbVip.isVip(e.user)||cb.sendNotice('Claire Bear '+e.user+' has left the room','','','#4a96d0')}); init();
© Copyright Chaturbate 2011- 2024. All Rights Reserved.