Bots Home
|
Create an App
luissenbot1
Author:
luissendev1
Description
Source Code
Launch Bot
Current Users
Created by:
Luissendev1
/******************************************************* * Title: JSModBot * * * Author: 'CrystalSopen' * * Based on a Jazbot by: 'Crazyware' * Based on a script by: 'badbadbubba' *******************************************************/ var app = { name: "'JSModBot'", type: 'Bot', version: '1.8', build: '.007', date: '2016.09.13' }; jsAdded = new Array(); regexStore = new Array(); userWarnCounts = new Array(); var COLOR = { SYNTAX: '#995B00', RED: '#FF1407', AMBER: '#E56B00', MOD: '#DC0000', HVTEXT: '#D80A00', HVBACK: '#FFFFBF', NOTICE: '#6900CC', INFO: '#144D8C' // MAG : '#E509E5' }; var COMMAND = { JSADD: 'jsadd', /* add a string to block */ JSB: 'jsb', /* Notice broadcaster */ JSM: 'jsm', /* Notice mods as group */ JSV: 'jsv', /* Notice to viewer */ JSN: 'jsn', /* Notice to chat */ MON: 'mon' /* Enables monitoring for each mod */ }; var commandPrefix = '/'; var dashLine = "------------------------------------------------------------"; var ONLY_MODERATORS = "* Command is only available to moderators."; var roomHost = cb.room_slug; var monList = []; cb.settings.warnmsg = 'no'; // var monitorFlag = false; cb.settings_choices = [{ name: 'warnings', type: 'choice', choice1: 1, choice2: 0, choice3: 2, choice4: -1, defaultValue: -1, label: "How many warnings to give to using before silencing 0=autosilence, -1 never silence" }, { name: 'mutedemands', type: 'choice', choice1: 'yes', choice2: 'no', defaultValue: 'yes', label: "Mute grey demands (open/show/zoom/etc & boobs/tits/ass/pussy/etc)?" }, { name: 'mutegreygraphics', type: 'choice', choice1: 'yes', choice2: 'no', defaultValue: 'yes', label: "Mute grey graphics?" }, { name: 'mutestickykeys', type: 'choice', choice1: 'yes', choice2: 'no', defaultValue: 'yes', label: "Mute grey sticky keys (4+ repeating characters eg. mmmm)?" }, { name: 'muteallcaps', type: 'choice', choice1: 'yes', choice2: 'no', defaultValue: 'yes', label: "Mute grey all caps?" }, { name: 'mutedemandwords', type: 'choice', choice1: 'yes', choice2: 'no', defaultValue: 'yes', label: "Mute grey demand words (pm,c2c,private,pvt,prvt)?" }, { name: 'mutevulgarwords', type: 'choice', choice1: 'yes', choice2: 'no', defaultValue: 'yes', label: "Mute grey vulgar words (bitch,slut,whore,finger,fuck,etc)?" }, { name: 'muterudewords', type: 'choice', choice1: 'yes', choice2: 'no', defaultValue: 'yes', label: "Mute grey rude words (bitch,slut,whore,ugly,fat,pee,poo,peeing,fist,etc)?" }, { name: 'mutebabywords', type: 'choice', choice1: 'yes', choice2: 'no', defaultValue: 'yes', label: "Mute grey 'baby', 'bby', babe, etc?" }, { name: 'mutefeetwords', type: 'choice', choice1: 'yes', choice2: 'no', defaultValue: 'yes', label: "Mute grey feet talk (feet,foot,soles,toes)?" }, { name: 'mutenonenglish', type: 'choice', choice1: 'yes', choice2: 'no', defaultValue: 'yes', label: "Mute grey non-english characters (cyrillic,arabic,chinese,accented)?" }, { name: 'mutespamwords', type: 'choice', choice1: 'yes', choice2: 'no', defaultValue: 'yes', label: "Mute advertising spam (streamingnaked,18f cam,18female,erotimo,etc)?" }, { name: 'UserSpamPattern1', type: 'str', required: false, default: " ", minLength: 1, maxLength: 255, label: "JS regex or plain text. ie: '(tap)|(click).*for' or 'free.*tkns'" }, { name: 'UserSpamPattern2', type: 'str', required: false, default: " ", minLength: 1, maxLength: 255, label: "JS regex or plain text. ie: '(tap)|(click).*for' or 'free.*tkns'" }, { name: 'UserSpamPattern3', type: 'str', required: false, default: " ", minLength: 1, maxLength: 255, label: "JS regex or plain text. ie: '(tap)|(click).*for' or 'free.*tkns'" }, { name: 'UserSpamPattern4', type: 'str', required: false, default: " ", minLength: 1, maxLength: 255, label: "JS regex or plain text. ie: '(tap)|(click).*for' or 'free.*tkns'" }, { name: 'UserSpamPattern5', type: 'str', required: false, default: " ", minLength: 1, maxLength: 255, label: "JS regex or plain text. ie: '(tap)|(click).*for' or 'free.*tkns'" }, { name: 'UserSpamPattern6', type: 'str', required: false, default: " ", minLength: 1, maxLength: 255, label: "JS regex or plain text. ie: '(tap)|(click).*for' or 'free.*tkns'" }, { name: 'UserSpamPattern7', type: 'str', required: false, default: " ", minLength: 1, maxLength: 255, label: "JS regex or plain text. ie: '(tap)|(click).*for' or 'free.*tkns'" }]; function checkmsg(msg) { var u = msg['user']; var tmpmsg = msg['m']; var reRude = /(?=.*\b(rape|eat|get|play|touch|suck|rub|eat|lick|spread|smell)\b)(?=.*\b(asshole|pussy|cunt|bobs?|tits?|toes?|armpits?|vagina|out|me|dog)\b)/i; var reVulgar = /body|ass|nipples?|breasts?|bust|naked|nude|(fuck)|(?=.*whore)|clit|cock|boobs?|fuck|hard|slut/i; var reDemands3 = /\b(pm|c2c|private|pv|pvt|prvt|cam2cam)\b/i; var reRude2 = /bitch|cunt|ugly|pee|piss|poo[\Wp]|pee|fist|fag|sissy/i; var reDemands2 = /((?=.*ass)|(?=.*pussy)|(?=.*boobs?)|(?=.*bobs?)|(?=.*tits?)|(?=.*vagina)|(?=.*cunt)|(?=.*cock)|(?=.*nipples?)|(?=.*breasts?)|(?=.*anal))((?=.*plz)|(?=.*pls)|(?=.*please))/i; var reDemands = /((^ass.?.?$)|(^boobs?.?.?$)|(^pussy.?.?$)|(^doggy.?.?$)|(^anal.?.?$)|(^zoom.?.?$)|(^show.?.?$)|(^tits?.?.?$)|(?=.*stand up.?.?)|(?=.*watch my cam.?.?)|zoom|flash|open|see|show)/i; var mutemsg = false; var temp; cb.log("checking in user has beed muted"); if ((cb.settings['warnings'] != -1) && ((userWarnCounts[u] != undefined) && (userWarnCounts[u] > cb.settings['warnings']))) { mutemsg = true; cb.log(u + ": Has been silenced by JSModBot, but still sending messages!") } //if ((!msg['has_tokens']) && (!msg['is_mod']) && (!msg['in_fanclub']) && (msg['user'] != cb['room_slug'])) { if (true) { cb.log("checking demands2"); if ((mutemsg != true) && (cb.settings['mutedemands'] == 'yes' && reDemands2.test(tmpmsg))) { mutemsg = true; cb.sendNotice(u + ':Muted message for demands', '', '', COLOR.RED, 'bold'); temp = 1; } cb.log("checking vulgar"); if ((mutemsg != true) && (cb.settings['mutevulgarwords'] == 'yes') && reVulgar.test(tmpmsg)) { mutemsg = true; temp = 2; cb.sendNotice(u + ':Muted message for vulgar', '', '', COLOR.RED, 'bold'); } cb.log("checking demands"); if ((mutemsg != true) && (cb.settings['mutedemands'] == 'yes') && reDemands.test(tmpmsg)) { mutemsg = true; temp = 2; cb.sendNotice(u + ':Muted message for demands2', '', '', COLOR.RED, 'bold'); } cb.log("checking demands words"); if ((mutemsg != true) && (cb.settings['mutedemandwords'] == 'yes') && reDemands3.test(tmpmsg)) { mutemsg = true; temp = 3; cb.sendNotice(u + ':Muted message for demands5', '', '', COLOR.RED, 'bold'); } cb.log("checking spam"); if ((mutemsg != true) && ((cb.settings['mutespamwords'] == 'yes') && (tmpmsg.search(/((swipegirls)|(link.*(bio|profile))|(tap)|((click)|(open) my)|(token.*hack)|(token.*gen)|(free.*registration)|(free.*tokens)|(pornmeds)|(?=.*18f cam)|(?=.*streamingnaked)|(?=.*premiumcheat)|(?=.*amecam)|(?=.*18female)|(?=.*erotimo)|(?=.*freesecurecams)|(?=.*ellagocam))/i) != -1))) { mutemsg = true; temp = 4; cb.sendNotice(u + ':Muted message for spam', '', '', COLOR.RED, 'bold'); } cb.log("checking added phrases"); for (var phrase = 0; phrase < jsAdded.length; phrase++) { reUSP = jsAdded[phrase]; if ((mutemsg != true) && (reUSP.test(tmpmsg))) { cb.log("muting by phrase"); mutemsg = true; temp = 4; cb.sendNotice(u + ':Muted message for jsadd phrase', '', '', COLOR.RED, 'bold'); } } cb.log("checking user predefined spam"); for (patternNumber = 1; patternNumber < 8; patternNumber++) { preregx = cb.settings['UserSpamPattern' + patternNumber].replace(/\s+$/, '') if ((preregx.length) > 0 && (cb.settings['mutespamwords'] == 'yes') && (mutemsg == false)) { if (regexStore[patternNumber] == undefined) { try { var reUSP = new RegExp(preregx, "i"); regexStore[patternNumber] = reUSP } catch (err) { regexStore[patternNumber] = false cb.log("invalid user spam pattern" + err.message) } } else { reUSP = regexStore[patternNumber] } if (reUSP != false) { if (tmpmsg.search(reUSP) != -1) { mutemsg = true; temp = 4; cb.sendNotice(u + ':Muted message for user spam pattern:' + preregx + ":" + patternNumber, '', '', COLOR.NOTICE, 'bold'); cb.log("msg:" + tmpmsg) } } } } cb.log("checking rude" + reRude.test(tmpmsg).toString() + reRude2.test(tmpmsg).toString()); if ((mutemsg != true) && (cb.settings['muterudewords'] == 'yes') && (reRude.test(tmpmsg) || reRude2.test(tmpmsg))) { mutemsg = true; temp = 5; cb.sendNotice(u + ':Muted message for rude words', '', '', COLOR.RED, 'bold'); } cb.log("checking bb"); if ((mutemsg != true) && ((cb.settings['mutebabywords'] == 'yes') && (tmpmsg.search(/\b(bb|bby|babe|baby|bae|daddy|daughter)\b/i) != -1))) { mutemsg = true; temp = 6; cb.sendNotice(u + ':Muted message for bb', '', '', COLOR.RED, 'bold'); } cb.log("checking feet"); if ((mutemsg != true) && ((cb.settings['mutefeetwords'] == 'yes') && (tmpmsg.search(/\b(ft|feet|foot|soles|toes)\b/i) != -1))) { mutemsg = true; temp = 7; cb.sendNotice(u + ':Muted message for feet', '', '', COLOR.RED, 'bold'); } cb.log("checking cat moisture"); if ((mutemsg != true) && (/my pussy is so.*wet/i.test(tmpmsg))) mutemsg = true; cb.log("checking grey graphics"); if ((mutemsg != true) && ((cb.settings['mutegreygraphics'] == 'yes') && (tmpmsg.search(/:\b\w{2}/) != -1))) { mutemsg = true; temp = 8; cb.sendNotice(u + ':Muted message for graphics', '', '', COLOR.RED, 'bold'); } cb.log("checking sticky keys"); if ((mutemsg != true) && ((cb.settings['mutestickykeys'] == 'yes') && (tmpmsg.search(/(([:]*)[^\s]*([^\s])\3{8,})/ig) != -1))) { mutemsg = true; temp = 9; cb.sendNotice(u + ':Muted message for stickykeys', '', '', COLOR.RED, 'bold'); } cb.log("checking all kaps"); if ((mutemsg != true) && ((cb.settings['muteallcaps'] == 'yes') && (tmpmsg === tmpmsg.toUpperCase() && tmpmsg !== "XD"))) { mutemsg = true; temp = 10; cb.sendNotice(u + ':Muted message for all caps', '', '', COLOR.RED, 'bold'); } cb.log("checking non english"); if ((mutemsg != true) && ((cb.settings['mutenonenglish'] == 'yes') && (tmpmsg.search(/[^\x00-\x7F]+/) != -1))) { mutemsg = true; temp = 11; cb.sendNotice(u + ':Muted message for non-english', '', '', COLOR.RED, 'bold'); } cb.log("processing a mute"); if (mutemsg) { msg['X-Spam'] = true; // if (cb.settings.warnmsg === 'yes') cb.sendNotice(warn,msg['user'],'',COLOR.INFO); if (monList.length > 0) { for (var i = 0; i < monList.length; i++) cb.sendNotice(temp + " - *JSModBot* " + msg['user'] + ": " + tmpmsg, monList[i], '', COLOR.INFO, 'bold'); } if (userWarnCounts[u] == undefined) { userWarnCounts[u] = 1 } else { userWarnCounts[u] += 1 } } } } cb.onMessage(function(msg) { var regexCommandSplit = '^' + commandPrefix + '(\\S+)(?:\\b\\s*)(.*)?'; var regexListSplit = /[,\s]+/; var reCmdSplit = new RegExp(regexCommandSplit); var cmdSplit = msg['m'].match(reCmdSplit); var cmd; var cmdval; var cmdValArray; if (cmdSplit) { cmd = cmdSplit[1]; cmdval = cmdSplit[2]; if (cmdval != null) { cmdval = cmdval.replace(/^\s+|\s+$/g, ''); } if (cmdval != null) { cmdValArray = cmdval.split(regexListSplit); } else { cmdValArray = ''; } } // for convenience var m = msg['m']; var u = msg['user']; var isMod = msg['is_mod']; var isRoomHost = (u == roomHost); var viewer, toViewer; switch (cmd) { /***** add block phrase *****/ case COMMAND.JSADD: if (isMod || isRoomHost) { if (cmdval) { cb.sendNotice("* now blocking: " + cmdval, '', '', COLOR.NOTICE, 'bold'); jsAdded.push(new RegExp(cmdval.replace(/\s+$/, ""), "i")); cb.log(jsAdded.toString()); } else { cb.sendNotice("* Syntax: /jsadd phrase to be blocked", u, '', COLOR.SYNTAX, 'bold'); } } else { cb.sendNotice(ONLY_MODERATORS, u, '', COLOR.NOTICE, 'bold'); } break; /***** Public Notice *****/ case COMMAND.JSN: if (isMod || isRoomHost) { if (cmdval) { cb.sendNotice("* " + cmdval, '', '', COLOR.NOTICE, 'bold'); } else { cb.sendNotice("* Syntax: /jsn message", u, '', COLOR.SYNTAX, 'bold'); } } else { cb.sendNotice(ONLY_MODERATORS, u, '', COLOR.NOTICE, 'bold'); } break; /***** Private Notice *****/ case COMMAND.JSV: viewer = cmdValArray[0]; cbjs.arrayRemove(cmdValArray, cmdValArray[0]); toViewer = cbjs.arrayJoin(cmdValArray, " "); if (isMod || isRoomHost) { if (cmdval) { cb.sendNotice("*JSModBot* " + toViewer, viewer, '', COLOR.RED, 'bold'); } else { cb.sendNotice("* Syntax: /jsv viewername message", u, '', COLOR.SYNTAX, 'bold'); } } else { cb.sendNotice(ONLY_MODERATORS, u, '', COLOR.NOTICE, 'bold'); } break; /***** Message to Broadcaster *****/ case COMMAND.JSB: if (isMod) { if (cmdval) { cb.sendNotice("* " + u.toUpperCase() + ": " + cmdval, roomHost, COLOR.HVBACK, COLOR.HVTEXT, 'bold'); cb.sendNotice("* " + u.toUpperCase() + ": " + cmdval, u, COLOR.HVBACK, COLOR.HVTEXT, 'bold'); } else { cb.sendNotice("* Syntax: /jbc message", u, '', COLOR.SYNTAX, 'bold'); } } else { cb.sendNotice(ONLY_MODERATORS, u, '', COLOR.NOTICE, 'bold'); } break; /***** Message to Mods *****/ case COMMAND.JSM: if (isMod || isRoomHost) { if (cmdval) { cb.sendNotice("* " + u.toUpperCase() + ": " + cmdval, '', COLOR.HVBACK, COLOR.HVTEXT, 'bold', 'red'); } else { cb.sendNotice("* Syntax: /jbm message", u, '', COLOR.SYNTAX, 'bold'); } } else { cb.sendNotice(ONLY_MODERATORS, u, '', COLOR.NOTICE, 'bold'); } break; case COMMAND.MON: if (isMod || isRoomHost) { if (!cbjs.arrayContains(monList, u)) monList.push(u); else cbjs.arrayRemove(monList, u); } break; } //switch if (m[0] == commandPrefix) msg['X-Spam'] = true; //suppress all command echoing in chat checkmsg(msg); return msg; }); function init() { cb.sendNotice("\n" + dashLine + "\n* " + app.name + " by CrystalSopen\n* Version: " + app.version + app.build + " (" + app.date + ")\n" + dashLine + "\n", roomHost, '', COLOR.INFO, 'bold'); cb.sendNotice("\n add more phrases with: /jsadd phrase"); } init();
© Copyright Chaturbate 2011- 2025. All Rights Reserved.