Bots Home
|
Create an App
Mamooshkas Monsters
Author:
roydz
Description
Source Code
Launch Bot
Current Users
Created by:
Roydz
// Mamooshkas Monster bot // CB app settings cb.settings_choices = [ { name: 'doColoring', type: 'choice', label: 'Change text and background coloring for Mamooshkas Monsters (choose colours below)?', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes' }, { name: 'doText', type: 'choice', label: 'Add text labels in front of Mamooshkas Monsters (choose text below)?', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes' }, { name: 'maText', label: 'Text to put in front of Mamooshkas Monsters (e.g. EN)', type: 'str', minLength: 0, maxLength: 15, required: false, defaultValue: 'Madhouse Monster' }, { name: 'maBGColor', label: 'Mamooshkas Monsters background color - HTML colour code without starting \'#\' e.g. (F5B608 is orangey/gold)', type: 'str', minLength: 0, maxLength: 6, required: false, defaultValue: 'BF5FFF' }, { name: 'maMinTip', label: 'Minimum tip to become Mamooshkas Monsters', type: 'int', minValue: 1, defaultValue: 777 }, { name: 'maAnnounce', label: 'Text to show when someone tips to become Mamooshkas Monsters, the text MEMBERNAME will be replaced with the username of the new member (Note: graphics don\'t work in this text)', type: 'str', minLength: 0, maxLength: 10240, required: false, defaultValue: 'MEMBERNAME just became one of Mamooshkas Madhouse Monsters' }, { name: 'maMemberList', label: 'List of current Mamooshkas Monsters, separated by commas (and they need to be the CB username exactly)', type: 'str', minLength: 0, maxLength: 10240, required: false, defaultValue: 'tufty,freddy4fingers,trkxxx,rubygirl,capt6960,2moso2,roydz' }, { name: 'maRainText', label: 'Text to use for Mamooshkas Monsters rain lines', type: 'str', minLength: 0, maxLength: 80, required: false, defaultValue: 'Mamooshkas Madhouse Monsters' }, { name: 'maRainCount', label: 'Number of lines of Mamooshkas Monsters rain', type: 'int', minValue: 1, maxValue: 15, defaultValue: 10 } ]; var maMembers = {}; // For auto-silencing at least some of token_wh*re_c*nts usernames var twcRegex = /t.?k.?n.?wh.?r.?_c.?nt.?/i; cb.onMessage(function (msg) { // vars for ease of use var u = msg['user']; if ( isMA(u)) { msg['background'] = '#' + cb.settings.maBGColor; msg['m'] = "[" + cb.settings.maText + "] " + msg['m']; } if (twcRegex.test(u)){ // Auto-silencing at least some of token_wh*re_c*nts usernames msg['X-Spam'] = true; } return msg; }); cb.onTip(function (tip) { var amountTipped = parseInt(tip['amount']); if (amountTipped == cb.settings.maMinTip && !isMA(tip['from_user'])) { // Make Mamooshkas Monsters and announce it var announcement = cb.settings.maAnnounce.replace("MEMBERNAME", tip['from_user']); makeMA(tip['from_user']); for (var i = 0; i < cb.settings.maRainCount; i++) { cb.chatNotice(cb.settings.maRainText); } cb.chatNotice(announcement); } }); function isMA(username) { return (username in maMembers); } function makeMA(username) { maMembers[username] = {'u': 1}; } function grabSettings() { cb.log("starting grabbing settings"); // Get Mamooshkas Monsters if (cb.settings.maMemberList) { var maMemberSettings = cb.settings.maMemberList.split(','); for (var ii = 0; ii < maMemberSettings.length; ii++) { var clean = maMemberSettings[ii].toLowerCase().replace(/ /g,""); maMembers[clean] = {'u': 1}; } } cb.log("finished grabbing settings"); } grabSettings();
© Copyright Chaturbate 2011- 2026. All Rights Reserved.