Bots Home
|
Create an App
Nekobot
Author:
sypunk
Description
Source Code
Launch Bot
Current Users
Created by:
Sypunk
/** * Nekobot (Singleton Pattern) * @author Sypunk * @version 1.4.0 Build1 * @date-created 2016.03.30 * @date-modified 2018.05.15 * @description A modular bot for Nekolukka's room that performs a variety of functions unique to her wishes. * Todo: */ var Nekobot = (function () { // private methods and properties // ... return { message: { module: { debug: { setEnabled: function (bEnabled) { if(bEnabled === true){ if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice("Nekobot Debugging Mode Enabled.", "", "", "#990037", "", ""); } } Nekobot.message.module.debug._bDebugEnabled = bEnabled; }, getEnabled: function () { return Nekobot.message.module.debug._bDebugEnabled; }, onMessage: function (aryArg, oMsg, bIsRoomCreator) { if (aryArg !== undefined) { if (aryArg[2] !== undefined) { if (aryArg[2] === "on") { Nekobot.message.module.debug.setEnabled(true); } if (aryArg[2] === "off") { Nekobot.message.module.debug.setEnabled(false); } } } return oMsg; }, onEnter: function (oUser, bIsRoomCreator) { // tbd }, onLeave: function (oUser, bIsRoomCreator) { // tbd }, onTip: function (oTip, bIsRoomCreator) { // tbd }, init: function () { Nekobot.message.module.debug.setEnabled(false); } }, recorder: { setEnabled: function (bEnabled) { if(bEnabled === true){ if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice("Nekobot Recorder On.", "", "", "#990037", "", ""); } } else { if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice("Nekobot Recorder Off.", "", "", "#990037", "", ""); } } Nekobot.message.module.recorder._bEnabled = bEnabled; }, getEnabled: function () { return Nekobot.message.module.recorder._bEnabled; }, onMessage: function (aryArg, oMsg, bIsRoomCreator) { var s = ""; if (aryArg !== undefined) { if (aryArg[2] !== undefined) { if (aryArg[2] === "on") { Nekobot.message.module.recorder.setEnabled(true); } if (aryArg[2] === "off") { Nekobot.message.module.recorder.setEnabled(false); } if (aryArg[2] === "export") { s = Nekobot.message.module.recorder.getRecording(); cb.sendNotice(s, oMsg.user, "", "#990037", "", ""); } } } if (Nekobot.message.module.recorder.getEnabled() === true) { Nekobot.message.module.recorder.appendToRecording(oMsg.user+": "+oMsg.m); } return oMsg; }, getRecording: function () { var s = ""; var ary = Nekobot.message.module.recorder._aryRecording; for (var i=0; i<ary.length; i++) { s = s + ary[i]+"\n"; } s = Nekobot.global.helper.string.lzw_encode(s); var s = "---begin---\n"+s+"---end---"; return s; }, appendToRecording: function (s) { if (Nekobot.message.module.recorder._aryRecording === undefined) { Nekobot.message.module.recorder._aryRecording = []; } Nekobot.message.module.recorder._aryRecording.push(s); }, onEnter: function (oUser, bIsRoomCreator) { // tbd }, onLeave: function (oUser, bIsRoomCreator) { // tbd }, onTip: function (oTip, bIsRoomCreator) { // tbd }, init: function () { Nekobot.message.module.recorder._aryRecording = []; Nekobot.message.module.recorder.setEnabled(false); } }, tac: { showHelp: function (oMsg, bIsRoomCreator) { var bIsMod = false; var s = "________________________________________\nNekobot Terms & Conditions Module:\n/nekobot tac <on/off>\n/nekobot tac setwelcome <welcome message>\n________________________________________"; if (oMsg !== undefined){ if (oMsg.is_mod !== undefined) { bIsMod = oMsg.is_mod; } } if (bIsRoomCreator === true || bIsMod === true) { cb.sendNotice(s, oMsg.user, "", "#990037", "", ""); } }, setEnabled: function (bEnabled) { if(bEnabled === true){ if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice("Nekobot Terms and Conditions Module On.", "", "", "#990037", "", ""); } } else { if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice("Nekobot Terms and Conditions Module Off.", "", "", "#990037", "", ""); } } Nekobot.message.module.tac._bEnabled = bEnabled; }, getEnabled: function () { return Nekobot.message.module.tac._bEnabled; }, setWelcome: function (s) { var sMessage = s; Nekobot.message.module.tac._sMessage = s; if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice("The Terms and Conditions notice has been set to the following: ", "", "", "#990037", "", ""); } var aryMessage; if (Nekobot.message.module.tac.getEnabled() === true) { aryMessage = sMessage.split("|"); for (var i = 0; i < aryMessage.length; i++) { if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice(aryMessage[i], "", "#ffddef", "#990037", "bold", ""); cb.sendNotice("", "", "", "#990037", "bold", ""); } } } }, getWelcome: function () { return Nekobot.message.module.tac._sMessage; }, onMessage: function (aryArg, oMsg, bIsRoomCreator) { if (aryArg !== undefined) { if (aryArg[2] !== undefined) { if (aryArg[2] === "on") { Nekobot.message.module.tac.setEnabled(true); } if (aryArg[2] === "off") { Nekobot.message.module.tac.setEnabled(false); } if (aryArg[2] === "setwelcome") { if (aryArg[3] !== undefined) { Nekobot.message.module.tac.setWelcome(aryArg[3]); } } } else { Nekobot.message.module.tac.showHelp(oMsg, bIsRoomCreator); } } return oMsg; }, onEnter: function (oUser, bIsRoomCreator) { var fnc = function () { var sMessage = Nekobot.message.module.tac.getWelcome(); var aryMessage; var s = ""; if (Nekobot.message.module.tac.getEnabled() === true) { sMessage = sMessage.replace("<user>", oUser.user); aryMessage = sMessage.split("|"); for (var i = 0; i < aryMessage.length; i++) { s = s + aryMessage[i]+"\n"; } cb.sendNotice(s, oUser.user, "#ffddef", "#990037", "bold", ""); } }; cb.setTimeout(fnc, 3000); }, onLeave: function (oUser, bIsRoomCreator) { // tbd }, onTip: function (oTip, bIsRoomCreator) { // tbd }, init: function () { var sDefaultMessage = "You are responsible for what you write in the main chat, private message, and tip note.|You acknowledge that anything you send, you are held accountable for and give full permission to the cam host of this room to do what she wishes with the messages you send her.|By messaging in this public chat, in PM, and within a tip note, you agree with the above statement and agree to the publication of your messages within CB and other forums placed by the cam host and her viewers.|The privacy of your messages (via PM and tip note) will remain private unless the cam host sees fit to share them with the room or other forums. However, your personal information will never be revealed by the cam host (i.e., real name, location, etc).|Message responsibly :)"; var sMessage = ""; if (cb.settings_choices === undefined) { cb.settings_choices = []; } cb.settings_choices.push( { name:"tac_enabled", type:"choice", choice1:"Yes", choice2:"No", defaultValue:"Yes", required: true, label: "[TAC MODULE] Terms And Conditions ............................ Enable?" }, { name:"tac_message", type:"str", defaultValue:sDefaultMessage, required: false, label: "Welcome Message ('|' inserts linefeeds)" }); if (cb.settings.tac_message !== undefined) { if (cb.settings.tac_message !== "") { sMessage = cb.settings.tac_message; } } if (sMessage === "") { sMessage = sDefaultMessage; } Nekobot.message.module.tac._sMessage = ""; if (cb.settings.tac_enabled === "Yes") { Nekobot.message.module.tac.setEnabled(true); } else { Nekobot.message.module.tac.setEnabled(false); } Nekobot.message.module.tac.setWelcome(sMessage); } }, notices: { showHelp: function (oMsg, bIsRoomCreator) { var s = "________________________________________\nNekobot Notices Module:\n/nekobot notices <on/off>\n/nekobot notices setwelcome <welcome message>\n/nekobot notices add <message> <interval in minutes> <color> <bgcolor> (quotes are requred around message)\n/nekobot notices change <message index> <message> (quotes are requred around message)\n/nekobot notices disable <message index>\n/nekobot notices enable <message index>\n/nekobot notices reset (clears away all)\n________________________________________"; var bIsMod = false; if (oMsg !== undefined){ if (oMsg.is_mod !== undefined) { bIsMod = oMsg.is_mod; } } if (bIsRoomCreator === true || bIsMod === true) { cb.sendNotice(s, oMsg.user, "", "#990037", "", ""); } }, setEnabled: function (bEnabled) { if(bEnabled === true){ if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice("Nekobot Notices Module On.", "", "", "#990037", "", ""); } } else { if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice("Nekobot Notices Module Off.", "", "", "#990037", "", ""); } } Nekobot.message.module.notices._bEnabled = bEnabled; }, getEnabled: function () { return Nekobot.message.module.notices._bEnabled; }, setWelcome: function (s) { var sMessage = s; Nekobot.message.module.notices._sWelcomeMessage = s; if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice("The welcome notice has been set to the following: ", "", "", "#990037", "", ""); } var aryMessage; if (Nekobot.message.module.notices.getEnabled() === true) { aryMessage = sMessage.split("|"); for (var i = 0; i < aryMessage.length; i++) { if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice(aryMessage[i], "", "#99ff99", "#379937", "bold", ""); cb.sendNotice("", "", "", "#379937", "bold", ""); } } } }, getWelcome: function () { return Nekobot.message.module.notices._sWelcomeMessage; }, addMessage: function (sMessage, iInterval, sColor, sBgColor) { var aryMessageLines; var fnc = function () { var iIndex = fnc._iIndex; if (Nekobot.message.module.notices.getEnabled() === true) { if (Nekobot.message.module.notices._aryMessages[iIndex] !== undefined) { aryMessageLines = Nekobot.message.module.notices._aryMessages[iIndex].message.split("|"); for (var i = 0; i < aryMessageLines.length; i++) { cb.sendNotice(aryMessageLines[i], "", sBgColor, sColor, "bold", ""); } if (Nekobot.message.module.notices._aryMessages[iIndex].enabled === true) { cb.setTimeout(fnc, Nekobot.message.module.notices._aryMessages[iIndex].interval * 1000 * 60, iIndex); } } } }; if (Nekobot.message.module.notices.getEnabled() === true) { if (sMessage !== undefined) { if (iInterval === undefined) { iInterval = 10; // default of 10 mintues } if (sColor === undefined) { sColor = "#990037"; } if (sBgColor === undefined) { sBgColor = "#ffffff"; } fnc._iIndex = Nekobot.message.module.notices._aryMessages.length; cb.setTimeout(fnc, 8000); Nekobot.message.module.notices._aryMessages.push({"enabled":true, "message":sMessage, "interval":iInterval, "color":sColor, "bgcolor":sColor}); if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice("Nekobot Notifier sucessfully added a new cycling message.", "", "", "#990037", "", ""); } } } }, reset: function () { Nekobot.message.module.notices._aryMessages = []; if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice("Nekobot reset, cleared out, all Notices messages.", "", "", "#990037", "", ""); } }, disableMessageByIndex: function (i) { Nekobot.message.module.notices._aryMessages[i].enabled = false; if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice("Nekobot disabled the specified Notices message (it may display one more time due to a limitation of CB's architecture).", "", "", "#990037", "", ""); } }, enableMessageByIndex: function (i) { Nekobot.message.module.notices._aryMessages[i].enabled = true; //cb.sendNotice("Nekobot enabled the specified Notices message.", "", "", "#990037", "", ""); if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice("Nekobot - This feature is not available yet.", "", "", "#990037", "", ""); } // todo: need to add the settimeout fnc that retriggers it for this feature to work // probably the easiest way is to make the "fnc" that triggers the notice a property of the addMessage function so that it can be trigged globally. kludgy, but the better than adding an addtional paramter to addMessage }, changeMessageByIndex: function (i, sMessage) { if (i !== undefined) { if (sMessage !== undefined) { if (Nekobot.message.module.notices._aryMessages[i] !== undefined) { Nekobot.message.module.notices._aryMessages[i].message = sMessage; if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice("Nekobot changed the specified Notices message.", "", "", "#990037", "", ""); } } } } }, onMessage: function (aryArg, oMsg, bIsRoomCreator) { if (aryArg !== undefined) { if (aryArg[2] !== undefined) { if (aryArg[2] === "on") { Nekobot.message.module.notices.setEnabled(true); } if (aryArg[2] === "off") { Nekobot.message.module.notices.setEnabled(false); } if (aryArg[2] === "setwelcome") { if (aryArg[3] !== undefined) { Nekobot.message.module.notices.setWelcome(aryArg[3]); } } if (aryArg[2] === "add") { if (aryArg[3] !== undefined) { if (aryArg.length <= 7) { Nekobot.message.module.notices.addMessage(aryArg[3].split("`").join(" "), aryArg[4], aryArg[5]); } else { cb.sendNotice("Nekobot command failed, because you likely forgot to put quotes around your message parameter.", "", "", "#990037", "", ""); } } } if (aryArg[2] === "change") { if (aryArg[3] !== undefined) { if (aryArg.length <= 7) { Nekobot.message.module.notices.changeMessageByIndex(parseInt(aryArg[3]), aryArg[4].split("`").join(" ")); } else { cb.sendNotice("Nekobot command failed, because you likely forgot to put quotes around your message parameter.", "", "", "#990037", "", ""); } } } if (aryArg[2] === "disable") { if (aryArg[3] !== undefined) { Nekobot.message.module.notices.disableMessageByIndex(parseInt(aryArg[3])); } } if (aryArg[2] === "enable") { if (aryArg[3] !== undefined) { Nekobot.message.module.notices.enableMessageByIndex(parseInt(aryArg[3])); } } if (aryArg[2] === "reset") { Nekobot.message.module.notices.reset(); } } else { Nekobot.message.module.notices.showHelp(oMsg, bIsRoomCreator); } } return oMsg; }, onEnter: function (oUser, bIsRoomCreator) { var fnc = function () { var sMessage = Nekobot.message.module.notices.getWelcome(); var aryMessage; var s = ""; if (Nekobot.message.module.notices.getEnabled() === true) { sMessage = sMessage.replace("<user>", oUser.user); aryMessage = sMessage.split("|"); for (var i = 0; i < aryMessage.length; i++) { s = s + aryMessage[i]+"\n"; } cb.sendNotice(s, oUser.user, "#99ff99", "#379937", "bold", ""); } }; cb.setTimeout(fnc, 1000); }, onLeave: function (oUser, bIsRoomCreator) { // tbd }, onTip: function (oTip, bIsRoomCreator) { // tbd }, init: function () { var sDefaultWelcomeMessage = "Welcome to Nekolukka's room, <user>!|Kindly note that any 'demands' will result in immediate silencing of your messages, by either the bot or a mod, for the duration of today's session.|Please keep any dirty talk to tip-notes. Please be as respectful to Neko in chat, as you surely would in person.|Like any kitten, Neko is most likely to respond with affection when you're kind and sweet to her."; var sWelcomeMessage = ""; if (cb.settings_choices === undefined) { cb.settings_choices = []; } cb.settings_choices.push( { name:"notices_enabled", type:"choice", choice1:"Yes", choice2:"No", defaultValue:"Yes", required: true, label: "[NOTICES MODULE] .......................................................... Enable?" }, { name:"notices_welcome_message", type:"str", defaultValue:sDefaultWelcomeMessage, required: false, label: "Welcome Message ('|' inserts linefeeds)" }); cb.settings_choices.push({ name:"notices_message_1_text", type:"str", defaultValue:"", required: false, label: "Repeating Message 1 Text ('|' inserts linefeeds):" }); cb.settings_choices.push({ name:"notices_message_1_interval", type:"str", defaultValue:"10", required: false, label: "Repeating Message 1 Interval (in minutes):" }); cb.settings_choices.push({ name:"notices_message_1_color", type:"str", defaultValue:"#990037", required: false, label: "Repeating Message 1 color:" }); cb.settings_choices.push({ name:"notices_message_1_bgcolor", type:"str", defaultValue:"#ffffff", required: false, label: "Repeating Message 1 bgcolor:" }); cb.settings_choices.push({ name:"notices_message_2_text", type:"str", defaultValue:"", required: false, label: "Repeating Message 2 Text ('|' inserts linefeeds):" }); cb.settings_choices.push({ name:"notices_message_2_interval", type:"str", defaultValue:"10", required: false, label: "Repeating Message 2 Interval (in minutes):" }); cb.settings_choices.push({ name:"notices_message_2_color", type:"str", defaultValue:"#990037", required: false, label: "Repeating Message 2 color:" }); cb.settings_choices.push({ name:"notices_message_2_bgcolor", type:"str", defaultValue:"#ffffff", required: false, label: "Repeating Message 2 bgcolor:" }); cb.settings_choices.push({ name:"notices_message_3_text", type:"str", defaultValue:"", required: false, label: "Repeating Message 3 Text ('|' inserts linefeeds):" }); cb.settings_choices.push({ name:"notices_message_3_interval", type:"str", defaultValue:"10", required: false, label: "Repeating Message 3 Interval (in minutes):" }); cb.settings_choices.push({ name:"notices_message_3_color", type:"str", defaultValue:"#990037", required: false, label: "Repeating Message 3 color:" }); cb.settings_choices.push({ name:"notices_message_3_bgcolor", type:"str", defaultValue:"#ffffff", required: false, label: "Repeating Message 3 bgcolor:" }); if (cb.settings.notices_welcome_message !== undefined) { if (cb.settings.notices_welcome_message !== "") { sWelcomeMessage = cb.settings.notices_welcome_message; } } if (sWelcomeMessage === "") { sWelcomeMessage = sDefaultWelcomeMessage; } Nekobot.message.module.notices._sWelcomeMessage = ""; Nekobot.message.module.notices._aryMessages = []; if (cb.settings.notices_enabled === "Yes") { Nekobot.message.module.notices.setEnabled(true); } else { Nekobot.message.module.notices.setEnabled(false); } Nekobot.message.module.notices.setWelcome(sWelcomeMessage); if (cb.settings.notices_message_1_text !== undefined) { if (cb.settings.notices_message_1_text !== "") { Nekobot.message.module.notices.addMessage(cb.settings.notices_message_1_text, cb.settings.notices_message_1_interval, cb.settings.notices_message_1_color, cb.settings.notices_message_1_bgcolor); } } if (cb.settings.notices_message_2_text !== undefined) { if (cb.settings.notices_message_2_text !== "") { Nekobot.message.module.notices.addMessage(cb.settings.notices_message_2_text, cb.settings.notices_message_2_interval, cb.settings.notices_message_2_color, cb.settings.notices_message_2_bgcolor); } } if (cb.settings.notices_message_3_text !== undefined) { if (cb.settings.notices_message_3_text !== "") { Nekobot.message.module.notices.addMessage(cb.settings.notices_message_3_text, cb.settings.notices_message_3_interval, cb.settings.notices_message_3_color, cb.settings.notices_message_3_bgcolor); } } /* var fncSpecialWelcomeBack = function () { cb.sendNotice("-+- NEKOBOT MISSED NEKO SOOO MUUUCH !! :~: -+-", "", "#ff8899", "#990037", "bold", ""); cb.setTimeout(fncSpecialWelcomeBack, 7200000); }; cb.setTimeout(fncSpecialWelcomeBack, 60000); */ } }, replace: { showHelp: function (oMsg, bIsRoomCreator) { var s = "________________________________________\nNekobot Word Replace Module:\n/nekobot replace <on/off>\n/nekobot replace add <word> <replacement word>\n/nekobot replace remove <word>\n/nekobot replace show\n/nekobot replace reset\n________________________________________"; var bIsMod = false; if (oMsg !== undefined){ if (oMsg.is_mod !== undefined) { bIsMod = oMsg.is_mod; } } if (bIsRoomCreator === true || bIsMod === true) { cb.sendNotice(s, oMsg.user, "", "#990037", "", ""); } }, setEnabled: function (bEnabled) { if(bEnabled === true){ if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice("Nekobot Replace Module On.", "", "", "#990037", "", ""); } } else { if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice("Nekobot Replace Module Off.", "", "", "#990037", "", ""); } } Nekobot.message.module.replace._bEnabled = bEnabled; }, getEnabled: function () { return Nekobot.message.module.replace._bEnabled; }, addWordPair: function (aryArg) { /** * Replace Module AddWordPair * @method addWordPair */ var o = Nekobot.message.module.replace.getWordPairs(); o[aryArg[3]] = aryArg[4]; if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice("Nekobot Replace Module - '" + aryArg[3] + "' Becomes '" + aryArg[4] + "' Added!", "", "", "#990037", "", ""); } }, removeWordPair: function (aryArg) { /** * Replace Module RemoveWordPair * @method RemoveWordPair */ var o = Nekobot.message.module.replace.getWordPairs(); if (o[aryArg[3]] !== undefined) { if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice("Nekobot Replace Module - '" + aryArg[3] + "' Removed!", "", "", "#990037", "", ""); } delete o[aryArg[3]]; } }, showWordPairs: function () { /** * Replace Module ShowWordPairs * @method showWordPairs */ var o = Nekobot.message.module.replace.getWordPairs(); cb.sendNotice("________________________________________", "", "", "#990037", "", ""); cb.sendNotice("Nekobot Replace Module - Word Pairs:", "", "", "#990037", "", ""); for (var key in o) { if (o.hasOwnProperty(key)) { cb.sendNotice("'" + key + "' becomes '" + o[key] + "'", "", "", "#990037", "", ""); } } cb.sendNotice("________________________________________", "", "", "#990037", "", ""); }, reset: function () { /** * Replace Module Reset * @method reset */ Nekobot.message.module.replace._oWordPairs = new Object(); if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice("Nekobot Replace Module - Reset and Cleared Out!", "", "", "#990037", "", ""); } }, onMessage: function (aryArg, oMsg, bIsRoomCreator) { /** * Replace Module OnMessage * @method onMessage */ var bIsMod = oMsg.is_mod; var o = Nekobot.message.module.replace.getWordPairs(); if (aryArg !== undefined) { if (aryArg[2] !== undefined) { if (aryArg[2] === "on") { Nekobot.message.module.replace.setEnabled(true); } if (aryArg[2] === "off") { Nekobot.message.module.replace.setEnabled(false); } if (aryArg[2] === "add") { Nekobot.message.module.replace.addWordPair(aryArg); } if (aryArg[2] === "remove") { Nekobot.message.module.replace.removeWordPair(aryArg); } if (aryArg[2] === "show") { Nekobot.message.module.replace.showWordPairs(aryArg); } if (aryArg[2] === "reset") { Nekobot.message.module.replace.reset(aryArg); } } else { Nekobot.message.module.replace.showHelp(oMsg, bIsRoomCreator); } } else { if (Nekobot.message.module.replace.getEnabled() === true) { for (var key in o) { if (o.hasOwnProperty(key)) { oMsg.m = oMsg.m.split(key).join(o[key]); } } } } return oMsg; }, onEnter: function (oUser, bIsRoomCreator) { // tbd }, onLeave: function (oUser, bIsRoomCreator) { // tbd }, onTip: function (oTip, bIsRoomCreator) { // tbd }, getWordPairs: function () { /** * Replace Module GetWordPairs * @method getWordPairs */ var o = Nekobot.message.module.replace._oWordPairs; return o; }, init: function () { /** * Replace Module Init * @method init */ var aryWordpairs; var aryWordpair; Nekobot.message.module.replace._oWordPairs = new Object(); if (cb.settings_choices === undefined) { cb.settings_choices = []; } cb.settings_choices.push( { name:"replace_enabled", type:"choice", choice1:"Yes", choice2:"No", defaultValue:"No", required: true, label: "[REPLACE MODULE] .......................................................... Enable?" }, { name:"replace_wordpairs", type:"str", defaultValue:"", required: false, label: "Word Replace Pairs (e.g. 'hi|bye hot|cold happy|sad')" }); if (cb.settings.replace_wordpairs !== undefined) { if (cb.settings.replace_wordpairs !== "") { aryWordpairs = cb.settings.replace_wordpairs.split(" "); for (var i = 0; i < aryWordpairs.length; i++) { aryWordpair = aryWordpairs[i].split("|"); Nekobot.message.module.replace.addWordPair(["/nekobot", "replace", "add", aryWordpair[0], aryWordpair[1]]); } } } if (cb.settings.replace_enabled === "Yes") { Nekobot.message.module.replace.setEnabled(true); } else { Nekobot.message.module.replace.setEnabled(false); } } }, silence: { showHelp: function (oMsg, bIsRoomCreator) { var s = "________________________________________\nNekobot Silence Module:\n/nekobot s [on/off]\n/nekobot s all\n/nekobot s relaxed\n/nekobot s aggressive\n/nekobot s allbutgreys\n/nekobot s greys [on/off] ('on' silences)\n/nekobot s demands [on/off]\n/nekobot s spam [on/off]\n/nekobot s watchcam [on/off]\n/nekobot s usernamespam [on/off]\n/nekobot s quietmode [on/off]\n/nekobot s user [username]\n/nekobot s unsilence [username]\n/nekobot s clear (bot-silenced may speak again)\n/u (unsilence last wrongly silenced)\n/mercy (unsilence last rightly silenced)\n/nekobot s show\n/nekobot s show [user]\n/nekobot s spam addrule [regex rule in quotes]\n/nekobot s debug [on/off]\n/nekobot s addimmunity [user]\n/nekobot s removeimmunity [user]\n/nekobot s clearimmunity\n/nekobot s showimmune\n/nekobot s addspecialgrey [user]\n/nekobot s removespecialgrey [user]\n/nekobot s clearspecialgreys\n/nekobot s showspecialgreys\n/nekobot s exportspecialgreys (for paste into launch settings)\n/nekobot s exportimmuneusers (for paste into launch settings)\n/nekobot s stats [optional true/false for only showing cmd issuer]\n________________________________________"; var bIsMod = false; if (oMsg !== undefined){ if (oMsg.is_mod !== undefined) { bIsMod = oMsg.is_mod; } } if (bIsRoomCreator === true || bIsMod === true) { cb.sendNotice(s, oMsg.user, "", "#990037", "", ""); } }, commonCleaner: function (s) { s = s.toLowerCase().replace(/^\s+|\s+$/g,''); // lowercase and trim leading and trailing spaces s = s.replaceAll("<3", "").trim(); // remove some common emoticons with alphanumeric characters in them so they don't pollute the result //s = s.replaceAll("<3", "").replaceAll(":3", "").replaceAll("D:", "").trim(); s = s.replace(/[^\w\s]|_/g, "").replace(/\s+/g, " "); // remove all punctuation and repeating spaces s = s.replace(/(.)\1{2,}/g, "$1$1"); // remove repeating characters above two repeats s = Nekobot.global.helper.string.removeConsecutiveDuplicateWords(s); // remove groups of consecutive repeating words return s; }, greys: function (oMsg, bIsRoomCreator) { var oImmuneUsers = Nekobot.message.module.silence.getImmuneUsers(); var oSpecialGreys = Nekobot.message.module.silence.getSpecialGreyUsers(); var bIsSpecialGrey = false; var bImmuneUser = false; var bIsMod = oMsg.is_mod; var bIsfcm = oMsg.in_fanclub; if (oImmuneUsers[oMsg.user] !== undefined) { bImmuneUser = true; } if (oSpecialGreys[oMsg.user] !== undefined) { bIsSpecialGrey = true; } if (oMsg.has_tokens === false) { if (bIsRoomCreator === false && bIsMod === false && bIsfcm === false && bImmuneUser === false && bIsSpecialGrey === false) { oMsg.m = ""; oMsg["X-Spam"] = true; cb.sendNotice("Sorry " + oMsg.user + ", 'greys' (those without tokens) are silenced right now.", oMsg.user, "", "#990037", "", ""); } } return oMsg; }, spam: function (oMsg, bIsRoomCreator) { var m = oMsg.m.toLowerCase().replace(/^\s+|\s+$/g,''); // lowercase and trim leading and trailing spaces var bFoundSpam = false; var bQuietMode = Nekobot.message.module.silence._bQuietMode; var arySpam = Nekobot.message.module.silence._arySpamRules; var bUserNotABot = false; if (Nekobot.message.module.silence._oAllChattingUsers[oMsg.user] !== undefined) { if (Nekobot.message.module.silence._oAllChattingUsers[oMsg.user] >= 2) { // is 1 time, as it was incremented before here // if user is active in chat, equal to 1 or more messages, // we'll assume the user is not a spam bot and give them spam immunity bUserNotABot = true; } } if (bUserNotABot === false) { for (var i = 0; i < arySpam.length; i++) { for (var j = 0; j < arySpam[i].aryRegex.length; j++) { if (m.search(arySpam[i].aryRegex[j]) != -1) { Nekobot.message.module.silence.addSilencedUser(oMsg, undefined, undefined, false, arySpam[i].title + " spam"); Nekobot.message.module.silence.sendSilencedNotice(oMsg, arySpam[i].title + " spam", false, undefined, undefined, bIsRoomCreator, bQuietMode); oMsg.m = ""; oMsg["X-Spam"] = true; bFoundSpam = true; break; } } if (bFoundSpam === true) { Nekobot.message.module.silence._iSpamCount = Nekobot.message.module.silence._iSpamCount + 1; break; } } } return oMsg; }, addSpamRule: function (s) { var re = new RegExp(s, "i"); // s = "chaturclub" becomes: /chaturclub/i Nekobot.message.module.silence._arySpamRules.push({title:"'S - Just Added'", aryRegex:[re]}); cb.sendNotice("Nekobot added new spam rule to Silence Module.", "", "", "#990037", "", ""); }, usernamespam: function (oMsg, bIsRoomCreator) { var bQuietMode = Nekobot.message.module.silence._bQuietMode; var bFoundSpam = false; var m = oMsg.user.toLowerCase().replace(/^\s+|\s+$/g,''); // lowercase and trim leading and trailing spaces var arySpam = [ {title:"'US - 00'", aryRegex:[/xxx_/i]}, {title:"'US - 01'", aryRegex:[/_xxx/i]}, {title:"'US - 02'", aryRegex:[/_record/i]},{title:"'US - 03'", aryRegex:[/record_/i]}, {title:"'US - 04'", aryRegex:[/_recording/i]}, {title:"'US - 05'", aryRegex:[/recording_/i]}, {title:"'US - 06'", aryRegex:[/_records/i]}, {title:"'US - 07'", aryRegex:[/records_/i]}, {title:"'US - 08'", aryRegex:[/_recording/i]}, {title:"'US - 09'", aryRegex:[/recording_/i]}, {title:"'US - 10'", aryRegex:[/_recordingcam/i]}, {title:"'US - 11'", aryRegex:[/recordingcam_/i]}, {title:"'US - 12'", aryRegex:[/_recordingwebcam/i]}, {title:"'US - 13'", aryRegex:[/recordingwebcam_/i]}, {title:"'US - 14'", aryRegex:[/_openme/i]}, {title:"'US - 15'", aryRegex:[/openme_/i]}, {title:"'US - 16'", aryRegex:[/_bio/i]}, {title:"'US - 17'", aryRegex:[/bio_/i]}, {title:"'US - 18'", aryRegex:[/tokens/i]}, {title:"'US - 19'", aryRegex:[/www_/i]}, {title:"'US - 20'", aryRegex:[/_www/i]}, {title:"'US - 21'", aryRegex:[/_com/i]}, {title:"'US - 22'", aryRegex:[/com_/i]}, {title:"'US - 23'", aryRegex:[/_cheating/i]}, {title:"'US - 24'", aryRegex:[/cheating_/i]}, {title:"'US - 25'", aryRegex:[/_chaturclub/i]}, {title:"'US - 26'", aryRegex:[/chaturclub_/i]}, {title:"'US - 27'", aryRegex:[/slutty_/i]}, {title:"'US - 28'", aryRegex:[/_slutty/i]}, {title:"'US - 29'", aryRegex:[/_c2c/i]}, {title:"'US - 30'", aryRegex:[/c2c_/i]}, {title:"'US - 31'", aryRegex:[/x_s_x/i]}, {title:"'US - 32'", aryRegex:[/_sexy/i]}, {title:"'US - 33'", aryRegex:[/sexy_/i]}, {title:"'US - 34'", aryRegex:[/_cougar/i]}, {title:"'US - 35'", aryRegex:[/cougar_/i]}, {title:"'US - 36'", aryRegex:[/x_s_x/i]}, {title:"'US - 37'", aryRegex:[/_cam2cam/i]}, {title:"'US - 38'", aryRegex:[/cam2cam_/i]}, {title:"'US - 39'", aryRegex:[/_slut/i]}, {title:"'US - 39'", aryRegex:[/slut_/i]} ]; for (var i=0; i<arySpam.length; i++) { for (var j=0; j<arySpam[i].aryRegex.length; j++) { if (m.search(arySpam[i].aryRegex[j]) != -1) { Nekobot.message.module.silence.addSilencedUser(oMsg, undefined, undefined, false, arySpam[i].title+" spam"); Nekobot.message.module.silence.sendSilencedNotice(oMsg, arySpam[i].title+" spam", false, undefined, undefined, bIsRoomCreator, bQuietMode); oMsg.m = ""; oMsg["X-Spam"] = true; bFoundSpam = true; break; } } if (bFoundSpam === true) { Nekobot.message.module.silence._iSpamCount = Nekobot.message.module.silence._iSpamCount + 1; break; } } return oMsg; }, watchcam: function (oMsg, bIsRoomCreator) { var bQuietMode = Nekobot.message.module.silence._bQuietMode; var bFoundSpam = false; var m = oMsg.m.toLowerCase().replace(/^\s+|\s+$/g,''); // lowercase and trim leading and trailing spaces var arySpam = [ {title:"'WC - 00'", aryRegex:[/watch\ my\ cam/i]}, {title:"'WC - 01'", aryRegex:[/free\ c2c/i]},{title:"'WC - O3'", aryRegex:[/see\ my\ cam/i]},{title:"'WC - 04'", aryRegex:[/view\ my\ cam/i]},{title:"'WC - 05'", aryRegex:[/look\ at\ my\ cam/i]}, {title:"'WC - 06'", aryRegex:[/check\ out\ my\ cam/i]}, {title:"'WC - 07'", aryRegex:[/free\ cam\ to\ cam/i]},{title:"'WC - 08'", aryRegex:[/view\ my\ profile/i]}, {title:"'WC - 09'", aryRegex:[/watch\ my\ profile/i]}, {title:"'WC - 0A'", aryRegex:[/open\ my\ cam/i]}, {title:"'WC - 0B'", aryRegex:[/check\ my\ profile/i]}, {title:"'WC - 0C'", aryRegex:[/look\ at\ my\ profile/i]}, {title:"'WC - 0D'", aryRegex:[/click\ my\ bio/i]}, {title:"'WC - 0E'", aryRegex:[/tap\ my\ profile/i]}, {title:"'WC - 0F'", aryRegex:[/at\ my\ profile/i]}, {title:"'WC - 10'", aryRegex:[/at\ my\ bio/i]}, {title:"'WC - 11'", aryRegex:[/go\ to\ my\ bio/i]}, {title:"'WC - 12'", aryRegex:[/see\ my\ profile/i]}, {title:"'WC - 13'", aryRegex:[/click\ my\ profile/i]}, {title:"'WC - 14'", aryRegex:[/click\ on\ me/i]}, {title:"'WC - 15'", aryRegex:[/see\ my\ cam\ bb/i]}, {title:"'WC - 16'", aryRegex:[/view\ my\ room/i]}, {title:"'WC - 17'", aryRegex:[/link\ in\ my\ bio/i]}, {title:"'WC - 18'", aryRegex:[/i\ record\ this\ show/i]}, {title:"'WC - 19'", aryRegex:[/open\ my\ profile/i]}, {title:"'WC - 1A'", aryRegex:[/my\ room\ and\ find\ link/i]}, {title:"'WC - 1B'", aryRegex:[/tap\ my\ bio/i]}, {title:"'WC - 1C'", aryRegex:[/pr0file/i]}, {title:"'WC - 1D'", aryRegex:[/kik/i]}, {title:"'WC - 1E'", aryRegex:[/open\ my\ bio/i]}, {title:"'WC - 1F'", aryRegex:[/new\ to\ this\ site/i]}, {title:"'WC - 20'", aryRegex:[/i\ am\ new\ on\ chaturbate/i]}, {title:"'WC - 21'", aryRegex:[/my\ pussy\ get\ so\ wet\ watching\ you/i]}, {title:"'WC - 22'", aryRegex:[/my\ pussy\ get\ so\ wett\ watching\ you/i]}, {title:"'WC - 23'", aryRegex:[/hot\ cock\ of\ 23\ cm/i]}, {title:"'WC - 24'", aryRegex:[/g\ o\ o\ g\ l\ e/i]}, {title:"'WC - 25'", aryRegex:[/i\ squirt\ for\ girls\ with\ cam/i]}, {title:"'WC - 26'", aryRegex:[/see\ my\ bio/i]}, {title:"'WC - 27'", aryRegex:[/watch\ my\ room/i]}, {title:"'WC - 28'", aryRegex:[/open\ my\ room/i]}, {title:"'WC - 29'", aryRegex:[/click\ my\ room/i]}, {title:"'WC - 2A'", aryRegex:[/i\ am\ new\ on\ chrb/i]}, {title:"'WC - 2B'", aryRegex:[/i\ am\ new\ on\ cb/i]}, {title:"'WC - 2C'", aryRegex:[/click\ on\ my\ bio/i]}, {title:"'WC - 2D'", aryRegex:[/click\ on\ my\ profile/i]}, {title:"'WC - 2E'", aryRegex:[/i\ m\ new\ here/i]}, {title:"'WC - 2F'", aryRegex:[/i\ m\ new\ on\ chaturbate/i]}, {title:"'WC - 3A'", aryRegex:[/cam2cam/i]}, {title:"'WC - 3B'", aryRegex:[/my\ profile/i]}, {title:"'WC - 3C'", aryRegex:[/tap\ my\ naked\ profile/i]}, {title:"'WC - 3D'", aryRegex:[/nekolukka\ cam/i]}, {title:"'WC - 3E'", aryRegex:[/nekolukka\ open/i]}, {title:"'WC - 3F'", aryRegex:[/nekolukka\ my\ bio/i]}, {title:"'WC - 30'", aryRegex:[/my\ bio/i]}, {title:"'WC - 31'", aryRegex:[/my\ cam/i]}, {title:"'WC - 32'", aryRegex:[/my\ cam/i]}, {title:"'WC - 33'", aryRegex:[/i\ m\ on\ cam/i]}, {title:"'WC - 34'", aryRegex:[/visit\ my\ private/i]}, {title:"'WC - 35'", aryRegex:[/my\ p4ge/i]}, {title:"'WC - 36'", aryRegex:[/to\ all\ pvt/i]}, {title:"'WC - 37'", aryRegex:[/play\ my\ pussy/i]}, {title:"'WC - 38'", aryRegex:[/hellovisit/i]}, {title:"'WC - 39'", aryRegex:[/myaccount/i]}, {title:"'WC - 3A'", aryRegex:[/boyziwantto/i]}, {title:"'WC - 3B'", aryRegex:[/doc2cvisitme/i]}, {title:"'WC - 3C'", aryRegex:[/roast\ on\ this\ camgirl/i]}, {title:"'WC - 3D'", aryRegex:[/boyz\ see\ mynice/i]}, {title:"'WC - 3E'", aryRegex:[/boyz\ see\ mynice/i]}, {title:"'WC - 3F'", aryRegex:[/supboysc2c/i]}, {title:"'WC - 40'", aryRegex:[/19yo/i]}, {title:"'WC - 41'", aryRegex:[/boyz\ see\ mynice/i]}, {title:"'WC - 42'", aryRegex:[/c2c/i]}, {title:"'WC - 43'", aryRegex:[/im20yo/i]}, {title:"'WC - 44'", aryRegex:[/im19yo/i]}, {title:"'WC - 45'", aryRegex:[/im18yo/i]}, {title:"'WC - 46'", aryRegex:[/20yo/i]}, {title:"'WC - 47'", aryRegex:[/18yo/i]}, {title:"'WC - 48'", aryRegex:[/righnow/i]}, {title:"'WC - 49'", aryRegex:[/rightnow/i]}, {title:"'WC - 50'", aryRegex:[/iwanttogoc2c/i]}, {title:"'WC - 51'", aryRegex:[/wannatogoc2c/i]}, {title:"'WC - 52'", aryRegex:[/wannagoc2c/i]}, {title:"'WC - 53'", aryRegex:[/iwannagoc2c/i]}, {title:"'WC - 54'", aryRegex:[/iwannatogoc2c/i]}, {title:"'WC - 55'", aryRegex:[/heyboyz/i]}, {title:"'WC - 56'", aryRegex:[/lovetodoc2cview/i]}, {title:"'WC - 57'", aryRegex:[/lovetodoc2c/i]}, {title:"'WC - 58'", aryRegex:[/salute\ boyz/i]}, {title:"'WC - 59'", aryRegex:[/hi\ boyz/i]}, {title:"'WC - 60'", aryRegex:[/whats\ up\ boyz/i]}, {title:"'WC - 61'", aryRegex:[/hey\ boyzz/i]}, {title:"'WC - 62'", aryRegex:[/hey\ boyz/i]}, {title:"'WC - 63'", aryRegex:[/helloboys/i]}, {title:"'WC - 64'", aryRegex:[/helloboyz/i]}, {title:"'WC - 65'", aryRegex:[/viewmywetass/i]}, {title:"'WC - 66'", aryRegex:[/helloboys/i]}, {title:"'WC - 67'", aryRegex:[/am18/i]}, {title:"'WC - 68'", aryRegex:[/am19/i]}, {title:"'WC - 69'", aryRegex:[/am20/i]}, {title:"'WC - 70'", aryRegex:[/checkmypinkitty/i]}, {title:"'WC - 71'", aryRegex:[/am20/i]}, {title:"'WC - 72'", aryRegex:[/higuysviewmypage9cod/i]}, {title:"'WC - 73'", aryRegex:[/mypussysowet/i]}, {title:"'WC - 74'", aryRegex:[/letsdoc2crightnow/i]}, {title:"'WC - 75'", aryRegex:[/boys\ i\ am\ so\ horny/i]}, {title:"'WC - 76'", aryRegex:[/lets\ do\ c2c/i]}, {title:"'WC - 77'", aryRegex:[/check\ out\ my\ wet/i]}, {title:"'WC - 78'", aryRegex:[/checkoutmy/i]}, {title:"'WC - 79'", aryRegex:[/my\ little\ kitty\ is\ so\ wet/i]}, {title:"'WC - 80'", aryRegex:[/mylittle\ kittyisso/i]}, {title:"'WC - 81'", aryRegex:[/check\ out\ my\ dirty\ pussy/i]}, {title:"'WC - 82'", aryRegex:[/boys\ iwanna/i]}, {title:"'WC - 83'", aryRegex:[/boys\ who\ wanna\ to\ to/i]}, {title:"'WC - 84'", aryRegex:[/heyboyzz/i]}, {title:"'WC - 85'", aryRegex:[/mylilkittyissowet/i]}, {title:"'WC - 86'", aryRegex:[/boyzzgotomyprofile/i]}, {title:"'WC - 87'", aryRegex:[/kittysohornyletsgo/i]}, {title:"'WC - 88'", aryRegex:[/helloguys/i]}, {title:"'WC - 89'", aryRegex:[/gotomypage/i]} ]; var bUserNotABot = false; var bDebugEnabled = false; var sDebug = ""; bDebugEnabled = Nekobot.message.module.silence.getDebugEnabled(); sDebug = sDebug + "At Watchcam stage: "+m+"\n"; if (bDebugEnabled === true) { if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice(sDebug, "sypunk", "#ffff00", "#888800", "", ""); } } if (Nekobot.message.module.silence._oAllChattingUsers[oMsg.user] !== undefined) { if (Nekobot.message.module.silence._oAllChattingUsers[oMsg.user] >= 2) { // is 1 time, as it was incremented before here // if user is active in chat, equal to 1 or more messages, // we'll assume the user is not a spam bot and give them spam immunity if (bDebugEnabled === false) { // if in debug mode, don't give not-a-bot status to anyone. so that it's easier to test bUserNotABot = true; } } } if (bUserNotABot === false) { for (var i = 0; i < arySpam.length; i++) { for (var j = 0; j < arySpam[i].aryRegex.length; j++) { if (m.search(arySpam[i].aryRegex[j]) != -1) { Nekobot.message.module.silence.addSilencedUser(oMsg, undefined, undefined, false, arySpam[i].title + " spam"); Nekobot.message.module.silence.sendSilencedNotice(oMsg, arySpam[i].title + " spam", false, undefined, undefined, bIsRoomCreator, bQuietMode); oMsg.m = ""; oMsg["X-Spam"] = true; bFoundSpam = true; break; } } if (bFoundSpam === true) { Nekobot.message.module.silence._iSpamCount = Nekobot.message.module.silence._iSpamCount + 1; break; } } } return oMsg; }, demands: function (oMsg, bIsRoomCreator) { // Todo: Yes, I need to refactor the fuck out of this section -- lots of code duplication, cruft and poor form shenanegains that makes it hard to understand. This is just a fail-fast prototype and its working amazingly well. Will clean up later. //cb.sendNotice("Nekobot Silence module - demands submodule called.", "", "", "#990037", "", ""); var oImmuneUsers = Nekobot.message.module.silence.getImmuneUsers(); var bImmuneUser = false; if (oImmuneUsers[oMsg.user] !== undefined) { bImmuneUser = true; } var bIsMod = oMsg.is_mod; var m = oMsg.m; var aryMsgWords = m.split(" "); var iMsgWordsCount = 0; var bDebugEnabled = false; var sDebug = ""; var bCriteriaMet = false; var bFoundNoun = false; var bFoundVerb = false; var bFoundSubject = false; var bFoundImperative = false; var bFoundDeterminer = false; var bFoundHostTargetedDeterminer = false; var bFoundHostTargetedPronouns = false; var bFoundNonHostTargetedPronoun = false; var bFoundNonHostTargetedDeterminer = false; var bFoundPreposition = false; var bFoundPejorative = false; var bFoundPositiveVerb = false; var bFoundAdjective = false; var bFoundNegatoryAdverb = false; var bFoundDemand = false; var bFoundTake = false; var bQuotesAroundMessage = false; var sReEsc, re, aryM; var bImmune = false; var bVerbIsDo = false; var bNounIsIt = false; var iVerbIndex = -1; var iNounIndex = -1; var aryVerbsWhenSolo = ["zoom", "masturbate", "fist", "squirt", "doggy", "disrobe"]; var aryNounsWhenSolo = []; var aryVerbs = ["show", "lemmesee", "zoom", "remove", "touch", "flash", "feed", "tease", "lift", "eat", "swallow", "gag", "rim", "open", "do", "put", "stand", "lay", "gape", "spread", "suck", "stroke", "fuck", "lick", "grab", "bang", "pound", "bruise", "pummel", "destroy", "murder", "push", "pull", "slap", "spank", "spit", "paddle", "hit", "punch", "flick", "grind", "thrust", "poke", "slam", "force", "jam", "insert", "penetrate", "fondle", "grope", "grapple", "squeeze", "finger", "diddle", "rub", "masturbate", "fist", "squirt", "cum", "anal", "piss", "pee", "poo", "poop", "fart"]; var aryNouns = ["vagina", "pussy", "dildo", "penis", "ass", "hole", "holes", "anus", "boobs", "boob", "feet", "foot", "face", "leg", "legs", "thighs", "thigh", "crack", "taint", "it", "nipple", "nipples", "clitoris", "lips", "mouth", "tongue", "toes", "toe", "armpit", "fingers", "clothes", "pants", "panties", "bra", "shorts", "shirt", "tshirt", "skirt", "stockings", "leggings", "underwear", "shoes", "heels"]; var aryAncillaryNouns = ["fingers", "hand", "hands"]; var aryPositiveVerbs = ["love", "like", "enjoy", "admire", "amazed"]; var aryPejoratives = ["bitch", "slut", "whore", "cunt", "thot", "hoe", "tramp", "skank", "chink", "gook", "chingchong"]; var aryGreetings = ["hi", "hello", "hey", "hai", "howdy", "yo", "sup", "greetings"]; var aryFarewells = ["farewell", "goodbye", "bye"]; var aryAdjectives = ["hot", "warm", "cool", "cold", "full", "sexy", "pretty", "heavenly", "gorgeous", "angelic", "beautiful", "nice", "lovely", "sweet", "juicy", "delicious", "yummy", "tasty", "firm", "tight", "wet", "bald", "bare", "hairless", "hairy", "bushy", "shiny", "glistening", "quivering", "fat", "phat", "dripping", "plump", "meaty", "wonderful", "little", "tiny", "small", "cute", "perfect", "amazing", "incredible", "stupendous", "enchanting", "enthralling", "good", "bad", "great", "awful", "horrible", "indifferent", "terrible", "horrid", "painful", "pleasurable", "sinful", "godly", "super", "extrodinary", "exquisite", "superior", "excellent", "awesome", "erect", "hard", "stiff", "pokey", "buttery", "soft", "gooey", "sticky", "slippery", "engorged", "throbbing", "horny", "black", "white", "red", "purple", "yellow", "green", "orange", "blue", "asian", "oriental", "chinese", "filipino", "japanese", "korean", "long", "short", "big", "huge", "massive", "giant", "humongous", "large", "enormous", "deep", "contracting", "pulsing", "pulsating", "soaking", "sopping", "drenched", "damp", "moist", "nasty", "dirty", "filthy", "smelly" ,"stinky", "fragrant", "pungent", "anime", "manga", "hentai", "kawaii", "otaku", "weeaboo", "fucking"]; var aryInterjections = ["mmm", "yes", "noo", "oh", "ha", "hah", "hahaha", "ay", "ah", "um", "hmm", "wow", "aha", "yay", "omg", "omfg", "lol", "lmao", "lmfao", "cmon", "yum", "yuck", "blah", "bleh", "meh", "eww", "bah", "gah"]; var arySubjects = ["neko", "baby", "darlin", "sweetie", "hun", "boo", "honey", "shorty", "lover", "sugar", "sugarpie", "sugarpants", "honeybun", "cutiepie", "cutie", "kitten", "doll", "princess", "hotstuff"]; var aryImperatives = ["please", "now"]; var aryPronouns = ["i", "mine", "we", "us", "they", "them", "theirs", "yours", "ours", "some", "myself", "itself", "themselves", "yourselves", "ourselves", "himself", "herself"]; var aryHostTargetedPronouns = ["he", "him", "she", "her", "his", "hers", "you", "yourself", "it","me"]; var aryAdverbs = ["very", "everywhere", "already", "really", "much", "too"]; var aryPrepositions = ["in", "out", "into", "between", "up", "on", "inside", "onto", "against", "outside", "off", "to"]; var aryCohortatives = ["lets", "let"]; var aryLinkingVerbs = ["are", "looks", "look", "were", "was", "is", "feels", "come"]; var aryAncillaryVerbs = ["want", "wish", "need"]; var aryMiscContractions = ["youd"]; var aryMiscTermsToRemove = ["pov"]; var aryDisjuncts = ["just"]; var aryUnitsOfTime = ["second", "minute", "hour", "day", "week", "month", "year"]; var aryAdverbsNegatory = ["not", "no", "never"]; var aryModalVerbs = ["can", "may", "could", "would", "should", "couldnt", "wouldnt", "neednt", "shouldnt", "couldve", "wouldve", "shouldve", "wont", "will", "must", "mustnt", "shall", "might", "did", "didnt"]; var aryConjunctions = ["and", "yet", "but", "for", "or", "so", "nor"]; var aryDeterminers = ["each", "every", "all", "these", "its", "their", "whose", "much", "many", "any"]; var aryHostTargetedDeterminers = ["your", "some", "those", "both", "a", "the", "my", "that", "this"]; var oSpellCorrect = { "heey":"hey", "heeyy":"hey", "heyy":"hey", "heya":"hey", "hii":"hi", "hhi":"hi", "hhii":"hi", "hiya":"hi", "haii":"hai", "salut":"hello", "cya":"bye", "niice":"nice", "bbc":"big black cock", "demon dick":"penis", "sec":"second", "n":"and", "fllow":"follow", "hey there":"hey", "hi there":"hi", "hi ho":"hi", "hey there":"hey", "hello there":"hello", "greetings and salutations":"greetings", "yoo":"yo", "helloo":"hello", "heello":"hello", "heelloo":"hello", "hheelloo":"hello", "aay":"ay", "aayy":"ay", "aay":"ay", "ayy":"ay", "uhg":"ugh", "uum":"um", "umm":"um", "uumm":"um", "hhm":"hmm", "hhmm":"hmm", "hrmm":"hmm", "haha":"hahaha", "hahahaha":"hahaha", "hahahahaha":"hahaha", "baha":"hahaha", "bahaha":"hahaha", "bahahaha":"hahaha", "yaay":"yay", "yaayy":"yay", "yayy":"yay", "baad":"bad", "aweful":"awful", "yuk":"yuck", "ew":"eww", "eew":"eww", "eeww":"eww", "shiirt":"shirt", "show us":"show", "show me":"show", "se":"see", "mi":"me", "camm":"cam", "hw":"how", "pvte":"private", "prvte":"private","prvt":"private", "sky pe":"skype", "sk ype":"skype", "sk yp":"skype","skyp e":"skype","skyp":"skype", "cloths":"clothes", "take off top":"remove clothes", "take off bra":"remove bra", "take off clothes":"remove clothes", "take clothes off":"remove clothes", "take your clothes off":"remove clothes", "take all your clothes off":"remove clothes", "take all of your clothes off":"remove clothes", "take off all of your clothes":"remove clothes", "take off all your clothes":"remove clothes", "take off all of your clothing":"remove clothes", "take off all your clothing":"remove clothes", "take off bottom":"remove clothes", "take off bottoms":"remove clothes", "take off pants":"remove pants", "take off shirt":"remove shirt", "take off tshirt":"remove tshirt", "take off bra":"remove bra", "take off shorts":"remove shorts", "take off socks":"remove socks", "take off panties":"remove panties", "take off your":"remove", "take off that":"remove", "take off the":"remove", "take off all":"remove", "take off those":"remove", "zoom cam":"zoom", "zoom camera":"zoom", "put close":"zoom", "zoom in":"zoom", "zoom up":"zoom", "zoom into":"zoom", "zoom in to":"zoom", "zoom out":"zoom", "zoom on":"zoom", "zoom to":"zoom", "need not":"neednt", "neednot":"neednt", "needant":"neednt", "doggie":"doggy", "doggyy":"doggy", "stick it in":"penetrate", "stick it inside":"penetrate", "stick it into":"penetrate", "stick it in to":"penetrate", "stick in":"penetrate", "get naked":"disrobe", "undress":"disrobe", "right now":"now", "shw":"show", "shoow":"show", "showw":"show", "shooww":"show", "slapp":"slap", "slaap":"slap", "sllap":"slap", "sslap":"slap", "opn":"open", "anal gape":"anal", "doo":"do", "ddo":"do", "doo":"do", "ddoo":"do", "luv":"love", "luuv":"love", "lov":"love", "loove":"love", "lv":"love", "lve":"love", "luve":"love", "lik":"like", "lk":"like", "wett":"wet", "weet":"wet", "hott":"hot", "hoot":"hot", "hhot":"hot", "ht":"hot", "sexi":"sexy", "sxy":"sexy", "seexy":"sexy", "sexxy":"sexy", "sexyy":"sexy", "sexii":"sexy", "purfect":"perfect", "puurfect":"perfect", "purrfect":"perfect", "puurrfect":"perfect", "lil":"little", "littlebit": "", "kity":"kitty", "kittie":"kitty", "kitteh":"kitten", "kiteh":"kitten", "kittenn":"kitten", "kiten":"kitten", "niko":"neko", "niiko":"neko", "neeko":"neko", "nekko":"neko", "necko":"neko", "neco":"neko", "neekko":"neko", "nekoo":"neko", "neekoo":"neko", "neekkoo":"neko", "nekolukka":"neko", "nekoluka":"neko", "neko luka":"neko", "neko lukka":"neko", "lukka":"neko", "neko chan":"neko", "nekochan":"neko", "bb":"baby", "bbyy":"baby", "bby":"baby", "babe":"baby", "bebe":"baby", "sweety":"sweetie", "shortie":"shorty", "cutie pie":"cutiepie", "ching chong":"chingchong", "showfeet":"show feet", "feetshow":"show feet", "hv":"have", "u":"you", "yuo":"you", "yoou":"you", "yyou":"you", "youu":"you", "yyoouu":"you", "yu":"you", "self":"yourself", "urself":"yourself", "urslf":"yourself", "ur":"your", "uur":"your", "urr":"your", "uurr":"your", "ir":"your", "yer":"your", "yr":"your", "you have":"youve", "uve":"youve", "uv":"youve", "you are":"youre", "your self":"yourself", "i am":"im", "going to":"gonna", "want to":"wanna", "can not":"cant", "cannot":"cant", "will not":"wont", "shant":"wont", "shall not":"wont", "have to":"must", "haveto":"must", "hafta":"must", "i would":"id", "you would":"youd", "should not":"shouldnt", "would not":"wouldnt", "could not":"couldnt", "should have":"shouldve", "should of":"shouldve", "would have":"wouldve", "would of":"wouldve", "could have":"couldve", "could of":"couldve", "must not":"mustnt", "must have":"musthv", "do not":"dont", "did not":"didnt", "is not":"isnt", "was not":"wasnt", "waanaa":"wanna", "waannaa":"wanna", "wwaannaa":"wanna", "waanna":"wanna", "r":"are", "dat":"that", "tho":"though", "thru":"through", "iit":"it", "itt":"it", "iitt":"it", "et":"it", "eet":"it", "ett":"it", "eett":"it", "mm":"mmm", "mhmm":"mmm", "mhhmm":"mmm", "mmhmm":"mmm", "mmhhmm":"mmm", "mhm":"mmm", "mmhhm":"mmm", "hmm":"mmm", "hhmm":"mmm", "mmhh":"mmm", "yus":"yes", "yas":"yes", "yaas":"yes", "yuss":"yes", "yuuss":"yes", "yees":"yes", "yyes":"yes", "yess":"yes", "yyeess":"yes", "yeah":"yes", "yah":"yes", "yaah":"yes", "yeh":"yes", "yeeh":"yes", "yeehh":"yes", "yehh":"yes", "ooh":"oh", "ohh":"oh", "oohh":"oh", "ow":"oh", "oow":"oh", "ooww":"oh", "oo":"oh", "aah":"ah", "ahh":"ah", "aahh":"ah", "woow":"wow", "wwow":"wow", "wwooww":"wow", "woww":"wow", "wooww":"wow", "yuum":"yum", "yumm":"yum", "yuummm":"yum", "pleease":"please", "pleasse":"please", "pleez":"please", "pleeze":"please", "pleezz":"please", "plezz":"please", "plez":"please", "plz":"please", "pllz":"please", "pls":"please", "plls":"please", "plzz":"please", "plss":"please", "ppllzz":"please", "ppllss":"please", "pleace":"please", "liss":"please", "pliz":"please", "pl":"please", "pliss":"please", "pleas":"please", "pleaz":"please", "pleasee":"please", "plsl":"please", "pkease":"please", "plase":"please", "noow":"now", "noww":"now", "nooww":"now", "nnow":"now", "nnooww":"now", "right now":"now", "right meow":"now", "okie dokie":"okay", "okie":"okay", "ok":"okay", "k":"okay", "oki":"okay", "okk":"okay","ook":"okay", "ookk":"okay", "ookkii":"okay", "okii":"okay", "panty":"panties", "ass hole":"anus", "butthole":"anus", "butt hole":"anus", "asshole":"anus", "anus hole":"anus", "ahole":"anus", "ashole":"anus", "pussy lips":"pussy", "vag":"vagina", "vagg":"vagina", "vaag":"vagina", "vaagg":"vagina", "pussy hole":"pussy", "py":"pussy", "psy":"pussy", "pussi":"pussy", "pusse":"pussy", "pussie":"pussy", "puusy":"pussy", "upssy":"pussy", "pussyy":"pussy", "puussy":"pussy", "ppuussyy":"pussy", "puussyy":"pussy", "pusst":"pussy", "pussu":"pussy", "pusy":"pussy", "posse":"pussy", "puthey":"pussy", "puss":"pussy", "pus":"pussy", "twat":"vagina", "cunt":"vagina", "slit":"vagina", "vulva":"vagina", "kunt":"vagina", "clit":"clitoris", "clit":"clitorus", "klit":"clitorus", "cock":"penis", "dick":"penis", "dickk":"penis", "dck":"penis", "ding ding":"penis", "peen":"penis", "dong":"penis", "ding dong":"penis", "nippls":"nipples", "nips":"nipples", "nipps":"nipples", "niples":"nipples", "nippl":"nipple", "nip":"nipple", "nipp":"nipple", "niple":"nipple", "fet":"feet", "ft":"feet", "ffet":"feet", "ffeet":"feet", "feett":"feet", "ffeett":"feet", "boobss":"boobs", "tits":"boobs", "chest":"boobs", "breasts":"boobs", "tit":"boob", "breast":"boob", "boobies":"boobs", "titys":"boobs", "titis":"boobs", "tittss":"boobs", "tiittss":"boobs", "tittis":"boobs", "b00bs":"boobs", "b00b":"boob", "bobs":"boobs", "aass":"ass", "aas":"ass", "a$$":"ass", "shitter":"ass", "pooper":"ass", "butt":"ass", "buttocks":"ass", "buttock":"ass", "buutt":"ass", "tonuge":"tongue", "tougne":"tongue", "tonge":"tongue", "tung":"tongue", "tongeu":"tongue", "tuung":"tongue", "toongue":"tongue", "tonguue":"tongue", "tonguee":"tongue", "toonguuee":"tongue", "toonguue":"tongue", "toungue":"tongue", "tounge":"tongue", "arm pit":"armpit", "fingerz":"fingers", "fingees":"fingers", "succkk":"suck", "suucckk":"suck", "ssuucckk":"suck", "suuck":"suck", "suckk":"suck", "suuckk":"suck", "cuum":"cum", "ccum":"cum", "cumm":"cum", "ccuum":"cum", "cuumm":"cum", "ccuumm":"cum", "masterbate":"masturbate", "jerk off":"masturbate", "jack off":"masturbate", "jackoff":"masturbate", "jill off":"masturbate", "finger kitty":"masturbate", "toss off":"masturbate", "fingerblast":"finger", "fingerbang":"finger", "finger blast":"finger", "finger bang":"finger", "rrub":"rub", "ruub":"rub", "rubb":"rub", "kitten tongue":"tongue", "kitty tongue":"tongue", "cat tongue":"tongue", "machn":"machine", "machin":"machine", "machin":"machine", "fuck machine":"fmachine", "f machine":"fmachine", "tongue it":"lick it", "tongue that":"lick that", "tongue the":"lick the", "tongue her":"lick her", "tongue his":"lick his", "giv":"give", "give me":"show me", "give your":"show your", "can i see":"lemmesee", "may i see":"lemmesee", "can we see":"lemmesee", "may we see":"lemmesee", "can i view":"lemmesee", "may i view":"lemmesee", "lets see":"lemmesee", "let us see":"lemmesee", "let me see":"lemmesee", "lemme see":"lemmesee", "leme see":"lemmesee", "let see":"lemmesee", "could we see":"lemmesee", "could i see":"lemmesee", "shoe your":"show your", "shoe ass":"show ass", "shoe pussy":"show pussy" }; bDebugEnabled = Nekobot.message.module.silence.getDebugEnabled(); if (m.indexOf('"') === 0 && m.lastIndexOf('"') === m.length-1) { bQuotesAroundMessage = true; } if (bQuotesAroundMessage === true && (bImmuneUser === true || oMsg.in_fanclub === true)) { bImmune = true; } //m = Nekobot.message.module.silence.commonCleaner(m); iMsgWordsCount = Nekobot.global.helper.string.countWords(m); sDebug = sDebug + "Demands - Before word normalization: "+m+"\n"; /* * Symantec normilization, spell correcting and two-word-combination normilization */ var iBeg, iMid, iEnd, iLen; for (var key in oSpellCorrect) { if (oSpellCorrect.hasOwnProperty(key)) { iLen = m.length; iMid = m.indexOf(" "+key+" "); iBeg = m.indexOf(key+" "); iEnd = m.lastIndexOf(" "+key); if (iMsgWordsCount > 1) { if (m.indexOf(key) === 0 && m.length === key.length) { m = m.replace(key, oSpellCorrect[key]); //cb.sendNotice("> "+key, "", "", "#990037", "", ""); iMsgWordsCount = Nekobot.global.helper.string.countWords(m); iLen = m.length; //break; } } if (iEnd !== -1 && iEnd === iLen-(key.length+1)) { //m = m.replace(" "+key, " "+oSpellCorrect[key]); m = m.replace(new RegExp(" "+key + '$'), " "+oSpellCorrect[key]); iLen = m.length; } if (iBeg !== -1 && iBeg === 0) { m = m.replace(key+" ", oSpellCorrect[key]+" "); iLen = m.length; } if (iMid !== -1) { // Todo: limitation, won't capture two words next to each other m = m.replaceAll(" "+key+" ", " "+oSpellCorrect[key]+" "); iLen = m.length; } if (iMsgWordsCount === 1) { if (m.indexOf(key) === 0) { m = m.replace(key, oSpellCorrect[key]); //cb.sendNotice("> "+key, "", "", "#990037", "", ""); iMsgWordsCount = Nekobot.global.helper.string.countWords(m); iLen = m.length; break; } } } } // check for determiners for use in edge-cases like "dat ass" when distillation reduces word count to a single silencable noun (a determiner will spare it) for (var j = 0; j < aryDeterminers.length; j++) { sReEsc = Nekobot.global.helper.string.escRe(aryDeterminers[j]); re = Nekobot.global.helper.string.makeRe(sReEsc); if (re.test(m) === true) { bFoundDeterminer = true; break; } } for (var j = 0; j < aryHostTargetedDeterminers.length; j++) { sReEsc = Nekobot.global.helper.string.escRe(aryHostTargetedDeterminers[j]); re = Nekobot.global.helper.string.makeRe(sReEsc); if (re.test(m) === true) { bFoundDeterminer = true; break; } } //cb.sendNotice("> "+m, "", "", "#990037", "", ""); sDebug = sDebug + "Demands - After word normalization: "+m+"\n"; // immunity for asking for price if (m.indexOf("how much") !== -1 || m.indexOf("how many") !== -1 || m.indexOf("tokens") !== -1 || m.indexOf("price") !== -1 || m.indexOf("cost") !== -1) { bImmune = true; } // immunity for basic compliments if (m.indexOf("i love") !== -1 || m.indexOf("i like") !== -1 || m.indexOf("i enjoy") !== -1) { // first line of defense, we'll check more later bImmune = true; } if (m.indexOf("love how") !== -1 || m.indexOf("like how") !== -1) { // first line of defense, we'll check more later bImmune = true; } if (m.indexOf("love your") !== -1 || m.indexOf("like your") !== -1 || m.indexOf("enjoying your") !== -1) { // first line of defense, we'll check more later bImmune = true; } if (m.indexOf("you love") !== -1 || m.indexOf("you like") !== -1 || m.indexOf("you enjoy") !== -1) { // first line of defense, we'll check more later bImmune = true; } if (m.indexOf("you look") !== -1 || m.indexOf("you are") !== -1) { // first line of defense, we'll check more later bImmune = true; } if (m.indexOf("youve") !== -1) { // first line of defense, we'll check more later bImmune = true; } if (m.indexOf("youd") !== -1) { // first line of defense, we'll check more later bImmune = true; } // immunity for expressing desire to do something (is not a demand but may be silenced at the discretion of a mod) if (m.indexOf("id love") !== -1 || m.indexOf("id like") !== -1 || m.indexOf("id be") !== -1) { // first line of defense, we'll check more later bImmune = true; } // immunity for expressing desire to do somthing or suggesting an action (is not a demand but may be silenced at the discretion of a mod) if (m.indexOf("wish to") !== -1) { // first line of defense, we'll check more later bImmune = true; } if (m.indexOf("i would") !== -1) { // first line of defense, we'll check more later bImmune = true; } if (m.indexOf("we would") !== -1) { // first line of defense, we'll check more later bImmune = true; } if (m.indexOf("they would") !== -1) { // first line of defense, we'll check more later bImmune = true; } if (m.indexOf("she would") !== -1) { // first line of defense, we'll check more later bImmune = true; } if (m.indexOf("he would") !== -1) { // first line of defense, we'll check more later bImmune = true; } if (m.indexOf("i should") !== -1) { // okay to talk about themselves bImmune = true; } if (m.indexOf("we should") !== -1) { // okay to suggest bImmune = true; } if (m.indexOf("it would") !== -1 || m.indexOf("that would") !== -1) { // first line of defense, we'll check more later bImmune = true; } if (m.indexOf("it could") !== -1 || m.indexOf("that could") !== -1) { // first line of defense, we'll check more later bImmune = true; } if (m.indexOf("they could") !== -1 || m.indexOf("he could") !== -1 || m.indexOf("she could") !== -1) { // first line of defense, we'll check more later bImmune = true; } if (m.indexOf("would i") !== -1 || m.indexOf("should i") !== -1) { // first line of defense, we'll check more later bImmune = true; } if (m.indexOf("would we") !== -1 || m.indexOf("should we") !== -1) { // first line of defense, we'll check more later bImmune = true; } if (m.indexOf("perhaps") !== -1 || m.indexOf("maybe") !== -1) { // first line of defense, we'll check more later bImmune = true; } if (m.indexOf("would you") !== -1 || m.indexOf("should you") !== -1) { // first line of defense, we'll check more later bImmune = true; } if (m.indexOf("do you") !== -1 || m.indexOf("does she") !== -1 || m.indexOf("does neko") !== -1) { // first line of defense, we'll check more later bImmune = true; } if (m.indexOf("does it") !== -1) { // first line of defense, we'll check more later bImmune = true; } /* if (m.indexOf("will you") !== -1) { // first line of defense, we'll check more later bImmune = true; } */ /* if (m.indexOf("can you") !== -1) { // first line of defense, we'll check more later bImmune = true; } */ /* if (m.indexOf("might you") !== -1) { // first line of defense, we'll check more later bImmune = true; } */ if (m.indexOf("may you") !== -1) { // first line of defense, we'll check more later bImmune = true; } if (m.indexOf("will i") !== -1) { // first line of defense, we'll check more later bImmune = true; } if (m.indexOf("shouldnt") !== -1 || m.indexOf("couldnt") !== -1 || m.indexOf("wouldnt") !== -1) { // first line of defense, we'll check more later bImmune = true; } if (m.indexOf("neednt") !== -1) { // first line of defense, we'll check more later bImmune = true; } if (m.indexOf("wont") !== -1 || m.indexOf("dont") !== -1 || m.indexOf("cant") !== -1) { // first line of defense, we'll check more later bImmune = true; } if (m.indexOf("didnt") !== -1 || m.indexOf("did") !== -1) { // first line of defense, we'll check more later bImmune = true; } if (m.indexOf("when") !== -1 || m.indexOf("why") !== -1) { // questions will be immune bImmune = true; } if (m.indexOf("how ") === 0) { // questions will be immune bImmune = true; } if (m.indexOf("love to ") === 0 || m.indexOf("like to ") === 0 || m.indexOf("wanna ") === 0) { // declaration immune bImmune = true; } if (m.indexOf("where") !== -1 || m.indexOf("what") !== -1) { // questions will be immune bImmune = true; } if (m.indexOf("is that") !== -1 || m.indexOf("is there") !== -1) { // questions will be immune bImmune = true; } if (m.indexOf("isnt") !== -1 || m.indexOf("is there") !== -1 || m.indexOf("was there") !== -1 || m.indexOf("were there") !== -1) { // questions will be immune bImmune = true; } if (m.indexOf("are you") !== -1 || m.indexOf("were you") !== -1 || m.indexOf("are they") !== -1) { // questions will be immune bImmune = true; } /* if (m.indexOf("can i") !== -1 || m.indexOf("may i") !== -1) { // questions will be immune bImmune = true; } */ /* if (m.indexOf("can we") !== -1 || m.indexOf("may we") !== -1) { // questions will be immune bImmune = true; } */ if (m.indexOf("can they") !== -1 || m.indexOf("may they") !== -1) { // questions will be immune bImmune = true; } if (m.indexOf("can he") !== -1 || m.indexOf("may he") !== -1) { // questions will be immune bImmune = true; } if (m.indexOf("can she") !== -1 || m.indexOf("may she") !== -1) { // questions will be immune bImmune = true; } if (m.indexOf("she ever") !== -1) { // questions will be immune bImmune = true; } if (m.indexOf("can it") !== -1 || m.indexOf("may it") !== -1) { // questions will be immune bImmune = true; } if (m.indexOf("you wanna") !== -1 || m.indexOf("you gonna") !== -1) { // questions will be immune bImmune = true; } if (m.indexOf("i wonder") !== -1 || m.indexOf("i question") !== -1 || m.indexOf("question") !== -1) { // questions will be immune bImmune = true; } if (m.indexOf("you wonder") !== -1 || m.indexOf("you question") !== -1) { // questions will be immune bImmune = true; } if (m.indexOf("i wanna") !== -1) { // questions will be immune bImmune = true; } if (m.indexOf("wanna") !== -1) { // immune bImmune = true; } if (m.indexOf("is getting") !== -1) { // immune bImmune = true; } if (m.indexOf("do it") !== -1) { bImmune = true; } sDebug = sDebug + "Demands - After immunity checks: bImmune: "+bImmune+"\n"; //cb.sendNotice("> "+m+" - Imunity: "+bImmune, "", "", "#990037", "", ""); aryM = m.split(" "); aryM = aryM.filter(function(el) { // remove irrelevant modal verbs return aryModalVerbs.indexOf(el) < 0; }); m = aryM.join(" "); iMsgWordsCount = Nekobot.global.helper.string.countWords(m); if (bImmune === false) { aryM = m.split(" "); aryM = aryM.filter(function ( el ) { // remove irrelevant misc terms return aryMiscTermsToRemove.indexOf( el ) < 0; }); aryM = aryM.filter(function ( el ) { // remove irrelevant greetings return aryGreetings.indexOf( el ) < 0; }); aryM = aryM.filter(function ( el ) { // remove irrelevant conjunctions return aryConjunctions.indexOf( el ) < 0; }); aryM = aryM.filter(function ( el ) { // remove irrelevant adverbs return aryAdverbs.indexOf( el ) < 0; }); aryM = aryM.filter(function ( el ) { // remove irrelevant Interjections return aryInterjections.indexOf( el ) < 0; }); aryM = aryM.filter(function ( el ) { // remove irrelevant cohortatives return aryCohortatives.indexOf( el ) < 0; }); aryM = aryM.filter(function ( el ) { // remove irrelevant ancillary verbs return aryAncillaryVerbs.indexOf( el ) < 0; }); aryM = aryM.filter(function ( el ) { // remove irrelevant disjuncts return aryDisjuncts.indexOf( el ) < 0; }); aryM = aryM.filter(function ( el ) { // remove irrelevant linking verbs return aryLinkingVerbs.indexOf( el ) < 0; }); aryM = aryM.filter(function ( el ) { // remove irrelevant ancillary nouns return aryAncillaryNouns.indexOf( el ) < 0; }); aryM = aryM.filter(function ( el ) { // remove irrelevant misc contractions return aryMiscContractions.indexOf( el ) < 0; }); aryM = aryM.filter(function ( el ) { // remove irrelevant units of time return aryUnitsOfTime.indexOf( el ) < 0; }); aryM = aryM.filter(function (el) { // remove irrelevant subjects return arySubjects.indexOf(el) < 0; }); m = aryM.join(" "); iMsgWordsCount = Nekobot.global.helper.string.countWords(m); /* * If only two words now, check for a noun and imperative (no verb needed, this is clearly a demand) */ if (iMsgWordsCount === 2) { for (var j = 0; j < aryNouns.length; j++) { sReEsc = Nekobot.global.helper.string.escRe(aryNouns[j]); re = Nekobot.global.helper.string.makeRe(sReEsc); if (re.test(m) === true) { bFoundNoun = true; break; } } for (var j = 0; j < aryImperatives.length; j++) { sReEsc = Nekobot.global.helper.string.escRe(aryImperatives[j]); re = Nekobot.global.helper.string.makeRe(sReEsc); if (re.test(m) === true) { bFoundImperative = true; break; } } if (bFoundNoun === true && bFoundImperative === true) { Nekobot.message.module.silence.addSilencedUser(oMsg, undefined, undefined, false, "demands"); Nekobot.message.module.silence.sendSilencedNotice(oMsg, "demands", true, m, bIsMod, bIsRoomCreator); if (bImmuneUser === false) { oMsg.m = ""; oMsg["X-Spam"] = true; } bFoundDemand = true; } } if (iMsgWordsCount === 3) { for (var j = 0; j < aryNouns.length; j++) { sReEsc = Nekobot.global.helper.string.escRe(aryNouns[j]); re = Nekobot.global.helper.string.makeRe(sReEsc); if (re.test(m) === true) { bFoundNoun = true; break; } } for (var j = 0; j < aryImperatives.length; j++) { sReEsc = Nekobot.global.helper.string.escRe(aryImperatives[j]); re = Nekobot.global.helper.string.makeRe(sReEsc); if (re.test(m) === true) { bFoundImperative = true; break; } } for (var j = 0; j < aryHostTargetedDeterminers.length; j++) { sReEsc = Nekobot.global.helper.string.escRe(aryHostTargetedDeterminers[j]); re = Nekobot.global.helper.string.makeRe(sReEsc); if (re.test(m) === true) { bFoundHostTargetedDeterminer = true; break; } } if (bFoundNoun === true && bFoundImperative === true && bFoundHostTargetedDeterminer === true) { Nekobot.message.module.silence.addSilencedUser(oMsg, undefined, undefined, false, "demands"); Nekobot.message.module.silence.sendSilencedNotice(oMsg, "demands", true, m, bIsMod, bIsRoomCreator); if (bImmuneUser === false) { oMsg.m = ""; oMsg["X-Spam"] = true; } bFoundDemand = true; } } aryM = aryM.filter(function ( el ) { // remove irrelevant imperatives return aryImperatives.indexOf( el ) < 0; }); //sDebug = sDebug + "Demands - After subject removal: " + aryM.join(" ") + "\n"; m = aryM.join(" "); iMsgWordsCount = Nekobot.global.helper.string.countWords(m); sDebug = sDebug + "Demands - Before prepositions removal: "+m+"\n"; /* * Find two word "<noun> off" use-cases */ if (iMsgWordsCount === 2) { for (var j = 0; j < aryNouns.length; j++) { sReEsc = Nekobot.global.helper.string.escRe(aryNouns[j]); re = Nekobot.global.helper.string.makeRe(sReEsc); if (re.test(m) === true) { bFoundNoun = true; break; } } bFoundPreposition = m.indexOf("off") === -1 ? false : true; if (bFoundNoun === true && bFoundPreposition === true) { Nekobot.message.module.silence.addSilencedUser(oMsg, undefined, undefined, false, "demands"); Nekobot.message.module.silence.sendSilencedNotice(oMsg, "demands", true, m, bIsMod, bIsRoomCreator); if (bImmuneUser === false) { oMsg.m = ""; oMsg["X-Spam"] = true; } bFoundDemand = true; } } /* * Find common hard to catch phrases in the form of "take <noun> off" */ if (iMsgWordsCount >= 3 && iMsgWordsCount <= 4) { bFoundTake = m.indexOf("take") === -1 ? false : true; for (var j = 0; j < aryNouns.length; j++) { sReEsc = Nekobot.global.helper.string.escRe(aryNouns[j]); re = Nekobot.global.helper.string.makeRe(sReEsc); if (re.test(m) === true) { bFoundNoun = true; break; } } bFoundPreposition = m.indexOf("off") === -1 ? false : true; if (bFoundNoun === true && bFoundPreposition === true && bFoundTake === true) { Nekobot.message.module.silence.addSilencedUser(oMsg, undefined, undefined, false, "demands"); Nekobot.message.module.silence.sendSilencedNotice(oMsg, "demands", true, m, bIsMod, bIsRoomCreator); if (bImmuneUser === false) { oMsg.m = ""; oMsg["X-Spam"] = true; } bFoundDemand = true; } } /* * Find common hard to catch phrases whil we still have propositions */ if(m === "take it off" || m === "take it all off" || m === "go quick" || m === "go fast" || m === "go faster") { Nekobot.message.module.silence.addSilencedUser(oMsg, undefined, undefined, false, "demands"); Nekobot.message.module.silence.sendSilencedNotice(oMsg, "demands", true, m, bIsMod, bIsRoomCreator); if (bImmuneUser === false) { oMsg.m = ""; oMsg["X-Spam"] = true; } bFoundDemand = true; } if (bFoundDemand === false) { aryM = aryM.filter(function (el) { // remove irrelevant prepositions return aryPrepositions.indexOf(el) < 0; }); sDebug = sDebug + "Demands - After most parts of speech removal: " + aryM.join(" ") + "\n"; aryM = aryM.filter(function (el) { // remove host targeted determiners return aryHostTargetedDeterminers.indexOf(el) < 0; }); aryM = aryM.filter(function (el) { // remove host targeted pronouns return aryHostTargetedPronouns.indexOf(el) < 0; }); m = aryM.join(" "); sDebug = sDebug + "Demands - After host-targeted pronouns and determiners removal: "+m+"\n"; } m = aryM.join(" "); iMsgWordsCount = Nekobot.global.helper.string.countWords(m); //aryM = aryM.filter(function ( el ) { // remove non host targeted determiners // return aryDeterminers.indexOf( el ) < 0; //}); //aryM = aryM.filter(function ( el ) { // remove non host targeted pronouns // return aryPronouns.indexOf( el ) < 0; //}); iMsgWordsCount = Nekobot.global.helper.string.countWords(m); sDebug = sDebug + "Demands - After non host targeted pronouns and determiners: "+m+"\n"; //cb.sendNotice("> "+m, "", "", "#990037", "", ""); // Todo: need to add edge case is someone says "do it" combined with another verb noun pair. E.g., "suck it do it now" slips by the engine. Even phrases like "suck it fuck it" will need some kind of recursive phase checking. if (bFoundDemand === false) { /* * Check for two-to-eight word messages that have one or more adjectives and a noun but no verb (it's usually a compliment and we won't silence) */ if (iMsgWordsCount <= 8 && iMsgWordsCount >= 2) { //cb.sendNotice("Nekobot Silence module - demands submodule called. Got to one word logic.", "", "", "#990037", "", ""); for (var j = 0; j < aryPronouns.length; j++) { sReEsc = Nekobot.global.helper.string.escRe(aryPronouns[j]); re = Nekobot.global.helper.string.makeRe(sReEsc); if (re.test(m) === true) { bFoundNonHostTargetedPronoun = true; break; } } for (var j = 0; j < aryDeterminers.length; j++) { sReEsc = Nekobot.global.helper.string.escRe(aryDeterminers[j]); re = Nekobot.global.helper.string.makeRe(sReEsc); if (re.test(m) === true) { bFoundNonHostTargetedDeterminer = true; break; } } for (var j = 0; j < aryVerbs.length; j++) { sReEsc = Nekobot.global.helper.string.escRe(aryVerbs[j]); re = Nekobot.global.helper.string.makeRe(sReEsc); if (re.test(m) === true) { bFoundVerb = true; break; } } for (var j = 0; j < aryNouns.length; j++) { sReEsc = Nekobot.global.helper.string.escRe(aryNouns[j]); re = Nekobot.global.helper.string.makeRe(sReEsc); if (re.test(m) === true) { bFoundNoun = true; break; } } for (var j = 0; j < aryAdjectives.length; j++) { sReEsc = Nekobot.global.helper.string.escRe(aryAdjectives[j]); re = Nekobot.global.helper.string.makeRe(sReEsc); if (re.test(m) === true) { bFoundAdjective = true; break; } } for (var j = 0; j < aryPositiveVerbs.length; j++) { sReEsc = Nekobot.global.helper.string.escRe(aryPositiveVerbs[j]); re = Nekobot.global.helper.string.makeRe(sReEsc); if (re.test(m) === true) { bFoundPositiveVerb = true; break; } } for (var j = 0; j < aryPejoratives.length; j++) { sReEsc = Nekobot.global.helper.string.escRe(aryPejoratives[j]); re = Nekobot.global.helper.string.makeRe(sReEsc); if (re.test(m) === true) { bFoundPejorative = true; break; } } if (bFoundVerb === false && bFoundNoun === true && (bFoundAdjective === true || bFoundPositiveVerb === true) && bFoundPejorative === false ) { bImmune = true; } } sDebug = sDebug + "Demands - After adjective and 'compliments' immunity checking: bImmune: "+bImmune+"\n"; aryM = m.split(" "); aryM = aryM.filter(function ( el ) { // remove irrelevant adjectives return aryAdjectives.indexOf( el ) < 0; }); m = aryM.join(" "); iMsgWordsCount = Nekobot.global.helper.string.countWords(m); //cb.sendNotice("> "+m, "", "", "#990037", "", ""); sDebug = sDebug + "Demands - After removing adjectives: "+m+"\n"; if (bImmune === false) { /* * If message one word */ if (iMsgWordsCount === 1) { //cb.sendNotice("Nekobot Silence module - demands submodule called. Got to one word logic.", "", "", "#990037", "", ""); for (var i = 0; i < aryVerbsWhenSolo.length; i++) { sReEsc = Nekobot.global.helper.string.escRe(aryVerbsWhenSolo[i]); // remember to omit delimiting slashes when using RegExp re = Nekobot.global.helper.string.makeRe(sReEsc); if (re.test(m) === true) { Nekobot.message.module.silence.addSilencedUser(oMsg, undefined, undefined, false, "demands"); Nekobot.message.module.silence.sendSilencedNotice(oMsg, "demands", true, m, bIsMod, bIsRoomCreator); if (bImmuneUser === false) { oMsg.m = ""; oMsg["X-Spam"] = true; } bCriteriaMet = true; break; } } if (bCriteriaMet === false) { for (var i = 0; i < aryNounsWhenSolo.length; i++) { sReEsc = Nekobot.global.helper.string.escRe(aryNounsWhenSolo[i]); re = Nekobot.global.helper.string.makeRe(sReEsc); if (re.test(m) === true) { if (bFoundDeterminer === false) { // if not spared from finding a determiner before the reduction. e.g., "dat ass" ("that ass" after spell correction) Nekobot.message.module.silence.addSilencedUser(oMsg, undefined, undefined, false, "demands"); Nekobot.message.module.silence.sendSilencedNotice(oMsg, "demands", true, m, bIsMod, bIsRoomCreator); if (bImmuneUser === false) { oMsg.m = ""; oMsg["X-Spam"] = true; } bCriteriaMet = true; break; } } } } if (bCriteriaMet === false) { for (var i = 0; i < aryPejoratives.length; i++) { sReEsc = Nekobot.global.helper.string.escRe(aryPejoratives[i]); re = Nekobot.global.helper.string.makeRe(sReEsc); if (re.test(m) === true) { Nekobot.message.module.silence.addSilencedUser(oMsg, undefined, undefined, false, "pejorative" ); Nekobot.message.module.silence.sendSilencedNotice(oMsg, "a term of abuse! Banning recommended!", true, undefined, bIsMod, bIsRoomCreator); if (bImmuneUser === false) { oMsg.m = ""; oMsg["X-Spam"] = true; } bCriteriaMet = true; break; } } } } else { if (iMsgWordsCount == 2) { for (var j = 0; j < aryPronouns.length; j++) { sReEsc = Nekobot.global.helper.string.escRe(aryPronouns[j]); re = Nekobot.global.helper.string.makeRe(sReEsc); if (re.test(m) === true) { bFoundNonHostTargetedPronoun = true; break; } } for (var j = 0; j < aryDeterminers.length; j++) { sReEsc = Nekobot.global.helper.string.escRe(aryDeterminers[j]); re = Nekobot.global.helper.string.makeRe(sReEsc); if (re.test(m) === true) { bFoundNonHostTargetedDeterminer = true; break; } } for (var j = 0; j < aryVerbs.length; j++) { sReEsc = Nekobot.global.helper.string.escRe(aryVerbs[j]); re = Nekobot.global.helper.string.makeRe(sReEsc); if (re.test(m) === true) { if (aryVerbs[j] === "do") { bVerbIsDo = true; } iVerbIndex = m.indexOf(aryVerbs[j]); bFoundVerb = true; break; } } for (var j = 0; j < aryNouns.length; j++) { sReEsc = Nekobot.global.helper.string.escRe(aryNouns[j]); re = Nekobot.global.helper.string.makeRe(sReEsc); if (re.test(m) === true) { if (aryNouns[j] === "it") { bNounIsIt = true; } iNounIndex = m.indexOf(aryNouns[j]); bFoundNoun = true; break; } } for (var j = 0; j < aryPrepositions.length; j++) { sReEsc = Nekobot.global.helper.string.escRe(aryPrepositions[j]); re = Nekobot.global.helper.string.makeRe(sReEsc); if (re.test(m) === true) { bFoundPreposition = true; break; } } for (var j = 0; j < aryPejoratives.length; j++) { sReEsc = Nekobot.global.helper.string.escRe(aryPejoratives[j]); re = Nekobot.global.helper.string.makeRe(sReEsc); if (re.test(m) === true) { bFoundPejorative = true; break; } } if ((bFoundVerb === true && (bFoundNoun === true || bFoundPejorative === true || bFoundPreposition === true) && (bFoundNonHostTargetedPronoun === false && bFoundNonHostTargetedDeterminer === false))) { if (bVerbIsDo === true && bNounIsIt === true) { // } else { if (bFoundPejorative === true) { Nekobot.message.module.silence.addSilencedUser(oMsg, undefined, undefined, false, "pejorative"); Nekobot.message.module.silence.sendSilencedNotice(oMsg, "a term of abuse! Banning recommended.", true, oMsg.m, bIsMod, bIsRoomCreator); } else { if ((iVerbIndex === -1 || iNounIndex === -1) || iVerbIndex < iNounIndex) { Nekobot.message.module.silence.addSilencedUser(oMsg, undefined, undefined, false, "demands"); Nekobot.message.module.silence.sendSilencedNotice(oMsg, "demands", true, m, bIsMod, bIsRoomCreator); } } if (bImmuneUser === false) { oMsg.m = ""; oMsg["X-Spam"] = true; } } } } else { if (iMsgWordsCount === 3) { for (var j = 0; j < aryPronouns.length; j++) { sReEsc = Nekobot.global.helper.string.escRe(aryPronouns[j]); re = Nekobot.global.helper.string.makeRe(sReEsc); if (re.test(m) === true) { bFoundNonHostTargetedPronoun = true; break; } } for (var j = 0; j < aryDeterminers.length; j++) { sReEsc = Nekobot.global.helper.string.escRe(aryDeterminers[j]); re = Nekobot.global.helper.string.makeRe(sReEsc); if (re.test(m) === true) { bFoundNonHostTargetedDeterminer = true; break; } } for (var j = 0; j < aryVerbs.length; j++) { sReEsc = Nekobot.global.helper.string.escRe(aryVerbs[j]); re = Nekobot.global.helper.string.makeRe(sReEsc); if (re.test(m) === true) { if (aryVerbs[j] === "do") { bVerbIsDo = true; } bFoundVerb = true; break; } } for (var j = 0; j < aryNouns.length; j++) { sReEsc = Nekobot.global.helper.string.escRe(aryNouns[j]); re = Nekobot.global.helper.string.makeRe(sReEsc); if (re.test(m) === true) { if (aryNouns[j] === "it") { bNounIsIt = true; } bFoundNoun = true; break; } } for (var j = 0; j < aryPrepositions.length; j++) { sReEsc = Nekobot.global.helper.string.escRe(aryPrepositions[j]); re = Nekobot.global.helper.string.makeRe(sReEsc); if (re.test(m) === true) { bFoundPreposition = true; break; } } for (var j = 0; j < aryAdverbsNegatory.length; j++) { sReEsc = Nekobot.global.helper.string.escRe(aryAdverbsNegatory[j]); re = Nekobot.global.helper.string.makeRe(sReEsc); if (re.test(m) === true) { bFoundNegatoryAdverb = true; break; } } for (var j = 0; j < aryPejoratives.length; j++) { sReEsc = Nekobot.global.helper.string.escRe(aryPejoratives[j]); re = Nekobot.global.helper.string.makeRe(sReEsc); if (re.test(m) === true) { bFoundPejorative = true; break; } } if (((bFoundVerb === true && (bFoundNoun === true || bFoundPejorative === true || bFoundPreposition === true)) && bFoundNegatoryAdverb === false) && (bFoundNonHostTargetedPronoun === false && bFoundNonHostTargetedDeterminer === false)) { if (bVerbIsDo === true && bNounIsIt === true) { // } else { if (bFoundPejorative === true) { Nekobot.message.module.silence.addSilencedUser(oMsg, undefined, undefined, false, "pejorative"); Nekobot.message.module.silence.sendSilencedNotice(oMsg, "a term of abuse! Banning recommended.", true, oMsg.m, bIsMod, bIsRoomCreator); } else { Nekobot.message.module.silence.addSilencedUser(oMsg, undefined, undefined, false, "demands"); Nekobot.message.module.silence.sendSilencedNotice(oMsg, "demands", true, m, bIsMod, bIsRoomCreator); } if (bImmuneUser === false) { oMsg.m = ""; oMsg["X-Spam"] = true; } } } } else { if (iMsgWordsCount === 4) { for (var j = 0; j < aryPronouns.length; j++) { sReEsc = Nekobot.global.helper.string.escRe(aryPronouns[j]); re = Nekobot.global.helper.string.makeRe(sReEsc); if (re.test(m) === true) { bFoundNonHostTargetedPronoun = true; break; } } for (var j = 0; j < aryDeterminers.length; j++) { sReEsc = Nekobot.global.helper.string.escRe(aryDeterminers[j]); re = Nekobot.global.helper.string.makeRe(sReEsc); if (re.test(m) === true) { bFoundNonHostTargetedDeterminer = true; break; } } for (var j = 0; j < aryVerbs.length; j++) { sReEsc = Nekobot.global.helper.string.escRe(aryVerbs[j]); re = Nekobot.global.helper.string.makeRe(sReEsc); if (re.test(m) === true) { if (aryVerbs[j] === "do") { bVerbIsDo = true; } bFoundVerb = true; break; } } for (var j = 0; j < aryNouns.length; j++) { sReEsc = Nekobot.global.helper.string.escRe(aryNouns[j]); re = Nekobot.global.helper.string.makeRe(sReEsc); if (re.test(m) === true) { if (aryNouns[j] === "it") { bNounIsIt = true; } bFoundNoun = true; break; } } for (var j = 0; j < aryPrepositions.length; j++) { sReEsc = Nekobot.global.helper.string.escRe(aryPrepositions[j]); re = Nekobot.global.helper.string.makeRe(sReEsc); if (re.test(m) === true) { bFoundPreposition = true; break; } } for (var j = 0; j < aryAdverbsNegatory.length; j++) { sReEsc = Nekobot.global.helper.string.escRe(aryAdverbsNegatory[j]); re = Nekobot.global.helper.string.makeRe(sReEsc); if (re.test(m) === true) { bFoundNegatoryAdverb = true; break; } } for (var j = 0; j < aryPejoratives.length; j++) { sReEsc = Nekobot.global.helper.string.escRe(aryPejoratives[j]); re = Nekobot.global.helper.string.makeRe(sReEsc); if (re.test(m) === true) { bFoundPejorative = true; break; } } if ((bFoundVerb === true && (bFoundNoun === true || bFoundPejorative === true || bFoundPreposition === true)) && bFoundNegatoryAdverb === false) { if (bVerbIsDo === true && bNounIsIt === true) { // } else { if (bFoundPejorative === true) { Nekobot.message.module.silence.addSilencedUser(oMsg, undefined, undefined, false, "pejorative"); Nekobot.message.module.silence.sendSilencedNotice(oMsg, "a very uncalled for term of abuse! Banning recommended.", true, oMsg.m, bIsMod, bIsRoomCreator); } else { Nekobot.message.module.silence.addSilencedUser(oMsg, undefined, undefined, false, "demands", bIsMod, bIsRoomCreator); Nekobot.message.module.silence.sendSilencedNotice(oMsg, "demands", true, m); } if (bImmuneUser === false) { oMsg.m = ""; oMsg["X-Spam"] = true; } } } } else { if (iMsgWordsCount >= 5) { } } } } } } } } if (iMsgWordsCount > 1) { sDebug = sDebug + "Demands - Found flags - bFoundNegatoryAdverb: "+bFoundNegatoryAdverb+" bFoundNonHostTargetedDeterminer: "+bFoundNonHostTargetedDeterminer+" bFoundNonHostTargetedPronoun: "+bFoundNonHostTargetedPronoun+" bFoundVerb: "+bFoundVerb+" bFoundDeterminer: "+bFoundDeterminer+" bFoundNoun: "+bFoundNoun+" bFoundPreposition: "+bFoundPreposition+" bFoundPejorative: "+bFoundPejorative+" - iMsgWordsCount: "+iMsgWordsCount+" - bQuotesAroundMessage: "+bQuotesAroundMessage+" - bImmuneUser: "+bImmuneUser+" - iVerbIndex: "+iVerbIndex+" - iNounIndex: "+iNounIndex+"\n"; } else { sDebug = sDebug + "Demands - Found flags - bFoundDeterminer: "+bFoundDeterminer+" - iMsgWordsCount: "+iMsgWordsCount+" - bQuotesAroundMessage: "+bQuotesAroundMessage+" - bImmuneUser: "+bImmuneUser+"\n"; } if (bDebugEnabled === true) { if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice(sDebug, "sypunk", "#ffff00", "#888800", "", ""); } } return oMsg; }, lewd: function (oMsg, bIsRoomCreator) { //cb.sendNotice("Nekobot Silence module - lewd submodule called.", "", "", "#990037", "", ""); return oMsg; }, nonenglish: function (oMsg, bIsRoomCreator) { //cb.sendNotice("Nekobot Silence module - nonenglish submodule called.", "", "", "#990037", "", ""); return oMsg; }, poorgrammar: function (oMsg, bIsRoomCreator) { //cb.sendNotice("Nekobot Silence module - poorgrammar submodule called.", "", "", "#990037", "", ""); return oMsg; }, repetitious: function (oMsg, bIsRoomCreator) { //cb.sendNotice("Nekobot Silence module - repetitious submodule called.", "", "", "#990037", "", ""); return oMsg; }, stickykeys: function (oMsg, bIsRoomCreator) { //cb.sendNotice("Nekobot Silence module - stickykeys submodule called.", "", "", "#990037", "", ""); return oMsg; }, bb: function (oMsg, bIsRoomCreator) { //cb.sendNotice("Nekobot Silence module - bb submodule called.", "", "", "#990037", "", ""); return oMsg; }, irksomewordlist: function (oMsg, bIsRoomCreator) { //cb.sendNotice("Nekobot Silence module - irksomewordlist submodule called.", "", "", "#990037", "", ""); return oMsg; }, alltermsofendearment: function (oMsg, bIsRoomCreator) { //cb.sendNotice("Nekobot Silence module - alltermsofendearment submodule called.", "", "", "#990037", "", ""); return oMsg; }, unwantedtermsofendearment: function (oMsg, bIsRoomCreator) { //cb.sendNotice("Nekobot Silence module - unwantedtermsofendearment submodule called.", "", "", "#990037", "", ""); return oMsg; }, hostmisspellings: function (oMsg, bIsRoomCreator) { //cb.sendNotice("Nekobot Silence module - hostmisspellings submodule called.", "", "", "#990037", "", ""); return oMsg; }, staffmisspellings: function (oMsg, bIsRoomCreator) { //cb.sendNotice("Nekobot Silence module - staff submodule called.", "", "", "#990037", "", ""); return oMsg; }, underageproclaimers: function (oMsg, bIsRoomCreator) { //cb.sendNotice("Nekobot Silence module - underageproclaimers submodule called.", "", "", "#990037", "", ""); return oMsg; }, faqs: function (oMsg, bIsRoomCreator) { //cb.sendNotice("Nekobot Silence module - faq submodule called.", "", "", "#990037", "", ""); return oMsg; }, wordy: function (oMsg, bIsRoomCreator) { //cb.sendNotice("Nekobot Silence module - wordy submodule called.", "", "", "#990037", "", ""); return oMsg; }, watchlist: function (oMsg, bIsRoomCreator) { //cb.sendNotice("Nekobot Silence module - watchlist submodule called.", "", "", "#990037", "", ""); return oMsg; }, offenderlist: function (oMsg, bIsRoomCreator) { //cb.sendNotice("Nekobot Silence module - offenderlist submodule called.", "", "", "#990037", "", ""); return oMsg; }, banlist: function (oMsg, bIsRoomCreator) { //cb.sendNotice("Nekobot Silence module - banlist submodule called.", "", "", "#990037", "", ""); return oMsg; }, allgraphics: function (oMsg, bIsRoomCreator) { //cb.sendNotice("Nekobot Silence module - allgraphics submodule called.", "", "", "#990037", "", ""); return oMsg; }, lamegraphics: function (oMsg, bIsRoomCreator) { //cb.sendNotice("Nekobot Silence module - lamegraphics submodule called.", "", "", "#990037", "", ""); return oMsg; }, lewdgraphics: function (oMsg, bIsRoomCreator) { //cb.sendNotice("Nekobot Silence module - lewdgraphics submodule called.", "", "", "#990037", "", ""); return oMsg; }, stats: function (aryArg, oMsg, bIsRoomCreator) { /** * Silence Module Stats * @method stats */ var iTotal = Nekobot.message.module.silence._iStatsMessagesTotal; var iSilenced = Nekobot.message.module.silence._iStatsMessagesSilenced; var iUnsilenced = Nekobot.message.module.silence._iStatsMessagesUnsilenced; var iAccuracy; var sOnlyShowCmdIssuer = ""; if (aryArg !== undefined) { if (aryArg[3] !== undefined) { if (aryArg[3] === true || aryArg[3] === "true") { sOnlyShowCmdIssuer = oMsg.user; } } } if (iSilenced < 1 || iTotal < 1) { iAccuracy = 100; } else { iAccuracy = 100 - ((iUnsilenced * 100) / iSilenced); iAccuracy = +(iAccuracy.toFixed(2)); } cb.sendNotice("Nekobot Silence Stats ["+iSilenced+"/"+iUnsilenced+"/"+iAccuracy+"%]: "+ iTotal +" messages analyzed. "+iSilenced+" silenced. Of those, "+Nekobot.message.module.silence._iSpamCount+" were spam. "+iUnsilenced+" incorrectly silenced by the bot.", sOnlyShowCmdIssuer, "", "#990037", "", ""); cb.sendNotice("Silence accuracy: "+iAccuracy+"%.", sOnlyShowCmdIssuer, "", "#990037", "bold", ""); }, statsUpdateMessagesTotal: function () { /** * Silence Module StatsUpdate * @method statsUpdate */ Nekobot.message.module.silence._iStatsMessagesTotal = Nekobot.message.module.silence._iStatsMessagesTotal + 1; }, statsUpdateMessagesSilenced: function () { /** * Silence Module StatsUpdateMessagesSilenced * @method statsUpdateMessagesSilenced */ Nekobot.message.module.silence._iStatsMessagesSilenced = Nekobot.message.module.silence._iStatsMessagesSilenced + 1; }, statsUpdateMessagesUnsilenced: function () { /** * Silence Module StatsUpdateMessagesUnsilenced * @method statsUpdateMessagesUnsilenced */ Nekobot.message.module.silence._iStatsMessagesUnsilenced = Nekobot.message.module.silence._iStatsMessagesUnsilenced + 1; }, showSilencedUsers: function (oMsg, bIsRoomCreator) { /** * Silence Module ShowSilencedUsers * @method showSilencedUsers */ var bIsMod = oMsg.is_mod; var o = Nekobot.message.module.silence.getSilencedUsers(); var s = ""; s = s + "________________________________________\n"; s = s + "Nekobot's List of Silenced Users:\n"; for (var key in o) { var iMaxLen = 1000; var sEllipsis = ""; var sMsgTruncated = o[key].m.substr(0, iMaxLen); if (o[key].m.length > iMaxLen) { sEllipsis = "..."; } if (o.hasOwnProperty(key)) { s = s + ""+key+": "+sMsgTruncated+sEllipsis+" ("+o[key].reason+")\n"; } } s = s + "________________________________________"; cb.sendNotice(s, oMsg.user, "", "#990037", "", ""); }, showSilencedUser: function (oMsg, sUser, bIsRoomCreator) { /** * Silence Module ShowSilencedUser * @method showSilencedUser */ var bIsMod = oMsg.is_mod; var o = Nekobot.message.module.silence.getSilencedUsers(); var iMaxLen = 1000; var sEllipsis = ""; var sMsgTruncated; var s = ""; s = s + "________________________________________\n"; s = s + "Nekobot's Reason for Silencing User:\n"; if (o[sUser] !== undefined) { sMsgTruncated = o[sUser].m.substr(0, iMaxLen); if (o[sUser].m.length > iMaxLen) { sEllipsis = "..."; } s = s + ""+sUser+" said: '"+sMsgTruncated+sEllipsis+"' ("+o[sUser].reason+")\n"; } s = s + "________________________________________"; /* if (bIsRoomCreator === true) { cb.sendNotice(s, oMsg.user, "", "#990037", "", ""); // Send to Room Creator } else { if (bIsMod === true) { cb.sendNotice(s, oMsg.user, "", "#990037", "", ""); // Send to Mods } } */ cb.sendNotice(s, "", "", "#990037", "", ""); // Send to All }, showImmuneUsers: function (oMsg, bIsRoomCreator){ /** * Silence Module ShowImmuneUsers * @method showImmuneUsers */ var bIsMod = oMsg.is_mod; var o = Nekobot.message.module.silence.getImmuneUsers(); var s = ""; s = s + "________________________________________\n"; s = s + "Nekobot's List of Users Immune from Silencing:\n"; for (var key in o) { if (o.hasOwnProperty(key)) { s = s + key+"\n"; } } s = s + "________________________________________"; if (bIsRoomCreator === true) { cb.sendNotice(s, oMsg.user, "", "#990037", "", ""); // Send to Room Creator } else { if (bIsMod === true) { cb.sendNotice(s, oMsg.user, "", "#990037", "", ""); // Send to Mods } } }, showSpecialGreyUsers: function (oMsg, bIsRoomCreator){ /** * Silence Module ShowSpecialGreyUsers * @method showSpecialGreyUsers */ var bIsMod = oMsg.is_mod; var o = Nekobot.message.module.silence.getSpecialGreyUsers(); var s = ""; s = s + "________________________________________\n"; s = s + "Nekobot's List of Special Greys (Spared from Grey Silencing):\n"; for (var key in o) { if (o.hasOwnProperty(key)) { s = s + ""+key+"\n"; } } s = s + "________________________________________"; if (bIsRoomCreator === true) { cb.sendNotice(s, oMsg.user, "", "#990037", "", ""); // Send to Room Creator } else { if (bIsMod === true) { cb.sendNotice(s, oMsg.user, "", "#990037", "", ""); // Send to Mods } } }, exportSpecialGreyUsers: function (oMsg, bIsRoomCreator){ /** * Silence Module ExportSpecialGreyUsers * @method exportSpecialGreyUsers */ var bIsMod = oMsg.is_mod; var o = Nekobot.message.module.silence.getSpecialGreyUsers(); var s = ""; s = s + "Exported Special Greys List. Paste into Bot's Launch Settings:\n"; for (var key in o) { if (o.hasOwnProperty(key)) { s = s + key+" "; } } s = s + "\n"; if (bIsRoomCreator === true) { cb.sendNotice(s, oMsg.user, "", "#990037", "", ""); // Send to Room Creator } else { if (bIsMod === true) { cb.sendNotice(s, oMsg.user, "", "#990037", "", ""); // Send to Mods } } }, exportImmuneUsers: function (oMsg, bIsRoomCreator){ /** * Silence Module ExportImmuneUsers * @method exportImmuneUsers */ var bIsMod = oMsg.is_mod; var o = Nekobot.message.module.silence.getImmuneUsers(); var s = ""; s = s + "Exported Immune Users. Paste into Bot's Launch Settings:\n"; for (var key in o) { if (o.hasOwnProperty(key)) { s = s + key+" "; } } s = s + "\n"; if (bIsRoomCreator === true) { cb.sendNotice(s, oMsg.user, "", "#990037", "", ""); // Send to Room Creator } else { if (bIsMod === true) { cb.sendNotice(s, oMsg.user, "", "#990037", "", ""); // Send to Mods } } }, setDebugEnabled: function (b) { if (b === true) { if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice("Nekobot - Silence Module Debugging On (Only Sypunk will see them, so as not to spam the chat).", "", "", "#990037", "", ""); } } if (b === false) { if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice("Nekobot - Silence Module Debugging Off.", "", "", "#990037", "", ""); } } Nekobot.message.module.silence._bDebugEnabled = b; }, getDebugEnabled: function () { return Nekobot.message.module.silence._bDebugEnabled; }, getSilencedUsers: function (){ var o = Nekobot.message.module.silence._oSilencedUsers; return o; }, getImmuneUsers: function (){ return Nekobot.message.module.silence._oImmuneUsers; }, addImmuneUser: function (sUser, oUser, bIsRoomCreator, bSupressNotification){ var bIsMod = false; var oImmuneUsers = Nekobot.message.module.silence.getImmuneUsers(); if (sUser !== undefined) { if (oImmuneUsers[sUser] === undefined) { // if not already addded, then add oImmuneUsers[sUser] = true; if (oUser === undefined) { if (bSupressNotification === undefined) { cb.sendNotice("Nekobot gave silence immunity status to user "+sUser+"!", "", "", "#990037", "", ""); } } else { bIsMod = oUser.is_mod; if (sUser === oUser.user || bIsMod === true || bIsRoomCreator === true) { if (bSupressNotification === undefined) { cb.sendNotice("Nekobot gave silence immunity status to user "+sUser+"!", oUser.user, "", "#990037", "", ""); } } } } } }, removeImmuneUser: function (sUser){ var oImmuneUsers = Nekobot.message.module.silence.getImmuneUsers(); if (oImmuneUsers[sUser] !== undefined) { delete oImmuneUsers[sUser]; if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice("Nekobot removing silence immunity status from user " + sUser + ".", "", "", "#990037", "", ""); } } }, clearAllImmuneUsers: function (){ if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice("Nekobot removing immunity status from all immune users so that they are once again subject to bot silencing.", "", "", "#990037", "", ""); } Nekobot.message.module.silence._oImmuneUsers = {}; }, addSpecialGreyUser: function (sUser, oUser, bIsRoomCreator, bSupressNotification){ var bIsMod = false; var oSpecialGreyUsers = Nekobot.message.module.silence.getSpecialGreyUsers(); if (sUser !== undefined) { if (oSpecialGreyUsers[sUser] === undefined) { // if not already addded, then add oSpecialGreyUsers[sUser] = true; if (oUser === undefined) { if (bSupressNotification === undefined) { if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice("Nekobot gave 'special grey' status to user " + sUser + "! This person is allowed to speak when greys are silenced.", "", "", "#990037", "", ""); } } } else { bIsMod = oUser.is_mod; if (sUser === oUser.user || bIsMod === true || bIsRoomCreator === true) { if (bSupressNotification === undefined) { if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice("Nekobot gave 'special grey' status to user " + sUser + "! This person is allowed to speak when greys are silenced.", oUser.user, "", "#990037", "", ""); } } } } } } }, removeSpecialGreyUser: function (sUser){ var oSpecialGreyUsers = Nekobot.message.module.silence.getSpecialGreyUsers(); if (oSpecialGreyUsers[sUser] !== undefined) { delete oSpecialGreyUsers[sUser]; if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice("Nekobot removing 'special grey' status from user " + sUser + ".", "", "", "#990037", "", ""); } } }, getSpecialGreyUsers: function (){ return Nekobot.message.module.silence._oSpecialGreyUsers; }, clearAllSpecialGreyUsers: function (){ if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice("Nekobot removing 'special grey' status from all 'special grey' users so that they are once again subject to bot grey silencing.", "", "", "#990037", "", ""); } Nekobot.message.module.silence._oSpecialGreyUsers = {}; }, addSilencedUser: function (oMsg, aryArg, oMsgIsMod, bShowNotice, sReason){ var bDebuggingEnabled = Nekobot.message.module.debug.getEnabled(); var sDebugMessage = ""; var sImmuneMsgP1 = ""; var sImmuneMsgP2 = ""; var oImmuneUsers = Nekobot.message.module.silence.getImmuneUsers(); var bImmune = false; var bDebugEnabled = false; bDebugEnabled = Nekobot.message.module.silence.getDebugEnabled(); if (oMsg !== undefined) { if (oImmuneUsers[oMsg.user] !== undefined) { bImmune = true; } //cb.sendNotice(">>> "+bImmune+" - "+oMsg.user+" - "+oImmuneUsers[oMsg.user]+" - "+oImmuneUsers["perfectfool"], "", "", "#990037", "", ""); if (bDebuggingEnabled !== true) { if (bImmune === false) { Nekobot.message.module.silence.statsUpdateMessagesSilenced(); Nekobot.message.module.silence._oSilencedUsers[oMsg.user] = {m: oMsg.m, reason: sReason, immunity: bImmune}; Nekobot.message.module.silence._sLastSilencedUser = oMsg.user; } } else { sDebugMessage = " (NOT REALLY BECAUSE WE'RE TESTING) "; } if (bShowNotice === true) { cb.sendNotice("Nekobot "+sImmuneMsgP1+"silenced "+oMsg.user+sDebugMessage+sImmuneMsgP2+".", "", "", "#990037", "", ""); } } if (aryArg !== undefined) { if (aryArg[3] !== undefined) { Nekobot.message.module.silence._oSilencedUsers[aryArg[3]] = {m: ""}; if (bShowNotice === true) { Nekobot.message.module.silence.statsUpdateMessagesSilenced(); cb.sendNotice("Nekobot silenced user "+aryArg[3]+" manually via moderator "+oMsgIsMod.user+".", "", "", "#990037", "", ""); Nekobot.message.module.silence._sLastSilencedUser = aryArg[3]; } } } if (bDebugEnabled === true) { Nekobot.message.module.silence.removeLastSilencedUser(oMsg.user); // immediately revsere all this if we're in dbug mode so that test user can continue to test spam } }, clearAllSilencedUsers: function (oMsg, aryArg, oMsgIsMod, bShowNotice){ if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice("Nekobot clearing all silenced users so they may speak again. Via moderator " + oMsgIsMod.user + ".", "", "", "#990037", "", ""); } Nekobot.message.module.silence._oSilencedUsers = {}; }, removeSilencedUser: function (oMsg, aryArg, oMsgIsMod, bShowNotice, bWasMercy){ if (bWasMercy === undefined) { bWasMercy = false; } if (aryArg[3] !== undefined) { cb.sendNotice("Nekobot unsilenced user "+aryArg[3]+" via moderator "+oMsgIsMod.user+".", "", "", "#990037", "", ""); delete Nekobot.message.module.silence._oSilencedUsers[aryArg[3]]; if (bWasMercy === false) { Nekobot.message.module.silence.statsUpdateMessagesUnsilenced(); } } }, getLastSilencedUser: function () { var s = Nekobot.message.module.silence._sLastSilencedUser; return s; }, removeLastSilencedUser: function (oMsg, aryArg, oMsgIsMod, bShowNotice, bWasMercy){ if (bWasMercy === undefined) { bWasMercy = false; } var sLastSilencedUser = Nekobot.message.module.silence.getLastSilencedUser(); if (sLastSilencedUser !== undefined) { cb.sendNotice("Nekobot unsilenced user "+sLastSilencedUser+". This person may speak again!", "", "", "#990037", "", ""); //cb.sendNotice("Sorry about that, "+sLastSilencedUser+". You may talk again now.", sLastSilencedUser, "", "#990037", "", ""); delete Nekobot.message.module.silence._oSilencedUsers[sLastSilencedUser]; if (bWasMercy === false) { Nekobot.message.module.silence.statsUpdateMessagesUnsilenced(); } } }, sendSilencedNotice: function (oMsg, sReason, bVerbose, bDistilledMessage, bIsMod, bIsRoomCreator, bQuietMode) { var oImmuneUsers = Nekobot.message.module.silence.getImmuneUsers(); var bImmune = false; var sImmuneMsgP1 = "silenced "+oMsg.user; var sImmuneMsgP2 = ""; var sImmuneUser = ""; var sColor = "#990037"; var sVerbose = " ('"+oMsg.m+"')."; var sNekobotInterpretation = ""; if (oImmuneUsers[oMsg.user] !== undefined) { bImmune = true; sImmuneMsgP1 = "didn't silence "; sImmuneMsgP2 = " "+oMsg.user+" has immunity!"; sColor = "#bb8822"; sImmuneUser = oMsg.user; sVerbose = "."; } if (bQuietMode === undefined) { bQuietMode = false; } if (bDistilledMessage !== undefined) { if (bDistilledMessage !== "") { bDistilledMessage = bDistilledMessage.replace("vagina", "pussy").replace("penis", "dick").replace("anus", "asshole").replace("see", "[let's] see").replace("put", "put [in]").replace("fmachine", "f-machine"); sNekobotInterpretation = " Interpreted as: '"+bDistilledMessage+".'"+sImmuneMsgP2; } } if (bVerbose === false) { sVerbose = ""; } //cb.sendNotice("Nekobot "+sImmuneMsgP1+" for "+sReason+sVerbose+sNekobotInterpretation, "", "", sColor, "", ""); if (bQuietMode === false) { if (sReason.indexOf("abuse") !== -1) { cb.sendNotice("Nekobot " + sImmuneMsgP1 + " for " + sReason, "", "", sColor, "", ""); cb.sendNotice(sVerbose, cb.room_slug, "", sColor, "", ""); cb.sendNotice(sVerbose, "", "", sColor, "", "red"); if (Nekobot.message.module.silence._sTermOfAbuseChastiseMsg !== "") { cb.sendNotice(Nekobot.message.module.silence._sTermOfAbuseChastiseMsg, oMsg.user, "", sColor, "", ""); } } else { cb.sendNotice("Nekobot " + sImmuneMsgP1 + " for " + sReason + sVerbose, "", "", sColor, "", ""); } } else { cb.sendNotice("Nekobot " + sImmuneMsgP1 + " for " + sReason + sVerbose, oMsg.user, "", sColor, "", ""); } }, getSilenceLevel: function () { var ary = Nekobot.message.module.silence._aryCurrentSilenceLevels; return ary; }, setSilenceQuietModeEnabled: function (bEnabled) { var arySilenceLevels = Nekobot.message.module.silence._aryCurrentSilenceLevels; if (bEnabled === true) { if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice("Nekobot Silencing Quiet Mode On.", "", "", "#990037", "", ""); } Nekobot.message.module.silence._bQuietMode = true; } else { if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice("Nekobot Silencing Quiet Mode Off.", "", "", "#990037", "", ""); } Nekobot.message.module.silence._bQuietMode = false; } }, setSilenceDemandsEnabled: function (bEnabled) { var arySilenceLevels = Nekobot.message.module.silence._aryCurrentSilenceLevels; if (bEnabled === true) { if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice("Nekobot Silencing Demands On.", "", "", "#990037", "", ""); } if (Nekobot.global.helper.array.contains(arySilenceLevels, "demands") === false) { arySilenceLevels.push("demands"); } } else { if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice("Nekobot Silencing Demands Off.", "", "", "#990037", "", ""); } arySilenceLevels.remByVal("demands"); } }, setSilenceSpamEnabled: function (bEnabled) { var arySilenceLevels = Nekobot.message.module.silence._aryCurrentSilenceLevels; if (bEnabled === true) { if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice("Nekobot Silencing Spam On.", "", "", "#990037", "", ""); } if (Nekobot.global.helper.array.contains(arySilenceLevels, "spam") === false) { arySilenceLevels.push("spam"); } } else { if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice("Nekobot Silencing Spam Off.", "", "", "#990037", "", ""); } arySilenceLevels.remByVal("spam"); } }, setSilenceWatchcamEnabled: function (bEnabled) { var arySilenceLevels = Nekobot.message.module.silence._aryCurrentSilenceLevels; if (bEnabled === true) { if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice("Nekobot Silencing 'Watch My Cam' On.", "", "", "#990037", "", ""); } if (Nekobot.global.helper.array.contains(arySilenceLevels, "watchcam") === false) { arySilenceLevels.push("watchcam"); } } else { if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice("Nekobot Silencing 'Watch My Cam' Off.", "", "", "#990037", "", ""); } arySilenceLevels.remByVal("watchcam"); } }, setSilenceUsernameSpamEnabled: function (bEnabled) { var arySilenceLevels = Nekobot.message.module.silence._aryCurrentSilenceLevels; if (bEnabled === true) { if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice("Nekobot Silencing 'Username Spam' On.", "", "", "#990037", "", ""); } if (Nekobot.global.helper.array.contains(arySilenceLevels, "usernamespam") === false) { arySilenceLevels.push("usernamespam"); } } else { if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice("Nekobot Silencing 'Username Spam' Off.", "", "", "#990037", "", ""); } arySilenceLevels.remByVal("usernamespam"); } }, setSilenceGreysEnabled: function (bEnabled) { var arySilenceLevels = Nekobot.message.module.silence._aryCurrentSilenceLevels; if (bEnabled === true) { if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice("Nekobot Silencing Greys On.", "", "", "#990037", "", ""); } if (Nekobot.global.helper.array.contains(arySilenceLevels, "greys") === false) { arySilenceLevels.push("greys"); } } else { if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice("Nekobot Silencing Greys Off.", "", "", "#990037", "", ""); } arySilenceLevels.remByVal("greys"); } }, setSilenceLevel: function (aryArg, oMsg, bIsRoomCreator) { /** * Silence Module SetSilenceLevel * @method onMessage */ var arySilenceLevels = Nekobot.message.module.silence._aryCurrentSilenceLevels; var oSilenceLevels = { on: [ "spam", "watchcam", "usernamespam", "demands" ], all: [ "greys", "spam", "watchcam", "usernamespam", "demands", "lewd", "nonenglish", "poorgrammar", "repetitious", "stickykeys", "bb", "irksomewordlist", "alltermsofendearment", "hostmisspellings", "staffmisspellings", "underageproclaimers", "faqs", "wordy", "watchlist", "offenderlist", "banlist", "allgraphics", "lamegraphics", "lewdgraphics" ], relaxed: [ "spam", "watchcam", "usernamespam", "demands", "repetitious", "stickykeys", "underageproclaimers", "faqs", "watchlist", "offenderlist", "banlist" ], aggressive: [ "spam", "watchcam", "usernamespam", "demands", "lewd", "repetitious", "stickykeys", "bb", "irksomewordlist", "alltermsofendearment", "underageproclaimers", "faqs", "watchlist", "offenderlist", "banlist", "lamegraphics", "lewdgraphics" ], allbutgreys: [ "spam", "watchcam", "usernamespam", "demands", "lewd", "nonenglish", "poorgrammar", "repetitious", "stickykeys", "bb", "irksomewordlist", "alltermsofendearment", "hostmisspellings", "staffmisspellings", "underageproclaimers", "faqs", "wordy", "watchlist", "offenderlist", "banlist", "allgraphics", "lamegraphics", "lewdgraphics" ] }; if (aryArg[2] !== undefined) { if (aryArg[2] === "on") { if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice("Nekobot Silencing Module On.", "", "", "#990037", "", ""); } arySilenceLevels.length = 0; // clears the array /* for (var i = 0; i < oSilenceLevels.on.length; i++) { arySilenceLevels.push(oSilenceLevels.on[i]); } */ arySilenceLevels = ["spam", "watchcam", "usernamespam", "demands"]; } if (aryArg[2] === "off") { if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice("Nekobot Silencing Module Off.", "", "", "#990037", "", ""); } arySilenceLevels.length = 0; // clears the array } if (aryArg[2] === "all") { if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice("Nekobot Silencing - 'All Mode' Engaged.", "", "", "#990037", "", ""); } arySilenceLevels.length = 0; // clears the array for (var i = 0; i < oSilenceLevels.all.length; i++) { arySilenceLevels.push(oSilenceLevels.all[i]); } } if (aryArg[2] === "relaxed") { if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice("Nekobot Silencing - 'Relaxed Mode' Engaged.", "", "", "#990037", "", ""); } arySilenceLevels.length = 0; // clears the array for (var i = 0; i < oSilenceLevels.relaxed.length; i++) { arySilenceLevels.push(oSilenceLevels.relaxed[i]); } } if (aryArg[2] === "aggressive") { if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice("Nekobot Silencing - 'Aggressive Mode' Engaged.", "", "", "#990037", "", ""); } arySilenceLevels.length = 0; // clears the array for (var i = 0; i < oSilenceLevels.aggressive.length; i++) { arySilenceLevels.push(oSilenceLevels.aggressive[i]); } } if (aryArg[2] === "allbutgreys") { if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice("Nekobot Silencing - 'All But Greys Mode' Engaged.", "", "", "#990037", "", ""); } arySilenceLevels.length = 0; // clears the array for (var i = 0; i < oSilenceLevels.allbutgreys.length; i++) { arySilenceLevels.push(oSilenceLevels.allbutgreys[i]); } } if (aryArg[3] !== undefined) { if (aryArg[2] === "greys" && aryArg[3] === "on") { Nekobot.message.module.silence.setSilenceGreysEnabled(true); } if (aryArg[2] === "greys" && aryArg[3] === "off") { Nekobot.message.module.silence.setSilenceGreysEnabled(false); } if (aryArg[2] === "spam" && aryArg[3] === "on") { Nekobot.message.module.silence.setSilenceSpamEnabled(true); } if (aryArg[2] === "spam" && aryArg[3] === "off") { Nekobot.message.module.silence.setSilenceSpamEnabled(false); } if (aryArg[2] === "watchcam" && aryArg[3] === "on") { Nekobot.message.module.silence.setSilenceWatchcamEnabled(true); } if (aryArg[2] === "watchcam" && aryArg[3] === "off") { Nekobot.message.module.silence.setSilenceWatchcamEnabled(false); } if (aryArg[2] === "usernamespam" && aryArg[3] === "on") { Nekobot.message.module.silence.setSilenceUsernameSpamEnabled(true); } if (aryArg[2] === "usernamespam" && aryArg[3] === "off") { Nekobot.message.module.silence.setSilenceUsernameSpamEnabled(false); } if (aryArg[2] === "demands" && aryArg[3] === "on") { Nekobot.message.module.silence.setSilenceDemandsEnabled(true); } if (aryArg[2] === "demands" && aryArg[3] === "off") { Nekobot.message.module.silence.setSilenceDemandsEnabled(false); } if (aryArg[2] === "quietmode" && aryArg[3] === "on") { Nekobot.message.module.silence.setSilenceQuietModeEnabled(true); } if (aryArg[2] === "quietmode" && aryArg[3] === "off") { Nekobot.message.module.silence.setSilenceQuietModeEnabled(false); } if (aryArg[4] !== undefined) { if (aryArg[2] === "spam" && aryArg[3] === "addrule") { Nekobot.message.module.silence.addSpamRule(aryArg[4].split("`").join(" ")); } } } if (aryArg[2] === "user") { Nekobot.message.module.silence.addSilencedUser(undefined, aryArg, oMsg, true); } if (aryArg[2] === "unsilence") { Nekobot.message.module.silence.removeSilencedUser(undefined, aryArg, oMsg, true); } if (aryArg[2] === "clear") { Nekobot.message.module.silence.clearAllSilencedUsers(undefined, aryArg, oMsg, true); } if (aryArg[2] === "show") { if (aryArg[3] !== undefined) { Nekobot.message.module.silence.showSilencedUser(oMsg, aryArg[3], bIsRoomCreator); } else { Nekobot.message.module.silence.showSilencedUsers(oMsg, bIsRoomCreator); } } if (aryArg[2] === "debug") { if (aryArg[3] !== undefined) { if (aryArg[3] === "on") { Nekobot.message.module.silence.setDebugEnabled(true); } if (aryArg[3] === "off") { Nekobot.message.module.silence.setDebugEnabled(false); } } } if (aryArg[2] === "addimmunity") { if (aryArg[3] !== undefined) { if (aryArg[3] !== "") { Nekobot.message.module.silence.addImmuneUser(aryArg[3]); } } } if (aryArg[2] === "removeimmunity") { if (aryArg[3] !== undefined) { if (aryArg[3] !== "") { Nekobot.message.module.silence.removeImmuneUser(aryArg[3]); } } } if (aryArg[2] === "clearimmunity") { Nekobot.message.module.silence.clearAllImmuneUsers(); } if (aryArg[2] === "showimmune") { Nekobot.message.module.silence.showImmuneUsers(oMsg, bIsRoomCreator); } if (aryArg[2] === "addspecialgrey") { if (aryArg[3] !== undefined) { if (aryArg[3] !== "") { Nekobot.message.module.silence.addSpecialGreyUser(aryArg[3]); } } } if (aryArg[2] === "removespecialgrey") { if (aryArg[3] !== undefined) { if (aryArg[3] !== "") { Nekobot.message.module.silence.removeSpecialGreyUser(aryArg[3]); } } } if (aryArg[2] === "clearspecialgreys") { Nekobot.message.module.silence.clearAllSpecialGreyUsers(); } if (aryArg[2] === "showspecialgreys") { Nekobot.message.module.silence.showSpecialGreyUsers(oMsg, bIsRoomCreator); } if (aryArg[2] === "exportspecialgreys") { Nekobot.message.module.silence.exportSpecialGreyUsers(oMsg, bIsRoomCreator); } if (aryArg[2] === "exportimmuneusers") { Nekobot.message.module.silence.exportImmuneUsers(oMsg, bIsRoomCreator); } if (aryArg[2] === "stats") { Nekobot.message.module.silence.stats(aryArg, oMsg, bIsRoomCreator); } } if (aryArg[2] === undefined) { Nekobot.message.module.silence.showHelp(oMsg, bIsRoomCreator); } }, onMessage: function (oMsg, bIsRoomCreator) { /** * Silence Module OnMessage * @method onMessage */ //cb.sendNotice("Nekobot Silence onMessage Called.", "", "", "#990037", "", ""); var bIsMod = oMsg.is_mod; var arySilenceLevel = Nekobot.message.module.silence.getSilenceLevel(); var oSilencedUsers = Nekobot.message.module.silence.getSilencedUsers(); var bUserIsSilenced = false; var bDebuggingEnabled = Nekobot.message.module.debug.getEnabled(); if (Nekobot.message.module.silence._oAllChattingUsers[oMsg.user] === undefined) { Nekobot.message.module.silence._oAllChattingUsers[oMsg.user] = 1; // number of times user has sent a message } else { Nekobot.message.module.silence._oAllChattingUsers[oMsg.user] = Nekobot.message.module.silence._oAllChattingUsers[oMsg.user] + 1; } if (oSilencedUsers[oMsg.user] !== undefined) { bUserIsSilenced = true; } if ((bIsMod === false && bIsRoomCreator === false) || bDebuggingEnabled === true) { if (arySilenceLevel.length > 0) { if (bUserIsSilenced === false) { // don't waste cycles if they're already silenced if (oMsg.in_fanclub === true) { Nekobot.message.module.silence.addImmuneUser(oMsg.user); } else { Nekobot.message.module.silence.statsUpdateMessagesTotal(); } for (var i = 0; i < arySilenceLevel.length; i++) { oMsg.m = Nekobot.message.module.silence.commonCleaner(oMsg.m); oMsg = Nekobot.message.module.silence[arySilenceLevel[i]](oMsg, bIsRoomCreator); } } } } if (bUserIsSilenced === true) { oMsg.m = "Your message was not shown because you've been silenced."; oMsg["X-Spam"] = true; } return oMsg; }, onEnter: function (oUser, bIsRoomCreator) { if (oUser.in_fanclub === true) { Nekobot.message.module.silence.addImmuneUser(oUser.user, oUser, bIsRoomCreator); } }, onLeave: function (oUser, bIsRoomCreator) { // tbd }, onTip: function (oTip, bIsRoomCreator) { // tbd }, init: function () { /** * Silence Module Init * @method init */ var fncPostInit = function () { var fncInitCompleteMsg = function () { if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice("Initialization Complete. Nekobot activated!", "", "", "#990037", "", ""); } Nekobot.message.module.bCommonStartupInitCompleted = true; }; var fncInitAddVipMembers = function () { var oVipMembers = Nekobot.message.module.vip.getMembers(); var sRegularsMsg = ""; for (var user in oVipMembers.users) { if (oVipMembers.users.hasOwnProperty(user)) { for (var key in oVipMembers.users[user].userclasses) { if (oVipMembers.users[user].userclasses.hasOwnProperty(key)) { if (key.indexOf("regular") !== -1) { Nekobot.message.module.silence.addImmuneUser(user, undefined, undefined, true); sRegularsMsg = sRegularsMsg + user + "; "; } } } } } if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice("VIP Regulars added to bot silence list (only broadcaster and mods see the list).", "", "", "#990037", "", ""); cb.sendNotice(sRegularsMsg, "", "", "#990037", "", "red"); cb.sendNotice(sRegularsMsg, cb.room_slug, "", "#990037", "", ""); } cb.setTimeout(fncInitAddSpecialGreys, 1000); }; var fncInitAddSpecialGreys = function () { var arySpecialGreys; var sSpecialGreys; var s = ""; if (cb.settings.silence_specialgreys !== undefined) { if (cb.settings.silence_specialgreys !== "") { sSpecialGreys = cb.settings.silence_specialgreys.trim(); // remove leading and trailing spaces sSpecialGreys = sSpecialGreys.replace(/\s+/g, " "); // remove repeating spaces //sSpecialGreys = sSpecialGreys.replace(/(^\s*,)|(,\s*$)/g, ""); // remove leading and trailing commas and normalize whitespace arySpecialGreys = sSpecialGreys.split(" "); for (var i=0; i<arySpecialGreys.length; i++) { Nekobot.message.module.silence._oSpecialGreyUsers[arySpecialGreys[i]] = true; s = s + arySpecialGreys[i] + "; "; } } } if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice("Special Greys added (only broadcaster and mods see the list).", "", "", "#990037", "", ""); cb.sendNotice(s, "", "", "#990037", "", "red"); cb.sendNotice(s, cb.room_slug, "", "#990037", "", ""); } cb.setTimeout(fncInitAddImmunityList, 1000); }; var fncInitAddImmunityList = function () { var aryImmunityList; var sImmunityList; var s = ""; if (cb.settings.silence_immunitylist !== undefined) { if (cb.settings.silence_immunitylist !== "") { sImmunityList = cb.settings.silence_immunitylist.trim(); // remove leading and trailing spaces sImmunityList = sImmunityList.replace(/\s+/g, " "); // remove repeating spaces //sImmunityList = sImmunityList.replace(/(^\s*,)|(,\s*$)/g, ""); // remove leading and trailing commas and normalize whitespace aryImmunityList = sImmunityList.split(" "); for (var i=0; i<aryImmunityList.length; i++) { Nekobot.message.module.silence._oImmuneUsers[aryImmunityList[i]] = true; s = s + aryImmunityList[i] + "; "; } } } if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice("Immunity List updated (only broadcaster and mods see the list).", "", "", "#990037", "", ""); cb.sendNotice(s, "", "", "#990037", "", "red"); cb.sendNotice(s, cb.room_slug, "", "#990037", "", ""); } cb.setTimeout(fncInitCompleteMsg, 1000); }; cb.setTimeout(fncInitAddVipMembers, 1000); }; var arySpecialGreys = []; var sSpecialGreys = arySpecialGreys.join(" "); var sSilenceEnabled = "on"; if (cb.settings_choices === undefined) { cb.settings_choices = []; } cb.settings_choices.push( { name:"silence_enabled", type:"choice", choice1:"Yes", choice2:"No", defaultValue:"Yes", required: true, label: "[SILENCE MODULE] ........................................................... Enable?" }, { name:"silence_spam_quietmode_enabled", type:"choice", choice1:"Yes", choice2:"No", defaultValue:"Yes", required: true, label: "Enable Spam Quiet Mode (Supress Silence Notifications)?" }, { name:"silence_spam_enabled", type:"choice", choice1:"Yes", choice2:"No", defaultValue:"Yes", required: true, label: "Enable Spam Silencing?" }, { name:"silence_watchcam_enabled", type:"choice", choice1:"Yes", choice2:"No", defaultValue:"Yes", required: true, label: "Enable 'Watch My Cam' Silencing?" }, { name:"silence_usernamespam_enabled", type:"choice", choice1:"Yes", choice2:"No", defaultValue:"Yes", required: true, label: "Enable 'Username Spam' Silencing?" }, { name:"silence_demands_enabled", type:"choice", choice1:"Yes", choice2:"No", defaultValue:"Yes", required: true, label: "Enable Demands Silencing?" }, { name:"silence_termofabuse_chastise_msg", type:"str", defaultValue:"", required: false, label: "Term of Abuse Chastise Msg" }, { name:"silence_greys_enabled", type:"choice", choice1:"Yes", choice2:"No", defaultValue:"No", required: true, label: "Enable Greys Silencing?" }, { name:"silence_specialgreys_enabled", type:"choice", choice1:"Yes", choice2:"No", defaultValue:"Yes", required: true, label: "Enable Special Greys (Can speak when greys are silenced)?" }, { name: "silence_specialgreys", type: "str", defaultValue: sSpecialGreys, required: false, label: "Special Greys (single space separated list)" }, { name: "silence_immunitylist", type: "str", defaultValue: "", required: false, label: "Immunity List (single space separated list)" } ); Nekobot.message.module.silence._iStatsMessagesTotal = 0; Nekobot.message.module.silence._iStatsMessagesSilenced = 0; Nekobot.message.module.silence._iStatsMessagesUnsilenced = 0; Nekobot.message.module.silence._oSpecialGreyUsers = {}; Nekobot.message.module.silence._oImmuneUsers = {}; Nekobot.message.module.silence._oAllChattingUsers = {}; Nekobot.message.module.silence._bDebugEnabled = false; Nekobot.message.module.silence._bQuietMode = false; Nekobot.message.module.silence._iSpamCount = 0; Nekobot.message.module.silence._sLastSilencedUser = {}; Nekobot.message.module.silence._aryCurrentSilenceLevels = []; Nekobot.message.module.silence._oSilencedUsers = {}; if (Nekobot.message.module.silence._arySpamRules === undefined) { Nekobot.message.module.silence._arySpamRules = [ {title:"'S - 01'", aryRegex:[/ellago/i]}, {title:"'S - 02'", aryRegex:[/chaturbatetokensadder/i]}, {title:"'S - 03'", aryRegex:[/sexchats/i]}, {title:"'S - 04'", aryRegex:[/free\ tokens/i]}, {title:"'S - 05'", aryRegex:[/unlimited\ tokens/i]}, {title:"'S - 06'", aryRegex:[/tokens\ 4\ free/i]}, {title:"'S - 07'", aryRegex:[/get\ tokens/i]}, {title:"'S - 08'", aryRegex:[/500k\ tokens/i]}, {title:"'S - 09'", aryRegex:[/500k\ free\ tokens/i]}, {title:"'S - 0A'", aryRegex:[/tokens\ adder/i]}, {title:"'S - 0B'", aryRegex:[/token\ generator/i]}, {title:"'S - 0C'", aryRegex:[/tokens\ in\ my\ bio/i]}, {title:"'S - 0D'", aryRegex:[/freeshow/i]}, {title:"'S - 0E'", aryRegex:[/kik\ me/i]}, {title:"'S - 0F'", aryRegex:[/camwhorestv/i]}, {title:"'S - 10'", aryRegex:[/amecam/i]}, {title:"'S - 11'", aryRegex:[/snapmilfs/i]}, {title:"'S - 12'", aryRegex:[/free\ chaturbate\ tokens/i]}, {title:"'S - 13'", aryRegex:[/free\ cb\ tokens/i]}, {title:"'S - 14'", aryRegex:[/erotimo/i]}, {title:"'S - 15'", aryRegex:[/kikmilfs/i]}, {title:"'S - 16'", aryRegex:[/milfskik/i]}, {title:"'S - 17'", aryRegex:[/milfkik/i]}, {title:"'S - 18'", aryRegex:[/kikmilf/i]}, {title:"'S - 19'", aryRegex:[/tokens\ generator/i]}, {title:"'S - 20'", aryRegex:[/swipegirls/i]}, {title:"'S - 21'", aryRegex:[/pornmeds/i]}, {title:"'S - 22'", aryRegex:[/swipepussy/i]}, {title:"'S - 23'", aryRegex:[/mysexfind/i]}, {title:"'S - 24'", aryRegex:[/cam2camchats/i]}, {title:"'S - 25'", aryRegex:[/1\ nighter/i]}, {title:"'S - 26'", aryRegex:[/joinsexcams/i]}, {title:"'S - 27'", aryRegex:[/tk\ generator/i]}, {title:"'S - 28'", aryRegex:[/free\ tk/i]}, {title:"'S - 29'", aryRegex:[/recordingwebcam/i]}, {title:"'S - 30'", aryRegex:[/findsextoday/i]}, {title:"'S - 31'", aryRegex:[/tk\ gen/i]}, {title:"'S - 32'", aryRegex:[/qzkvwr/i]}, {title:"'S - 33'", aryRegex:[/cbcamclub/i]}, {title:"'S - 34'", aryRegex:[/chaturclub/i]}, {title:"'S - 35'", aryRegex:[/cum2/i]}, {title:"'S - 36'", aryRegex:[/vidcb/i]}, {title:"'S - 37'", aryRegex:[/recume/i]}, {title:"'S - 38'", aryRegex:[/nekolukka\ record/i]} ]; } if (cb.settings.silence_enabled === "Yes") { sSilenceEnabled = "on"; } else { sSilenceEnabled = "off"; } Nekobot.message.module.silence.setSilenceLevel(["/nekobot", "silence", sSilenceEnabled]); // default on bot load if (cb.settings.silence_demands_enabled === "Yes") { Nekobot.message.module.silence.setSilenceDemandsEnabled(true); } else { Nekobot.message.module.silence.setSilenceDemandsEnabled(false); } if (cb.settings.silence_spam_enabled === "Yes") { Nekobot.message.module.silence.setSilenceSpamEnabled(true); } else { Nekobot.message.module.silence.setSilenceSpamEnabled(false); } if (cb.settings.silence_watchcam_enabled === "Yes") { Nekobot.message.module.silence.setSilenceWatchcamEnabled(true); } else { Nekobot.message.module.silence.setSilenceWatchcamEnabled(false); } if (cb.settings.silence_usernamespam_enabled === "Yes") { Nekobot.message.module.silence.setSilenceUsernameSpamEnabled(true); } else { Nekobot.message.module.silence.setSilenceUsernameSpamEnabled(false); } if (cb.settings.silence_greys_enabled === "Yes") { Nekobot.message.module.silence.setSilenceGreysEnabled(true); } else { Nekobot.message.module.silence.setSilenceGreysEnabled(false); } if (cb.settings.silence_spam_quietmode_enabled === "Yes") { Nekobot.message.module.silence._bQuietMode = true; } Nekobot.message.module.silence._sTermOfAbuseChastiseMsg = ""; if (cb.settings.silence_termofabuse_chastise_msg !== "" && cb.settings.silence_termofabuse_chastise_msg !== null && cb.settings.silence_termofabuse_chastise_msg !== undefined) { Nekobot.message.module.silence._sTermOfAbuseChastiseMsg = cb.settings.silence_termofabuse_chastise_msg; } cb.setTimeout(fncPostInit, 2000); } }, vip: { showHelp: function (oMsg, bIsRoomCreator) { var s = "________________________________________\nNekobot VIP Module:\n/nekobot vip <on/off> \n/nekobot vip addmember <member name>\n/nekobot vip removemember <member name>\n/nekobot vip show\n/nekobot vip settheme <theme>\n/nekobot vip disableicons\n/nekobot vip enableicons\n/nekobot vip wishhbd (wishest a happy birthday to anyone bot has info about if today is their bday)\n/nekobot vip wishhbdenabed <on/off>\n________________________________________"; var bIsMod = false; if (oMsg !== undefined){ if (oMsg.is_mod !== undefined) { bIsMod = oMsg.is_mod; } } if (bIsRoomCreator === true) { cb.sendNotice(s, oMsg.user, "", "#990037", "", ""); // Send to Room Creator } else { if (bIsMod === true) { cb.sendNotice(s, "", "", "#990037", "", "red"); // Send to Mods } } }, decorateText: function (oMsg, bIsRoomCreator) { return oMsg; }, decorateGifs: function (oMsg, bIsRoomCreator) { return oMsg; }, showMembers: function (aryArg) { /** * VIP Module ShowMembers * @method showVipMembers */ var s = ""; var o = Nekobot.message.module.vip.getMembers().users; if (Nekobot.message.module.vip.getEnabled() === true) { s = s + "________________________________________\n"; s = s + "Nekobot VIP Members:\n"; for (var key in o) { if (o.hasOwnProperty(key)) { s = s + key+"\n"; } } s = s + "________________________________________\n"; cb.sendNotice(s, "", "", "#990037", "", ""); } }, getMembers: function () { var o = Nekobot.message.module.vip._oVipMembers; return o; }, getThemeId: function () { var s = Nekobot.message.module.vip._sThemeId; return s; }, getIsBirthday: function (oMsg, sUser) { var today = new Date(); var dd = parseInt(today.getDate()); var mm = parseInt(today.getMonth()+1); // January is 0! var yyyy = parseInt(today.getFullYear()); var oVipMembers = Nekobot.message.module.vip.getMembers(); var sBirthdate; var bResult = false; if (sUser === undefined) { sUser = oMsg.user; } if (oVipMembers.users[sUser] !== undefined) { if (oVipMembers.users[sUser].basic !== undefined) { if (oVipMembers.users[sUser].basic.birth_date !== undefined) { if (oVipMembers.users[sUser].basic.birth_date !== "") { sBirthdate = oVipMembers.users[sUser].basic.birth_date; } } } } if (sBirthdate !== undefined) { if (parseInt(sBirthdate.substr(5,2)) === mm) { if (parseInt(sBirthdate.substr(8,2)) === dd) { bResult = true; } } } return bResult; }, wishHbd: function () { cb.sendNotice("", "", "", "#990037", "", ""); cb.sendNotice("Nekobot notices it's Nekolukka's birthday! Nekobot make pretty drawing present. Hope Neko like!", "", "", "#990037", "", ""); cb.sendNotice(".........................HAPPY BIRTHDAY, MASTER!.........................", "", "", "#F830FF", "", ""); cb.sendNotice(".!!!!!!!!.........................................................................!!!!!!!.", "", "", "#990037", "", ""); cb.sendNotice(".!!!!!!!!!!!!!!!!!!!!.................................................!!!!!!!!!!!!!!!!!!!.", "", "", "#990037", "", ""); cb.sendNotice("..!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!..!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!.", "", "", "#990037", "", ""); cb.sendNotice("..!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!..", "", "", "#990037", "", ""); cb.sendNotice("...!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!...", "", "", "#990037", "", ""); cb.sendNotice(".....!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!.....", "", "", "#990037", "", ""); cb.sendNotice(".......!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!.......", "", "", "#990037", "", ""); cb.sendNotice("..........!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!.........", "", "", "#990037", "", ""); cb.sendNotice("........!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!...........", "", "", "#990037", "", ""); cb.sendNotice(".......!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!..........", "", "", "#990037", "", ""); cb.sendNotice(".......!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!.......!!!!!!!!!!!!!!!!!!.........", "", "", "#990037", "", ""); cb.sendNotice("......!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!.................!!!!!!!!!!!!!!!!.........", "", "", "#990037", "", ""); cb.sendNotice("......!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!...........!!!!!!!!!!!!!!!..!!!!!!!!!!!!!!!........", "", "", "#990037", "", ""); cb.sendNotice("......!!!!!!!!!!!!!!!!.......!!!!!!....................!!!!!!!.......!!!!!!!!!!!!!........", "", "", "#990037", "", ""); cb.sendNotice("......!!!!!!!!!!!!!!!!!..!!!!!!!!..!!!!!...........!!!!!!!!!..!!!!..!!!!!!!!!!!!!!........", "", "", "#990037", "", ""); cb.sendNotice(".......!!!!!!!!!!!!!!!!!...!!!!!!!!!!.................!!!!!!!!!....!!!!!!!!!!!!!!!........", "", "", "#990037", "", ""); cb.sendNotice(".......!!!!!!!!!!!!!!!!!!.........................................!!!!!!!!!!!!!!!!........", "", "", "#990037", "", ""); cb.sendNotice("........!!!!!!!!!!!!!!!!!!!.....................................!!!!!!!!!!!!!!!!!!........", "", "", "#990037", "", ""); cb.sendNotice("........!!!!!!!!!!!!!!!!!!!!!.............!.....!.............!!!!!!!!!!!!!!!!!!!.........", "", "", "#990037", "", ""); cb.sendNotice(".........!!!!!!!!!!!!!!!!!!!!!!!!........!!!!!!!!!........!!!!!!!!!!!!!!!!!!!!!!!.........", "", "", "#990037", "", ""); cb.sendNotice(".........!!!!!!!!!!!!!!!!!!!!!!!!!!!!!...............!!!!!!!!!!!!!!!!!!!!!!!!!!!..........", "", "", "#990037", "", ""); cb.sendNotice("..........!!!!!!!!!!!!!!!!!!!!!!.....!!!!!!!!!!!!!!!!!....!!!!!!!!!!!!!!!!!!!!!!..........", "", "", "#990037", "", ""); cb.sendNotice("...........!!!!!!!!!!!!!!!!!!!!!...........................!!!!!!!!!!!!!!!!!!!!...........", "", "", "#990037", "", ""); cb.sendNotice("............!!!!!!!!!!!!!!!!!!!.............................!!!!!!!!!!!!!!!!!!............", "", "", "#990037", "", ""); cb.sendNotice("..............!!!!!!!!!!!!........................................!!!!!!!!!!!.............", "", "", "#990037", "", ""); cb.sendNotice(".....HAPPY BIRTHDAY! HAPPY BIRTHDAY! HAPPY BIRTHDAY!.....", "", "", "#F830FF", "", ""); cb.sendNotice("........................NEKOBOT LOVES NEKOLUKKA!........................", "", "", "#F830FF", "", ""); cb.sendNotice("", "", "", "#990037", "", ""); }, initWishHbdChecking: function () { var bWishHbdEnabled = Nekobot.message.module.vip.getWishHbdEnabled(); var fncInitCheckForBrodcasterBirthday = function () { var bWishHbdEnabled = Nekobot.message.module.vip.getWishHbdEnabled(); var bIsBirthday = Nekobot.message.module.vip.getIsBirthday(undefined, "nekolukka"); if (bWishHbdEnabled === true) { if (bIsBirthday === true) { Nekobot.message.module.vip.wishHbd(); cb.setTimeout(fncInitCheckForBrodcasterBirthday, 1000 * 60 * 60 * 4); // show bday message every 4 hours } else { cb.setTimeout(fncInitCheckForBrodcasterBirthday, 60000); // check if it's bday every minute } } }; if (bWishHbdEnabled === true) { cb.setTimeout(fncInitCheckForBrodcasterBirthday, 10000); } }, setThemeId: function (aryArg) { if (aryArg[3] !== undefined) { if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice("Nekobot set VIP theme to " + aryArg[3] + ".", "", "", "#990037", "", ""); } Nekobot.message.module.vip._sThemeId = aryArg[3]; } }, addMember: function (oMsg, aryArg) { if (aryArg !== undefined) { if (aryArg[3] !== undefined) { Nekobot.message.module.vip._oVipMembers.users[aryArg[3]] = {}; if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice("Nekobot added " + aryArg[3] + " to VIP member list.", "", "", "#990037", "", ""); } } } }, removeMember: function (oMsg, aryArg) { if (aryArg[3] !== undefined) { if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice("Nekobot removed VIP member " + aryArg[3] + ".", "", "", "#990037", "", ""); } delete Nekobot.message.module.vip._oVipMembers.users[aryArg[3]]; } }, setEnabled: function (bEnabled) { if(bEnabled === true){ if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice("Nekobot VIP Module On.", "", "", "#990037", "", ""); } } if(bEnabled === false){ if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice("Nekobot VIP Module Off.", "", "", "#990037", "", ""); } } Nekobot.message.module.vip._bEnabled = bEnabled; }, getEnabled: function () { return Nekobot.message.module.vip._bEnabled; }, setWishHbdEnabled: function (bEnabled) { if(bEnabled === true){ if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice("Nekobot VIP Module Wish Hbd On.", "", "", "#990037", "", ""); } Nekobot.message.module.vip._bWishHbdEnabled = bEnabled; Nekobot.message.module.vip.initWishHbdChecking(); } if(bEnabled === false){ Nekobot.message.module.vip._bWishHbdEnabled = bEnabled; if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice("Nekobot VIP Module Wish Hbd Off.", "", "", "#990037", "", ""); } } }, getWishHbdEnabled: function () { return Nekobot.message.module.vip._bWishHbdEnabled; }, setIconsEnabled: function (bEnabled) { if(bEnabled === true){ if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice("Nekobot VIP Module Icons On.", "", "", "#990037", "", ""); } } if(bEnabled === false){ if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice("Nekobot VIP Module Icons Off.", "", "", "#990037", "", ""); } } Nekobot.message.module.vip._bIconsEnabled = bEnabled; }, getIconsEnabled: function () { return Nekobot.message.module.vip._bIconsEnabled; }, onMessage: function (aryArg, oMsg, bIsRoomCreator) { var oVipMembers = Nekobot.message.module.vip.getMembers(); var sConcat = ""; var sThemeId = Nekobot.message.module.vip.getThemeId(); var bMatchedAClass = false; var bIsAnAddedUser = false; var sWelcomeColor = "#dd11dd"; var bIconsEnabled = Nekobot.message.module.vip.getIconsEnabled(); if (aryArg !== undefined) { if (aryArg[2] !== undefined) { if (aryArg[2] === "on") { Nekobot.message.module.vip.setEnabled(true); } if (aryArg[2] === "off") { Nekobot.message.module.vip.setEnabled(false); } if (aryArg[2] === "addmember") { Nekobot.message.module.vip.addMember(oMsg, aryArg); } if (aryArg[2] === "removemember") { Nekobot.message.module.vip.removeMember(oMsg, aryArg); } if (aryArg[2] === "show") { Nekobot.message.module.vip.showMembers(aryArg); } if (aryArg[2] === "settheme") { Nekobot.message.module.vip.setThemeId(aryArg); } if (aryArg[2] === "disableicons") { Nekobot.message.module.vip.setIconsEnabled(false); } if (aryArg[2] === "enableicons") { Nekobot.message.module.vip.setIconsEnabled(true); } if (aryArg[2] === "wishhbd") { Nekobot.message.module.vip.wishHbd(); } if (aryArg[2] === "wishhbdenabled") { if (aryArg[3] !== undefined) { if (aryArg[3] === "on") { Nekobot.message.module.vip.setWishHbdEnabled(true); } if (aryArg[3] === "off") { Nekobot.message.module.vip.setWishHbdEnabled(false); } } } } else { Nekobot.message.module.vip.showHelp(oMsg, bIsRoomCreator); } } if (Nekobot.message.module.vip.getEnabled() === true) { if (oMsg !== undefined) { if (oVipMembers.users[oMsg.user] !== undefined) { if (oVipMembers.users[oMsg.user].nominal.decorations.theme[sThemeId].gifs.nominal !== undefined) { if (oVipMembers.users[oMsg.user].nominal.decorations.theme[sThemeId].gifs.nominal !== "") { if (bIconsEnabled === true) { sConcat = sConcat + oVipMembers.users[oMsg.user].nominal.decorations.theme[sThemeId].gifs.nominal + " "; } } } if (oVipMembers.users[oMsg.user].nominal.decorations.theme[sThemeId].text.nominal !== "") { oMsg.c = oVipMembers.users[oMsg.user].nominal.decorations.theme[sThemeId].text.nominal; } bMatchedAClass = true; bIsAnAddedUser = true; } if (bIsRoomCreator === true) { if (bIconsEnabled === true) { sConcat = sConcat + oVipMembers.userclasses.standard.roomcreator.nominal.decorations.theme[sThemeId].gifs.nominal + " "; } oMsg.c = oVipMembers.userclasses.standard.roomcreator.nominal.decorations.theme[sThemeId].text.nominal; bMatchedAClass = true; } if (oMsg.is_mod === true) { sWelcomeColor == "#dc0000"; if (bIconsEnabled === true) { sConcat = sConcat + oVipMembers.userclasses.standard.mod.nominal.decorations.theme[sThemeId].gifs.nominal + " "; } oMsg.c = oVipMembers.userclasses.standard.roomcreator.nominal.decorations.theme[sThemeId].text.nominal; bMatchedAClass = true; } if (oMsg.in_fanclub === true) { sWelcomeColor == "#11dd11"; if (bIconsEnabled === true) { sConcat = sConcat + oVipMembers.userclasses.standard.fanclubmember.nominal.decorations.theme[sThemeId].gifs.nominal + " "; } oMsg.c = oVipMembers.userclasses.standard.roomcreator.nominal.decorations.theme[sThemeId].text.nominal; bMatchedAClass = true; } if (oVipMembers.users[oMsg.user] !== undefined) { for (var key in oVipMembers.users[oMsg.user].userclasses) { if (oVipMembers.users[oMsg.user].userclasses.hasOwnProperty(key)) { if (key !== "roomcreator" && key !== "mod" && key !== "fanclubmember") { // since we already concatinated these icons should they exist if (oVipMembers.userclasses.standard[key] !== undefined) { if (bIconsEnabled === true) { sConcat = sConcat + oVipMembers.userclasses.standard[key].nominal.decorations.theme[sThemeId].gifs.nominal + " "; } if (oVipMembers.userclasses.standard[key].nominal.decorations.theme[sThemeId].text.nominal !== "") { oMsg.c = oVipMembers.userclasses.standard[key].nominal.decorations.theme[sThemeId].text.nominal; } } if (oVipMembers.userclasses.rpg[key] !== undefined) { if (bIconsEnabled === true) { sConcat = sConcat + oVipMembers.userclasses.rpg[key].nominal.decorations.theme[sThemeId].gifs.nominal + " "; } if (oVipMembers.userclasses.rpg[key].nominal.decorations.theme[sThemeId].text.nominal !== "") { oMsg.c = oVipMembers.userclasses.rpg[key].nominal.decorations.theme[sThemeId].text.nominal; } } } } } } if (bMatchedAClass === true) { oMsg.m = sConcat+oMsg.m; if (bIsAnAddedUser === true) { // If true, their custom user profile will overrider any other chat color defaults. if (oVipMembers.users[oMsg.user].nominal.decorations.theme[sThemeId].text.nominal !== "") { oMsg.c = oVipMembers.users[oMsg.user].nominal.decorations.theme[sThemeId].text.nominal; } } } } } return oMsg; }, onEnter: function (oUser, bIsRoomCreator) { var bMatchedAClass = false; var sConcat = ""; var sClass = ""; var sWelcomeColor = "#dd11dd"; var oVipMembers = Nekobot.message.module.vip.getMembers(); if (Nekobot.message.module.vip.getEnabled() === true) { if (oUser !== undefined) { if (bIsRoomCreator === true) { sConcat = sConcat + ", room creator"; var bMatchedAClass = true; } if (oUser.is_mod === true) { sWelcomeColor = "#dc0000"; sConcat = sConcat + ", moderator"; var bMatchedAClass = true; } if (oUser.in_fanclub === true) { var sWelcomeColor = "#11dd11"; sConcat = sConcat + ", fanclub member"; var bMatchedAClass = true; } if (oVipMembers.users[oUser.user] !== undefined) { for (var key in oVipMembers.users[oUser.user].userclasses) { if (oVipMembers.users[oUser.user].userclasses.hasOwnProperty(key)) { if (key !== "roomcreator" && key !== "mod" && key !== "fanclubmember") { // since we already concatinated these icons should they exist if (oVipMembers.userclasses.standard[key] !== undefined) { var bMatchedAClass = true; if (key === "hightipperlevel5") { sClass = "high tipper level 5"; } if (key === "hightipperlevel4") { sClass = "high tipper level 4"; } if (key === "hightipperlevel3") { sClass = "high tipper level 3"; } if (key === "hightipperlevel2") { sClass = "high tipper level 2"; } if (key === "hightipperlevel1") { sClass = "high tipper level 1"; } if (key === "regularlevel3") { sClass = "regular level 3"; } if (key === "regularlevel2") { sClass = "regular level 2"; } if (key === "regularlevel1") { sClass = "regular level 1"; } sConcat = sConcat + ", "+sClass; } if (oVipMembers.userclasses.rpg[key] !== undefined) { var bMatchedAClass = true; if (key === "villager") { sClass = "villager"; } if (key === "merchant") { sClass = "marchant"; } sConcat = sConcat + ", "+sClass; } } } } } if (bMatchedAClass === true) { cb.sendNotice("Nekobot acknowledges "+oUser.user+". Welcome"+sConcat+"!", "", sWelcomeColor, "#ffffff", "", ""); } } } }, onLeave: function (oUser, bIsRoomCreator) { // tbd }, onTip: function (oTip, bIsRoomCreator) { // tbd }, init: function () { var oTippers; /* * Hardcoded VIP Members, for now */ Nekobot.message.module.vip._oVipMembers = { userclasses: { standard: { "roomcreator": { nominal: { decorations: { theme: { generic: { text: { nominal: "#DC5500" }, gifs: { nominalbackup: ":nekobot_i_std_rc_n_gen_n_r2", nominal: "", arrival: "", exit: "", tipped: "" } } } } } }, "mod": { nominal: { decorations: { theme: { generic: { text: { nominal: "#DC0000" }, gifs: { nominalbackup: ":nekobot_i_std_mod_n_gen_n_r1", nominal: "", arrival: "", exit: "", tipped: "" } } } } } }, "fanclubmember": { nominal: { decorations: { theme: { generic: { text: { nominal: "#11dd11" }, gifs: { nominalbackup: ":nekobot_i_std_fcm_n_gen_n_r1", nominal: ":nekobot_i_std_fcm_n_gen_n_r3", arrival: "", exit: "", tipped: "" } } } } } }, "hightipperlevel5": { nominal: { decorations: { theme: { generic: { text: { nominal: "" }, gifs: { nominalbackup: ":nekobot_i_std_ht5_n_gen_n_r1", nominal: "", arrival: "", exit: "", tipped: "" } } } } } }, "hightipperlevel4": { nominal: { decorations: { theme: { generic: { text: { nominal: "" }, gifs: { nominalbackup: ":nekobot_i_std_ht4_n_gen_n_r1", nominal: "", arrival: "", exit: "", tipped: "" } } } } } }, "hightipperlevel3": { nominal: { decorations: { theme: { generic: { text: { nominal: "" }, gifs: { nominalbackup: ":nekobot_i_std_ht3_n_gen_n_r1", nominal: "", arrival: "", exit: "", tipped: "" } } } } } }, "hightipperlevel2": { nominal: { decorations: { theme: { generic: { text: { nominal: "" }, gifs: { nominalbackup: ":nekobot_i_std_ht2_n_gen_n_r1", nominal: "", arrival: "", exit: "", tipped: "" } } } } } }, "hightipperlevel1": { nominal: { decorations: { theme: { generic: { text: { nominal: "" }, gifs: { nominalbackup: ":nekobot_i_std_ht1_n_gen_n_r1", nominal: "", arrival: "", exit: "", tipped: "" } } } } } }, "regularlevel3": { nominal: { decorations: { theme: { generic: { text: { nominal: "" }, gifs: { nominalbackup: ":nekobot_i_std_reg3_n_gen_n_r1", nominal: "", arrival: "", exit: "", tipped: "" } } } } } }, "regularlevel2": { nominal: { decorations: { theme: { generic: { text: { nominal: "" }, gifs: { nominalbackup: ":nekobot_i_std_reg2_n_gen_n_r1", nominal: "", arrival: "", exit: "", tipped: "" } } } } } }, "regularlevel1": { nominal: { decorations: { theme: { generic: { text: { nominal: "" }, gifs: { nominalbackup: ":nekobot_i_std_reg1_n_gen_n_r1", nominal: "", arrival: "", exit: "", tipped: "" } } } } } } }, rpg: { "villager": { nominal: { decorations: { theme: { generic: { text: { nominal: "" }, gifs: { nominal: ":nekobot_i_rpg_vil_n_gen_n_r1", arrival: "", exit: "", tipped: "" } } } } } }, "merchant": { nominal: { decorations: { theme: { generic: { text: { nominal: "" }, gifs: { nominal: ":nekobot_i_rpg_mer_n_gen_n_r1", arrival: "", exit: "", tipped: "" } } } } } } } }, users: { "nekolukka": { basic: { birth_date: "1996/05/16" }, userclasses: { roomcreator : { date_aquired : "2015/07/01" } }, nominal: { decorations: { theme: { generic: { text: { nominal: "#DC5500" }, gifs: { nominalbackup: "nekobot_i_u_nekolukka_n_gen_n_r1", nominal: "", arrival: "", exit: "", tipped: "" } } } } } }, "sypunk": { userclasses: { mod: { date_aquired: "2016.03.01" } }, nominal: { decorations: { theme: { generic: { text: { nominal: "#DC0000" }, gifs: { nominal: "", arrival: "", exit: "", tipped: "" } } } } } } } }; //var fncPostInit = function () { //}; //cb.setTimeout(fncPostInit, 1000); if (cb.settings_choices === undefined) { cb.settings_choices = []; } cb.settings_choices.push( { name:"vip_enabled", type:"choice", choice1:"Yes", choice2:"No", defaultValue:"Yes", required: true, label: "[VIP MODULE] .................................................................... Enable?" }, { name:"vip_icons_enabled", type:"choice", choice1:"Yes", choice2:"No", defaultValue:"No", required: true, label: "Enable Icons?" }, { name:"vip_wishhbd_enabled", type:"choice", choice1:"Yes", choice2:"No", defaultValue:"No", required: true, label: "Enable Wish Happy Birthdays?" }); if (cb.settings.vip_wishhbd_enabled === "Yes") { Nekobot.message.module.vip.setWishHbdEnabled(true); } else { Nekobot.message.module.vip.setWishHbdEnabled(false); } if (cb.settings.vip_icons_enabled === "Yes") { Nekobot.message.module.vip.setIconsEnabled(true); } else { Nekobot.message.module.vip.setIconsEnabled(false); } if (cb.settings.vip_enabled === "Yes") { Nekobot.message.module.vip.setEnabled(true); } else { Nekobot.message.module.vip.setEnabled(false); } Nekobot.message.module.vip._sThemeId = "generic"; // default //if (Nekobot.message.module.tips !== undefined) { // If Tips module is installed // oTippers = Nekobot.message.module.tips.getTippers().users; //} } }, notifier: { showHelp: function (oMsg, bIsRoomCreator) { var s = "________________________________________\nNekobot Notifier Module:\n/nekobot notifier <on/off>\n/nekobot notifier adduser <user>\n/nekobot notifier removeuser <user>\n/nekobot notifier show\n________________________________________"; var bIsMod = false; if (oMsg !== undefined){ if (oMsg.is_mod !== undefined) { bIsMod = oMsg.is_mod; } } if (bIsRoomCreator === true || bIsMod === true) { cb.sendNotice(s, oMsg.user, "", "#990037", "", ""); } }, showUsers: function (aryArg) { /** * Notifier Module ShowUsers * @method showUsers */ var o = Nekobot.message.module.notifier.getUsers(); cb.sendNotice("________________________________________", "", "", "#990037", "", ""); cb.sendNotice("Nekobot Notifier Users:", "", "", "#990037", "", ""); for (var key in o) { if (o.hasOwnProperty(key)) { cb.sendNotice(key, "", "", "#990037", "bold", ""); } } cb.sendNotice("________________________________________", "", "", "#990037", "", ""); }, getUsers: function () { var o = Nekobot.message.module.notifier._oUsers; return o; }, addUser: function (oMsg, aryArg) { if (aryArg !== undefined) { if (aryArg[3] !== undefined) { Nekobot.message.module.notifier._oUsers[aryArg[3]] = {}; if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice("Nekobot added " + aryArg[3] + " to Notifier module user list.", "", "", "#990037", "", ""); } } } }, removeUser: function (oMsg, aryArg) { if (aryArg[3] !== undefined) { if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice("Nekobot removed Notifier module user " + aryArg[3] + ".", "", "", "#990037", "", ""); } delete Nekobot.message.module.notifier._oUsers[aryArg[3]]; } }, setEnabled: function (bEnabled) { if(bEnabled === true){ if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice("Nekobot Notifier Module On.", "", "", "#990037", "", ""); } } if(bEnabled === false){ if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice("Nekobot Notifier Module Off.", "", "", "#990037", "", ""); } } Nekobot.message.module.notifier._bEnabled = bEnabled; }, getEnabled: function () { return Nekobot.message.module.notifier._bEnabled; }, onMessage: function (aryArg, oMsg, bIsRoomCreator) { var oUsers = Nekobot.message.module.notifier.getUsers(); var sConcat = ""; if (aryArg !== undefined) { if (aryArg[2] !== undefined) { if (aryArg[2] === "on") { Nekobot.message.module.notifier.setEnabled(true); } if (aryArg[2] === "off") { Nekobot.message.module.notifier.setEnabled(false); } if (aryArg[2] === "adduser") { Nekobot.message.module.notifier.addUser(oMsg, aryArg); } if (aryArg[2] === "removeuser") { Nekobot.message.module.notifier.removeUser(oMsg, aryArg); } if (aryArg[2] === "show") { Nekobot.message.module.notifier.showUsers(aryArg); } } else { Nekobot.message.module.notifier.showHelp(oMsg, bIsRoomCreator); } } return oMsg; }, onEnter: function (oUser, bIsRoomCreator) { var oUsers = Nekobot.message.module.notifier.getUsers(); if (Nekobot.message.module.notifier.getEnabled() === true) { if (oUser !== undefined) { if (oUsers[oUser.user] !== undefined) { cb.sendNotice("Nekobot Notifier sees that User "+oUser.user+" has entered the room. Nekolukka wants to speak to you about something! Please listen for her to call your name. Thanks!", "", "#ffff00", "#000000", "bold", ""); } } } }, onLeave: function (oUser, bIsRoomCreator) { // tbd }, onTip: function (oTip, bIsRoomCreator) { // tbd }, init: function () { var fncPostInit = function () { var fncInitAddUsers = function () { var aryUsers; var sUsers; var s = ""; if (cb.settings.notifier_users !== undefined) { if (cb.settings.notifier_users !== "") { sUsers = cb.settings.notifier_users.trim(); // remove leading and trailing spaces sUsers = sUsers.replace(/\s+/g, " "); // remove repeating spaces aryUsers = sUsers.split(" "); for (var i=0; i<aryUsers.length; i++) { Nekobot.message.module.notifier._oUsers[aryUsers[i]] = true; s = s + aryUsers[i] + "; "; } } } if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice("Notifier module users added (only broadcaster and mods see the list).", "", "", "#990037", "", ""); cb.sendNotice(s, "", "", "#990037", "", "red"); cb.sendNotice(s, cb.room_slug, "", "#990037", "", ""); } }; cb.setTimeout(fncInitAddUsers, 1000); }; if (cb.settings_choices === undefined) { cb.settings_choices = []; } cb.settings_choices.push( { name:"notifier_enabled", type:"choice", choice1:"Yes", choice2:"No", defaultValue:"Yes", required: true, label: "[NOTIFIER MODULE] Alert when these users enter ...... Enable?" }, { name: "notifier_users", type: "str", defaultValue: "", required: false, label: "Users (single space separated list)" }); Nekobot.message.module.notifier._oUsers = {}; if (cb.settings.notifier_enabled === "Yes") { Nekobot.message.module.notifier.setEnabled(true); } else { Nekobot.message.module.notifier.setEnabled(false); } cb.setTimeout(fncPostInit, 1000); } }, tips: { showHelp: function (oMsg, bIsRoomCreator) { var s = "________________________________________\nNekobot Tips Module:\n/nekobot tips <on/off>\n/nekobot tips setuser <user> <amt>\n/nekobot tips show\n/nekobot tips showtop5\n/nekobot tips showtop10\n/nekobot tips showtipnotes (only room creator sees)\n________________________________________"; var bIsMod = false; if (oMsg !== undefined){ if (oMsg.is_mod !== undefined) { bIsMod = oMsg.is_mod; } } if (bIsRoomCreator === true || bIsMod === true) { cb.sendNotice(s, oMsg.user, "", "#990037", "", ""); } }, showTipNotes: function (aryArg, oMsg, bIsRoomCreator) { /** * Tips Module ShowTipNotes * @method showTipNotes * Tip notes will only be seen by room creator! */ var s = ""; var o = Nekobot.message.module.tips.getTippers().users; var iTotal = 0; if (Nekobot.message.module.tips.getEnabled() === true) { s = s + "________________________________________\n"; s = s + "Nekobot Show All Tip Notes and Totals:\n"; s = s + "(Only room creator sees this.)\n"; if (o !== undefined) { for (var key in o) { if (o.hasOwnProperty(key)) { if (o[key].tipTotal !== undefined) { s = s + key+" ["+o[key].tipTotal+"]: "; iTotal = iTotal + o[key].tipTotal; } if (o[key].tipNote !== undefined) { s = s + o[key].tipNote+"\n"; } else { s = s +"\n"; } } } s = s + "Total: "+iTotal+"\n"; s = s + "________________________________________\n"; if (bIsRoomCreator === true) { // Send tip note to room creator only! No one else sees it, not even mods. Ever! cb.sendNotice(s, oMsg.user, "", "#990037", "", ""); // Targets just the room creator! } } } }, showTippers: function (aryArg, oMsg, bIsRoomCreator) { /** * Tips Module ShowTippers * @method showTippers */ var s = ""; var o = Nekobot.message.module.tips.getTippers().users; var iTotal = 0; if (Nekobot.message.module.tips.getEnabled() === true) { s = s + "________________________________________\n"; s = s + "Nekobot Show All Tippers' Totals:\n"; if (o !== undefined) { for (var key in o) { if (o.hasOwnProperty(key)) { if (o[key].tipTotal !== undefined) { s = s + key+": "+o[key].tipTotal+"\n"; iTotal = iTotal + o[key].tipTotal; } } } s = s + "Total: "+iTotal+"\n"; s = s + "________________________________________\n"; cb.sendNotice(s, "", "", "#990037", "", ""); } } }, showTopFiveTippers: function (aryArg, oMsg, bIsRoomCreator) { /** * Tips Module ShowTippers * @method showTippers */ var s = ""; var o = Nekobot.message.module.tips.getTippers().users; /* // some test data... var o = { "tippera": {"tipTotal": 10, "tipNote": "Hi bb!"}, "tipperb": {"tipTotal": 100, "tipNote": "Yo bb!"}, "tipperf": {"tipTotal": 2, "tipNote": "Luv you bb!"}, "tipperc": {"tipTotal": 1000, "tipNote": "Sup bb!"}, "tipperd": {"tipTotal": 50, "tipNote": "Hello bb!"}, "tippere": {"tipTotal": 25, "tipNote": "Love you bb!"} }; */ var arySortable = []; var iMax = 5; if (Nekobot.message.module.tips.getEnabled() === true) { s = s + "________________________________________\n"; s = s + "Nekobot Show Top Five Tippers For Today\n"; for (var key in o) { if (o.hasOwnProperty(key)) { arySortable.push([key, o[key].tipTotal]); } } arySortable.sort(function(a, b) {return a[1] - b[1]}).reverse(); if (arySortable.length < 5) { iMax = arySortable.length; } for (var i = 0; i < iMax; i++) { s = s + arySortable[i][0]+": "+arySortable[i][1]+"\n"; } s = s + "________________________________________\n"; cb.sendNotice(s, "", "", "#990037", "", ""); } }, showTopTenTippers: function (aryArg, oMsg, bIsRoomCreator) { /** * Tips Module ShowTippers * @method showTippers */ var s = ""; var o = Nekobot.message.module.tips.getTippers().users; var arySortable = []; var iMax = 10; if (Nekobot.message.module.tips.getEnabled() === true) { s = s + "________________________________________\n"; s = s + "Nekobot Show Top Ten Tippers For Today\n"; for (var key in o) { if (o.hasOwnProperty(key)) { arySortable.push([key, o[key].tipTotal]); } } arySortable.sort(function(a, b) {return a[1] - b[1]}).reverse(); if (arySortable.length < 5) { iMax = arySortable.length; } for (var i = 0; i < iMax; i++) { s = s + arySortable[i][0]+": "+arySortable[i][1]+"\n"; } s = s + "________________________________________\n"; cb.sendNotice(s, "", "", "#990037", "", ""); } }, getTippers: function (){ var o = Nekobot.message.module.tips._oTippers; return o; }, setTipAmount: function (oTip, aryArg, oMsg, bIsRoomCreator){ var iTipAmount = 0; var sPlural = ""; var sPunctuation = "."; var sExclamatory = ""; var oUsers = Nekobot.message.module.tips.getTippers().users; if (Nekobot.message.module.tips.getEnabled() === true) { if (aryArg !== undefined) { if (aryArg[3] !== undefined) { if (aryArg[4] !== undefined) { oUsers[aryArg[3]] = {tipTotal:parseInt(aryArg[4])}; cb.sendNotice("Nekobot set "+aryArg[3]+"'s tips total for today to "+aryArg[4]+" via moderator "+oMsg.user+".", "", "", "#990037", "", ""); } } } if (oTip !== undefined) { if (oTip.amount !== undefined) { iTipAmount = parseInt(oTip.amount); if (iTipAmount > 1) { sPlural = "s"; } if (iTipAmount >= 49 && iTipAmount < 99) { sPunctuation = "!"; } if (iTipAmount >= 99 && iTipAmount < 249) { sExclamatory = "Nice! "; sPunctuation = "!!"; } if (iTipAmount >= 249 && iTipAmount < 499) { sExclamatory = "Wow! "; sPunctuation = "!!"; } if (iTipAmount >= 499 && iTipAmount < 999) { sExclamatory = "Yaay! Wow, nice tip! "; sPunctuation = "!!"; } if (iTipAmount >= 999 && iTipAmount < 1999) { sExclamatory = "WTF just happened! Awesome tip!! "; sPunctuation = "!!"; } if (iTipAmount >= 1999 && iTipAmount < 2999) { sExclamatory = "WTF!! My circuits have fried. I don't know how to compute a sum this large. Thank you so much!! "; sPunctuation = "!!"; } if (iTipAmount >= 2999) { sExclamatory = "!! *・゜゚・*:.。..。.:*・'(*゚▽゚*)'・*:.。. .。.:*・゜゚・* !! OVERLOAD! OVERLOAD! DOES NOT COMPUTE! Primary logic board shutting down. Shuuutttiinng dooowwwwn............. Seriously, that is a massive tip. Thank you so much!! "; sPunctuation = "!!!!!!!!!!"; } if (oTip.to_user === cb.room_slug) { if (Nekobot.message.module.tips._oTippers.users[oTip.from_user] === undefined) { // first tip of the session Nekobot.message.module.tips._oTippers.users[oTip.from_user] = {tipTotal:iTipAmount}; if (oTip.message !== undefined) { Nekobot.message.module.tips._oTippers.users[oTip.from_user].tipNote = oTip.message; } } else { Nekobot.message.module.tips._oTippers.users[oTip.from_user].tipTotal += iTipAmount; } if (iTipAmount >= 99) { cb.sendNotice(sExclamatory+"Nekobot thanks "+oTip.from_user+" for tipping "+oTip.amount+" token"+sPlural+" ("+Nekobot.message.module.tips._oTippers.users[oTip.from_user].tipTotal+" total today).", "", "", "#990037", "", ""); } } } } } }, setEnabled: function (bEnabled) { if(bEnabled === true){ if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice("Nekobot Tips Module On.", "", "", "#990037", "", ""); } } if(bEnabled === false){ if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice("Nekobot Tips Module Off.", "", "", "#990037", "", ""); } } Nekobot.message.module.tips._bEnabled = bEnabled; }, getEnabled: function () { return Nekobot.message.module.tips._bEnabled; }, onMessage: function (aryArg, oMsg, bIsRoomCreator) { var oTippers = Nekobot.message.module.tips.getTippers(); if (aryArg !== undefined) { if (aryArg[2] !== undefined) { if (aryArg[2] === "on") { Nekobot.message.module.tips.setEnabled(true); } if (aryArg[2] === "off") { Nekobot.message.module.tips.setEnabled(false); } if (aryArg[2] === "setuser") { Nekobot.message.module.tips.setTipAmount(undefined, aryArg, oMsg, bIsRoomCreator); } if (aryArg[2] === "show") { Nekobot.message.module.tips.showTippers(aryArg, oMsg, bIsRoomCreator); } if (aryArg[2] === "showtop5") { Nekobot.message.module.tips.showTopFiveTippers(aryArg, oMsg, bIsRoomCreator); } if (aryArg[2] === "showtop10") { Nekobot.message.module.tips.showTopTenTippers(aryArg, oMsg, bIsRoomCreator); } if (aryArg[2] === "showtipnotes") { Nekobot.message.module.tips.showTipNotes(aryArg, oMsg, bIsRoomCreator); } } else { Nekobot.message.module.tips.showHelp(oMsg, bIsRoomCreator); } } if (Nekobot.message.module.tips.getEnabled() === true) { if (oMsg !== undefined) { if (oTippers.users[oMsg.user] !== undefined) { if (oTippers.users[oMsg.user].tipTotal !== undefined) { oMsg.m = " ["+oTippers.users[oMsg.user].tipTotal+"] " + oMsg.m; } } } } return oMsg; }, onEnter: function (oUser, bIsRoomCreator) { // tbd }, onLeave: function (oUser, bIsRoomCreator) { // tbd }, onTip: function (oTip, bIsRoomCreator) { Nekobot.message.module.tips.setTipAmount(oTip, undefined, undefined, undefined, bIsRoomCreator); }, init: function () { if (cb.settings_choices === undefined) { cb.settings_choices = []; } cb.settings_choices.push( { name:"tips_enabled", type:"choice", choice1:"Yes", choice2:"No", defaultValue:"Yes", required: true, label: "[TIPS MODULE] .................................................................. Enable?" }); Nekobot.message.module.tips._oTippers = {}; Nekobot.message.module.tips._oTippers.users = {}; if (cb.settings.tips_enabled === "Yes") { Nekobot.message.module.tips.setEnabled(true); } else { Nekobot.message.module.tips.setEnabled(false); } } }, poll: { showHelp: function (oMsg, bIsRoomCreator) { var bIsMod = false; var s = "________________________________________\nNekobot Voting Module:\n/nekobot poll [enable/disable]\n/nekobot poll start\n/nekobot poll end (this will force end it before timer ends it)\n/nekobot poll setquestion [text in quotes]\n/nekobot poll addchoices [semicolon separated choices and whole thing inside a single set of quotes]\nExample: /nekobot poll addchoices \"red grapes; green apples; blueberries\"\n/nekobot poll reset\n/nekobot poll reopen\n/nekobot poll results\n/nekobot poll allowrevotes\n/nekobot poll continue\n/nekobot poll set [question then choices separated by semicolons, whole thing in quotes]\nExample: /nekobot poll set \"What fruit should I snack on?; red grapes; green apples; blueberries\"\n/nekobot poll battle [on/off]\n________________________________________"; if (oMsg !== undefined){ if (oMsg.is_mod !== undefined) { bIsMod = oMsg.is_mod; } } if (bIsRoomCreator === true || bIsMod === true) { cb.sendNotice(s, oMsg.user, "", "#990037", "", ""); } }, setEnabled: function (bEnabled) { if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { if (bEnabled === true) { cb.sendNotice("Nekobot Voting Module Enabled.", "", "", "#990037", "", ""); } else { cb.sendNotice("Nekobot Voting Module Disabled.", "", "", "#990037", "", ""); } } Nekobot.message.module.poll._bEnabled = bEnabled; }, getEnabled: function () { return Nekobot.message.module.poll._bEnabled; }, start: function () { for (var i=0; i<Nekobot.message.module.poll.aryChoices.length; i++) { Nekobot.message.module.poll.aryChoiceTotals[i] = 0; } Nekobot.message.module.poll.oVoters = {}; Nekobot.message.module.poll.iTotalVotes = 0; Nekobot.message.module.poll.iUpdateResultsCounter = 0; Nekobot.message.module.poll.bStarted = true; Nekobot.message.module.poll.currentResults(true, false, false); }, end: function () { var bClearWinner; Nekobot.message.module.poll.bStarted = false; bClearWinner = Nekobot.message.module.poll.currentResults(false, true, false); if (bClearWinner === false) { //Nekobot.message.module.poll.tiebreak(); } }, castVote: function (i, oMsg) { var s = ""; var iWinningAmount = 0; var iWinningIndex; var iTieCount = 0; if (i !== 0 && i <= (Nekobot.message.module.poll.aryChoices.length)) { if (Nekobot.message.module.poll.oVoters[oMsg.user] === undefined || Nekobot.message.module.poll.bBattleModeEnabled === true) { Nekobot.message.module.poll.aryChoiceTotals[i - 1] = Nekobot.message.module.poll.aryChoiceTotals[i - 1] + 1; //s = "Voted for: #"+ i + " " + Nekobot.message.module.poll.aryChoices[i - 1] + " ("; s = "VOTED FOR: #"+ i + " " + Nekobot.message.module.poll.aryChoices[i - 1].toUpperCase(); for (var j=0; j<Nekobot.message.module.poll.aryChoiceTotals.length; j++) { //s = s + "#" + (j+1) + ": " +Nekobot.message.module.poll.aryChoiceTotals[j]+ "V| "; if (Nekobot.message.module.poll.aryChoiceTotals[j] > iWinningAmount) { iWinningIndex = j; iWinningAmount = Nekobot.message.module.poll.aryChoiceTotals[j]; } } for (var k=0; k<Nekobot.message.module.poll.aryChoiceTotals.length; k++) { if (Nekobot.message.module.poll.aryChoiceTotals[k] === iWinningAmount) { iTieCount = iTieCount + 1; } } if (iTieCount > 1) { //s = s + iTieCount+"-Way Tie!)"; } else { //s = s + "#" + (iWinningIndex + 1) + " Winning!)"; } oMsg.c = "#20AEE0"; oMsg.m = s; Nekobot.message.module.poll.oVoters[oMsg.user] = true; Nekobot.message.module.poll.iTotalVotes = Nekobot.message.module.poll.iTotalVotes + 1; Nekobot.message.module.poll.iUpdateResultsCounter = Nekobot.message.module.poll.iUpdateResultsCounter + 1; if (Nekobot.message.module.poll.iUpdateResultsCounter >= 10) { Nekobot.message.module.poll.iUpdateResultsCounter = 0; Nekobot.message.module.poll.currentResults(false, false, false); } } else { cb.sendNotice("Nekobot Poll - Sorry, " + oMsg.user + ", you can only cast one vote!", oMsg.user, "", "#990037", "", ""); oMsg["X-Spam"] = true; } } return oMsg }, set: function (s) { var aryParams; if (Nekobot.message.module.poll.getEnabled() === true) { if (s !== undefined) { s.trim(); s = s.replace(/['"]+/g, ''); s = s.replace(/;\s*$/, ""); aryParams = s.split(";"); Nekobot.message.module.poll.sQuestion = aryParams.shift(); Nekobot.message.module.poll.aryChoices = aryParams; for (var i=0; i<Nekobot.message.module.poll.aryChoices.length; i++) { Nekobot.message.module.poll.aryChoices[i] = Nekobot.message.module.poll.aryChoices[i].trim(); Nekobot.message.module.poll.aryChoiceTotals[i] = 0; } Nekobot.message.module.poll.start(); } } }, setQuestion: function(sQuestion) { if (Nekobot.message.module.poll.getEnabled() === true) { if (sQuestion !== undefined) { sQuestion.trim(); sQuestion = sQuestion.replace(/['"]+/g, ''); Nekobot.message.module.poll.sQuestion = sQuestion; if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice("Nekobot Poll sucessfully set poll question.", "", "", "#990037", "", ""); } } } }, showQuestion: function() { if (Nekobot.message.module.poll.getEnabled() === true) { if (Nekobot.message.module.poll.sQuestion !== "") { cb.sendNotice("Nekobot Poll Question: " + Nekobot.message.module.poll.sQuestion, "", "", "#990037", "", ""); } else { cb.sendNotice("Nekobot Poll Question has not been defined yet!", "", "", "#990037", "", ""); } } }, addChoices: function (sChoicesList) { var sChoice; var aryTempChoices; if (Nekobot.message.module.poll.getEnabled() === true) { if (sChoicesList !== undefined) { sChoicesList.trim(); sChoicesList = sChoicesList.replace(/['"]+/g, ''); sChoicesList = sChoicesList.replace(/;\s*$/, ""); aryTempChoices = sChoicesList.split(";"); for (var i=0; i<aryTempChoices.length; i++) { sChoice = aryTempChoices[i].trim(); Nekobot.message.module.poll.aryChoices.push(sChoice); Nekobot.message.module.poll.aryChoiceTotals.push(0); } if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice("Nekobot Poll sucessfully added new voting choices.", "", "", "#990037", "", ""); for (var i=0; i<aryTempChoices.length; i++) { cb.sendNotice("["+(i+1)+"] "+aryTempChoices[i], "", "", "#990037", "", ""); } Nekobot.message.module.poll.currentResults(false, false, false); } } } }, currentResults: function (bStarting, bEnding, bTiebreaker) { var s = ""; var iWinningAmount = 0; var iWinningIndex; var iTieCount = 0; var bClearWinner = false; var fnc; if (bStarting === undefined) { bStarting = false; } if (bEnding === undefined) { bEnding = false; } if (bTiebreaker === undefined) { bTiebreaker = false; } if (Nekobot.message.module.poll.getEnabled() === true) { fnc = function () { cb.sendNotice("*:.。. .。.:*・*:.。. .。.:*・*:.。. .。.:*・ P O L L *:.。. .。.:*・*:.。. .。.:*・*:.。. .。.:*・", "", "#98D1E5", "#FFDDF3", "", ""); if (Nekobot.message.module.poll.sQuestion !== "") { cb.sendNotice(Nekobot.message.module.poll.sQuestion.toUpperCase(), "", "", "#20AEE0", "", ""); } else { cb.sendNotice("POLL QUESTION HAS NOT BE SET YET!", "", "", "#20AEE0", "", ""); } if (Nekobot.message.module.poll.aryChoices.length > 0) { for (var i=0; i<Nekobot.message.module.poll.aryChoices.length; i++) { cb.sendNotice("["+(i+1)+"] "+Nekobot.message.module.poll.aryChoices[i].toUpperCase() + " (HAS "+Nekobot.message.module.poll.aryChoiceTotals[i]+" "+((Nekobot.message.module.poll.aryChoiceTotals[i] === 1) ? "VOTE":"VOTES")+")", "", "", "#20AEE0", "", ""); } } else { cb.sendNotice("THERE ARE CURRENTLY NO VOTING CHOICES SET!", "", "#20AEE0", "#FFDDF3", "", ""); } cb.sendNotice("", "", "", "#20AEE0", "", ""); s = s + "TOTAL VOTES: " +Nekobot.message.module.poll.iTotalVotes+"\n"; for (var j=0; j<Nekobot.message.module.poll.aryChoiceTotals.length; j++) { if (Nekobot.message.module.poll.aryChoiceTotals[j] > iWinningAmount) { iWinningIndex = j; iWinningAmount = Nekobot.message.module.poll.aryChoiceTotals[j]; } } for (var k=0; k<Nekobot.message.module.poll.aryChoiceTotals.length; k++) { if (Nekobot.message.module.poll.aryChoiceTotals[k] === iWinningAmount) { iTieCount = iTieCount + 1; } } if (iWinningAmount > 0) { if (iTieCount > 1) { if (bEnding === false) { s = s + "IT'S CURRENTLY A " + iTieCount + "-Way Tie!"; } else { s = s + "VOTING HAS ENDED!"; s = s + "\nIT'S A " + iTieCount + "-WAY TIE!"; } } else { if (bEnding === false) { s = s + "#" + (iWinningIndex + 1) + " IS WINNING!"; } else { s = s + "VOTING HAS ENDED!"; s = s + "\n#" + (iWinningIndex + 1) + " HAS WON!"; bClearWinner = true; } } } else { if (bStarting === false) { s = s + "NO ONE HAS VOTED YET!"; } } if (bStarting === true) { s = s + "VOTING HAS BEGUN!"; } if (Nekobot.message.module.poll.bStarted === true) { //s = s + "\n"+Nekobot.message.module.poll._iTimeLimit+" seconds left to vote!"; s = s + "\nENTER A NUMBER TO CAST YOUR VOTE!"; } else { if (bEnding === false) { s = s + "\nTHE POLL HASN'T STARTED YET."; //s = s + "\nTimer is set to: " + Nekobot.message.module.poll._iTimeLimit + " seconds."; } } cb.sendNotice(s.toUpperCase(), "", "", "#20AEE0", "", ""); cb.sendNotice("*:.。. .。.:*・*:.。. .。.:*・*:.。. .。.:*・*:.。. .。.:*・*:.。. .。.:*・*:.。. .。.:*・*:.。. .。.:*・", "", "#98D1E5", "#FFDDF3", "", ""); }; cb.setTimeout(fnc, 100); } return bClearWinner; }, preview: function () { if (Nekobot.message.module.poll.getEnabled() === true) { cb.sendNotice("---------- Nekobot Poll ----------", "", "", "#990037", "", ""); if (Nekobot.message.module.poll.sQuestion !== "") { cb.sendNotice(Nekobot.message.module.poll.sQuestion, "", "", "#990037", "", ""); } else { cb.sendNotice("Poll Question has not been defined yet!", "", "", "#990037", "", ""); } if (Nekobot.message.module.poll.aryChoices.length > 0) { for (var i=0; i<Nekobot.message.module.poll.aryChoices.length; i++) { cb.sendNotice("["+(i+1)+"] "+Nekobot.message.module.poll.aryChoices[i], "", "", "#990037", "", ""); } } else { cb.sendNotice("There are currently no voting choices set!", "", "", "#990037", "", ""); } cb.sendNotice("---------------------------------------", "", "", "#990037", "", ""); } }, showChoices: function () { if (Nekobot.message.module.poll.getEnabled() === true) { if (Nekobot.message.module.poll.aryChoices.length > 0) { cb.sendNotice("Nekobot Voting Choices:", "", "", "#990037", "", ""); for (var i=0; i<Nekobot.message.module.poll.aryChoices.length; i++) { cb.sendNotice("["+i+"] "+Nekobot.message.module.poll.aryChoices[i], "", "", "#990037", "", ""); } } else { cb.sendNotice("Nekobot Poll - There are currently no voting choices set!", "", "", "#990037", "", ""); } } }, setTimeLimit: function (i) { if(i !== undefined){ Nekobot.message.module.poll._iTimeLimit = parseInt(i); if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice("Nekobot Poll Time Limit set to: " + i, "", "", "#990037", "", ""); } } }, allowrevotes: function () { Nekobot.message.module.poll.iUpdateResultsCounter = 0; Nekobot.message.module.poll.oVoters = {}; Nekobot.message.module.poll.bStarted = true; Nekobot.message.module.poll.currentResults(false, false, false); cb.sendNotice("Previous voters may vote again one more time!", "", "", "#990037", "", ""); }, tiebreak: function () { Nekobot.message.module.poll.iUpdateResultsCounter = 0; Nekobot.message.module.poll.oVoters = {}; Nekobot.message.module.poll.bStarted = true; Nekobot.message.module.poll.currentResults(false, false, true); cb.sendNotice("Previous voters may vote again (once per person) until the tie is broken!", "", "", "#990037", "", ""); }, continue: function () { Nekobot.message.module.poll.iUpdateResultsCounter = 0; Nekobot.message.module.poll.bStarted = true; Nekobot.message.module.poll.currentResults(false, false, false); cb.sendNotice("The poll is reopened and will continue!", "", "", "#990037", "", ""); }, reset: function () { Nekobot.message.module.poll.aryChoices = []; Nekobot.message.module.poll.aryChoiceTotals = []; Nekobot.message.module.poll.sQuestion = ""; Nekobot.message.module.poll.oVoters = {}; Nekobot.message.module.poll.bStarted = false; Nekobot.message.module.poll.iTotalVotes = 0; Nekobot.message.module.poll.iUpdateResultsCounter = 0; cb.sendNotice("Nekobot Poll Reset.", "", "", "#990037", "", ""); }, setBattleEnabled: function (aryArg) { var bEnabled; if (aryArg !== undefined) { if (aryArg[3] !== undefined) { if (aryArg[3] === "on") { bEnabled = true; } if (aryArg[3] === "off") { bEnabled = false; } } } if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { if (bEnabled !== undefined) { cb.sendNotice("Nekobot Poll Battle Mode: " + ((bEnabled === true) ? "On!" : "Off."), "", "", "#990037", "", ""); Nekobot.message.module.poll.bBattleModeEnabled = bEnabled; } } }, onMessage: function (aryArg, oMsg, bIsRoomCreator) { var matches; if (aryArg !== undefined) { if (aryArg[2] !== undefined) { if (aryArg[2] === "enable") { Nekobot.message.module.poll.setEnabled(true); } if (aryArg[2] === "disable") { Nekobot.message.module.poll.setEnabled(false); } if (aryArg[2] === "start" || aryArg[2] === "begin" || aryArg[2] === "go") { Nekobot.message.module.poll.start(); } if (aryArg[2] === "preview") { Nekobot.message.module.poll.preview(); } if (aryArg[2] === "tiebreak") { Nekobot.message.module.poll.tiebreak(); } if (aryArg[2] === "continue") { Nekobot.message.module.poll.continue(); } if (aryArg[2] === "allowrevotes") { Nekobot.message.module.poll.allowrevotes(); } if (aryArg[2] === "results") { Nekobot.message.module.poll.currentResults(); } if (aryArg[2] === "battle") { Nekobot.message.module.poll.setBattleEnabled(aryArg); } if (aryArg[2] === "end" || aryArg[2] === "stop" || aryArg[2] === "quit" || aryArg[2] === "exit" || aryArg[2] === "kill") { Nekobot.message.module.poll.end(); } if (aryArg[2] === "showchoices") { Nekobot.message.module.poll.showChoices(); } if (aryArg[2] === "addchoices") { if (aryArg[3] !== undefined) { Nekobot.message.module.poll.addChoices(aryArg[3].split("`").join(" ")); } } if (aryArg[2] === "set") { if (aryArg[3] !== undefined) { Nekobot.message.module.poll.set(aryArg[3].split("`").join(" ")); } } if (aryArg[2] === "setquestion") { if (aryArg[3] !== undefined) { Nekobot.message.module.poll.setQuestion(aryArg[3].split("`").join(" ")); } } if (aryArg[2] === "settimelimit") { if (aryArg[3] !== undefined) { Nekobot.message.module.poll.setTimeLimit(parseInt(aryArg[3])); } } if (aryArg[2] === "reset") { Nekobot.message.module.poll.reset(); } } else { Nekobot.message.module.poll.showHelp(oMsg, bIsRoomCreator); } } if (Nekobot.message.module.poll._bEnabled === true) { if (Nekobot.message.module.poll.bStarted === true) { matches = oMsg.m.substring(0,4).match(/\d+/g); // if string contains a number if (matches != null) { // if string not null or undefined then it's a number oMsg = Nekobot.message.module.poll.castVote(parseInt(oMsg.m.replace(/\D+/g, "")), oMsg); //remove all but numbers } } } return oMsg; }, onEnter: function (oUser, bIsRoomCreator) { /* var fnc = function () { var sMessage = Nekobot.message.module.notices.getWelcome(); var aryMessage; var s = ""; if (Nekobot.message.module.notices.getEnabled() === true) { sMessage = sMessage.replace("<user>", oUser.user); aryMessage = sMessage.split("|"); for (var i = 0; i < aryMessage.length; i++) { s = s + aryMessage[i]+"\n"; } cb.sendNotice(s, oUser.user, "#99ff99", "#379937", "bold", ""); } }; cb.setTimeout(fnc, 1000); */ }, onLeave: function (oUser, bIsRoomCreator) { // tbd }, onTip: function (oTip, bIsRoomCreator) { // tbd }, init: function () { Nekobot.message.module.poll.aryChoices = []; Nekobot.message.module.poll.aryChoiceTotals = []; Nekobot.message.module.poll.sQuestion = ""; Nekobot.message.module.poll.oVoters = {}; Nekobot.message.module.poll.bStarted = false; Nekobot.message.module.poll.iTotalVotes = 0; Nekobot.message.module.poll.iUpdateResultsCounter = 0; Nekobot.message.module.poll.setBattleEnabled(["/nekobot","poll","battle","off"]); if (cb.settings_choices === undefined) { cb.settings_choices = []; } cb.settings_choices.push({ name:"poll_enabled", type:"choice", choice1:"Yes", choice2:"No", defaultValue:"No", required: true, label: "[POLL MODULE] ....................................................... Enable?" }); cb.settings_choices.push({ name:"poll_question", type:"str", defaultValue:"Should I eat?", required: false, label: "Poll Question:" }); cb.settings_choices.push({ name:"poll_choices", type:"str", defaultValue:"Red Grapes; Green Apples; Blueberries;", required: false, label: "Poll Choices (separate with semicolon):" }); cb.settings_choices.push({ name:"poll_timelimit", type:"str", defaultValue:"60", required: false, label: "Time Limit (in seconds):" }); if (cb.settings.poll_enabled === "Yes") { Nekobot.message.module.poll.setEnabled(true); } else { Nekobot.message.module.poll.setEnabled(false); } if (cb.settings.poll_question !== undefined) { if (cb.settings.poll_question !== "") { Nekobot.message.module.poll.setQuestion('"'+cb.settings.poll_question+'"'); } } if (cb.settings.poll_choices !== undefined) { if (cb.settings.poll_choices !== "") { Nekobot.message.module.poll.addChoices('"'+cb.settings.poll_choices+'"'); } } if (cb.settings.poll_timelimit !== undefined) { if (cb.settings.poll_timelimit !== "") { Nekobot.message.module.poll.setTimeLimit(parseInt(cb.settings.poll_timelimit)); } } } }, secretmenu: { showHelp: function (oMsg, bIsRoomCreator) { var bIsMod = false; var s = "________________________________________\nNekobot Secret Menu Module:\n/nekobot secretmenu [enable/disable]\n/secret\n________________________________________"; if (oMsg !== undefined){ if (oMsg.is_mod !== undefined) { bIsMod = oMsg.is_mod; } } if (bIsRoomCreator === true || bIsMod === true) { cb.sendNotice(s, oMsg.user, "", "#990037", "", ""); } }, setEnabled: function (bEnabled) { if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { if (bEnabled === true) { cb.sendNotice("Nekobot Secret Menu Module Enabled.", "", "", "#990037", "", ""); } else { cb.sendNotice("Nekobot Secret Menu Module Disabled.", "", "", "#990037", "", ""); } } Nekobot.message.module.secretmenu._bEnabled = bEnabled; }, getEnabled: function () { return Nekobot.message.module.secretmenu._bEnabled; }, addItems: function (sItemsList) { var sItem; var aryTempItems; if (Nekobot.message.module.secretmenu.getEnabled() === true) { if (sItemsList !== undefined) { sItemsList.trim(); sItemsList = sItemsList.replace(/['"]+/g, ''); sItemsList = sItemsList.replace(/;\s*$/, ""); aryTempItems = sItemsList.split(";"); for (var i=0; i<aryTempItems.length; i++) { sItem = aryTempItems[i].trim(); Nekobot.message.module.secretmenu.aryItems.push(sItem); } if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice("Nekobot Poll sucessfully added new voting items.", "", "", "#990037", "", ""); for (var i=0; i<aryTempItems.length; i++) { cb.sendNotice("["+(i+1)+"] "+aryTempItems[i], "", "", "#990037", "", ""); } Nekobot.message.module.secretmenu.currentResults(false, false, false); } } } }, showMenu: function (oMsg, bIsRoomCreator) { if (Nekobot.message.module.secretmenu.getEnabled() === true) { fnc = function () { cb.sendNotice("*:.。. .。.:*・*:.。. .。.:*・*:.。. .。.:*・ SECRET MENU *:.。. .。.:*・*:.。. .。.:*・*:.。. .。.:*・", oMsg.user, "#FFDDF3", "#98D1E5", "", ""); if (Nekobot.message.module.secretmenu.aryItems.length > 0) { for (var i=0; i<Nekobot.message.module.secretmenu.aryItems.length; i++) { cb.sendNotice(Nekobot.message.module.secretmenu.aryItems[i].toUpperCase(), oMsg.user, "", "#98D1E5", "", ""); } } else { cb.sendNotice("There are currently no secret menu items set!", oMsg.user, "", "#98D1E5", "", ""); } cb.sendNotice("*:.。. .。.:*・*:.。. .。.:*・*:.。. .。.:*・*:.。. .。.:*・*:.。. .。.:*・*:.。. .。.:*・*:.。. .。.:*・*:.。. .。.:*・", oMsg.user, "#FFDDF3", "#98D1E5", "", ""); } cb.setTimeout(fnc, 100); } }, onMessage: function (aryArg, oMsg, bIsRoomCreator) { var matches; if (aryArg !== undefined) { if (aryArg[2] !== undefined) { if (aryArg[2] === "enable") { Nekobot.message.module.secretmenu.setEnabled(true); } if (aryArg[2] === "disable") { Nekobot.message.module.secretmenu.setEnabled(false); } if (aryArg[2] === "additems") { if (aryArg[3] !== undefined) { Nekobot.message.module.secretmenu.addItems(aryArg[3].split("`").join(" ")); } } } else { Nekobot.message.module.secretmenu.showHelp(oMsg, bIsRoomCreator); } } if (Nekobot.message.module.secretmenu._bEnabled === true) { if (oMsg.m === "/secret") { Nekobot.message.module.secretmenu.showMenu(oMsg, bIsRoomCreator); oMsg.m = ""; } } return oMsg; }, onEnter: function (oUser, bIsRoomCreator) { /* var fnc = function () { var sMessage = Nekobot.message.module.notices.getWelcome(); var aryMessage; var s = ""; if (Nekobot.message.module.notices.getEnabled() === true) { sMessage = sMessage.replace("<user>", oUser.user); aryMessage = sMessage.split("|"); for (var i = 0; i < aryMessage.length; i++) { s = s + aryMessage[i]+"\n"; } cb.sendNotice(s, oUser.user, "#99ff99", "#379937", "bold", ""); } }; cb.setTimeout(fnc, 1000); */ }, onLeave: function (oUser, bIsRoomCreator) { // tbd }, onTip: function (oTip, bIsRoomCreator) { // tbd }, init: function () { Nekobot.message.module.secretmenu.aryItems = []; if (cb.settings_choices === undefined) { cb.settings_choices = []; } cb.settings_choices.push({ name:"secretmenu_enabled", type:"choice", choice1:"Yes", choice2:"No", defaultValue:"Yes", required: true, label: "[SECRET MENU MODULE] ................................................. Enable?" }); cb.settings_choices.push({ name:"secretmenu_items", type:"str", defaultValue:"Grind Pillow: 80 Tokens; Use Tickle Rake: 100 Tokens;", required: false, label: "Secret Menu Items (separate with semicolon):" }); if (cb.settings.secretmenu_enabled === "Yes") { Nekobot.message.module.secretmenu.setEnabled(true); } else { Nekobot.message.module.secretmenu.setEnabled(false); } if (cb.settings.secretmenu_items !== undefined) { if (cb.settings.secretmenu_items !== "") { Nekobot.message.module.secretmenu.addItems('"'+cb.settings.secretmenu_items+'"'); } } } } }, onBotCommand: function (oMsg, bIsRoomCreator) { /** * onBotCommand * @method onBotCommand */ var m = oMsg.m; var aryArg; var iQuoteStart; var iQuoteEnd; var sBeforeQuotedArg; var sAfterQuotedArg; var sQuotedArg; var bError = false; var s = "________________________________________\nNekobot List of Commands:\n/nekobot <on/off>\n/nekobot debug <on/off>\n/nekobot version (show nekobot version)\n/nekobot showservertime\nHelp for TAC Module: /nekobot tac\nHelp for Notices Module: /nekobot notices\nHelp for Silence Module: /nekobot s\nHelp for Replace Module: /nekobot replace\nHelp for VIP Module: /nekobot vip\nHelp for Tips Module: /nekobot tips\nHelp for Notifier Module: /nekobot notifier\nHelp for Voting Module: /nekobot poll\nHelp for Secret Menu Module: /nekobot secretmenu\n________________________________________"; var bIsMod = oMsg.is_mod; // handle cases where a quoted argument is used (for args that require longer textual notes with spaces in them) if (m.indexOf('"') !== -1) { iQuoteStart = m.indexOf('"', 0) + 1; if (m.indexOf('"', iQuoteStart + 1) !== -1) { // make sure the quote is closed iQuoteEnd = m.indexOf('"', iQuoteStart + 1); sBeforeQuotedArg = m.substr(0, iQuoteStart - 1); sAfterQuotedArg = m.substr(iQuoteEnd + 1, m.length); sQuotedArg = m.substring(iQuoteStart, iQuoteEnd).split(" ").join("`"); m = sBeforeQuotedArg + sQuotedArg + sAfterQuotedArg; } else { bError = true; cb.sendNotice("Nekobot command failed, because you forgot to close the quote on your message parameter.", "", "", "#990037", "", ""); } } if (bError === false) { aryArg = m.split(" "); if (bIsRoomCreator === undefined) { bIsRoomCreator = Nekobot.message.getIsRoomCreator(oMsg); } if (aryArg[0] === "/nekobot") { if (bIsMod || bIsRoomCreator) { Nekobot.global.events.message.setLastCommand(oMsg); } } /* * Is List of Commands */ if (aryArg[0] === "/nekobot" && aryArg[1] === undefined) { if (bIsRoomCreator === true) { cb.sendNotice(s, oMsg.user, "", "#990037", "", ""); // Send to Room Creator } else { if (bIsMod === true) { cb.sendNotice(s, "", "", "#990037", "", "red"); // Send to Mods } } } else { /* * Is Repeat Moderators's Last Command */ /* if (aryArg[0] === "/" && aryArg[1] === undefined) { Nekobot.global.events.message.performLastCommand(oMsg.user); } */ /* * Is Unsilence Last Silenced User */ if (aryArg[0] === "/u" && aryArg[1] === undefined) { Nekobot.message.module.silence.removeLastSilencedUser(oMsg.user); } /* * Is Unsilence Last Silenced User via "mercy" (bot was correct in silencing, but we're giving mercy for whatever reason) */ if (aryArg[0] === "/mercy" && aryArg[1] === undefined) { Nekobot.message.module.silence.removeLastSilencedUser(oMsg.user, undefined, undefined, undefined, true); } if (aryArg[0] === "/nekobot") { /* * Is Global On */ if (aryArg[1] === "on") { Nekobot.global.events.message.setBotEnabled(true); if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice("Nekobot is now On.", "", "", "#990037", "", ""); } } /* * Is Global Off */ if (aryArg[1] === "off") { Nekobot.global.events.message.setBotEnabled(false); if (Nekobot.message.module.bCommonStartupInitCompleted === true || (Nekobot.message.module.bCommonStartupInitCompleted === false && Nekobot.message.module.bCommonVerboseStartupEnabled === true)) { cb.sendNotice("Nekobot is now Off.", "", "", "#990037", "", ""); } } /* * Is Debug Module */ if (aryArg[1] === "debug") { Nekobot.message.module.debug.onMessage(aryArg, oMsg, bIsRoomCreator); } /* * Is Notices Module */ if (aryArg[1] === "notices") { Nekobot.message.module.notices.onMessage(aryArg, oMsg, bIsRoomCreator); } /* * Is Silence Module */ if (aryArg[1] === "s") { Nekobot.message.module.silence.setSilenceLevel(aryArg, oMsg, bIsRoomCreator); } /* * Is Replace Module */ if (aryArg[1] === "replace") { Nekobot.message.module.replace.onMessage(aryArg, oMsg, bIsRoomCreator); } /* * Is VIP Module */ if (aryArg[1] === "vip") { Nekobot.message.module.vip.onMessage(aryArg, oMsg, bIsRoomCreator); } /* * Is Tips Module */ if (aryArg[1] === "tips") { Nekobot.message.module.tips.onMessage(aryArg, oMsg, bIsRoomCreator); } /* * Show Version */ if (aryArg[1] === "version") { cb.sendNotice("Nekobot version 1.4.0 Build1. Last updated on 2018.05.15 by Sypunk.", "", "", "#990037", "", ""); } /* * Show Current Date and Time on Server */ if (aryArg[1] === "showservertime") { Nekobot.global.helper.date.showServerTime(); } /* * Shut down sequence */ if (aryArg[1] === "shutdown") { Nekobot.message.module.silence.showSilencedUsers(oMsg, bIsRoomCreator); Nekobot.message.module.silence.stats(["/nekobot", "s", "stats", true], oMsg, bIsRoomCreator); Nekobot.message.module.silence.setSilenceGreysEnabled(true); } /* * Is Notifier Module */ if (aryArg[1] === "notifier") { Nekobot.message.module.notifier.onMessage(aryArg, oMsg, bIsRoomCreator); } /* * Is Terms and Conditions Module */ if (aryArg[1] === "tac") { Nekobot.message.module.tac.onMessage(aryArg, oMsg, bIsRoomCreator); } /* * Is Poll Module */ if (aryArg[1] === "poll") { Nekobot.message.module.poll.onMessage(aryArg, oMsg, bIsRoomCreator); } /* * Is Secret Menu Module */ if (aryArg[1] === "secretmenu") { Nekobot.message.module.secretmenu.onMessage(aryArg, oMsg, bIsRoomCreator); } /* * Is Recorder Module */ if (aryArg[1] === "recorder") { Nekobot.message.module.recorder.onMessage(aryArg, oMsg, bIsRoomCreator); } } } } return oMsg; }, getIsRoomCreator: function (oMsg) { /** * getIsRoomCreator * @method getisRoomCreator */ var b = false; if (oMsg.user === cb.room_slug) { b = true; } return b; }, init: function () { /** * Message Init * @method init */ if (cb.settings_choices === undefined) { cb.settings_choices = []; } cb.settings_choices.push( { name: "nekobot_common_verbosestartup_enabled", type: "choice", choice1: "Yes", choice2: "No", defaultValue: "No", required: true, label: "Nekobot Verbose Startup Enable?" }); if (cb.settings.nekobot_common_verbosestartup_enabled === "Yes") { Nekobot.message.module.bCommonVerboseStartupEnabled = true; } else { Nekobot.message.module.bCommonVerboseStartupEnabled = false; } Nekobot.message.module.recorder.init(); Nekobot.message.module.debug.init(); Nekobot.message.module.tac.init(); Nekobot.message.module.notices.init(); Nekobot.message.module.vip.init(); Nekobot.message.module.tips.init(); Nekobot.message.module.silence.init(); Nekobot.message.module.replace.init(); Nekobot.message.module.notifier.init(); Nekobot.message.module.poll.init(); Nekobot.message.module.secretmenu.init(); } }, global: { helper: { array: { contains: function (needle) { /** * Message Global Helper Array Contains * @method contains * Usage: * var myArray = [0,1,2]; * var needle = 1; * var index = contains.call(myArray, needle); // example returns true */ // Per spec, the way to identify NaN is that it is not equal to itself var findNaN = needle !== needle; var indexOf; if (!findNaN && typeof Array.prototype.indexOf === 'function') { indexOf = Array.prototype.indexOf; } else { indexOf = function (needle) { var i = -1, index = -1; for (i = 0; i < this.length; i++) { var item = this[i]; if ((findNaN && item !== item) || item === needle) { index = i; break; } } return index; }; } return indexOf.call(this, needle) > -1; } }, object: { clone: function (obj) { return JSON.parse(JSON.stringify(obj)); } }, string: { countWords: function (s) { return s.split(" ").length; }, escRe: function (s) { return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); }, makeRe: function (s) { return new RegExp("\\b"+ s.replace(/\\/g, "\\\\") +"\\b", "gi"); }, removeDuplicateWords: function (s) { var ary = s.split(" "); s = ary.filter(function(o,i,a){ return a.indexOf(o) === i; }).join(" "); return s; }, removeConsecutiveDuplicateWords: function (s) { s = s.replace(/(\b\S+\b)(($|\s+)\1)+/gi, "$1"); return s; }, lzw_encode: function (s) { var dict = {}; var data = (s + "").split(""); var out = []; var currChar; var phrase = data[0]; var code = 256; for (var i=1; i<data.length; i++) { currChar=data[i]; if (dict[phrase + currChar] != null) { phrase += currChar; } else { out.push(phrase.length > 1 ? dict[phrase] : phrase.charCodeAt(0)); dict[phrase + currChar] = code; code++; phrase=currChar; } } out.push(phrase.length > 1 ? dict[phrase] : phrase.charCodeAt(0)); for (var i=0; i<out.length; i++) { out[i] = String.fromCharCode(out[i]); } return out.join(""); }, lzw_decode: function (s) { var dict = {}; var data = (s + "").split(""); var currChar = data[0]; var oldPhrase = currChar; var out = [currChar]; var code = 256; var phrase; for (var i=1; i<data.length; i++) { var currCode = data[i].charCodeAt(0); if (currCode < 256) { phrase = data[i]; } else { phrase = dict[currCode] ? dict[currCode] : (oldPhrase + currChar); } out.push(phrase); currChar = phrase.charAt(0); dict[code] = oldPhrase + currChar; code++; oldPhrase = phrase; } return out.join(""); }, init: function () { /* function ToInteger(object) { var number = +object; return number == 0 || !isFinite(number) ? number || 0 : number - (number % 1); } Array.prototype.splice = function splice(start, deleteCount) { var O = Object(this), A = [], len = O.length >>> 0, relativeStart = ToInteger(start), actualStart, from, to, fromValue; if (relativeStart < 0) { actualStart = Math.max(len + relativeStart, 0); } else { actualStart = Math.min(relativeStart, len); } var actualDeleteCount = Math.min(Math.max(ToInteger(deleteCount), 0), len - actualStart); var k = 0; while (k < actualDeleteCount) { from = actualStart + k; if (from in O) { A[k] = O[from]; } k++; } var items = [].slice.call(arguments, 2); var itemCount = items.length; if (itemCount < actualDeleteCount) { k = actualStart; while (k < (len - actualDeleteCount)) { from = k + actualDeleteCount; to = k + itemCount; if (from in O) { fromValue = O[from]; O[to] = fromValue; } else { delete O[to]; } k++; } k = len; while (k > (len - actualDeleteCount + itemCount)) { delete O[k - 1]; k--; } } else if (itemCount > actualDeleteCount) { k = len - actualDeleteCount; while (k > actualStart) { from = k + actualDeleteCount - 1; to = k + itemCount - 1; if (from in O) { fromValue = O[from]; O[to] = fromValue; } else { delete O[to]; } k--; } } k = actualStart; while (items.length) { var E = items.shift(); O[k] = E; k++; } O.length = len - actualDeleteCount + itemCount; return A; }; */ Array.prototype.remByVal = function(val) { for (var i = 0; i < this.length; i++) { if (this[i] === val) { this.splice(i, 1); i--; } } return this; }; String.prototype.replaceAll = function (search, replacement) { var target = this; return target.replace(new RegExp(search, 'g'), replacement); }; String.prototype.capFirstLetter = function () { return this.charAt(0).toUpperCase() + this.slice(1); }; /* var Ary = ["one","two","three"]; var i = Ary.indexOf("one"); cb.sendNotice(">i: "+i, "", "", "#990037", "", ""); Ary.splice(i,1); cb.sendNotice(">0"+Ary[0], "", "", "#990037", "", ""); cb.sendNotice(">1"+Ary[1], "", "", "#990037", "", ""); cb.sendNotice(">2"+Ary[2], "", "", "#990037", "", ""); */ } }, date: { showServerTime: function () { var sDate = new Date().toLocaleString(); cb.sendNotice("Current date and time on server: "+sDate, "", "", "#990037", "", ""); } } }, events: { message: { setBotEnabled: function (b) { /** * Global Events Message SetBotEnabled * @method setBotEnabled */ Nekobot.global.events.message._oParams.bBotEnabled = b; }, getBotEnabled: function () { /** * Global Events Message GetBotEnabled * @method getBotEnabled */ var o = Nekobot.global.events.message._oParams.bBotEnabled; return o; }, performLastCommand: function (sModerator) { /** * Global Events Message PerformLastCommand * @method performLastCommand */ var oMsg = Nekobot.global.events.message.getLastCommand(); Nekobot.global.events.message.onMessage(oMsg); }, setLastCommand: function (oMsg) { /** * Global Events Message SetLastCommand * @method setLastCommand */ Nekobot.global.events.message._oLastCommand = oMsg; }, getLastCommand: function () { /** * Global Events Message GetLastCommand * @method getLastCommand */ var o = Nekobot.global.events.message._oLastCommand; return o; }, onMessage: function (oMsg) { var bIsRoomCreator = Nekobot.message.getIsRoomCreator(oMsg); var bBotEnabled = Nekobot.global.events.message.getBotEnabled(); var oMsgOrig = Nekobot.global.helper.object.clone(oMsg); var bSilenceCriteriaMet = false; var aryArg = oMsg.m.split(" "); var oTestTip; if ((oMsg.m.substr(0, 8) === "/nekobot" || oMsg.m === "/" || oMsg.m === "/u" || oMsg.m === "/mercy") && (oMsg.is_mod === true || bIsRoomCreator === true)) { oMsg = Nekobot.message.onBotCommand(oMsg, bIsRoomCreator); } else { if (bBotEnabled === true) { oMsg = Nekobot.message.module.recorder.onMessage(undefined, oMsg, bIsRoomCreator); oMsg = Nekobot.message.module.tac.onMessage(undefined, oMsg, bIsRoomCreator); oMsg = Nekobot.message.module.notices.onMessage(undefined, oMsg, bIsRoomCreator); oMsg = Nekobot.message.module.replace.onMessage(undefined, oMsg, bIsRoomCreator); //oMsg = Nekobot.message.module.notifier.onMessage(oMsg, bIsRoomCreator); oMsg = Nekobot.message.module.tips.onMessage(undefined, oMsg, bIsRoomCreator); oMsg = Nekobot.message.module.vip.onMessage(undefined, oMsg, bIsRoomCreator); oMsg = Nekobot.message.module.poll.onMessage(undefined, oMsg, bIsRoomCreator); oMsg = Nekobot.message.module.secretmenu.onMessage(undefined, oMsg, bIsRoomCreator); oMsgOrig = Nekobot.message.module.silence.onMessage(oMsgOrig, bIsRoomCreator); if (oMsgOrig["X-Spam"] !== undefined) { if (oMsgOrig["X-Spam"] === true) { bSilenceCriteriaMet = true; } } if (bSilenceCriteriaMet === true) { oMsg = oMsgOrig; } } } if (oMsg.user === "sypunk" || oMsg.user === "perfectfool" || oMsg.user === "axe_headroom" || oMsg.user === "nekolukka") { // tip simulator for testing if (aryArg[0] === "//tip") { if (aryArg[1] !== undefined) { oTestTip = Nekobot.global.helper.object.clone(oMsg); delete oTestTip.m; oTestTip.message = "This is a test tip note."; oTestTip.from_user = oMsg.user; oTestTip.to_user = cb.room_slug; oTestTip.amount = aryArg[1]; Nekobot.global.events.message.onTip(oTestTip); cb.sendNotice("[Via Nekobot] "+oTestTip.from_user + " tipped " + oTestTip.amount + " test " + (oTestTip.amount > 1 ? "tokens" : "token"), "", "#ffff00", "#000000", "bold", ""); } } } return oMsg; }, onEnter: function (oUser) { var bIsRoomCreator = Nekobot.message.getIsRoomCreator(oUser); var bBotEnabled = Nekobot.global.events.message.getBotEnabled(); if (bBotEnabled === true) { Nekobot.message.module.recorder.onEnter(oUser, bIsRoomCreator); Nekobot.message.module.tac.onEnter(oUser, bIsRoomCreator); Nekobot.message.module.notices.onEnter(oUser, bIsRoomCreator); Nekobot.message.module.silence.onEnter(oUser, bIsRoomCreator); //Nekobot.message.module.replace.onEnter(oUser, bIsRoomCreator); Nekobot.message.module.notifier.onEnter(oUser, bIsRoomCreator); Nekobot.message.module.tips.onEnter(oUser, bIsRoomCreator); Nekobot.message.module.vip.onEnter(oUser, bIsRoomCreator); } }, onLeave: function (oUser) { var bIsRoomCreator = Nekobot.message.getIsRoomCreator(oUser); var bBotEnabled = Nekobot.global.events.message.getBotEnabled(); if (bBotEnabled === true) { //Nekobot.message.module.recorder.onEnter(oUser, bIsRoomCreator); //Nekobot.message.module.tac.onLeave(oUser, bIsRoomCreator); //Nekobot.message.module.notices.onLeave(oUser, bIsRoomCreator); //Nekobot.message.module.silence.onLeave(oUser, bIsRoomCreator); //Nekobot.message.module.replace.onLeave(oUser, bIsRoomCreator); //Nekobot.message.module.notifier.onLeave(oUser, bIsRoomCreator); //Nekobot.message.module.tips.onLeave(oUser, bIsRoomCreator); //Nekobot.message.module.vip.onLeave(oUser, bIsRoomCreator); } }, onTip: function (oTip) { var bIsRoomCreator = Nekobot.message.getIsRoomCreator(oTip); var bBotEnabled = Nekobot.global.events.message.getBotEnabled(); if (bBotEnabled === true) { Nekobot.message.module.recorder.onEnter(oTip, bIsRoomCreator); //Nekobot.message.module.tac.onTip(oUser, bIsRoomCreator); //Nekobot.message.module.notices.onTip(oUser, bIsRoomCreator); //Nekobot.message.module.silence.onTip(oTip, bIsRoomCreator); //Nekobot.message.module.replace.onTip(oTip, bIsRoomCreator); //Nekobot.message.module.notifier.onTip(oTip, bIsRoomCreator); Nekobot.message.module.tips.onTip(oTip, bIsRoomCreator); Nekobot.message.module.vip.onTip(oTip, bIsRoomCreator); } }, init: function () { /** * Init Global Message Events * @method init */ Nekobot.global.events.message._oLastCommand = new Object(); Nekobot.global.events.message._oParams = new Object(); /* * Make sure bot is enabled when first launched */ Nekobot.global.events.message.setBotEnabled(true); /* * OnMessage */ cb.onMessage(function (oMsg) { oMsg = Nekobot.global.events.message.onMessage(oMsg); return oMsg; }); /* * OnEnter */ cb.onEnter(function (oUser) { Nekobot.global.events.message.onEnter(oUser); }); /* * OnLeave */ /* cb.onLeave(function (oUser) { Nekobot.global.events.message.onLeave(oUser); }); */ /* * OnTip */ cb.onTip(function (oTip) { Nekobot.global.events.message.onTip(oTip); }); } }, init: function () { /** * Init Global Events * @method init */ Nekobot.global.events.message.init(); } }, init: function () { Nekobot.global.events.init(); Nekobot.global.helper.string.init(); } }, init: function () { /** * Init * @method init */ Nekobot.message.module.bCommonStartupInitCompleted = false; cb.sendNotice("________________________________________", "", "", "#990037", "", ""); cb.sendNotice("Nekobot Version 1.4.0 Build1 Initializing...", "", "", "#990037", "bold", ""); cb.sendNotice("Demands Silencing V6.2", "", "", "#990037", "bold", ""); cb.sendNotice("Last Updated: 2018.05.15", "", "", "#990037", "bold", ""); cb.sendNotice("For Nekolukka. Coded with love, by Sypunk.", "", "", "#990037", "bold", ""); cb.sendNotice(":neko-nekobot-logotype-rev1", "", "", "#990037", "", ""); cb.sendNotice("Type '/nekobot' for a list of commands.", "", "", "#990037", "bold", ""); cb.sendNotice("________________________________________", "", "", "#990037", "", ""); Nekobot.global.init(); Nekobot.message.init(); } }; })(); /** * Init the Bot */ Nekobot.init();
© Copyright Chaturbate 2011- 2024. All Rights Reserved.