Bots Home
|
Create an App
bottype2
Author:
cryptojunkie
Description
Source Code
Launch Bot
Current Users
Created by:
Cryptojunkie
// Variable declaration var hasGreetedArray = new Array(); // Chat color variables var curCol = "050000"; var curMsg = 0; cb.sendNotice("BRQBot v2.0\nAlways an honor mistress:)", cb.room_slug, "#00FF00", "", "bold", ""); cb.sendNotice('BRQBot v2.0 has been started\nPlease re-greet by saying "hello mistress".', "", "#ADD8E6", "", "bold", ""); // Settings stuff cb.settings_choices = [ {name:"stutter_message", type:"str", minLength:1, maxLength:99, defaultValue:"and also my inability to read makes me a cuck.", label: "Add some funk to the end of their message. (space will be auto added)"}, {name:"imageId", type:"str", minLength:1, maxLength:99, defaultValue:":brq-fucku", label:"Image to add as well:"}, {name:"rotate", type:"int", minValue:0, maxValue: 25, defaultValue:10, label:"How many messages until black -> red (and red -> black) [0 to remove rotations]"} ]; cb.onTip(function (tip) { var user = tip["from_user"]; if (!hasGreeted(user)) { hasGreetedArray.push(user); cb.sendNotice("You no longer have to greet for this session :) (Because your tip was greeting enough).", user, "#00FF00", "", "bold", ""); } }); // Set Chaturbate class event functions // START cb.onEnter(function(user) { // Avoid any stranger things. if (user["user"] == cb.room_slug) { hasGreetedArray.push(user["user"]); } // Check if a noobie is around if (!hasGreeted(user["user"])) { cb.sendNotice("Welcome " + user["user"] + ", please greet our beautiful hostess by calling her Mistress. Example: Hello Mistress", user["user"], "#FF0000", "", "bold", ""); } // Check for mods if (user["is_mod"]) { hasGreetedArray.push(user["user"]); cb.sendNotice("Welcome " + user["user"] + ", you are exempt from needing to greet. \nBut doing so is always appreciated.", user["user"], "#00FF00", "", "bold", ""); } }); // Bulk of the magic cb.onMessage(function(msg) { var user = msg["user"]; // Mistress is always exempt, mods are sometimes exempt // This bit is mainly for if the bot was reset during a session if (!hasGreeted(cb.room_slug)) { hasGreetedArray.push(cb.room_slug); } if (msg["is_mod"] && !hasGreeted(user)) { hasGreetedArray.push(user); } if (!hasGreeted(user)) { if (msg["m"].toLowerCase().includes("mistress")) { hasGreetedArray.push(user); cb.sendNotice(user + ", welcome to the show, and thanks for the introduction :).", user, "#00FF00", "", "bold", ""); return; } else { msg["m"] = cb.settings.imageId + " " + msg["m"] + " " + cb.settings.stutter_message + " " + cb.settings.imageId; return; } } // Commands // slug and mods if (msg["m"].charAt(0) == "/") { msg["X-Spam"] = true; if (user == cb.room_slug || msg["is_mod"]) { if (msg["m"].substr(0, 6) == "/shame") { var tempArray = msg["m"].substr(7).split(" "); for (var i = 0; i < tempArray.length; i++) { if (tempArray[i] == cb.room_slug) { cb.sendNotice("Not to mistress.", user, "#217EF7", "", "bold", ""); } else { cb.sendNotice("Shaming " + tempArray[i], user, "#217EF7", "", "bold", ""); cbjs.arrayRemove(hasGreetedArray, tempArray[i]); } } } else if (msg["m"].substr(0, 8) == "/unshame") { var tempArray = msg["m"].substr(9).split(" "); for (var i = 0; i < tempArray.length; i++) { cb.sendNotice("Unshaming " + tempArray[i], user, "#217EF7", "", "bold", ""); hasGreetedArray.push(tempArray[i]); } } else if (msg["m"].substr(0, 5) == "/help") { cb.sendNotice("Anna's Bot, The Sequel!!! \n | /shame [username/s] - Add the shame message to [username/s]\n | -- [username/s] can be a list separated by spaces, or left empty to absolve all users\n | /unshame [username/s] - Remove the shame message from [username/s]\n | -- [username/s] is a list separated by spaces\n | /help - show this menu", user, "#217EF7", "", "bold", ""); } else { cb.sendNotice("Sorry, I don't know that one\n" + "Try /help for the list of commands.", user, "#217EF7", "", "bold", ""); } } else { cb.sendNotice(user + ", you do not have access to commands.", user, "#FF0000", "", "bolder", ""); } } if (!msg["X-Spam"] && cb.settings.rotate != 0) { changeColor(); if (curMsg == parseInt(((2 * cb.settings.rotate) - 1))) { curMsg = 0; } else { curMsg++; } msg["c"] = "#" + curCol; } return msg; }); //STOP function hasGreeted(username) { return cbjs.arrayContains(hasGreetedArray, username); } function changeColor() { if (curMsg <= cb.settings.rotate) { var r = parseInt("05", 16) + (Math.floor(250/cb.settings.rotate) * curMsg); } if (curMsg > cb.settings.rotate) { var r = parseInt("FF", 16) - (Math.floor(250/cb.settings.rotate) * (curMsg - cb.settings.rotate)); } if (r.toString(16).length < 2) { curCol = "0" + r.toString(16) + "0000"; } else { curCol = r.toString(16) + "0000"; } curCol = curCol.toUpperCase(); }
© Copyright Chaturbate 2011- 2024. All Rights Reserved.