Bots Home
|
Create an App
jjyjyuyrjytjhf
Author:
fghjkldfghjkhlkgykctgkyfjkfkft
Description
Source Code
Launch Bot
Current Users
Created by:
Fghjkldfghjkhlkgykctgkyfjkfkft
var wordsPublic = []; var wordsPrivate = []; cb['settings_choices'] = [{ name: 'publicWords', type: 'str', minLength: 0, maxLength: 4000, label: 'Public Word List (No Spaces & Comma Separated)', defaultValue: 'slut,bitch,cunt,whore' }, { name: 'privateWords', type: 'str', minLength: 0, maxLength: 4000, label: 'Private Word List (No Spaces & Comma Separated)', defaultValue: '' }, { name: 'backgroundColor', type: 'str', minLength: 0, maxLength: 7, label: 'Message Background Color', defaultValue: '#FFFFFF' }, { name: 'fontColor', type: 'str', minLength: 0, maxLength: 7, label: 'Message Font Color', defaultValue: '#000000' }]; cb['onMessage'](function(msg) { var user = msg['user']; var msgString = msg['m']; msgString = msgString.toLowerCase(); var isHost = (cb.room_slug == user); var isMod = msg['is_mod']; var isFan = msg['in_fanclub']; var isViewer = (!isHost && !isMod && !isFan); var isGrey = (!msg['has_tokens'] && !isMod && !isHost); if (msgString[0] == '!') { msg['X-Spam'] = true }; // if ((msgString == '!list') || (msgString == '!l')) { // ShowWords(wordsPublic, user); // return msg // }; if (isHost || isMod) { if (msgString == '!help' || (msgString == '!h')) { var notices = '***** Commands ******\x0A** !list or !l - displays public words'; // if (isMod || isHost) { notices += '\x0A** !add <word> - Add a word to public list.'; // } if (isHost) { notices += '\x0A** !addprivate <word> - Add a word to private list.\x0A** !listprivate - Shows Broadcaster only the private word list.'; }; cb['sendNotice'](notices, user); }; return msg }; if (isGrey) { if (checkPublicWords(msgString)) { msg['X-Spam'] = true }; if (checkPrivateWords(msgString)) { msg['X-Spam'] = true }; return msg }; if (isViewer || isMod || isFan) { if (checkPrivateWords(msgString)) { msg['X-Spam'] = true }; return msg }; if (isHost) { if (msgString['substring'](0, 12) == '!addprivate ') { wordsPrivate['push'](msgString['substring'](12)); }; if (msgString === '!listprivate') { ShowWords(wordsPrivate, cb['room_slug']); }; return msg }; if (isHost || isMod) { if ((msgString == '!list') || (msgString == '!l')) { ShowWords(wordsPublic, user); }; if (msgString['substring'](0, 5) == '!add ') { wordsPublic['push'](msgString['substring'](5)); ShowWords(wordsPublic, user); }; return msg; }; }); function checkPublicWords(inputString) { var remainAlpha = []; var alphaString = inputString['replace'](/[^a-zA-Z ]/gi, ''); // Strip anything not alpha var alphaSplit = alphaString['split'](' '); // Turn string into array at word boundaries remainAlpha = reduce(alphaSplit, wordsPublic); if (remainAlpha['length'] > 0) { return true }; return false } function checkPrivateWords(inputString) { var remainAlpha = []; var alphaString = inputString['replace'](/[^a-zA-Z ]/gi, ''); // Strip anything not alpha var alphaSplit = alphaString['split'](' '); // Turn string into array at word boundaries remainAlpha = reduce(alphaSplit, wordsPrivate); if (remainAlpha['length'] > 0) { return true }; return false } function reduce(inputString, inputList) { inputList = new RegExp(inputList['join']('|\\b')['toLowerCase']()); for (var remainingWords = [], i = inputString['length']; i--;) { inputList['test'](inputString[i]['toLowerCase']()) && remainingWords['unshift'](inputString[i]['toLowerCase']()) }; return remainingWords } function ShowWords(wordList, usr) { var notice = ''; var toUser = ''; notice = readList(wordList); if (usr == null || usr == undefined || usr['length'] == 0) { toUser = '' } else { toUser = usr }; cb['sendNotice'](notice, toUser, cb['settings']['backgroundColor'], cb['settings']['fontColor'], 'bold') } function readList(list) { var temp = ''; for (var i = 0; i < list['length']; i++) { if (temp['length'] > 0) { temp += ',' }; temp += list[i] }; return temp } function LoadSettings() { LoadArrays(cb['settings']['publicWords'], wordsPublic); LoadArrays(cb['settings']['privateWords'], wordsPrivate); } function LoadArrays(inputSettings, outputArray) { var temp1; var temp2; var temp3; temp1 = inputSettings; temp2 = temp1 ? temp1['split'](',') : ''; for (var i = 0; i <= temp2['length']; ++i) { temp3 = ''; if (temp2[i] != null) { temp3 = temp2[i]['replace'](/ +$/, ''); if (temp3['length'] > 0) { outputArray['push'](temp3) } } } } // Checks if setting is empty/not set -- from Bomb Bot Ultra ------------------- function isBlank(cbsetting) { var s; if (cbsetting) { s = cbsetting.trim(); } if (s == null || s == '' || s.substr(0, 9) == '[Optional') { return true; } else { return false; } } function init() { cb['sendNotice']('-----------------------------------------\x0A--- Ultra Mega Chatroom Battle Tank Cyborg Army \x0A --- by: Satan\x0A-----------------------------------------'); LoadSettings(); var notice = '***** Commands ******'; notice += '\x0A** !list or !l - Displays the list of banned words'; notice += '\x0A** !add <word> - Add a word to the list.'; notice += '\x0A** !addprivate <word> - Add a word to the private list.'; notice += '\x0A** !listprivate - Shows Broadcaster the private word list.'; notice += '\x0A** !help or !h - Displays this help message' // ShowWords(wordsPublic) cb['sendNotice'](notice, cb.room_slug, cb['settings']['backgroundColor'], cb['settings']['fontColor'], 'bold') } String['prototype']['trim'] = function() { return this['replace'](/^\s+|\s+$/g, '') }; Array['prototype']['contains'] = function(element) { var i = this['length']; while (i--) { if (this[i] === element) { return true } }; return false }; Array['prototype']['removeItem'] = function(key) { for (i = 0; i < this['length']; i++) { if (this[i] == key) { for (i2 = i; i2 < this['length'] - 1; i2++) { this[i2] = this[i2 + 1] }; this['length'] = this['length'] - 1; return } } }; init()
© Copyright Chaturbate 2011- 2026. All Rights Reserved.