Bots Home
|
Create an App
test141234
Author:
hardcan0n
Description
Source Code
Launch Bot
Current Users
Created by:
Hardcan0n
/* Bevz Bot Created by HardCan0n Version 0.9 */ cb.settings_choices = [{ name: 'poor_user_control', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'No', label: 'Allow grey users to chat?' }, { name: 'init_white_list', type: 'str', minLength: 1, maxLength: 1000, required: false, defaultValue: 'hardcan0n', label: 'WhiteList' }]; var box = { whiteList: [], initWhihtList: function() { var strList = String(cb.settings.init_white_list).replace(/\s+/g, ''); box.whiteList = strList.split(','); }, makeWhite: function(user) { if (!cbjs.arrayContains(box.whiteList, user)) { box.whiteList.push(user); cb.sendNotice("User " + user + " has been added to white list.", cb.room_slug, "#FFFFFF", "#00B61C", "bold"); } }, killWhite: function(user) { if (cbjs.arrayContains(box.whiteList, user)) { cbjs.arrayRemove(box.whiteList, user); cb.sendNotice("User " + user + " has been removed from white list.", cb.room_slug, "#FFFFFF", "#DC5500", "bold"); } }, showList: function() { cb.sendNotice("WhiteList: " + box.whiteList.join() + ".", cb.room_slug, "#000000", "#E2E645", "bold"); }, greyChatPermission: true, testSpam: function(m) { if (box.greyChatPermission || cbjs.arrayContains(box.whiteList, m['user']) || m['has_tokens'] || m['tipped_tons_recently'] || m['tipped_alot_recently'] || m['tipped_recently'] || m['in_fanclub'] || m['is_mod'] == true) { return false; } else return true; }, checkCommand: function(c) { var flag; var cmd = c['m'].split(" "); switch (cmd[0]) { case '/allow': box.makeWhite(cmd[1]); flag = true; break; case '/block': box.killWhite(cmd[1]); flag = true; break; case '/list': box.showList(); flag = true; break; case '/url': cb.sendNotice("Url : " + cmd[2], cmd[1] , "#FFFFFF", "#6200bd", "bold"); flag = true; break; default: flag = false; } return flag; } } function init() { if (cb.settings.poor_user_control == 'No') box.greyChatPermission = false; box.initWhihtList(); cb.sendNotice("Hello everyone.\nWelcome tp my room"); cb.onMessage(function(msg) { cb.log(msg); if (box.testSpam(msg)) { msg['X-Spam'] = true; cb.sendNotice("Sorry. You don't have enough tokens to message me.", msg['user'], "#FFFFFF", "#B90000", "bold"); } else { if (msg['user'] == cb.room_slug) { if (box.checkCommand(msg)) msg['X-Spam'] = true; } } return msg; }); } init();
© Copyright Chaturbate 2011- 2024. All Rights Reserved.