Apps Home
|
Create an App
tert
Author:
nickvise
Description
Source Code
Launch App
Current Users
Created by:
Nickvise
cb.settings_choices = [ /**** 1. PERSONALIZATION ****/ { name: 'colorscheme', label: '1.) PERSONALIZATION ........................................... Color Scheme:', type: 'choice', choice1: 'Purple', choice2: 'Pink', choice3: 'Orange', choice4: 'Red', choice5: 'Green', choice6: 'Teal', choice7: 'Grey', choice8: 'Custom (Please define below)', required: false }, { name: 'darkcolor', label: 'Custom Dark Color (Hex #)', type: 'str', defaultValue: '[Optional - Set color scheme to "Custom" above]', required: false }, { name: 'lightcolor', label: 'Custom Light Color (Hex #)', type: 'str', defaultValue: '[Optional - Set color scheme to "Custom" above]', required: false }, { name: 'enterMessage', label: 'Welcome Message', type: 'str', minLength: 1, maxLength: 1000, defaultValue: '[Optional - Leave blank in busy rooms, as it can cause CB bots to crash]', required: false }, /**** 2. ROTATING NOTIFIER ****/ { name: 'notifierSpam', label: '2.) ROTATING NOTIFIER ............................. Use rotating notifier?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes', required: false }, { name: 'notifierTimer', label: 'Interval (in mins) for rotating notices', type: 'int', minValue: 1, maxValue: 60, defaultValue: 4, required: false }, { name: 'spamMessage1', label: 'Notice #1', type: 'str', minLength: 1, maxLength: 1000, defaultValue: '[Optional - use {newline} for line break]', required: false }, { name: 'spamMessage2', label: 'Notice #2', type: 'str', minLength: 1, maxLength: 1000, defaultValue: '[Optional - use {newline} for line break]', required: false }, { name: 'spamMessage3', label: 'Notice #3', type: 'str', minLength: 1, maxLength: 1000, defaultValue: '[Optional - use {newline} for line break]', required: false }, { name: 'spamMessage4', label: 'Notice #4', type: 'str', minLength: 1, maxLength: 1000, defaultValue: '[Optional - use {newline} for line break]', required: false }, { name: 'spamMessage5', label: 'Notice #5', type: 'str', minLength: 1, maxLength: 1000, defaultValue: '[Optional - use {newline} for line break]', required: false }, { name: 'spamMessage6', label: 'Notice #6', type: 'str', minLength: 1, maxLength: 1000, defaultValue: '[Optional - use {newline} for line break]', required: false }, { name: 'spamMessage7', label: 'Notice #7', type: 'str', minLength: 1, maxLength: 1000, defaultValue: '[Optional - use {newline} for line break]', required: false }, { name: 'spamMessage8', label: 'Notice #8', type: 'str', minLength: 1, maxLength: 1000, defaultValue: '[Optional - use {newline} for line break]', required: false }, /**** 3. TIP MENU ****/ { name: 'TipMenu', label: '3.) TIP MENU ............................. Use Tip Menu?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes', required: false }, { name: 'sepchar', type: 'choice', choice1: 'Vertical Bar', choice2: 'Hearts', choice3: 'Glitter', choice4: 'Flowers', choice5: 'Bow', choice6: 'Hearts2', choice7: 'Smiley', defaultValue: 'Vertical Bar', label: "Separator character" }, {name: 'item1', type: 'str', label: 'Item 1 (eg 10--flash tits)'}, {name: 'item2', type: 'str', required: false, label: 'Item 2'}, {name: 'item3', type: 'str', required: false, label: 'Item 3'}, {name: 'item4', type: 'str', required: false, label: 'Item 4'}, {name: 'item5', type: 'str', required: false, label: 'Item 5'}, {name: 'item6', type: 'str', required: false, label: 'Item 6'}, {name: 'item7', type: 'str', required: false, label: 'Item 7'}, {name: 'item8', type: 'str', required: false, label: 'Item 8'}, {name: 'item9', type: 'str', required: false, label: 'Item 9'}, {name: 'item10', type: 'str', required: false, label: 'Item 10'}, {name: 'item11', type: 'str', required: false, label: 'Item 11'}, {name: 'item12', type: 'str', required: false, label: 'Item 12'}, {name: 'item13', type: 'str', required: false, label: 'Item 13'}, {name: 'item14', type: 'str', required: false, label: 'Item 14'}, {name: 'item15', type: 'str', required: false, label: 'Item 15'}, {name: 'item16', type: 'str', required: false, label: 'Item 16'}, {name: 'item17', type: 'str', required: false, label: 'Item 17'}, {name: 'item18', type: 'str', required: false, label: 'Item 18'}, {name: 'item19', type: 'str', required: false, label: 'Item 19'}, {name: 'item20', type: 'str', required: false, label: 'Item 20'}, {name: 'item21', type: 'str', required: false, label: 'Item 21'}, {name: 'item22', type: 'str', required: false, label: 'Item 22'}, {name: 'item23', type: 'str', required: false, label: 'Item 23'}, {name: 'item24', type: 'str', required: false, label: 'Item 24'}, {name: 'item25', type: 'str', required: false, label: 'Item 25'}, {name: 'item26', type: 'str', required: false, label: 'Item 26'}, {name: 'item27', type: 'str', required: false, label: 'Item 27'}, {name: 'item28', type: 'str', required: false, label: 'Item 28'}, {name: 'item29', type: 'str', required: false, label: 'Item 29'}, {name: 'item30', type: 'str', required: false, label: 'Item 30'}, {name: 'noticecolor', type: 'str', label: 'Notice color (html code default red #FF0000)', defaultValue: '#FF0000'}, { name: 'chat_ad', type: 'int', minValue: 1, maxValue: 999, defaultValue: 1, label: 'Delay in minutes between notice being displayed (minimum 1)' } ]; /************************************************************************************************************************************ ***** Global Variables ************************************************************************************************************** ************************************************************************************************************************************/ var noticeArray = []; // Array of rotating notices var noticeNum = 0; // Index into rotating notice var notifierTimer = parseInt(cb.settings.notifierTimer); // user defined interval for leader spam var tipNote = ''; //colors and styles var yellow_light = "#FFFF55"; var mod_orange = "#DC5500"; var white = "#ffffff"; var theme_dark = "#143536"; function isBlank(cbsetting) { var s; if (cbsetting) { s = cbsetting.trim(); } return s == null || s === '' || s.substr(0, 9) === '[Optional'; } function addNotice(m) { if (!isBlank(m)) { noticeArray.push(m); } } function parseRotating() { // Parse setup screen for rotating notices addNotice(cb.settings.spamMessage1); addNotice(cb.settings.spamMessage2); addNotice(cb.settings.spamMessage3); addNotice(cb.settings.spamMessage4); addNotice(cb.settings.spamMessage5); addNotice(cb.settings.spamMessage6); addNotice(cb.settings.spamMessage7); addNotice(cb.settings.spamMessage8); } function notify(message, u, bg, c, w) { cb.sendNotice(message, u, "#ffffff", "#a34576", "bold"); } function notifyThemePlain(message, u, c) { bg = white; if (c == null) { c = theme_dark; } notify(message, u, bg, c); } function sendRotating() { // Send the next rotating notice if (noticeArray.length) { // Since we pushed, there should be no gaps, even if there were some // in the GUI. But check that it's valid, just in case. if (noticeArray[noticeNum]) { notifyThemePlain(noticeArray[noticeNum]); } noticeNum += 1; if (noticeNum >= noticeArray.length) { noticeNum = 0; } } } function notifierSpam() { notifierTimeout = setTimeout(function() { if(notifierSpamTGL == 1) { if (noticeArray.length) { sendRotating(); notifierSpam(); } } }, notifierTimer*minuteMS); } /************************************************************************************************************************************ ***** onTip ************************************************************************************************************************* ************************************************************************************************************************************/ var separator_char = "| "; var msg; var MAXITEMS = 30; var tipmenuprice = []; var tipmenuitem = []; var minuteMS = parseInt(60000); // one minute in milliseconds var MAXSEP = 6; separators = [ {label: 'Hearts', shortcut: ':heart2'}, {label: 'Glitter', shortcut: ':pixelglitter'}, {label: 'Flowers', shortcut: ':tinyflower2'}, {label: 'Bow', shortcut: ':bluebow'}, {label: 'Hearts2', shortcut: ':pixelheart'}, {label: 'Smiley', shortcut: ':smile'} ]; cb.onTip(function (tip) { var thisTip = parseInt(tip['amount']); var thisTipper = tip['from_user']; var tipNote = tip['message']; var tip_amt = parseInt(tip['amount']); for (var i = 1; i <= MAXITEMS; i++) { if (tip_amt === tipmenuprice[i]) { cb.sendNotice(tip['from_user'] + ' tipped for ' + tipmenuitem[i], '', '', cb.settings['noticecolor'], 'bold'); } } if (cb.settings.notifierTip.substr(0, 2) !== 'No' && thisTip >= cb.settings.tipMessageMin) { var to = ''; tipMessage = cb.settings.tipMessage.replace('{username}', thisTipper); if (cb.settings.notifierTip === 'Privately to tipper only') { to = thisTipper; } notify(tipMessage, to, yellow_light, mod_orange); } }); function chatAd() { cb.sendNotice(msg, '', '', cb.settings['noticecolor'], 'bold'); cb.setTimeout(chatAd, (cb.settings.chat_ad * 60000)); } cb.setTimeout(chatAd, (cb.settings.chat_ad * 60000)); function init() { for (i = 0; i <= MAXSEP - 1; i++) { if (cb.settings['sepchar'] == separators[i].label) { separator_char = separators[i].shortcut + ' '; } } if(cb.settings.notifierSpam === 'Yes') { parseRotating(); notifierSpamTGL = 1; cb.setTimeout(function() { sendRotating(); notifierSpam(); // random amount of time not more than chosen interval }, Math.floor((Math.random() * notifierTimer) + 1)*minuteMS); } msg = 'Tip Menu: '; for (i = 1; i <= MAXITEMS; i++) { var tmp; tmp = cb.settings['item' + i]; if (tmp) { var arr = tmp.split('--'); var amt = parseInt(arr[0]); if (amt > 0) { tipmenuprice[i] = amt; tipmenuitem[i] = arr[1]; if (i >= 2) { msg += separator_char; } msg += arr[1] + '(' + amt + ') '; } } } cb.sendNotice(msg, '', '', cb.settings['noticecolor'], 'bold'); } init(); cb.onEnter(function(user) { var u = user['user']; if (!isBlank(cb.settings.enterMessage)) { var enterMessage = cb.settings.enterMessage.replace(/{newline}/gi, "\n"); notifyThemePlain(enterMessage,u); } // Add mod to modArray if(user['is_mod']) { if (!cbjs.arrayContains(modArray,u)) { modArrayPopulate(u); modAndEmodArrayPopulate(u); if(cb.settings.wordlistShowModerators == 'Yes') { modBlockMsgArrayPopulate(u); } } } });
© Copyright Chaturbate 2011- 2024. All Rights Reserved.