Bots Home
|
Create an App
aperson1_kinkyinkky_test
Author:
aperson1test
Description
Source Code
Launch Bot
Current Users
Created by:
Aperson1test
/* This one should work pretty much the same as your current one, just with the improvements I mentioned. To list club members, type /clublist into chat. * The last line after serialized is what you can copy-paste into the memberList setting to load clubs (you can leave the Notice: part in, it will strip it out. * Figured that would make it faster to copy-paste). To populate the clubs the first time, take your current list and put semi-colons between them. In other words, * if your cc list is "user1,user2,user3", your kk list is "user4,user5", and your ha list is "user6,user7,user8", you would enter * "user1,user2,user3;user4,user5;user6,user7,user8". Again, you should only have to do that manually once, since /clublist will do it for you every time you log out. * There's a setting for whether /clublist should be available to just you, you and mods, or everyone, so make sure you set that to whatever you want it to be. * I would suggest making a new bot and putting the code in rather than updating your current one's code, that way settings aren't weirdly copied over * (since some have changed and some haven't) -- the defaults should be right, and you can always go back to set them up later if they aren't. * Also, that means if there is any issue with this, you can just quickly switch back to the other one. * Let me know if you run into any issues with it or if there's anything else you want me to add to it! */ // Kinkyinkky Club bot // CB app settings cb.settings_choices = [ { name: 'memberList', label: 'List of all club members. Each club is delimited by semicolons, and each member in each club is delimited by commas.', type: 'str', minLength: 0, maxLength: 10240, required: false, defaultValue: '' }, { name: 'doColoring', type: 'choice', label: 'Change text and background coloring for club members (choose colours below)?', choice1: 'Yes', choice2: 'No', required: true, defaultValue: 'Yes' }, { name: 'doText', type: 'choice', label: 'Add text labels in front of club members (choose text below)?', choice1: 'Yes', choice2: 'No', required: true, defaultValue: 'Yes' }, { name: 'doJoinAnnounce', label: 'Announce when club members join (choose text below)?', type: 'choice', choice1: 'Yes', choice2: 'No', required: true, defaultValue: 'Yes' }, { name: 'limitList', type: 'choice', label: 'Limit club listing (/clublist)?', choice1: 'Broadcaster Only', choice2: 'Broadcast and Mods', choice3: 'Everyone', required: true, defaultValue: 'Broadcaster and Mods' }, { name: 'ccText', label: 'Text to put in front of Cum Club members messages, the text will be put inside square brackets [ ]', type: 'str', minLength: 0, maxLength: 15, required: true, defaultValue: 'Cum Club' }, { name: 'ccTip', label: 'Tip to become Cum Club member', type: 'int', minValue: 1, required: true, defaultValue: 500 }, { name: 'ccAnnounce', label: 'Text to show when someone tips to become a Cum Club member, the text MEMBERNAME will be replaced with the username of the new (Note: graphics don\'t work in this text)', type: 'str', minLength: 0, maxLength: 10240, required: true, defaultValue: 'Welcome to the Cum Club, MEMBERNAME!' }, { name: 'ccJoinAnnounce', label: 'Text to show when a Cum Club member joins the room, the text MEMBERNAME will be replaced with the username of the new (Note: graphics don\'t work in this text)', type: 'str', minLength: 0, maxLength: 10240, required: true, defaultValue: 'Cum Club member MEMBERNAME has joined!' }, { name: 'ccTextColor', label: 'Cum Club members text color - HTML colour code without starting \'#\' e.g. (FFFFFF is white)', type: 'str', minLength: 0, maxLength: 6, required: true, defaultValue: '000000' }, { name: 'ccBGColor', label: 'Cum Club members background color - HTML colour code without starting \'#\' e.g. (000000 is black)', type: 'str', minLength: 0, maxLength: 6, required: true, defaultValue: 'D0EBF2' }, { name: 'kkText', label: 'Text to put in front of Kink Kult members messages, the text will be put inside square brackets [ ]', type: 'str', minLength: 0, maxLength: 15, required: true, defaultValue: 'Kink Kult' }, { name: 'kkTip', label: 'Tip to become Kink Kult member', type: 'int', minValue: 1, required: true, defaultValue: 510 }, { name: 'kkAnnounce', label: 'Text to show when someone tips to become a Kink Kult member, the text MEMBERNAME will be replaced with the username of the new (Note: graphics don\'t work in this text)', type: 'str', minLength: 0, maxLength: 10240, required: true, defaultValue: 'Welcome to the Kink Kult, MEMBERNAME!' }, { name: 'kkJoinAnnounce', label: 'Text to show when a Kink Kult member joins the room, the text MEMBERNAME will be replaced with the username of the new (Note: graphics don\'t work in this text)', type: 'str', minLength: 0, maxLength: 10240, required: true, defaultValue: 'Kink Kult member MEMBERNAME has joined!' }, { name: 'kkTextColor', label: 'Kink Kult members text color - HTML colour code without starting \'#\' e.g. (FFFFFF is white)', type: 'str', minLength: 0, maxLength: 6, required: true, defaultValue: '000000' }, { name: 'kkBGColor', label: 'Kink Kult members background color - HTML colour code without starting \'#\' e.g. (000000 is black)', type: 'str', minLength: 0, maxLength: 6, required: true, defaultValue: 'F2D7D0' }, { name: 'haText', label: 'Text to put in front of H4x0r messages, the text will be put inside square brackets [ ]', type: 'str', minLength: 0, maxLength: 15, required: true, defaultValue: 'H4x0r' }, { name: 'haAnnounce', label: 'Text to show when someone tips to become a H4x0r, the text MEMBERNAME will be replaced with the username of the new (Note: graphics don\'t work in this text)', type: 'str', minLength: 0, maxLength: 10240, required: true, defaultValue: 'MEMBERNAME broke the system and is now a H4x0r.' }, { name: 'haJoinAnnounce', label: 'Text to show when a h4x0r joins the room, the text MEMBERNAME will be replaced with the username of the new (Note: graphics don\'t work in this text)', type: 'str', minLength: 0, maxLength: 10240, required: true, defaultValue: 'H4x0r MEMBERNAME has joined!' }, { name: 'haTextColor', label: 'H4x0r text color - HTML colour code without starting \'#\' e.g. (FFFFFF is white)', type: 'str', minLength: 0, maxLength: 6, required: true, defaultValue: '000000' }, { name: 'haBGColor', label: 'H4x0r background color - HTML colour code without starting \'#\' e.g. (000000 is black)', type: 'str', minLength: 0, maxLength: 6, required: true, defaultValue: 'E8D0F2' }, ]; var ccMembers = []; var kkMembers = []; var haMembers = []; // 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 (iscc(u)) { if(cb.settings.doColoring == 'Yes') { msg['background'] = '#' + cb.settings.ccBGColor; msg['c'] = '#' + cb.settings.ccTextColor; } if(cb.settings.doText == 'Yes') { msg['m'] = "[" + cb.settings.ccText + "] " + msg['m']; } } else if (iskk(u)) { if(cb.settings.doColoring == 'Yes') { msg['background'] = '#' + cb.settings.kkBGColor; msg['c'] = '#' + cb.settings.kkTextColor; } if(cb.settings.doText == 'Yes') { msg['m'] = "[" + cb.settings.kkText + "] " + msg['m']; } } else if (isha(u)) { if(cb.settings.doColoring == 'Yes') { msg['background'] = '#' + cb.settings.haBGColor; msg['c'] = '#' + cb.settings.haTextColor; } if(cb.settings.doText == 'Yes') { msg['m'] = "[" + cb.settings.haText + "] " + msg['m']; } } if(msg['m'] == '/clublist') { msg['X-Spam'] = true; if(cb.settings.limitList == 'Broadcaster Only' && u != cb.room_slug) { setTimeout(function() {cb.sendNotice("You do not have permission to view the club list. Only the broadcaster may view the list.", u);}, 250); } else if(cb.settings.limitList == 'Broadcast and Mods' && u != cb.room_slug && !msg['is_mod']) { setTimeout(function() {cb.sendNotice("You do not have permission to view the club list. Only the broadcaster and moderators may view the list.", u);}, 250); } else { var currMembers = serialize(); setTimeout(function() {cb.sendNotice(cb.settings.ccText + ":\n" + currMembers[0], u, '#' + cb.settings.ccBGColor, '#' + cb.settings.ccTextColor);}, 250); setTimeout(function() {cb.sendNotice(cb.settings.kkText + ":\n" + currMembers[1], u, '#' + cb.settings.kkBGColor, '#' + cb.settings.kkTextColor);}, 500); setTimeout(function() {cb.sendNotice(cb.settings.haText + ":\n" + currMembers[2], u, '#' + cb.settings.haBGColor, '#' + cb.settings.haTextColor);}, 750); setTimeout(function() {cb.sendNotice("Serialized:\n" + currMembers[3], u);}, 1000); } } if (twcRegex.test(u)){ // Auto-silencing at least some of token_wh*re_c*nts usernames msg['X-Spam'] = true; } return msg; }); cb.onEnter(function(user) { if(cb.settings.doJoinAnnounce == 'Yes') { if(iscc(user['user'])) { setTimeout(function() {cb.sendNotice(cb.settings.ccJoinAnnounce.replace("MEMBERNAME", user['user']), '', '#' + cb.settings.ccBGColor, '#' + cb.settings.ccTextColor);}, 250); } else if(iskk(user['user'])) { setTimeout(function() {cb.sendNotice(cb.settings.kkJoinAnnounce.replace("MEMBERNAME", user['user']), '', '#' + cb.settings.kkBGColor, '#' + cb.settings.kkTextColor);}, 250); } else if(isha(user['user'])) { setTimeout(function() {cb.sendNotice(cb.settings.haJoinAnnounce.replace("MEMBERNAME", user['user']), '', '#' + cb.settings.haBGColor, '#' + cb.settings.haTextColor);}, 250); } } }); cb.onTip(function (tip) { var amountTipped = parseInt(tip['amount']); var u = tip['from_user']; if (amountTipped == cb.settings.ccTip && !iscc(u) && !isha(u)) { if(iskk(u)){ // Make h4x0r and announce it makeha(tip['from_user']); kkMembers.splice(kkMembers.indexOf(tip['from_user']), 1); } else { // Make Cum Club and announce it makecc(tip['from_user']); } } else if (amountTipped == cb.settings.kkTip && !iskk(u) && !isha(u)) { if(iscc(u)){ // Make h4x0r and announce it makeha(tip['from_user']); ccMembers.splice(ccMembers.indexOf(tip['from_user']), 1) } else { // Make Kink Kult and announce it makekk(tip['from_user']); } } else if (amountTipped == (cb.settings.ccTip + cb.settings.kkTip) && !isha(u)) { // Make h4x0r and announce it makeha(tip['from_user']); } }); function iscc(username) { return ccMembers.includes(username); } function iskk(username) { return kkMembers.includes(username); } function isha(username) { return haMembers.includes(username); } function makecc(username) { var announcement = cb.settings.ccAnnounce.replace("MEMBERNAME", username); ccMembers.push(username); setTimeout(function() {cb.sendNotice(announcement, '', '#' + cb.settings.ccBGColor, '#' + cb.settings.ccTextColor);}, 250); } function makekk(username) { var announcement = cb.settings.kkAnnounce.replace("MEMBERNAME", username); kkMembers.push(username); setTimeout(function() {cb.sendNotice(announcement, '', '#' + cb.settings.kkBGColor, '#' + cb.settings.kkTextColor);}, 250); } function makeha(username) { var announcement = cb.settings.haAnnounce.replace("MEMBERNAME", username); haMembers.push(username); setTimeout(function() {cb.sendNotice(announcement, '', '#' + cb.settings.haBGColor, '#' + cb.settings.haTextColor);}, 250); } function deserialize() { if(!cb.settings.memberList) return; var members = cb.settings.memberList.replace('Notice: ', '').split(';'); // Get Cum Club if (members[0]) { var ccMemberSettings = members[0].split(','); for (var i = 0; i < ccMemberSettings.length; i++) { var clean = ccMemberSettings[i].toLowerCase().replace(/ /g,""); ccMembers.push(clean); } } // Get Kink Kult if (members[1]) { var kkMemberSettings = members[1].split(','); for (var i = 0; i < kkMemberSettings.length; i++) { var clean = kkMemberSettings[i].toLowerCase().replace(/ /g,""); kkMembers.push(clean); } } // Get h4x0rs if (members[2]) { var haMemberSettings = members[2].split(','); for (var i = 0; i < haMemberSettings.length; i++) { var clean = haMemberSettings[i].toLowerCase().replace(/ /g,""); haMembers.push(clean); } } } function serialize() { var tmp = [ccMembers.join(','), kkMembers.join(','), haMembers.join(',')]; tmp[3] = tmp.join(';'); return tmp; } deserialize();
© Copyright Chaturbate 2011- 2024. All Rights Reserved.