|
|
ggg
/*
Chaturbate Bot — “SelenaPurr” (v0.1)
Features:
• Welcome message (cute & playful), auto every N minutes
• Tip menu (up to 10 lines) + !menu command
• Tracks total tips & Top Tipper; announces milestones
• Simple commands: !menu, !rules, !levels, !time, !top
• Anti-spam cooldown for commands
Notes:
• Configure in the app settings after you upload this bot.
• Colors kept soft; you can tweak hex codes below.
• This bot uses standard Chaturbate App v2 callbacks (cb.*).
*/
/********************* SETTINGS *********************/
cb.settings_choices = [
{ name: 'room_nickname', type: 'str', minLength: 0, maxLength: 16, defaultValue: 'Selena' },
{ name: 'welcome_msg', type: 'str', minLength: 0, maxLength: 300, defaultValue: 'hi daddy ✨ welcome to my cozy room — be nice, tip to play, and have fun ♡' },
{ name: 'rules_msg', type: 'str', minLength: 0, maxLength: 400, defaultValue: 'Be respectful • No spam • No underage talk • No illegal requests • English preferred • Tip to request from menu' },
{ name: 'levels_msg', type: 'str', minLength: 0, maxLength: 500, defaultValue: 'Levels: 1 — tease • 15 — soft • 25 — medium • 99 — random max (5–50s) • 100 — fast 10s • 111 — random level' },
{ name: 'repeat_minutes', type: 'int', minValue: 0, maxValue: 60, defaultValue: 3 },
{ name: 'menu_title', type: 'str', minLength: 0, maxLength: 50, defaultValue: 'Tip Menu' },
// Up to 10 menu lines: label + tokens
{ name: 'm1_label', type: 'str', minLength: 0, maxLength: 60, defaultValue: 'Spanks (cute)' },
{ name: 'm1_tokens', type: 'int', minValue: 1, maxValue: 9999, defaultValue: 15 },
{ name: 'm2_label', type: 'str', minLength: 0, maxLength: 60, defaultValue: 'Booty arch + jiggle' },
{ name: 'm2_tokens', type: 'int', minValue: 1, maxValue: 9999, defaultValue: 25 },
{ name: 'm3_label', type: 'str', minLength: 0, maxLength: 60, defaultValue: 'Oil tease (focus on hips)' },
{ name: 'm3_tokens', type: 'int', minValue: 1, maxValue: 9999, defaultValue: 33 },
{ name: 'm4_label', type: 'str', minLength: 0, maxLength: 60, defaultValue: 'Machine control (slow 10s)' },
{ name: 'm4_tokens', type: 'int', minValue: 1, maxValue: 9999, defaultValue: 50 },
{ name: 'm5_label', type: 'str', minLength: 0, maxLength: 60, defaultValue: 'Random speed (5–50s)' },
{ name: 'm5_tokens', type: 'int', minValue: 1, maxValue: 9999, defaultValue: 99 },
{ name: 'm6_label', type: 'str', minLength: 0, maxLength: 60, defaultValue: 'Fast 10s' },
{ name: 'm6_tokens', type: 'int', minValue: 1, maxValue: 9999, defaultValue: 100 },
{ name: 'm7_label', type: 'str', minLength: 0, maxLength: 60, defaultValue: 'Random level' },
{ name: 'm7_tokens', type: 'int', minValue: 1, maxValue: 9999, defaultValue: 111 },
{ name: 'm8_label', type: 'str', minLength: 0, maxLength: 60, defaultValue: '' },
{ name: 'm8_tokens', type: 'int', minValue: 0, maxValue: 9999, defaultValue: 0 },
{ name: 'm9_label', type: 'str', minLength: 0, maxLength: 60, defaultValue: '' },
{ name: 'm9_tokens', type: 'int', minValue: 0, maxValue: 9999, defaultValue: 0 },
{ name: 'm10_label', type: 'str', minLength: 0, maxLength: 60, defaultValue: '' },
{ name: 'm10_tokens', type: 'int', minValue: 0, maxValue: 9999, defaultValue: 0 },
// Announcements
{ name: 'announce_on_tip', type: 'bool', defaultValue: true },
{ name: 'milestone_amount', type: 'int', minValue: 0, maxValue: 100000, defaultValue: 1000 },
{ name: 'milestone_text', type: 'str', minLength: 0, maxLength: 200, defaultValue: 'We hit {sum} tokens! You’re making me purr ♡' },
// Anti-spam
{ name: 'command_cooldown_sec', type: 'int', minValue: 0, maxValue: 300, defaultValue: 10 }
];
/********************* RUNTIME STATE *********************/
var state = {
total_tokens: 0,
top_tipper: null,
top_amount: 0,
last_cmd_at: {}, // username -> ts
next_milestone: 0,
colors: {
primary: '#ffb3d9', // pink
accent: '#ffd1ec', // light pink
strong: '#ff66aa'
}
};
/********************* HELPERS *********************/
function now() { return new Date().getTime(); }
function canRunCmd(user) {
var cd = cb.settings.command_cooldown_sec || 0;
if (cd <= 0) return true;
var last = state.last_cmd_at[user] || 0;
if (now() - last > cd * 1000) { state.last_cmd_at[user] = now(); return true; }
return false;
}
function colorNotice(text, color, isBold) {
cb.sendNotice(text, null, color || state.colors.primary, isBold ? 'bold' : null);
}
function menuLines() {
var rows = [];
function add(labelKey, tokKey){
var label = (cb.settings[labelKey] || '').trim();
var t = parseInt(cb.settings[tokKey], 10) || 0;
if (label && t > 0) rows.push(t + ' — ' + label);
}
add('m1_label','m1_tokens'); add('m2_label','m2_tokens'); add('m3_label','m3_tokens');
add('m4_label','m4_tokens'); add('m5_label','m5_tokens'); add('m6_label','m6_tokens');
add('m7_label','m7_tokens'); add('m8_label','m8_tokens'); add('m9_label','m9_tokens'); add('m10_label','m10_tokens');
return rows;
}
function postMenu() {
var title = (cb.settings.menu_title || 'Tip Menu') + ' ✨';
colorNotice('— ' + title + ' —', state.colors.strong, true);
var lines = menuLines();
if (lines.length === 0) {
colorNotice('No items configured yet. Broadcaster: open settings to add menu lines.', state.colors.accent, false);
} else {
for (var i=0;i state.top_amount) {
state.top_tipper = tip['from_user'];
state.top_amount = tip['amount'];
}
if (cb.settings.announce_on_tip) {
colorNotice('❤ ' + tip['from_user'] + ' tipped ' + tip['amount'] + ' — thank you!', state.colors.strong, true);
}
// Milestones
var m = parseInt(cb.settings.milestone_amount,10) || 0;
if (m > 0) {
if (state.next_milestone === 0) state.next_milestone = m;
while (state.total_tokens >= state.next_milestone) {
var text = (cb.settings.milestone_text || '').replace('{sum}', state.next_milestone);
colorNotice(text, state.colors.strong, true);
state.next_milestone += m;
}
}
});
cb.onMessage(function(msg){
var u = msg['user'];
var body = (msg['m'] || '').trim();
if (!body || body.charAt(0) !== '!') return; // not a command
var lower = body.toLowerCase();
if (!canRunCmd(u)) return;
if (lower === '!menu') { postMenu(); return; }
if (lower === '!rules') { postRules(); return; }
if (lower === '!levels') { postLevels(); return; }
if (lower === '!time') { colorNotice('Local time: ' + new Date().toLocaleTimeString(), state.colors.accent, false); return; }
if (lower === '!top') { postTop(); return; }
});
/********************* AUTO REPEATER *********************/
(function setupRepeater(){
var min = parseInt(cb.settings.repeat_minutes, 10) || 0;
if (min > 0) {
cb.setTimeout(function tick(){
postWelcome();
cb.drawPanel();
cb.setTimeout(tick, min*60);
}, min*60);
} else {
postWelcome();
}
})();
/********************* STARTUP ANNOUNCE *********************/
colorNotice('Bot “SelenaPurr” is alive. Type !menu • !rules • !levels • !top', state.colors.accent, false);
© Copyright Chaturbate 2011- 2026. All Rights Reserved.