Apps Home
|
Create an App
Queen_Chloe Kingdom
Author:
shaemus_the_irish
Description
Source Code
Launch App
Current Users
Created by:
Shaemus_The_Irish
// Queen_Chloe's court // CB app settings cb.settings_choices = [ {name: 'doColoring', type: 'choice', label: 'Change text and background coloring for members (choose colors below)?', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes'}, {name: 'doText', type: 'choice', label: 'Add text labels in front of members messages (choose text below)?', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes'}, {name: 'f1Text', label: 'Text to put in front of Knights circle members messages (e.g. smoke), the text will be put inside square brackets []', type: 'str', minLength: 0, maxLength: 20, required: false, defaultValue: 'Knights circle'}, {name: 'f1TextColor', label: 'Knights circle members text color - HTML colour code without starting \'#\' e.g. (000000 is black)', type: 'str', minLength: 0, maxLength: 6, required: false, defaultValue: '000000'}, {name: 'f1BGColor', label: 'Knights circle members background color - HTML colour code without starting \'#\' e.g. (7FFF00 is chartreuse)', type: 'str', minLength: 0, maxLength: 6, required: false, defaultValue: 'FFCAFD'}, {name: 'f1MinTip', label: 'Minimum tip to become Knights circle member', type: 'int', minValue: 1, defaultValue: 200}, {name: 'f1Announce', label: 'Text to show when someone tips to become a Knights circle 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: false, defaultValue: 'MEMBERNAME just joined Knights circle!'}, {name: 'f1MemberList', label: 'List of current Knights circle members, separated by commas (and they need to be the CB username exactly)', type: 'str', minLength: 0, maxLength: 10240, required: false, defaultValue: 'shaemus_the_irish'}, {name: 'f1RainText', label: 'Text to use for Knights circle rain lines', type: 'str', minLength: 0, maxLength: 80, required: false, defaultValue: 'Knights circle MEMBER'}, {name: 'f1RainCount', label: 'Number of lines of Knights circle rain', type: 'int', minValue: 1, maxValue: 15, defaultValue: 15}, {name: 'f2Text', label: 'Text to put in front of Queens court messages (e.g. hr)', type: 'str', minLength: 0, maxLength: 15, required: false, defaultValue: 'Queens Court'}, {name: 'f2TextColor', label: 'Queens court text color - HTML colour code without starting \'#\' e.g. (000000 is black)', type: 'str', minLength: 0, maxLength: 6, required: false, defaultValue: '000000'}, {name: 'f2BGColor', label: 'Queens court background color - HTML colour code without starting \'#\' e.g. (01DFD7 is light blue)', type: 'str', minLength: 0, maxLength: 6, required: false, defaultValue: 'FF92FA'}, {name: 'f2MinTip', label: 'Minimum tip to become Queens court', type: 'int', minValue: 1, defaultValue: 1000}, {name: 'f2Announce', label: 'Text to show when someone tips to become a Queens court, 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 Joined the Queens court!'}, {name: 'f2MemberList', label: 'List of current Queens court, separated by commas (and they need to be the CB username exactly)', type: 'str', minLength: 0, maxLength: 10240, required: false, defaultValue: 'shaemus_the_irish'}, {name: 'f2RainText', label: 'Text to use for Queens court rain lines', type: 'str', minLength: 0, maxLength: 80, required: false, defaultValue: 'Queens court Queens court Queens court Queens court!'}, {name: 'f2RainCount', label: 'Number of lines of Queens court rain', type: 'int', minValue: 1, maxValue: 15, defaultValue: 15} ]; var f1Members = {}; var f2Members = {}; var ffNotice = "Tip 200 to become Knights circle Member !!" Notice = "Tip 1000 for For Queens Court !!" Notice = "Follow Queen_Chloe" // For auto-silencing at least some of token_wh*re_c*nts usernames var twcRegex = /t.?k.?n.?wh.?r.?_c.?nt.?/i; function showFFNotice(){ cb.chatNotice(ffNotice); cb.setTimeout(showFFNotice,900000); } cb.onMessage(function (msg) { // vars for ease of use var u = msg['user']; if (isF2(u)) { msg['background'] = '#' + cb.settings.f2BGColor; msg['c'] = '#' + cb.settings.f2TextColor; msg['m'] = "[" + cb.settings.f2Text + "] " + msg['m']; } else if (isF1(u)) { msg['background'] = '#' + cb.settings.f1BGColor; msg['c'] = '#' + cb.settings.f1TextColor; msg['m'] = "[" + cb.settings.f1Text + "] " + 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.f2MinTip && !isF2(tip['from_user'])) { // Make Queen Court and announce it var announcement = cb.settings.f2Announce.replace("MEMBERNAME", tip['from_user']); makeF2(tip['from_user']); for (var i = 0; i < cb.settings.f2RainCount; i++) { cb.chatNotice(cb.settings.f2RainText); } cb.chatNotice(announcement); } else if (amountTipped >= cb.settings.f1MinTip && !isF1(tip['from_user'])) { // Make Knights circle and announce it var announcement = cb.settings.f1Announce.replace("MEMBERNAME", tip['from_user']); makeF1(tip['from_user']); for (var i = 0; i < cb.settings.f1RainCount; i++) { cb.chatNotice(cb.settings.f1RainText); } cb.chatNotice(announcement); } }); function isF2(username) { return (username in f2Members); } function isF1(username) { return (username in f1Members); } function makeF2(username) { f2Members[username] = {'u': 1}; } function makeF1(username) { f1Members[username] = {'u': 1}; } function grabSettings() { cb.log("starting grabbing settings"); // Get Knights circle members if (cb.settings.f1MemberList) { var f1MemberSettings = cb.settings.f1MemberList.split(','); for (var ii = 0; ii < f1MemberSettings.length; ii++) { var clean = f1MemberSettings[ii].toLowerCase().replace(/ /g, ""); f1Members[clean] = {'u': 1}; } } // Get Queens Court if (cb.settings.F2MemberList) { var f2MemberSettings = cb.settings.f2MemberList.split(','); for (var ii = 0; ii < f2MemberSettings.length; ii++) { var clean = f2MemberSettings[ii].toLowerCase().replace(/ /g, ""); f2Members[clean] = {'u': 1}; } } cb.log("finished grabbing settings"); } grabSettings(); showFFNotice();
© Copyright Chaturbate 2011- 2026. All Rights Reserved.