Bots Home
|
Create an App
Test782613876213
Author:
raising_arizona
Description
Source Code
Launch Bot
Current Users
Created by:
Raising_Arizona
// ====================================================== // // ================ Roxie's Tip Menu ==================== // // ====================================================== // // ============ Written By chopper_daddy ================ // // ====================================================== // // = Based on Tip Menu Single Line Plus by: badbadbubba = // // ====================================================== // var HEART = '\u2665'; // ♥ BDIAMOND = '\u2666'; // ♦ BSTAR = '\u2605'; // ★ var separator_char = " | "; var tip_amt = 0; var MAXITEMS = 20; var MAXSEP = 9; var modelName; var messageIntro; var messageMenu; var messageIntroFan; var messageMenuFan; var messageOutro; var mip = []; var mi = []; var menuItemPrice; var menuItem; 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' }, { label: 'Text Heart', shortcut: HEART }, { label: 'Text Diamond', shortcut: BDIAMOND }, { label: 'Text Star', shortcut: BSTAR } ] cb.settings_choices = [ { name: 'modelName', type: 'str', label: 'Performer Name', required: false }, { name: 'thanksM', type: 'str', label: 'Thank You Message', required: false }, { name: 'sepchar', type: 'choice', choice1: 'Vertical Bar', choice2: 'Hearts', choice3: 'Glitter', choice4: 'Flowers', choice5: 'Bow', choice6: 'Hearts2', choice7: 'Smiley', choice8: 'Text Heart', choice9: 'Text Diamond', choice10: 'Text Star', defaultValue: 'Vertical Bar', label: 'Separator character', required: false }, { name: 'customsep', type: 'str', label: 'Custom Separator', required: false }, { name: 'fanclub_on', type:'choice', label: 'Turn Fanclub Menu On?', choice1: 'on', choice2: 'off', defaultValue: 'off'}, { name: 'item1', type: 'str', label: 'Item 1' }, { name: 'item1price', type: 'int', minValue: 0, maxValue: 99999999, label: 'Item 1 Price' }, { name: 'item2', type: 'str', required: false, label: 'Item 2' }, { name: 'item2price', type: 'int', minValue: 0, maxValue: 99999999, required: false, label: 'Item 2 Price' }, { name: 'item3', type: 'str', required: false, label: 'Item 3' }, { name: 'item3price', type: 'int', minValue: 0, maxValue: 99999999, required: false, label: 'Item 3 Price' }, { name: 'item4', type: 'str', required: false, label: 'Item 4' }, { name: 'item4price', type: 'int', minValue: 0, maxValue: 99999999, required: false, label: 'Item 4 Price' }, { name: 'item5', type: 'str', required: false, label: 'Item 5' }, { name: 'item5price', type: 'int', minValue: 0, maxValue: 99999999, required: false, label: 'Item 5 Price' }, { name: 'item6', type: 'str', required: false, label: 'Item 6' }, { name: 'item6price', type: 'int', minValue: 0, maxValue: 99999999, required: false, label: 'Item 6 Price' }, { name: 'item7', type: 'str', required: false, label: 'Item 7' }, { name: 'item7price', type: 'int', minValue: 0, maxValue: 99999999, required: false, label: 'Item 7 Price' }, { name: 'item8', type: 'str', required: false, label: 'Item 8' }, { name: 'item8price', type: 'int', minValue: 0, maxValue: 99999999, required: false, label: 'Item 8 Price' }, { name: 'item9', type: 'str', required: false, label: 'Item 9' }, { name: 'item9price', type: 'int', minValue: 0, maxValue: 99999999, required: false, label: 'Item 9 Price' }, { name: 'item10', type: 'str', required: false, label: 'Item 10' }, { name: 'item10price', type: 'int', minValue: 0, maxValue: 99999999, required: false, label: 'Item 10 Price' }, { name: 'item11', type: 'str', required: false, label: 'Item 11' }, { name: 'item11price', type: 'int', minValue: 0, maxValue: 99999999, required: false, label: 'Item 11 Price' }, { name: 'item12', type: 'str', required: false, label: 'Item 12' }, { name: 'item12price', type: 'int', minValue: 0, maxValue: 99999999, required: false, label: 'Item 12 Price' }, { name: 'item13', type: 'str', required: false, label: 'Item 13' }, { name: 'item13price', type: 'int', minValue: 0, maxValue: 99999999, required: false, label: 'Item 13 Price' }, { name: 'item14', type: 'str', required: false, label: 'Item 14' }, { name: 'item14price', type: 'int', minValue: 0, maxValue: 99999999, required: false, label: 'Item 14 Price' }, { name: 'item15', type: 'str', required: false, label: 'Item 15' }, { name: 'item15price', type: 'int', minValue: 0, maxValue: 99999999, required: false, label: 'Item 15 Price' }, { name: 'item16', type: 'str', required: false, label: 'Item 16' }, { name: 'item16price', type: 'int', minValue: 0, maxValue: 99999999, required: false, label: 'Item 16 Price' }, { name: 'item17', type: 'str', required: false, label: 'Item 17' }, { name: 'item17price', type: 'int', minValue: 0, maxValue: 99999999, required: false, label: 'Item 17 Price' }, { name: 'item18', type: 'str', required: false, label: 'Item 18' }, { name: 'item18price', type: 'int', minValue: 0, maxValue: 99999999, required: false, label: 'Item 18 Price' }, { name: 'item19', type: 'str', required: false, label: 'Item 19' }, { name: 'item19price', type: 'int', minValue: 0, maxValue: 99999999, required: false, label: 'Item 19 Price' }, { name: 'item20', type: 'str', required: false, label: 'Item 20' }, { name: 'item20price', type: 'int', minValue: 0, maxValue: 99999999, required: false, label: 'Item 20 Price' }, { name: 'noticecolor', type: 'str', label: 'Notice Color (default: red)', defaultValue: '#9013FE' }, { name: 'noticebg', type: 'str', label: 'Notice Background Color (default: white)', defaultValue: '#ffffff' }, { name: 'chat_ad', type: 'int', minValue: 1, maxValue: 999, defaultValue: 1, label: 'Delay in minutes between notice being displayed (min 1)' } ]; cb.onTip(tip => { tip_amt = parseInt(tip['amount']); for (var i = 1; i <= MAXITEMS; i++) { if (tip_amt == mip[i] && !tip['from_user_in_fanclub'] || tip_amt == mip[i] && cb.settings.fanclub_on == 'off') { cb.sendNotice(`${tip['from_user']} tipped for ${mi[i]}\u00A0`, '', cb.settings['noticecolor'], cb.settings['noticebg'], 'bold', ''); } else if (tip_amt == Math.round(mip[i] * .6) && tip['from_user_in_fanclub'] && cb.settings.fanclub_on == 'on') { cb.sendNotice(`${tip['from_user']} tipped for ${mi[i]}\u00A0`, '', cb.settings['noticecolor'], cb.settings['noticebg'], 'bold', ''); } } cb.setTimeout(() => { cb.sendNotice(`${HEART} ${cb.settings.thanksM} ${HEART}\u00A0`, tip['from_user'], cb.settings['noticebg'], cb.settings['noticecolor'], 'bold', ''); }, 500); }); cb.onEnter(user => { if (user['has_tokens'] && !user['in_fanclub']) { notice(user['user'], null); } if (user['has_tokens'] && user['in_fanclub']) { notice(user['user'], 'singleFan'); } }); cb.onMessage(msg => { if (msg['m'] == '/menu') { msg['X-Spam'] = true; notice(msg['user'], null); } return msg; }); // function chatAd() { // notice(null, 'red'); // notice(null, 'darkblue'); // notice(null, 'lightpurple'); // notice(null, 'darkpurple'); // notice(null, 'lightblue'); // cb.setTimeout(chatAd, (cb.settings.chat_ad * 60000)); // } // function chatAdFan() { // notice(null, 'green'); // cb.setTimeout(chatAdFan, (cb.settings.chat_ad * 60000)); // } // cb.setTimeout(chatAd, (cb.settings.chat_ad * 60000)); // if (cb.settings.fanclub_on == 'on') { // cb.setTimeout(chatAdFan, (cb.settings.chat_ad * 60000)); // } function init() { messageMenu = ''; messageMenuFan = ''; if (cb.settings['modelName']) { modelName = cb.settings['modelName']; } else { modelName = cb.room_slug; } for (i = 0; i <= MAXSEP - 1; i++) { if (cb.settings['customsep']) { separator_char = `${cb.settings['customsep']}`; } else if (cb.settings['sepchar'] == separators[i].label) { separator_char = ` ${separators[i].shortcut} `; } } for (i = 1; i <= MAXITEMS; i++) { menuItem = cb.settings['item' + i]; menuItemPrice = cb.settings['item' + i + 'price']; mip[i] = menuItemPrice; mi[i] = menuItem; if (menuItem != '' && menuItem != null) { messageMenu += `${menuItem} (${menuItemPrice}) ${separator_char}\u00A0`; messageMenuFan += `${menuItem} (${Math.round(menuItemPrice * .6)}) ${separator_char}\u00A0`; } } messageIntro = `${separator_char} ${modelName}'s Tip Menu ${separator_char}\u00A0`; messageOutro = `${separator_char} ${cb.settings.thanksM} ${separator_char}\u00A0`; messageIntroFan = `${separator_char} ${modelName}'s Fan Only Tip Menu ${separator_char}\u00A0`; } function notice(usr, group) { var u = usr; var g = group; if (u === null) { u = '' } if (g === null) { g = '' } if (g = 'green' && cb.settings.fanclub_on == 'on') { cb.sendNotice(messageIntroFan, u, cb.settings['noticecolor'], cb.settings['noticebg'], 'normal', g); cb.sendNotice(messageMenuFan, u, cb.settings['noticebg'], cb.settings['noticecolor'], 'normal', g); } else if (g = 'singleFan' && cb.settings.fanclub_on == 'on') { cb.sendNotice(messageIntroFan, u, cb.settings['noticecolor'], cb.settings['noticebg'], 'normal', ''); cb.sendNotice(messageMenuFan, u, cb.settings['noticebg'], cb.settings['noticecolor'], 'normal', ''); } else { cb.sendNotice(messageIntro, u, cb.settings['noticecolor'], cb.settings['noticebg'], 'normal', g); cb.sendNotice(messageMenu, u, cb.settings['noticebg'], cb.settings['noticecolor'], 'normal', g); } cb.sendNotice(messageOutro, u, cb.settings['noticecolor'], cb.settings['noticebg'], 'normal', g); } init();
© Copyright Chaturbate 2011- 2024. All Rights Reserved.