Apps Home
|
Create an App
RoomFlow
Author:
with_marie
Description
Source Code
Launch App
Current Users
Created by:
With_Marie
/* ========================================= ROOMFLOW V1 All-in-One Chaturbate Room Manager ========================================= */ cb.settings_choices = [ // ----- GOAL ----- { name: 'goal_enabled', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes', label: 'GOAL - Turn goal tracker on?' }, { name: 'goal_amount', type: 'int', minValue: 1, defaultValue: 3000, label: 'GOAL - Token amount' }, { name: 'goal_name', type: 'str', defaultValue: 'Room Goal', label: 'GOAL - Goal description' }, // ----- TIP MENU ----- { name: 'menu_enabled', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes', label: 'MENU - Turn tip menu on?' }, {name:'item1', type:'str', defaultValue:'Blow a kiss', label:'MENU - Item 1'}, {name:'price1', type:'int', defaultValue:5, label:'MENU - Item 1 price'}, {name:'item2', type:'str', defaultValue:'Heart hands', label:'MENU - Item 2'}, {name:'price2', type:'int', defaultValue:10, label:'MENU - Item 2 price'}, {name:'item3', type:'str', defaultValue:'Take socks off', label:'MENU - Item 3'}, {name:'price3', type:'int', defaultValue:40, label:'MENU - Item 3 price'}, {name:'item4', type:'str', defaultValue:'Show feet', label:'MENU - Item 4'}, {name:'price4', type:'int', defaultValue:50, label:'MENU - Item 4 price'}, {name:'item5', type:'str', defaultValue:'Turn around', label:'MENU - Item 5'}, {name:'price5', type:'int', defaultValue:100, label:'MENU - Item 5 price'}, // ----- PROMOTION ----- { name: 'promo_enabled', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes', label: 'PROMOTION - Automatic room promotion?' }, { name: 'promo_message', type: 'str', defaultValue: 'Follow us and check out our profile!', label: 'PROMOTION - Message' }, { name: 'promo_minutes', type: 'int', minValue: 1, maxValue: 60, defaultValue: 5, label: 'PROMOTION - Minutes between messages' }, // ----- RULES ----- { name: 'rules', type: 'str', defaultValue: 'Be respectful. No spam or self-promo. Requests with tips. No means no. Have fun!', label: 'ROOM - Rules' } ]; var goalCurrent = 0; var tipTotals = {}; var MENU_ITEMS = 5; // ========================================= // SEND MENU // ========================================= function sendMenu(username) { if (cb.settings.menu_enabled !== 'Yes') { cb.sendNotice('The tip menu is currently turned off.', username); return; } var text = 'ROOMFLOW TIP MENU\n'; for (var i = 1; i <= MENU_ITEMS; i++) { var item = cb.settings['item' + i]; var price = cb.settings['price' + i]; if (item && price > 0) { text += item + ' - ' + price + ' tokens\n'; } } cb.sendNotice(text, username, '#222222', '#FFFFFF', 'bold'); } // ========================================= // GOAL // ========================================= function sendGoal(username) { if (cb.settings.goal_enabled !== 'Yes') { cb.sendNotice('The goal tracker is currently turned off.', username); return; } var target = parseInt(cb.settings.goal_amount); var remaining = target - goalCurrent; if (remaining < 0) { remaining = 0; } cb.sendNotice( 'GOAL: ' + cb.settings.goal_name + '\n' + goalCurrent + ' / ' + target + ' tokens\n' + remaining + ' tokens remaining', username, '#111111', '#FFFFFF', 'bold' ); } // ========================================= // TOP TIPPERS // ========================================= function sendTop(username) { var list = []; for (var user in tipTotals) { if (tipTotals.hasOwnProperty(user)) { list.push({ user: user, amount: tipTotals[user] }); } } list.sort(function(a, b) { return b.amount - a.amount; }); if (list.length === 0) { cb.sendNotice('No tips yet this session.', username); return; } var text = 'TOP SUPPORTERS\n'; for (var i = 0; i < list.length && i < 3; i++) { text += (i + 1) + '. ' + list[i].user + ' - ' + list[i].amount + ' tokens\n'; } cb.sendNotice(text, username, '#111111', '#FFFFFF', 'bold'); } // ========================================= // TIP HANDLER // ========================================= cb.onTip(function(tip) { var amount = parseInt(tip.amount); var username = tip.from_user; // Track leaderboard if (!tipTotals[username]) { tipTotals[username] = 0; } tipTotals[username] += amount; // Update goal if (cb.settings.goal_enabled === 'Yes') { var oldGoal = goalCurrent; goalCurrent += amount; var target = parseInt(cb.settings.goal_amount); if (oldGoal < target && goalCurrent >= target) { cb.sendNotice( 'GOAL COMPLETE! ' + cb.settings.goal_name + ' reached!', '', '#FFD700', '#000000', 'bold' ); } } // Check menu prices if (cb.settings.menu_enabled === 'Yes') { for (var i = 1; i <= MENU_ITEMS; i++) { var price = parseInt(cb.settings['price' + i]); var item = cb.settings['item' + i]; if (amount === price && item) { cb.sendNotice( username + ' tipped for ' + item + '!', '', '#FF69B4', '#FFFFFF', 'bold' ); } } } }); // ========================================= // CHAT COMMANDS // ========================================= cb.onMessage(function(msg) { var text = msg.m.trim().toLowerCase(); var username = msg.user; if (text === '/menu') { sendMenu(username); msg['X-Spam'] = true; } else if (text === '/goal') { sendGoal(username); msg['X-Spam'] = true; } else if (text === '/top') { sendTop(username); msg['X-Spam'] = true; } else if (text === '/rules') { cb.sendNotice( 'ROOM RULES\n' + cb.settings.rules, username, '#222222', '#FFFFFF', 'bold' ); msg['X-Spam'] = true; } else if (text === '/help') { cb.sendNotice( 'ROOMFLOW COMMANDS\n' + '/menu - Tip menu\n' + '/goal - Current goal\n' + '/top - Top supporters\n' + '/rules - Room rules\n' + '/help - Commands', username, '#222222', '#FFFFFF', 'bold' ); msg['X-Spam'] = true; } return msg; }); // ========================================= // AUTOMATIC PROMOTION // ========================================= function promotionLoop() { if (cb.settings.promo_enabled === 'Yes') { cb.sendNotice( cb.settings.promo_message, '', '#111111', '#FFFFFF', 'bold' ); } cb.setTimeout( promotionLoop, parseInt(cb.settings.promo_minutes) * 60000 ); } cb.setTimeout( promotionLoop, parseInt(cb.settings.promo_minutes) * 60000 ); // ========================================= // STARTUP // ========================================= cb.sendNotice( 'RoomFlow is running! Type /help to see commands.', '', '#111111', '#FFFFFF', 'bold' );
© Copyright Chaturbate 2011- 2026. All Rights Reserved.