Bots Home
|
Create an App
test_multi_goal_ignore
Author:
testbarbie
Description
Source Code
Launch Bot
Current Users
Created by:
Testbarbie
/* Name: Multi-Goal-Ignore-user Author: barbiedetective Version History ============================================ v1.0 08/02/2013: First release Credits and Props ============================================ Based on the bog standard tip goal app, with multiple goals. I can't believe noone had thought of it yet! */ // vars var total_tipped = 0; var current_total_tipped = 0; var high_tip_username = null; var high_tip_amount = 0; var last_tip_username = null; var last_tip_amount = 0; var subject_is_final = false; var current_goal = 1; var final_goal_met = false; cb.settings_choices = [ {name: 'room_subject_old', label: 'Room Subject', type: 'str', defaultValue:'❤️ Welcome Guys ❤️ #cute #ass #pussy #teen #european #18 #smalltits #bigass #toy #cum #dildo #lovense #squirt #young'}, {name: 'ignore_user', label: 'Ignore this username', type: 'str', defaultValue:'ouland'}, {name: 'crew',label: 'Crew members separated by semi-colons',type:'str',defaultValue:'barbiedetective;ouland'}, {name: 'goal_1_tokens', label: 'Goal 1 Token Amount', type: 'int', minValue: 1, defaultValue: 200}, {name: 'goal_1_description', label: 'Goal 1 Description', type: 'str', defaultValue:'Doggy Style on bed'}, {name: 'goal_2_tokens', label: 'Goal 2 Token Amount', type: 'int', minValue: 1, defaultValue: 300, required: false}, {name: 'goal_2_description', label: 'Goal 2 Description', type: 'str', defaultValue:'Hot strip dance'}, {name: 'goal_3_tokens', label: 'Goal 3 Token Amount', type: 'int', minValue: 1, defaultValue: 500, required: false}, {name: 'goal_3_description', label: 'Goal 3 Description', type: 'str', defaultValue:'Completly naked on my bed'}, {name: 'goal_4_tokens', label: 'Goal 4 Token Amount', type: 'int', minValue: 1, defaultValue: 500, required: false}, {name: 'goal_4_description', label: 'Goal 4 Description', type: 'str', defaultValue:'Blow Job'}, {name: 'goal_5_tokens', label: 'Goal 5 Token Amount', type: 'int', minValue: 1, defaultValue: 800, required: false}, {name: 'goal_5_description', label: 'Goal 5 Description', type: 'str', defaultValue:'Cum Show'}, {name: 'finality_message', label: 'Final Goal Met Subject', type: 'str', minLength: 1, maxLength: 255, defaultValue: 'Goal reached! Thanks to all tippers!'}, {name: 'highlight_goal_king', label: 'Highlight highest tipper', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes'} ]; function getCurrentGoalDescription() { return cb.settings['goal_' + current_goal + '_description']; } function getCurrentGoalAmount() { return cb.settings['goal_' + current_goal + '_tokens']; } function checkFinality() { if (getCurrentGoalAmount() <= 0 || getCurrentGoalDescription() === "" || current_goal === 6) { final_goal_met = true; } } function tips_remaining() { var r = getCurrentGoalAmount() - current_total_tipped; return (r < 0) ? 0 : r; } function format_username(val) { return (val === null) ? "--" : val.substring(0, 12); } function update_goals() { var new_subject = ""; if (subject_is_final) { return; } if (final_goal_met) { new_subject = cb.settings.finality_message; subject_is_final = true; } else { new_subject = getCurrentGoalDescription() + " [" + tips_remaining() + " tokens remaining]"; } cb.log("Changing subject to: " + new_subject); cb.changeRoomSubject(new_subject + " "+ cb.settings['room_subject_old']); } cb.onTip(function (tip) { if ((tip['from_user'])==cb.settings['ignore_user']) { cb.drawPanel(); cb.sendNotice("Thanks "+ cb.settings['ignore_user']+" :oulandkiss","","#21eb14","#1209e6"); } else { total_tipped += tip.amount; current_total_tipped += tip.amount; while (current_total_tipped >= getCurrentGoalAmount()) { current_total_tipped = current_total_tipped - getCurrentGoalAmount(); current_goal++; checkFinality(); } } update_goals(); last_tip_amount = tip.amount; last_tip_username = tip.from_user; if (tip.amount > high_tip_amount) { high_tip_amount = tip.amount; high_tip_username = tip.from_user; } cb.drawPanel(); }); cb.onDrawPanel(function (user) { var panel = {}; if (final_goal_met) { panel = { 'template': '3_rows_of_labels', 'row1_label': 'Total Tips:', 'row1_value': total_tipped, 'row2_label': 'Highest Tip:', 'row2_value': format_username(high_tip_username) + ' (' + high_tip_amount + ')', 'row3_label': 'Latest Tip Received:', 'row3_value': format_username(last_tip_username) + ' (' + last_tip_amount + ')' }; } else { panel = { 'template': '3_rows_of_labels', 'row1_label': 'Tip Received / Goal (Total):', 'row1_value': current_total_tipped + ' / ' + getCurrentGoalAmount() + ' (' + total_tipped + ')', 'row2_label': 'Highest Tip:', 'row2_value': format_username(high_tip_username) + ' (' + high_tip_amount + ')', 'row3_label': 'Latest Tip Received:', 'row3_value': format_username(last_tip_username) + ' (' + last_tip_amount + ')' }; } return panel; }); cb.onMessage(function (msg) { var acrew = cb.settings.crew.split(';'); for (var i = 0; i < acrew.length; i++){ if (msg.user === acrew[i]) { msg.m = ":alycecrew" +" " + msg.m; } } if (cb.settings.highlight_goal_king === "Yes" && msg.user === high_tip_username) { msg.background = '#9F9'; } return msg; }); function init() { update_goals(); } init();
© Copyright Chaturbate 2011- 2025. All Rights Reserved.