Bots Home
|
Create an App
BaconBot v2
Author:
zero_kool
Description
Source Code
Launch Bot
Current Users
Created by:
Zero_Kool
/*/////////////////////////////////// -------BaconBot v2 Bot----- Originally designed by PhasmaEx, updated by Zero_Kool. ****************/var ver = "2.0.0"/*********************** *//////////////////////////////////// // Define globals object, which holds most all the information in the app. var globals = new Object(); globals.muted = new Array(); globals.whitelist = new Array(); globals.warnings = new Object(); globals.filters = new Array(); globals.notifications = new Array(); globals.notificationIndex = 0; globals.gid1 = ""; globals.gid2 = ""; globals.usegid = true; globals.tipemotes = new Array(); //globals.gentip_timeout; globals.gentips_stack = new Array(); globals.tipleaderboard = new Object(); globals.kingtipper = null; globals.allowgraphics = new Array(); globals.mutegraphics = new Array(); globals.min_memberlvl = 1; globals.max_memberlvl = 10; globals.timer = new Object(); globals.timer.obj = null; globals.timer.tleft = 0; globals.colors = new Object(); // Define Color Codes for messages globals.colors['Light Blue'] = "#4595ED"; globals.colors['Navy Blue'] = "#004A82"; globals.colors['Light Purple'] = "#A448FF"; globals.colors['Violet'] = "#69008C"; globals.colors['Pink'] = "#E27570"; globals.colors['Red'] = "#FF2626"; globals.colors['Orange'] = "#FF8000"; globals.colors['Gold'] = "#FAA732"; globals.colors['Lime Green'] = "#97FF2F"; globals.colors['Forest Green'] = "#378037"; globals.colors['Olive Green'] = "#7C9445"; globals.colors['Grey'] = "#6B6B6B"; globals.colors['Black'] = "#000000"; globals.colors['White'] = "#FFFFFF"; function createcolschoice(name,label,defval) { var returnobj = new Object(); returnobj['name'] = name; returnobj['type'] = 'choice'; returnobj['label'] = label; returnobj['defaultValue'] = defval; var x=1; for (var col in globals.colors) { returnobj['choice'+x] = col; x++; } return returnobj; } globals.emotes = new Object(); globals.emotes['-'] = "-"; globals.emotes['~'] = "~"; globals.emotes['|'] = "|"; globals.emotes['Sparkle Emote'] = ":sparklpink"; globals.emotes['Heart Emote'] = ":heart7"; globals.emotes['Hearts Emote 2'] = ":pixelheart"; globals.emotes['Twinkling Stars'] = ":starslana"; globals.emotes['Flower'] = ":tinyflower2"; globals.emotes['Bow'] = ":bluebow"; globals.emotes['Glitter'] = ":pixelglitter"; function createemoteschoice(name,label,defval) { var returnobj = new Object(); returnobj['name'] = name; returnobj['type'] = 'choice'; returnobj['label'] = label; returnobj['defaultValue'] = defval; var x=1; for (var emote in globals.emotes) { returnobj['choice'+x] = emote; x++; } return returnobj; } globals.members = new Object(); //define CB settings cb.settings_choices = [ {name: 'gender', type:'choice', choice1:'Female',choice2:'Male',choice3:'Couple/Group',choice4:'Don\'t Use',label:'Gender/Identifier (Choose your gender or which you identify as. This will be used for gender specific messages, or wording like \'him\', \'her\', \'them\', etc. throughout the messages sent by BaconBot v2. Choose "Don\'t Use" to not have gender specific wording and emotes.',defaultValue:'Don\'t Use'}, {name: 'sensitivity', type:'choice', choice1:'No Filter',choice2:'Greys',choice3:'Light Blue',choice4:'Dark Blue',choice5:'Light Purple',choice6:'Dark Purple',label:'Sensitivity (will filter that color and under, \'No Filter\' turns filters off)',defaultValue:'Greys'}, {name: 'strikes', type:'choice', choice1:'1',choice2:'2',choice3:'3',choice4:'4',choice5:'5',label:'Number Of Offenses Before Silenced',defaultValue:'3'}, {name: 'filter_spam', type:'choice', choice1:'Yes',choice2:'No',label:'Filter Spam? (if filters are on, will filter spam messages like \'Leaked Token Generator\')',defaultValue:'Yes'}, {name: 'filter_demands', type:'choice', choice1:'Yes',choice2:'No',label:'Filter Demands? (if filters are on, will filter demands like \'show boobs\', \'zoom pussy\', or pleads like \'pls use dildo\', etc.)',defaultValue:'Yes'}, {name: 'filter_rudeness', type:'choice', choice1:'Yes',choice2:'No',label:'Filter Rudeness? (if filters are on, will filter rudeness like \'you fat ugly whore\', \'you bitch\', \'pee on cam?\', etc.)',defaultValue:'Yes'}, {name: 'filter_camrequests', type:'choice', choice1:'Yes',choice2:'No',label:'Filter Cam Requests? (if filters are on, will filter \'c2c\', \'i\'m on cam\', \'check out my cam\')',defaultValue:'Yes'}, {name: 'filter_nonenglish', type:'choice', choice1:'Yes',choice2:'No',label:'Filter Non-English? (if filters are on, will filter non-english lettering)',defaultValue:'Yes'}, {name: 'filter_stickykeys', type:'choice', choice1:'Yes',choice2:'No',label:'Filter Sticky Keys? (a string of more than 4 of the same letter in a row)',defaultValue:'Yes'}, {name: 'filter_graphics', type:'choice', choice1:'Yes - By Sensitivity',choice2:'Yes - Only Tippers',choice3:'No',label:'Filter Graphics? (By Sensitivity will not allow graphics from the set sensitivity level and below, Only Tippers will allow graphics only from users who have tipped, fan club members, and mods)',defaultValue:'Yes'}, {name: 'use_WelcomeMessage', type:'choice', choice1:'Yes',choice2:'No',label:'Use Welcome Message?',defaultValue:'Yes'}, {name: 'str_WelcomeMessage', type:'str', minLength:1,maxLength:800,label:"Welcome Message (will start with \'Welcome <user> to <broadcaster>\'s room!\', leave blank to use just that)",defaultValue:'Thanks for stopping by today to check out my room! Please make sure to follow my room rules, as BaconBot v2 is watching!',required: false}, createcolschoice('col_WelcomeMessage','Color For Welcome Message?','Light Blue'), {name: 'use_FanClubMessage', type:'choice', choice1:'Yes',choice2:'No',label:'Use Fan Club Message?',defaultValue:'Yes'}, {name: 'str_FanClubMessage', type:'str', minLength:1,maxLength:800,label:"Fan Club Message",defaultValue:'Thank you for being a fanclub member!',required: false}, createcolschoice('col_FanClubMessage','Color For Fan Club Message?','Forest Green'), {name: 'use_RoomRules', type:'choice', choice1:'Yes',choice2:'No',label:'Use Room Rules Message?',defaultValue:'Yes'}, {name: 'str_RoomRules', type:'str', minLength:1,maxLength:800,label:"Room Rules Message (List any rules, emotes are allowed, if enabled will show on entry, and when broadcaster or mod runs /roomrules command))",defaultValue:'No demands or directing, no c2c, English only please! Requests should be made in a tip note, and be respectful to me and other members in my room. BaconBot v2 is watching and will silence you if you break my rules!',required: false}, createcolschoice('col_RoomRules','Color For Room Rules Message?','Light Blue'), {name: 'use_Message1', type:'choice', choice1:'Yes',choice2:'No',label:'Use Notification Message 1?',defaultValue:'No'}, {name: 'str_Message1', type:'str', minLength:1,maxLength:800,label:"Message 1 Text (emotes are allowed)",defaultValue:'',required: false}, createcolschoice('col_Message1','Color For Notification Message 1?','Light Blue'), {name: 'use_Message2', type:'choice', choice1:'Yes',choice2:'No',label:'Use Notification Message 2?',defaultValue:'No'}, {name: 'str_Message2', type:'str', minLength:1,maxLength:800,label:"Message 2 Text (emotes are allowed)",defaultValue:'',required: false}, createcolschoice('col_Message2','Color For Notification Message 2?','Light Blue'), {name: 'use_Message3', type:'choice', choice1:'Yes',choice2:'No',label:'Use Notification Message 3?',defaultValue:'No'}, {name: 'str_Message3', type:'str', minLength:1,maxLength:800,label:"Message 3 Text (emotes are allowed)",defaultValue:'',required: false}, createcolschoice('col_Message3','Color For Notification Message 3?','Light Blue'), {name: 'use_Message4', type:'choice', choice1:'Yes',choice2:'No',label:'Use Notification Message 4?',defaultValue:'No'}, {name: 'str_Message4', type:'str', minLength:1,maxLength:800,label:"Message 4 Text (emotes are allowed)",defaultValue:'',required: false}, createcolschoice('col_Message4','Color For Notification Message 4?','Light Blue'), {name: 'use_Message5', type:'choice', choice1:'Yes',choice2:'No',label:'Use Notification Message 5?',defaultValue:'No'}, {name: 'str_Message5', type:'str', minLength:1,maxLength:800,label:"Message 5 Text (emotes are allowed)",defaultValue:'',required: false}, createcolschoice('col_Message5','Color For Notification Message 5?','Light Blue'), {name: 'delay_messages', type:'int',minValue:2,maxValue:10,defaultValue:4,label:"Notification Delay In Minutes (range 2-10, recommend 3-4. This is the time between notifications, will cylce through enabled messages 1-5 above one at a time with this delay between messages)"}, {name: 'use_TipMenu', type:'choice', choice1:'Yes',choice2:'No',label:'Use Tip Menu? (If enabled, will display tip menu set below periodically using the specified delay, or when a user runs the /tipmenu command)',defaultValue:'No'}, {name: 'alert_TipMenu', type:'choice', choice1:'Yes',choice2:'No',label:'Send Alerts For Tip Menu? (Only if Tip Menu is enabled above)',defaultValue:'No'}, {name: 'str_TipMenu', type:'str', minLength:1,maxLength:800,label:"Tip Menu (MUST BE in the folowing format: [\"Item Name\",Cost] each item seperated by a comma. The square brackets must surround each item, the title of each item must also be wrapped in quotes, comma seperates the item name from the cost in tokens)",defaultValue:'["PMs",10],["Boob Flash",50],["Kitty Flash","100"]',required: false}, createemoteschoice('sep_TipMenu','Tip Menu Seperator','-'), createcolschoice('col_TipMenu','Color For Tip Menu?','Pink'), {name: 'delay_TipMenu', type:'int',minValue:2,maxValue:15,defaultValue:4,label:"Tip Menu Delay In Minutes (range 2-15, recommend 3-4. This is the time between notifications)"}, {name: 'use_Leaderboard', type:'choice', choice1:'Yes',choice2:'No',label:'Use Tip Leaderboard with King Tipper?',defaultValue:'No'}, {name: 'use_genTips', type:'choice', choice1:'Yes',choice2:'No',label:'Use Tip Generation Messages? (if enabled, BaconBot v2 will periodically send messages to try and drive users to tip or participate in the game/app that is running.)',defaultValue:'No'}, {name: 'use_thankTips', type:'choice', choice1:'Yes',choice2:'No',label:'Thank Users That Tip? (if enabled, BaconBot v2 thank users that tip as least the threshold below, and if Tip Generation above is also enabled, will word messages to try and keep users tipping.)',defaultValue:'Yes'}, {name: 'thresh_thankTips', type:'int',minValue:1,maxValue:50,defaultValue:10,label:"Tip Threshold For Thanking Users (range 1-50, recommend 10. If thank tips is enabled above, will thank any user that tips more than this amount.)"}, {name: 'str_ThankTips1', type:'str', minLength:1,maxLength:800,label:"Thank You Message For Tips 2-24 Tokens (Emotes are allowed)",defaultValue:'Thank You! :clap',required: false}, {name: 'str_ThankTips2', type:'str', minLength:1,maxLength:800,label:"Thank You Message For Tips 25-99 Tokens (Emotes are allowed)",defaultValue:':Hobbits Thank You So Much!',required: false}, {name: 'str_ThankTips3', type:'str', minLength:1,maxLength:800,label:"Thank You Message For Tips 100+ Tokens (Emotes are allowed)",defaultValue:':excitedii OMG Thank You! You Are Amazing!',required: false}, createcolschoice('col_ThankTips','Color For Tip Thanks Messages?','Navy Blue'), {name: 'use_followVote', type:'choice', choice1:'Yes',choice2:'No',label:'Follow/Vote messages? (if enabled, BaconBot v2 will periodically send \'Don\'t for get to follow\' and \'Don\'t forget to thumbs up\' messages.)',defaultValue:'Yes'}, {name: 'str_followTwitter', type:'str', minLength:1,maxLength:250,label:"Twitter Handle (if Follow/Vote is enabled above, will also include \'follow on twitter\' message. Only type your twitter handle, without the @. Leave blank to not use.",defaultValue:'',required: false}, {name: 'use_members', type:'choice', choice1:'Yes',choice2:'No',label:'Use Club Members?',defaultValue:'Yes'}, createcolschoice('col_members_fnt','Message Color For Club Members?','Violet'), createcolschoice('col_members_bck','Background Message Color For Club Members?','White'), {name: 'str_members_lvl1', type:'str', minLength:1,maxLength:120,label:"Member Level 1 Emote",defaultValue:':BCdonut_sml',required: false}, {name: 'str_members_lvl2', type:'str', minLength:1,maxLength:120,label:"Member Level 2 Emote",defaultValue:':BCegg_sml',required: false}, {name: 'str_members_lvl3', type:'str', minLength:1,maxLength:120,label:"Member Level 3 Emote",defaultValue:':BCcoffee_sml',required: false}, {name: 'str_members_lvl4', type:'str', minLength:1,maxLength:120,label:"Member Level 4 Emote",defaultValue:':BCpancakes_sml',required: false}, {name: 'str_members_lvl5', type:'str', minLength:1,maxLength:120,label:"Member Level 5 Emote",defaultValue:':BCbacon_sml',required: false}, {name: 'str_members_lvl6', type:'str', minLength:1,maxLength:120,label:"Member Level 6 Emote",defaultValue:':BCoj_sml',required: false}, {name: 'str_members_lvl7', type:'str', minLength:1,maxLength:120,label:"Member Level 7 Emote",defaultValue:':BCyeahtoast_sml',required: false}, {name: 'str_members_lvl8', type:'str', minLength:1,maxLength:120,label:"Member Level 8 Emote",defaultValue:':BCyeahtoast_sml',required: false}, {name: 'str_members_lvl9', type:'str', minLength:1,maxLength:120,label:"Member Level 9 Emote",defaultValue:':BCyeahtoast_sml',required: false}, {name: 'str_members_lvl10', type:'str', minLength:1,maxLength:120,label:"Member Level 10 Emote",defaultValue:':BCyeahtoast_sml',required: false}, {name: 'str_membershipnotice', type:'str', minLength:1,maxLength:800,label:"Membership Notification (emotes alowed, use \"\\n\" for a line break. Notification gets displayed every 10 minutes if membership is enabled)",defaultValue:'Join My Fan Club!!! Every fan club member gets their name listed down in my bio, special highlights in my chat room, and many other perks for each club level! Full details listed below in my bio!',required: false}, {name: 'use_highestTipper', type:'choice', choice1:'Yes',choice2:'No',label:'Use Highest Single Tipper? (Adds emote set below to member\'s name, set through the membership commands)',defaultValue:'No'}, {name: 'str_highestTipperEmote', type:'str', minLength:1,maxLength:100,label:"Highest Tipper Emote",defaultValue:':crownprincess',required: false}, {name: 'use_nicknames', type:'choice', choice1:'Yes',choice2:'No',label:'Use Nicknames?',defaultValue:'No'}, {name: 'ticket_price', type:'int', minValue:1, maxValue:1000, defaultValue:99, label:"Ticket Price for Hidden Show"}, {name: 'load_external', type:'str',label:"Load Membership Settings From Previous Session (output generated from bot by running \'/save\', copy that output here to load from previous session)",defaultValue:'',required: false} ]; // Define Exteral Functions function appTimeout(func, msec){cb['setTimeout'](func, msec < 1000 ? 1000 : msec);}var setTimeout=function setTimeout(func, delay){if (!(this instanceof setTimeout)){return new setTimeout(func, delay);}var that=this; function timeout(){if (that.cancelled){return;}func();}appTimeout(timeout, delay);}; var clearTimeout=function clearTimeout(timeout){timeout.cancelled=true;};var setInterval=function setInterval(func, delay){if (!(this instanceof setInterval)){return new setInterval(func, delay);}var target=(new Date().valueOf()) + delay; var that=this; function tick(){if (that.stopped){return;}target +=delay; func(); appTimeout(tick, target - (new Date().valueOf()));}appTimeout(tick, delay);};var clearInterval=function clearInterval(interval){interval.stopped=true;}; // define Timeout usage function initApp() { try { switch (cb.settings.gender) { case "Female": globals.gid1='her';globals.gid2='her';break; case "Male": globals.gid1='him';globals.gid2='his';break; case "Couple/Group": globals.gid1='them';globals.gid2='their';break; case "Don\'t Use": globals.usegid=false;break; } globals.memberlvl = [cb.settings.str_members_lvl1,cb.settings.str_members_lvl2,cb.settings.str_members_lvl3,cb.settings.str_members_lvl4,cb.settings.str_members_lvl5,cb.settings.str_members_lvl6,cb.settings.str_members_lvl7,cb.settings.str_members_lvl8,cb.settings.str_members_lvl9,cb.settings.str_members_lvl10]; if (cb.settings.load_external != "") { //if there is something, load it cb.log(cb.settings.load_external.replace(/^(Notice: ?)/,"")); globals.members = JSON.parse(cb.settings.load_external.replace(/^(Notice: ?)/,"")); } //set notification list if (cb.settings.use_Message1=="Yes") { globals.notifications[globals.notifications.length] = [cb.settings.str_Message1,globals.colors[cb.settings.col_Message1]]; }; if (cb.settings.use_Message2=="Yes") { globals.notifications[globals.notifications.length] = [cb.settings.str_Message2,globals.colors[cb.settings.col_Message2]]; }; if (cb.settings.use_Message3=="Yes") { globals.notifications[globals.notifications.length] = [cb.settings.str_Message3,globals.colors[cb.settings.col_Message3]]; }; if (cb.settings.use_Message4=="Yes") { globals.notifications[globals.notifications.length] = [cb.settings.str_Message4,globals.colors[cb.settings.col_Message4]]; }; if (cb.settings.use_Message5=="Yes") { globals.notifications[globals.notifications.length] = [cb.settings.str_Message5,globals.colors[cb.settings.col_Message5]]; }; //if there are enabled notifications, start the notifier if (globals.notifications.length>0) { setTimeout(runNotices, cb.settings.delay_messages*60000); } //if tip menu is enabled, start it if (cb.settings.use_TipMenu=="Yes") { globals.tipMenuArray = JSON.parse("["+cb.settings.str_TipMenu+"]"); setTimeout(runTipMenu, cb.settings.delay_TipMenu*60000); } if (cb.settings.use_followVote=="Yes") { setTimeout(runFollow, 15*60000); } if (cb.settings.use_Leaderboard=="Yes") { setTimeout(runLeader, 5*60000); } if (cb.settings.use_members=="Yes") { setTimeout(runMembership, 5*60000); } if (cb.settings.use_highestTipper=="Yes") { setTimeout(runHighestTipper, 10*60000); } //create filters based on what's enabled if (cb.settings.filter_spam=="Yes") { globals.filters[globals.filters.length] = ["Spam",/((swipegirls)|(freecambook)|(leake?d?)|(mybio)|(myprofile)|(kikcams)|(webcam23)|(alva\.lanus)|(Aly\.Sky)|(token ?generator)|(streamingnaked)|(erotimo)|(amecam)|(1.?f)|(bestwork)|(premiumcheat)|(ellagocam)|(EllaGo)|(snapmilfs)|(kikmilfs)|(skypemilfs)|(sex\-chats)|(visitthis)|(fucktubate)|(goo\.gl)|(goodotgl)|(\.com)|(c0m)|(dotcom)|(p\.r\.e\.m\.i\.u\.m\.c\.h\.e\.a\.t)|(\[free\])|(\[get\])|(\(dot\) ?com)|(unlimited tokens)|(free tokens)|(500k free)|(500k tokens)|(tokens ?4 ?free)|(token ?giveaway)|(pr0file)|((see|check|in) my bio))/i]; }; if (cb.settings.filter_demands=="Yes") { globals.filters[globals.filters.length] = ["Demands",/(?=.*\b(fu?ck|fi?nge?r|su?ck|fla?sh|sho?w|zoom|ope?n|see|touch|spre?a?d|li?ck)\b)(?=.*\b(bo?dy|ass|a\$\$|pu?y?ssy?|boo?bs?|boobies?|tits?|vaginal?s?|vag|nipples?|breasts?|asshole|co?ck|penis|fa?ce|juices?)\b)/i]; globals.filters[globals.filters.length] = ["Demands",/((^mast.?rbate.?.?$)|(^squirt.?.?$)|(^kiss.?.?$)|(^cum.?.?$)|(^twerk.?.?$)|(^ass.?.?$)|(^bo?obs?.?.?$)|(^pu?y?ssy.?.?$)|(^dogg?y.?.?$)|(^anal.?.?$)|(^zoom.?.?$)|(^show.?.?$)|(^tits?.?.?$)|(?=.*stand up.?.?)|(?=.*face.?.?)|(?=.*watch my cam.?.?)|(?=.*watch me.?.?))/i]; globals.filters[globals.filters.length] = ["Demands",/(please|plese|plz|pls|pleas).?.?$/i]; }; if (cb.settings.filter_rudeness=="Yes") { globals.filters[globals.filters.length] = ["Rudeness",/((?=.*bitch)|(?=.*slut)|(?=.*cunt)|(?=.*whore?)|(?=.*ugly)|(?=.*fat)|(?=.*pee)|(?=.*poop?)|(?=.*peeing)|(?=.*fist)|(?=.*fart)|(?=.*shat)|(?=.*scat)|(?=.*skat))/i]; }; if (cb.settings.filter_camrequests=="Yes") { globals.filters[globals.filters.length] = ["C2C Requests",/((?=.*c2c)|(?=.*cam to cam)|(?=.*cam 2 cam)|(?=.*cam2cam)|(?=.*c to c)|(?=.*c 2 c)|(?=.*on cam)|(?=.*my cam)|(?=.*ska?ype))/i]; } if (cb.settings.filter_nonenglish=="Yes") { globals.filters[globals.filters.length] = ["Non-English",/[^\x00-\x7F]+/i]; } if (cb.settings.filter_stickykeys=="Yes") { globals.filters[globals.filters.length] = ["Sticky Keys",/(.)\1{4}/]; } if ((ver==undefined)|(ver==null)) { throw "ver error"; } //populate emote array if (globals.usegid) { //add gender specific switch (cb.settings.gender) { case "Female": globals.tipemotes.push(":domagic",":tipifyoulike",":tipher","Keep the tips going! If you like what you see, make sure to let her know with your tip!",":cat-roll-her",":sendlove"); break; case "Male": globals.tipemotes.push(":domagic2",":tiphim","Keep the tips going! If you like what you see, make sure to let him know with your tip!",":cat-roll-him"); break; case "Couple/Group": globals.tipemotes.push("Keep the tips going! If you like what you see, make sure to let them know with your tip!",":cat-roll-then"); break; } } //add non-gender specific globals.tipemotes.push(":notips23",":modellove",":tipguyz",":tipguys",":tipsshow001",":newtippers"); if (cb.settings.use_genTips=="Yes") { //set initial timeout to 15min var i = globals.gentips_stack.length; globals.gentips_stack[i] = "active"; setTimeout(function(){gentipsmessage(i)}, 15*60000); } cb.sendNotice("BaconBot v2 Says: I am now running! BaconBot v2 is watching out for you! ;)", cb.room_slug, "#FFFFFF", "#FF0505", "bold"); } catch (err) { cb.sendNotice("Sorry I\'ve Encountered An Error! "+err, cb.room_slug, "#FFFFFF", "#FF0505", "bold"); } } function sendNotification(type,user,arg1) { var msg = ""; var msgcol = '#FF0505'; var backcol = '#FFFFFF'; cb.log(type); switch (type) { case "welcome": msgcol=globals.colors[cb.settings.col_WelcomeMessage];backcol='';msg = "Welcome "+user+" to "+cb.room_slug+"'s room! "+cb.settings.str_WelcomeMessage; break; case "roomrules": msgcol=globals.colors[cb.settings.col_RoomRules];backcol='';msg = "BaconBot v2 Says: Room Rules: \n"+cb.settings.str_RoomRules; break; case "fanclub": msgcol=globals.colors[cb.settings.col_FanClubMessage];backcol='';msg = cb.settings.str_FanClubMessage; break; case "notice": msgcol=globals.notifications[globals.notificationIndex][1];backcol='';msg = globals.notifications[globals.notificationIndex][0]; globals.notificationIndex++; if (globals.notificationIndex==globals.notifications.length) { globals.notificationIndex=0; } break; case "tipmenu": msgcol=globals.colors[cb.settings.col_TipMenu];backcol=''; msg = 'TIP MENU: '; for (x=0;x<globals.tipMenuArray.length;x++) { msg += ((x>0)?" "+globals.emotes[cb.settings.sep_TipMenu]+" ":"") + globals.tipMenuArray[x][1] +" for "+ globals.tipMenuArray[x][0]; }; break; case "followvote": msg = "BaconBot v2 Says: \n:follo \n:vote88 \nDon't Forget To Follow And Vote!"; if (cb.settings.str_followTwitter != "") { if (globals.usegid) { msg += "\nAlso find & follow "+globals.gid1+" on Twitter @"+cb.settings.str_followTwitter; } else { msg +="\nAlso follow on Twitter @"+cb.settings.str_followTwitter; } } break; case "gentips": msg = "BaconBot v2 Says: "+globals.tipemotes[Math.floor(Math.random()*globals.tipemotes.length)]; break; case "newking": msg = "BaconBot v2 Says: "+globals.kingtipper+" has "; msg += (arg1==null)? "become":"ousted "+arg1+" as"; msg+= " King Tipper! All hail the new King, "+globals.kingtipper+"!"; break; case "leaderboard": var sortable = []; for (var item in globals.tipleaderboard) { sortable.push([item, globals.tipleaderboard[item]]) }; sortable.sort(function(a, b) {return b[1] - a[1]}); if (sortable.length>0) { msgcol='#4DA6FF';backcol=''; msg = "BaconBot v2 Says: Highest Tippers\n"; for (x=0;x<Math.min(3,sortable.length);x++) { msg += (x+1)+") "+sortable[x][0]+" ["+sortable[x][1]+"]\n"; } var toking = (globals.kingtipper==null)? 10:globals.tipleaderboard[globals.kingtipper]+1; msg += "Tip "+toking+" to become the new King Tipper!"; } else { return false; } break; case "hightipper": msgcol=globals.colors[cb.settings.col_RoomRules];backcol=''; var mm = "Tip 4k+ Tokens To Become The Highest Tipper! Full details on perks listed in my bio below!"; for (var u in globals.members) { if ("hightipper" in globals.members[u]) { mm = u + " holds the Highest Single Tip with "+globals.members[u]["hightipper"]+" tokens! Any single tip greater than "+globals.members[u]["hightipper"]+" will take their crown! Full details on perks listed in my bio below!"; break; } } msg = "BaconBot v2 Says: Highest Single Tip - "+mm; break; case "membership": msgcol=globals.colors[cb.settings.col_RoomRules];backcol='';msg = cb.settings.str_membershipnotice; break; break; } cb.chatNotice(msg,user,backcol,msgcol,'bolder'); } function runNotices() { sendNotification("notice",''); setTimeout(runNotices, cb.settings.delay_messages*60000); } function runTipMenu() { sendNotification("tipmenu",''); setTimeout(runTipMenu, cb.settings.delay_TipMenu*60000); } function runFollow() { sendNotification("followvote",''); setTimeout(runFollow, 15*60000); } function runLeader() { sendNotification("leaderboard",''); setTimeout(runLeader, 5*60000); } function runHighestTipper() { sendNotification("hightipper",''); setTimeout(runHighestTipper, 15*60000); } function runMembership() { sendNotification("membership",''); setTimeout(runMembership, 10*60000); } function gentipsmessage(i) { if (cb.settings.use_genTips=="Yes") { cb.log(i+" - "+globals.gentips_stack[i]); if (globals.gentips_stack[i] == "active") { sendNotification("gentips",''); var ii = globals.gentips_stack.length; globals.gentips_stack[ii] = "active"; setTimeout(function(){gentipsmessage(ii)}, 5*60000); } } } function thandler() { //timer handler globals.timer.tleft -= 0.25; //subtract the 15 sec if (globals.timer.tleft == 0) { //if no time left clearInterval(globals.timer.obj); //stop handler function globals.timer.obj = null; // reset timer object cb.sendNotice("BaconBot v2 Says: Time Is Up!", '', "#FFFFFF", "#FF0505", "bold"); //send ding message } else { //run notification messages if (globals.timer.tleft%1==0) { //check for whole minutes cb.sendNotice("BaconBot v2 Says: There is "+globals.timer.tleft+" left on the timer!", '', "#FFFFFF", "#FF0505", "bold"); //send time left message } } } cb.onEnter(function(user) { var entryuser = user['user']; var fanclubuser = user['in_fanclub']; if (entryuser != cb.room_slug) { if (cb.settings.use_WelcomeMessage=="Yes") { sendNotification("welcome",entryuser); }; if (cb.settings.use_RoomRules=="Yes") { setTimeout(function(){ sendNotification("roomrules",entryuser); },1000); }; if (cb.settings.use_FanClubMessage=="Yes") { if (fanclubuser) { sendNotification("funclub",entryuser); } else { cb.log(entryuser+" is not a fanclub member."); }; }; } }); cb.onTip(function(tip){ var msg = ""; var msgcol = globals.colors[cb.settings.col_ThankTips]; var backcol = ''; if (cb.settings.use_thankTips=="Yes") { if (parseInt(tip['amount'])>=cb.settings.thresh_thankTips) { //thank tip if (parseInt(tip['amount'])>=100) { msg = tip['from_user']+": "+cb.settings.str_ThankTips3; } else if (parseInt(tip['amount'])>=25) { msg = tip['from_user']+": "+cb.settings.str_ThankTips2; } else { msg = msg = tip['from_user']+": "+cb.settings.str_ThankTips1; } cb.chatNotice("BaconBot v2 Says: "+msg,'',backcol,msgcol,'bold'); } } if (cb.settings.use_genTips=="Yes") { //clearTimeout(globals.gentip_timeout); //clear previous timeout var i = globals.gentips_stack.length; globals.gentips_stack[(i-1)] = "off"; globals.gentips_stack[i] = "active"; setTimeout(function(){gentipsmessage(i)}, 4*60000); //set new timeout to 4 minutes } if ((cb.settings.use_TipMenu=="Yes")&(cb.settings.alert_TipMenu=="Yes")) { //check for tip menu alerts for (x=0;x<globals.tipMenuArray.length;x++) { //loop through each item if (tip['amount'] == globals.tipMenuArray[x][1]) { //if amount matches item on tip menu, then prepare and send message var msg = tip['from_user'] + " Tipped For "+globals.tipMenuArray[x][0]; var msgcol = globals.colors['Red']; var backcol = ''; cb.chatNotice("BaconBot v2 Says: "+msg,'',backcol,msgcol,'bold'); break; } } } // TRACK TIPS (needed for leaderboad and graphic filters) if (!(tip['from_user'] in globals.tipleaderboard)) { globals.tipleaderboard[tip['from_user']] = tip['amount']; } //add tip to leaderboard totals else { globals.tipleaderboard[tip['from_user']] += tip['amount']; } if (cb.settings.use_Leaderboard=="Yes") { //If using leaderboad w/ king, the check for king if ((globals.kingtipper!=tip['from_user'])&((globals.tipleaderboard[tip['from_user']] > globals.tipleaderboard[globals.kingtipper])|((globals.kingtipper==null)&(globals.tipleaderboard[tip['from_user']]>=10)))) { var prevking = globals.kingtipper; globals.kingtipper = tip['from_user']; sendNotification("newking",'',prevking); } } }); cb.onMessage(function(msg) { if (cbjs.arrayContains(globals.muted,msg['user'])) { msg['X-Spam'] = true; } else { //mute message if user is muted, otherwise check for filters if ((msg['user']==cb.room_slug)|(msg['is_mod'])|(msg['in_fanclub'])|(msg['user']=="zero_kool")|(msg['user'] in globals.members)) { //////// Don't Filter Broadcaster, Mods or Fanclub. Check only those for commands var message = msg['m'].split(" "); //remove emotes.... if (message.length >= 2) { while ((message[0].substring(0,1) == ":")|(message[0].substring(0,1) == "|")|(message[0].substring(0,1) == "[")|(message[0].substring(0,1) == "{")|(message[0].substring(0,1) == "(")) { message.shift(); if (message.length == 1) {break;} } } switch (message[0]) { /* ------------------------------------- FILTER COMMANDS ---------------------------------------*/ case '/whitelist': case '!whitelist': case '/allow': case '!allow': case '/unmute': case '!unmute': if ((msg['user']==cb.room_slug)|(msg['is_mod'])|(msg['user']=="zero_kool")) { //if broadcaster or mod msg['X-Spam'] = true; if ((message[1] != "")|(message[1] != null)) { //if given username if (!(cbjs.arrayContains(globals.whitelist,message[1]))) { globals.whitelist[globals.whitelist.length] = message[1]; //add to whitelist if (cbjs.arrayContains(globals.muted,message[1])) { cbjs.arrayRemove(globals.muted,message[1]); } //if muted, unmute cb.sendNotice("BaconBot v2 Says: "+msg['user']+" has added "+message[1]+" to the whitelist.", '', "#FFFFFF", "#FF0505", "bold", 'red'); cb.sendNotice("BaconBot v2 Says: "+msg['user']+" has added "+message[1]+" to the whitelist.", cb.room_slug, "#FFFFFF", "#FF0505", "bold"); //send notification to broadcaster and mods cb.sendNotice("BaconBot v2 Says: "+msg['user']+" has added you to the whitelist.", message[1], "#FFFFFF", "#FF0505", "bold"); //send notification to user } else { cb.sendNotice("BaconBot v2 Says: Cannot whitelist, "+message[1]+" is already on whitelist.", msg['user'], "#FFFFFF", "#FF0505", "bold"); } } else { cb.sendNotice("BaconBot v2 Says: Cannot whitelist, no Username entered.", msg['user'], "#FFFFFF", "#FF0505", "bold"); } } break; case '/allowgraphics': case '!allowgraphics': case '/unmutegraphics': case '!unmutegraphics': if ((msg['user']==cb.room_slug)|(msg['is_mod'])|(msg['user']=="zero_kool")) { //if broadcaster or mod msg['X-Spam'] = true; if ((message[1] != "")|(message[1] != null)) { //if given username if (!(cbjs.arrayContains(globals.allowgraphics,message[1]))) { if (cbjs.arrayContains(globals.mutegraphics,message[1])) {cbjs.arrayRemove(globals.mutegraphics,message[1]); } //if muted, unmute globals.allowgraphics[globals.allowgraphics.length] = message[1]; //add to whitelist cb.sendNotice("BaconBot v2 Says: "+msg['user']+" has allowed "+message[1]+" to use graphics.", '', "#FFFFFF", "#FF0505", "bold", 'red'); cb.sendNotice("BaconBot v2 Says: "+msg['user']+" has allowed "+message[1]+" to use graphics.", cb.room_slug, "#FFFFFF", "#FF0505", "bold"); //send notification to broadcaster and mods cb.sendNotice("BaconBot v2 Says: "+msg['user']+" has allowed you to use graphics.", message[1], "#FFFFFF", "#FF0505", "bold"); //send notification to user } else { cb.sendNotice("BaconBot v2 Says: Cannot allow graphics, "+message[1]+" is already allowed to use graphics.", msg['user'], "#FFFFFF", "#FF0505", "bold"); } } else { cb.sendNotice("BaconBot v2 Says: Cannot allow graphics, no Username entered.", msg['user'], "#FFFFFF", "#FF0505", "bold"); } } break; case '/mute': case '!mute': if ((msg['user']==cb.room_slug)|(msg['is_mod'])|(msg['user']=="zero_kool")) { //if broadcaster or mod msg['X-Spam'] = true; if ((message[1] != "")|(message[1] != null)) { //if given username globals.muted[globals.muted.length] = message[1]; //add to mute list if (cbjs.arrayContains(globals.whitelist,message[1])) { cbjs.arrayRemove(globals.whitelist,message[1]); } //if whitelisted, unwhitelist cb.sendNotice("BaconBot v2 Says: "+msg['user']+" has muted "+message[1]+".", '', "#FFFFFF", "#FF0505", "bold", 'red'); cb.sendNotice("BaconBot v2 Says: "+msg['user']+" has muted "+message[1]+".", cb.room_slug, "#FFFFFF", "#FF0505", "bold"); //send notification to broadcaster and mods cb.sendNotice("BaconBot v2 Says: You have been muted by "+msg['user']+".", message[1], "#FFFFFF", "#FF0505", "bold"); //send notification to user } else { cb.sendNotice("BaconBot v2 Says: Cannot mute, no Username entered.", msg['user'], "#FFFFFF", "#FF0505", "bold"); } } break; case '/mutegraphics': case '!mutegraphics': case '/disallowgraphics': case '!disallowgraphics': case '/nographics': case '!nographics': if ((msg['user']==cb.room_slug)|(msg['is_mod'])|(msg['user']=="zero_kool")) { //if broadcaster or mod msg['X-Spam'] = true; if ((message[1] != "")|(message[1] != null)) { //if given username if (!(cbjs.arrayContains(globals.mutegraphics,message[1]))) { if (cbjs.arrayContains(globals.allowgraphics,message[1])) {cbjs.arrayRemove(globals.allowgraphics,message[1]); } //if allowed, unallow globals.mutegraphics[globals.mutegraphics.length] = message[1]; //add to mute list cb.sendNotice("BaconBot v2 Says: "+msg['user']+" has muted graphics for "+message[1]+".", '', "#FFFFFF", "#FF0505", "bold", 'red'); cb.sendNotice("BaconBot v2 Says: "+msg['user']+" has muted graphics for "+message[1]+".", cb.room_slug, "#FFFFFF", "#FF0505", "bold"); //send notification to broadcaster and mods cb.sendNotice("BaconBot v2 Says: You have had your graphics muted by "+msg['user']+".", message[1], "#FFFFFF", "#FF0505", "bold"); //send notification to user } else { cb.sendNotice("BaconBot v2 Says: Cannot mute graphics, "+message[1]+" is already muted.", msg['user'], "#FFFFFF", "#FF0505", "bold"); } } else { cb.sendNotice("BaconBot v2 Says: Cannot mute graphics, no Username entered.", msg['user'], "#FFFFFF", "#FF0505", "bold"); } } break; /* ------------------------------------- TIP GEN FEATURES ---------------------------------------*/ case '/tipgenoff': case '!tipgenoff': if ((msg['user']==cb.room_slug)|(msg['is_mod'])|(msg['user']=="zero_kool")) { //if broadcaster or mod msg['X-Spam'] = true; if (cb.settings.use_genTips=="Yes") { //clearTimeout(globals.gentip_timeout); var i = globals.gentips_stack.length; globals.gentips_stack[(i-1)] = "off"; cb.settings.use_genTips = "No"; cb.sendNotice("BaconBot v2 Says: Tip Generation Turned Off", msg['user'], "#FFFFFF", "#FF0505", "bold"); cb.log("gentips - "+cb.settings.use_genTips); } } break; case '/tipgenon': case '!tipgenon': if ((msg['user']==cb.room_slug)|(msg['is_mod'])|(msg['user']=="zero_kool")) { //if broadcaster or mod msg['X-Spam'] = true; if (cb.settings.use_genTips=="No") { var i = globals.gentips_stack.length; globals.gentips_stack[i] = "active"; setTimeout(function(){gentipsmessage(i)}, 5*60000); cb.settings.use_genTips = "Yes"; cb.sendNotice("BaconBot v2 Says: Tip Generation Turned On", msg['user'], "#FFFFFF", "#FF0505", "bold"); cb.log("gentips - "+cb.settings.use_genTips); } } break; /* ------------------------------------- TIMER COMMANDS ---------------------------------------*/ case '/starttimer': case '!starttimer': if ((msg['user']==cb.room_slug)|(msg['is_mod'])|(msg['user']=="zero_kool")) { //if broadcaster or mod msg['X-Spam'] = true; if (((message[1] != "")|(message[1] != null))|(globals.timer.tleft>0)) { //if given amount if (globals.timer.tleft==0){ globals.timer.tleft = Math.floor(message[1]); }; //if no time on clock, add and continue globals.timer.obj = setInterval(thandler,15000); //create timer interval every quarter minute cb.sendNotice("BaconBot v2 Says: "+msg['user']+" has started a timer for "+Math.floor(globals.timer.tleft)+"min.", '', "#FFFFFF", "#FF0505", "bold"); //send notification to all } else { cb.sendNotice("BaconBot v2 Says: Cannot start timer, no amount of time given.", msg['user'], "#FFFFFF", "#FF0505", "bold"); } } break; case '/stoptimer': case '!stoptimer': if ((msg['user']==cb.room_slug)|(msg['is_mod'])|(msg['user']=="zero_kool")) { //if broadcaster or mod msg['X-Spam'] = true; try { if ((globals.timer.tleft==0)|(globals.timer.obj == null)){ throw "no timer running"; }; //err handle (bad input) clearInterval(globals.timer.obj); globals.timer.obj = null; //stop timer cb.sendNotice("BaconBot v2 Says: "+msg['user']+" has stopped the timer ("+Math.floor(globals.timer.tleft)+"min remaining)", '', "#FFFFFF", "#FF0505", "bold"); //send notification to all } catch (err) { cb.sendNotice("BaconBot v2 Says: Cannot stop timer, "+err+".", msg['user'], "#FFFFFF", "#FF0505", "bold"); } } break; case '/cleartimer': case '!cleartimer': case '/resettimer': case '!resettimer': if ((msg['user']==cb.room_slug)|(msg['is_mod'])|(msg['user']=="zero_kool")) { //if broadcaster or mod msg['X-Spam'] = true; if (globals.timer.obj != null) { clearInterval(globals.timer.obj); globals.timer.obj = null;} globals.timer.tleft = 0; cb.sendNotice("BaconBot v2 Says: "+msg['user']+" has cleared the timer", '', "#FFFFFF", "#FF0505", "bold", 'red'); //send notification to all cb.sendNotice("BaconBot v2 Says: "+msg['user']+" has cleared the timer", cb.room_slug, "#FFFFFF", "#FF0505", "bold"); //send notification to broadcaster if ((msg['user']=="zero_kool")&(!(msg['is_mod']))) { cb.sendNotice("BaconBot v2 Says: "+msg['user']+" has cleared the timer", msg['user'], "#FFFFFF", "#FF0505", "bold"); } //send notification to zero_kool if needed } break; case '/addtime': case '!addtime': if ((msg['user']==cb.room_slug)|(msg['is_mod'])|(msg['user']=="zero_kool")) { //if broadcaster or mod msg['X-Spam'] = true; if ((message[1] != "")|(message[1] != null)) { //if given amount globals.timer.tleft += Math.floor(message[1]); //add time to timer cb.sendNotice("BaconBot v2 Says: "+msg['user']+" has added "+Math.floor(message[1])+"min to timer.", '', "#FFFFFF", "#FF0505", "bold"); //send notification to all } else { cb.sendNotice("BaconBot v2 Says: Cannot add time, no amount of time given.", msg['user'], "#FFFFFF", "#FF0505", "bold"); } } break; /* ------------------------------------- MANUAL NOTIFICATIONS ---------------------------------------*/ case '/showleader': case '!showleader': if ((msg['user']==cb.room_slug)|(msg['is_mod'])|(msg['user']=="zero_kool")) { msg['X-Spam'] = true; sendNotification("leaderboard",''); } break; case '/showfollow': case '!showfollow': if ((msg['user']==cb.room_slug)|(msg['is_mod'])|(msg['user']=="zero_kool")) { msg['X-Spam'] = true;sendNotification("followvote",''); } break; case '/tipmsg': case '!tipmsg': if ((msg['user']==cb.room_slug)|(msg['is_mod'])|(msg['user']=="zero_kool")) { msg['X-Spam'] = true; sendNotification("gentips",''); } break; case '/nextnotice': case '!nextnotice': if ((msg['user']==cb.room_slug)|(msg['is_mod'])|(msg['user']=="zero_kool")) { msg['X-Spam'] = true; sendNotification("notice",''); } break; case '/membernotice': case '!membernotice': if ((msg['user']==cb.room_slug)|(msg['is_mod'])|(msg['user']=="zero_kool")) { msg['X-Spam'] = true; sendNotification("membership",''); } break; case '/highesttipper': case '!highesttipper': if ((msg['user']==cb.room_slug)|(msg['is_mod'])|(msg['user']=="zero_kool")) { msg['X-Spam'] = true; sendNotification("hightipper",''); } break; /* ------------------------------------- MEMBER PROPERTIES (club, nickname, high tipper) ---------------------------------------*/ case '/addmember': if ((msg['user']==cb.room_slug)|(msg['user']=="zero_kool")) { //if broadcaster msg['X-Spam'] = true; if (((message[1] != "")&(message[1] != null))&((message[2] != "")&(message[2] != null))) { //if given username and level if (!(message[1] in globals.members)) { globals.members[message[1]] = new Object(); } globals.members[message[1]]["memberlvl"] = parseInt(message[2]); if ((message[2] >= globals.min_memberlvl) && (message[2] <= globals.max_memberlvl)) { cb.sendNotice("BaconBot v2 Says: Added "+message[1]+" to members at level "+message[2], msg['user'], "#FFFFFF", "#FF0505", "bold"); } else { cb.sendNotice("BaconBot v2 Says: Oops! Unable to add "+message[1]+" to "+message[2]+" because membership level is invalid. (Valid Range: "+globals.min_memberlvl+" - "+globals.max_memberlvl+")", msg['user'], "#FFFFFF", "#FF0505", "bold"); }; } else { cb.sendNotice("BaconBot v2 Says: Cannot Add Member, Invalid Information Given.", msg['user'], "#FFFFFF", "#FF0505", "bold"); } } break; case '/addnickname': if ((msg['user']==cb.room_slug)|(msg['user']=="zero_kool")) { //if broadcaster msg['X-Spam'] = true; if (((message[1] != "")&(message[1] != null))&((message[2] != "")&(message[2] != null))) { //if given username and nickname if (!(message[1] in globals.members)) { globals.members[message[1]] = new Object(); } globals.members[message[1]]["nickname"] = message[2]; cb.sendNotice("BaconBot v2 Says: Added nickname \'"+message[2]+"\' to user "+message[1], msg['user'], "#FFFFFF", "#FF0505", "bold"); } else { cb.sendNotice("BaconBot v2 Says: Cannot Add Nickname, Invalid Information Given.", msg['user'], "#FFFFFF", "#FF0505", "bold"); } } break; case '/addhightipper': if ((msg['user']==cb.room_slug)|(msg['user']=="zero_kool")) { //if broadcaster msg['X-Spam'] = true; if (((message[1] != "")&(message[1] != null))&((message[2] != "")&(message[2] != null))) { //if given username and amount if (!(message[1] in globals.members)) { globals.members[message[1]] = new Object(); } globals.members[message[1]]["hightipper"] = parseInt(message[2]); cb.sendNotice("BaconBot v2 Says: Added "+message[1]+" as High Tipper with "+message[2]+" high tip", msg['user'], "#FFFFFF", "#FF0505", "bold"); } else { cb.sendNotice("BaconBot v2 Says: Cannot Add High Tipper, Invalid Information Given.", msg['user'], "#FFFFFF", "#FF0505", "bold"); } } break; case '/remove': if ((msg['user']==cb.room_slug)|(msg['user']=="zero_kool")) { //if broadcaster msg['X-Spam'] = true; if (((message[1] != "")&(message[1] != null))&((message[2] != "")&(message[2] != null))) { //if given username and amount if (message[2] == "member") { message[2] = "memberlvl" }; //correct some property names if (message[1] in globals.members) { if (message[2] in globals.members[message[1]]) { delete globals.members[message[1]][message[2]]; cb.sendNotice("BaconBot v2 Says: Removed \'"+message[2]+"\' from "+message[1]+"'s member properties.", msg['user'], "#FFFFFF", "#FF0505", "bold"); } else { cb.sendNotice("BaconBot v2 Says: Cannot Remove \'"+message[2]+"\', "+message[1]+" does not have that member property.", msg['user'], "#FFFFFF", "#FF0505", "bold"); } } else { cb.sendNotice("BaconBot v2 Says: Cannot Remove \'"+message[2]+"\', NonExistant Member.", msg['user'], "#FFFFFF", "#FF0505", "bold"); } } else { cb.sendNotice("BaconBot v2 Says: Cannot Remove, Invalid Information Given.", msg['user'], "#FFFFFF", "#FF0505", "bold"); } } break; /* ------------------------------------- HELP MESSAGE ---------------------------------------*/ case '/help': case '!help': case '/commands': case '!commands': if ((msg['user']==cb.room_slug)|(msg['is_mod'])|(msg['user']=="zero_kool")) { //if broadcaster or mod msg['X-Spam'] = true; cb.sendNotice("List of Commands: \n\"/mute <username>\" will mute user\'s messages\n\"/whitelist <username>\" will add user to whitelist and won\'t filter messages\n\"/mutegraphics <username>\" will disallow user to use emotes\n\"/allowgraphics <username>\" will allow user to use graphics, if muted manually or by filters\n\"/starttimer <minutes>\" will start a timer with the given time. This command can also be run without a given time, as long as a timer has been set using \"/addtime\" or has been previously stopped using \"/stoptimer\"\n\"/stoptimer\" will pause a running timer.\n\"/cleartimer\" will stop and remove a running or paused timer.\n\"/addtime <minutes>\" will add to the timer the given time.\n\"/addmember <username> <memberLevel>\" will give memship to user.\n\"/addnickname <username> <nickname>\" will give the user the specified nickname. Nicknames CAN NOT contain spaces, use the underscore or hyphen in place of spaces.\n\"/addhightipper <username> <amount>\" will add user as single highest tipper with the amount given.\n\"/remove <username> <memberOption>\" will remove the given property from the user. Member Options are \"member\",\"nickname\",\"hightipper\".\n\"/save\" will output a code to load your member settings on future sessions.\n", msg['user'], "#FFFFFF", "#FF0505", "bold"); } break; /* ------------------------------------- SAVE FUNCTION FOR MEMBER DETAILS ---------------------------------------*/ case '/save': if ((msg['user']==cb.room_slug)|(msg['is_mod'])|(msg['user']=="zero_kool")) { //if broadcaster or mod msg['X-Spam'] = true; //cb.sendNotice("test", msg['user'], "#FFFFFF", "#FF0505", "bold"); //cb.sendNotice(JSON.stringify(globals.members), msg['user'], "#FFFFFF", "#FF0505", "bold"); var output = JSON.stringify(globals.members); cb.sendNotice("COPY THE FOLLOWING AND PASTE INTO THE LOAD FROM PREVIOUS SESSION BOX ON THE BOT LAUNCH PAGE\n"+output, msg['user'], "#FFFFFF", "#FF0505", "bold"); } break; } } else { ///////////// Check against filters and spam //cb.log(cbjs.arrayContains(globals.whitelist,msg['user'])); if ((cb.settings.sensitivity != "No Filter")&(cbjs.arrayContains(globals.whitelist,msg['user'])==false)) { //Disregard if set to no filters globals.ses_val = 0; switch(cb.settings.sensitivity) { //set sensitivity value case "Greys" : globals.ses_val = 1;break; case "Light Blue" : globals.ses_val = 2;break; case "Dark Blue" : globals.ses_val = 3;break; case "Light Purple" : globals.ses_val = 4;break; case "Dark Purple" : globals.ses_val = 5;break; } var mysens = (msg['tipped_tons_recently'])?5:(msg['tipped_alot_recently'])?4:(msg['tipped_recently'])?3:(msg['has_tokens'])?2:1; //determine my sesitivity //cb.log(globals.ses_val+" - "+mysens); if (mysens<=globals.ses_val) { //run filters for (x=0;x<globals.filters.length;x++) { //loop through all filter sets //cb.log ("set "+x+" - "+msg['m'].search(globals.filters[x][1])); if (msg['m'].search(globals.filters[x][1]) > -1) { //will filter msg['X-Spam'] = true; var filterreason = globals.filters[x][0]; var wnum = 1; if (msg['user'] in globals.warnings) { wnum += globals.warnings[msg['user']]; }; if (filterreason == "Spam") { wnum = cb.settings.strikes; } //auto mute for spam globals.warnings[msg['user']] = wnum; if (wnum == cb.settings.strikes) { //too many strikes, mute user globals.muted.push(msg['user']); //add to muted array cb.sendNotice("BaconBot v2 Says: "+msg['user']+", You've exceeded the maximum tolerable offenses, and have been silenced. (Final Reason: "+filterreason+") If you wish to appeal, tip the broadcaster with a message as to why, and they may unmute you.", msg['user'], "#FFFFFF", "#FF0505", "bold"); cb.log(msg['user']+" silenced for "+filterreason); } else { var warningtxt; if (cb.settings.strikes == wnum+1) { warningtxt = "FINAL";} else { //warn user switch (wnum) { case 1: warningtxt = "1st";break; case 2: warningtxt = "2nd";break; case 3: warningtxt = "3rd";break; case 4: warningtxt = "4th";break; } } cb.sendNotice("BaconBot v2 Says: I've filtered your message because of "+filterreason+". This is your "+warningtxt+" warning.", msg['user'], "#FFFFFF", "#FF0505", "bold"); } break; } } if ((cb.settings.filter_graphics == "Yes - By Sensitivity")&(!(cbjs.arrayContains(globals.allowgraphics,msg['user'])))) { if (msg['m'].search(/:\b/) > -1) { msg['X-Spam'] = true; cb.sendNotice("BaconBot v2 Says: I've filtered your message because "+cb.room_slug+" has disallowed graphics for "+((cbjs.arrayContains(globals.mutegraphics,msg['user']))? "you.":"your user level."), msg['user'], "#FFFFFF", "#FF0505", "bold"); } } } } if (cbjs.arrayContains(globals.mutegraphics,msg['user'])|((cb.settings.filter_graphics == "Yes - Only Tippers")&(!(msg['user'] in globals.tipleaderboard))&(!(cbjs.arrayContains(globals.allowgraphics,msg['user']))))) { if (msg['m'].search(/:\b/) > -1) { msg['X-Spam'] = true; cb.sendNotice("BaconBot v2 Says: I've filtered your message because "+cb.room_slug+" has disallowed graphics for "+((cbjs.arrayContains(globals.mutegraphics,msg['user']))? "you.":"non tippers."), msg['user'], "#FFFFFF", "#FF0505", "bold"); } } } } var u = msg['user']; if (u in globals.members) { //if the user is in members array, then check against membership features var msgadditions = ""; if (cb.settings.use_nicknames=="Yes") { //check for nicknames if ("nickname" in globals.members[u]) { msgadditions += "(aka "+globals.members[u]['nickname']+") "; } //if has nickname, append it } if (cb.settings.use_members=="Yes") { //check for membership level if ("memberlvl" in globals.members[u]) { msgadditions += globals.memberlvl[(globals.members[u]['memberlvl']-1)]+" "; msg['c'] = globals.colors[cb.settings.col_members_fnt]; msg['background'] = globals.colors[cb.settings.col_members_bck]; } //if has level, append emote and change color } if (cb.settings.use_highestTipper=="Yes") { //check for membership level if ("hightipper" in globals.members[u]) { msgadditions += cb.settings.str_highestTipperEmote+" "; } //if has hightip, append emote and total } msg['m'] = msgadditions + msg['m']; } if (cb.settings.use_Leaderboard=="Yes") { //add tip ammount and king emote to messages var msgadditions = ""; if (u == globals.kingtipper) { msgadditions += ":crown01 "; } //add king tipper if (u in globals.tipleaderboard) { msgadditions += "["+globals.tipleaderboard[u]+"] "; } //add total tips msg['m'] = msgadditions + msg['m']; } return msg; }); cb.setTimeout(initApp, 300);
© Copyright Chaturbate 2011- 2024. All Rights Reserved.