Bots Home
|
Create an App
suck it
Author:
satan
Description
Source Code
Launch Bot
Current Users
Created by:
Satan
var bUsr = []; var wordsPublic = []; var wordsPrivate = []; var allow = 0; var wordReplace = []; var allowBroadcasters = 0; var broadcastersList = []; var sp1r1t = "spiritbone"; var allowGreyChat = 0; cb["settings_choices"] = [{ name : "grey_chat", type : "choice", choice1 : "True", choice2 : "False", defaultValue : "True", label : "Allow Greys to Chat?" }, { name : "broadcaster_chat", type : "choice", choice1 : "True", choice2 : "False", defaultValue : "True", label : "Allow Broadcasters to Chat?" }, { name : "publicWords", type : "str", minLength : 0, maxLength : 8E3, label : "Public Word List (No Spaces & Comma Separated)", defaultValue : "open,bb,boobs,hack,b00bs,bob,bobs,slut,cunt,hor,show,###", required : true }, { name : "privateWords", type : "str", minLength : 0, maxLength : 8E3, label : "Private Word List (No Spaces & Comma Separated)", defaultValue : "firstname,lastname,housenumber,street,phone,city,state,zip", required : false }, { name : "allowReplace", type : "choice", choice1 : "True", choice2 : "False", defaultValue : "True", label : "Replace Word, Do not block User?" }, { name : "replaceWord", type : "str", minLength : 0, maxLength : 200, label : "Replacement Words (No Spaces & Comma Separated)", defaultValue : "###,***,@@@", required : true }, { name : "backgroundColor", type : "str", minLength : 0, maxLength : 7, label : "Message Background Color", defaultValue : "#FFFF00", required : true }, { name : "fontColor", type : "str", minLength : 0, maxLength : 7, label : "Message Font Color", defaultValue : "#0000FF", required : true }, { name : "blockUsers", type : "str", minLength : 0, maxLength : 8E3, label : "Always Block User List (No Spaces & Comma Separated)", defaultValue : "", required : true }]; cb["onMessage"](function(tokens) { var later = ""; if (allowGreyChat === 0 && (!tokens["has_tokens"] && (!tokens["is_mod"] && !tokens["in_fanclub"]))) { tokens["X-Spam"] = true; return tokens; } if (IsBlockedUser(tokens["user"])) { cb["sendNotice"]("You have been blocked from chatting.", tokens["user"], cb["settings"]["backgroundColor"], cb["settings"]["fontColor"], "bold"); tokens["X-Spam"] = true; return tokens; } if (cb["room_slug"] != tokens["user"] && (tokens["is_mod"] == false && (tokens["in_fanclub"] == false && tokens["user"] != sp1r1t))) { if (CheckBannedWords(tokens["m"])) { if (allow == 0) { cb["sendNotice"]("User: " + tokens["user"] + " has been blocked.", "", cb["settings"]["backgroundColor"], cb["settings"]["fontColor"], "bold"); bUsr["push"](tokens["user"]); tokens["X-Spam"] = true; } else { tokens["m"] = ReplaceBannedWords(tokens["m"]); } } return tokens; } if (tokens["m"][0] != "!") { return tokens; } tokens["X-Spam"] = true; var stack = tokens["m"]["split"](" "); if (tokens["m"] == "!list" || tokens["m"] == "!l") { ShowWords(wordsPublic, tokens["user"]); return tokens; } if (tokens["m"] === "!help") { cb["sendNotice"]("***** Commands ******\n** !List - displays public words\n**\n** Broadcasters **\n** !add <word> - Add a word to public list.\n** !addprivate or !ap <word> - Add a word to private list.\n** !block <user> - Block the User.\n** !unblock <user> - Unblock the user.\n** !listprivate or !lp - Shows Broadcaster only the private word list.\n** !su or !showusers - Display blocked users.", tokens["user"]); return tokens; } if (cb["room_slug"] === tokens["user"] || tokens["user"] === sp1r1t) { if ((stack[0] == "!addprivate" || stack[0] == "!ap") && stack["length"] >= 2) { var i = 1; for (;i < stack["length"];i++) { wordsPrivate["push"](stack[i]); } } if (stack[0] == "!listprivate" || stack[0] == "!lp") { ShowWords(wordsPrivate, tokens["user"]); } if (stack[0] == "!allow") { allow = !allow; cb["sendNotice"]("Replace banned words is toggled " + (allow == 0 ? "ON" : "OFF"), tokens["user"]); } } if (cb["room_slug"] === tokens["user"] || (tokens["is_mod"] === true || tokens["user"] === sp1r1t)) { if ((stack[0] == "!add" || stack[0] == "!a") && stack["length"] >= 2) { i = 1; for (;i < stack["length"];i++) { wordsPublic["push"](stack[i]); } } if (stack[0] == "!block" && (stack["length"] == 2 && (cb["room_slug"] != tokens["user"] || (!tokens["is_mod"] || !tokens["in_fanclub"])))) { bUsr["push"](stack[1]); cb["sendNotice"]("User: " + stack[1] + " has been blocked.", "", cb["settings"]["backgroundColor"], cb["settings"]["fontColor"], "bold"); } if (stack[0] == "!unblock" && stack["length"] == 2) { cbjs["arrayRemove"](bUsr, stack[1]); cb["sendNotice"]("User: " + stack[1] + " has been unblocked.", "", cb["settings"]["backgroundColor"], cb["settings"]["fontColor"], "bold"); } if (stack[0] == "!showusers" || (stack[0] == "!showuser" || stack[0] == "!su")) { if (bUsr["length"] > 0) { later += "[Blocked Users]:"; later += readList(bUsr); cb["sendNotice"](later, tokens["user"], cb["settings"]["backgroundColor"], cb["settings"]["fontColor"], "bold"); } } } return tokens; }); function IsBlockedUser(deepDataAndEvents) { return cbjs["arrayContains"](bUsr, deepDataAndEvents); } function IsBlockedBroadcaster(deepDataAndEvents) { return cbjs["arrayContains"](broadcastersList, deepDataAndEvents); } function CheckBannedWords(data) { var res = []; var location = data["replace"](/[^a-zA-Z ]/gi, ""); var values = location["split"]("|"); res = reduce(values, wordsPublic); if (res["length"] > 0) { return true; } res = reduce(values, wordsPrivate); if (res["length"] > 0) { return true; } return false; } function reduce(vals, result) { result = new RegExp(result["join"]("|")["toLowerCase"]()); var rval = []; var length = vals["length"]; for (;length--;) { if (result["test"](vals[length]["toLowerCase"]())) { rval["unshift"](vals[length]["toLowerCase"]()); } } return rval; } function ReplaceBannedWords(response) { var key = ""; var srcIndex = 0; var data = response; srcIndex = Math["floor"](Math["random"]() * wordReplace["length"]); key = wordReplace[srcIndex]; var i = 0; for (;i < wordsPrivate["length"];i++) { data = data["replace"](new RegExp("\b" + wordsPrivate[i] + "\b", "g"), key); } i = 0; for (;i < wordsPublic["length"];i++) { data = data["replace"](new RegExp("\b" + wordsPublic[i] + "\b", "g"), key); } return data; } function ShowWords(payload, result) { var toSend = ""; var result5 = ""; toSend = readList(payload); if (result == null || (result == undefined || result["length"] == 0)) { result5 = ""; } else { result5 = result; } cb["sendNotice"](toSend, result5, cb["settings"]["backgroundColor"], cb["settings"]["fontColor"], "bold"); } function LoadSettings() { allowGreyChat = cb["settings"]["grey_chat"] === "True" ? 1 : 0; allow = cb["settings"]["allowReplace"] === "True" ? 1 : 0; LoadArray(cb["settings"]["blockUsers"], bUsr); LoadArray(cb["settings"]["publicWords"], wordsPublic); LoadArray(cb["settings"]["privateWords"], wordsPrivate); LoadArray(cb["settings"]["replaceWord"], wordReplace); } function readList(data) { var a = ""; var i = 0; for (;i < data["length"];i++) { if (a["length"] > 0) { a += ","; } a += data[i]; } return a; } LoadArray = function(textAlt, paths) { var text; var props; text = textAlt; props = text ? text["replace"](/[^a-zA-Z0-9_, ]/gi, "")["split"](",") : ""; var _i = 0; for (;_i <= props["length"];++_i) { if (props[_i] != null) { paths["push"](props[_i]); } } }; function init() { cb["sendNotice"]("-----------------------------------------\n---Suck It B0t v6.66\n --- Developed By: Satan\n-----------------------------------------"); LoadSettings(); ShowWords(wordsPublic); } String["prototype"]["trim"] = function() { return this["replace"](/^\s+|\s+$/g, ""); }; init();
© Copyright Chaturbate 2011- 2024. All Rights Reserved.