Apps Home
|
Create an App
hid tkt
Author:
loulouw
Description
Source Code
Launch App
Current Users
Created by:
Loulouw
// Modified Sequence Tips to allow group tipping // Mods by badbadbubba // June 14 2014 // V1.0.1 Added support for descending tips as well as ascending // V1.0.2 Only change subject if next sequence value changes instead of on all tips // V1.0.3 Added option to setup intermediate goals, removes in subject line when met and notifies // V1.0.4 Set start and stop values (if original sequence interrupted). Message to broadcaster only of sequence totals // V1.0.4b Minor bug with ascending always showing in panel // V1.0.4c Raised limit to 200 from 100 //== This app is a collaborative work of Cliche123 and Nolidoux == // vars var last_tip_username = null; var next_tip_remaining = 0; var next_tip_amount = 1; var goal_reached = false; var max_minigoals = 5; var next_minigoals = 1 var dir_label = 'Ascending:'; var tags = 'Real #french #bbw #bigboobs #hairy #mature #lovense' // var version = 10 // Limit goal description as we add some text cb.settings_choices = [ {name: 'final_goal', type: 'str', label: 'Final Goal Subject', minLength: 1, maxLength: 255, default:'Cum Show'}, {name: 'start_value', type: 'int', label: 'Start Level', minValue: 1, maxValue: 200, default: 1, required: true}, {name: 'stop_value', type: 'int', label: 'Stop Level', minValue: 1, maxValue: 200, default: 50, required: true}, {name: 'multi1', type: 'int', label: 'Level 1 (0 to disable)', minValue: 0, default: 10, required: false}, {name: 'multi1_desc', type: 'str', label: 'Level 1 Goal', minLength: 0, maxLength: 255, default:'Flash', required: false}, {name: 'multi2', type: 'int', label: 'Level 2 (0 to disable)', minValue: 0, default: 20, required: false}, {name: 'multi2_desc', type: 'str', label: 'Level 2 Goal', minLength: 0, maxLength: 255, default:'Topless', required: false}, {name: 'multi3', type: 'int', label: 'Level 3 (0 to disable)', minValue: 0, default: 40, required: false}, {name: 'multi3_desc', type: 'str', label: 'Level 3 Goal', minLength: 0, maxLength: 255, default:'Naked', required: false}, {name: 'multi4', type: 'int', label: 'Level 4 (0 to disable)', minValue: 0, default: 0, required: false}, {name: 'multi4_desc', type: 'str', label: 'Level 4 Goal', minLength: 0, maxLength: 255, required: false}, {name: 'multi5', type: 'int', label: 'Level 5 (0 to disable)', minValue: 0, default: 0, required: false}, {name: 'multi5_desc', type: 'str', label: 'Level 5 Goal', minLength: 0, maxLength: 255, required: false} ]; function chklvl(lvl){ for (var i= 1; i<= max_minigoals; i++) { var multiplier = parseInt(cb.settings['multi' + i]); var multiplier_goal = cb.settings['multi' + i + '_desc']; if ((multiplier > 0) && (multiplier == lvl)) { next_minigoals++ cb.chatNotice('*** Goal reached: ' + multiplier_goal + ' ***','','','','bold'); update_subject(); } } } cb.onTip( function (tip) { var diff = tip['amount']; var old_tip_amount = next_tip_amount; last_tip = diff; if (isAscendingOrder()) { while ((diff > next_tip_remaining) && (next_tip_amount <= cb.settings.stop_value)) { diff -= next_tip_remaining; chklvl(next_tip_amount); next_tip_amount++; next_tip_remaining=next_tip_amount; } if (diff==next_tip_remaining) { chklvl(next_tip_amount); next_tip_amount++; next_tip_remaining=next_tip_amount; } else { if (diff<next_tip_remaining) { next_tip_remaining -= diff; } } } else { while ((diff > next_tip_remaining) && (next_tip_amount>=0)) { diff -= next_tip_remaining; chklvl(next_tip_amount); next_tip_amount--; next_tip_remaining=next_tip_amount; } if (diff==next_tip_remaining) { chklvl(next_tip_amount); next_tip_amount--; next_tip_remaining=next_tip_amount; } else { if (diff<next_tip_remaining) { next_tip_remaining -= diff; } } } last_tip_username = tip['from_user'] + '(' + last_tip + ')'; if (old_tip_amount != next_tip_amount) { //update_subject(); } cb.drawPanel(); } ); cb.onDrawPanel( function (user) { if (finalGoalReached()) { return { 'template': '3_rows_11_21_31', 'row1_value': 'Goal reached!', 'row2_value': 'Last Tip: ' + format_username(last_tip_username), 'row3_value': 'Thanks to all tippers' }; } else { return { 'template': '3_rows_of_labels', 'row1_label': '[Next] Remaining:', 'row1_value': '[' + next_tip_amount + '] ' + next_tip_remaining, 'row2_label': 'Last Tip From:', 'row2_value': format_username(last_tip_username), 'row3_label': dir_label, 'row3_value': 'From ' + cb.settings.start_value + ' to ' + cb.settings.stop_value }; } } ); function test() { if (goal_reached) { return; } var new_subject = ""; if (finalGoalReached()) { new_subject = cb.settings.final_goal + " [Goal reached!] Thanks to all tippers"; goal_reached = true; } else { for (var i= 1; i<= max_minigoals; i++) { var multiplier = parseInt(cb.settings['multi' + i]); var multiplier_goal = cb.settings['multi' + i + '_desc']; if (multiplier > 0) { if (((isAscendingOrder()) && (multiplier > next_tip_amount)) || (!(isAscendingOrder()) && (multiplier < next_tip_amount))){ new_subject += multiplier_goal+'@'+multiplier+' | '; } } } new_subject += cb.settings.final_goal + "@" +cb.settings.stop_value } cb.changeRoomSubject(new_subject); //cb.chatNotice (new_subject) } // helper functions function update_subject() { if (goal_reached) { return; } var new_subject = ""; if (finalGoalReached()) { //new_subject = cb.settings.final_goal + " [Goal reached!] Thanks to all tippers"; new_subject = tags; goal_reached = true; cb.chatNotice('*** Goal reached: ' + cb.settings.final_goal + ' ***','','','','bold'); } else { new_subject = '' for (var i= next_minigoals; i<= next_minigoals; i++) { var multiplier = parseInt(cb.settings['multi' + i]); var multiplier_goal = cb.settings['multi' + i + '_desc']; if (multiplier > 0) { if (((isAscendingOrder()) && (multiplier >= next_tip_amount)) || (!(isAscendingOrder()) && (multiplier <= next_tip_amount))){ new_subject += multiplier_goal+'@'+multiplier+' | '; } } } //new_subject += cb.settings.final_goal + "@" +cb.settings.stop_value+" Tip in order from " + cb.settings.start_value + " to " + cb.settings.stop_value + ". Next tip: " + next_tip_amount + " #seqwithgroup"; if (!multiplier ) new_subject += cb.settings.final_goal + '@' +cb.settings.stop_value+' | '; new_subject += tags } cb.changeRoomSubject(new_subject); } function format_username(val) { if (val === null) { return "--"; } else { return val.substring(0, 12); } } function series_tot(first,last) { return (Math.abs(last-first) + 1) * (last + first) * 0.5; } function isAscendingOrder() { return (cb.settings.stop_value >= cb.settings.start_value); } function setNextTipNeeded() { if (isAscendingOrder()) { next_tip_amount++; } else { next_tip_amount--; } } function finalGoalReached() { if (isAscendingOrder()) { return (next_tip_amount > cb.settings.stop_value); } else { return (next_tip_amount < cb.settings.stop_value); } } function init() { if (isAscendingOrder()) { dir_label = 'Ascending:'; } else { dir_label = 'Descending:'; } notice = 'Total tokens = ' + Math.abs(series_tot(cb.settings.start_value,cb.settings.stop_value)) next_tip_amount = cb.settings.start_value; next_tip_remaining = next_tip_amount; update_subject(); for (var i= 1; i<= max_minigoals; i++) { var multiplier = parseInt(cb.settings['multi' + i]); var multiplier_goal = cb.settings['multi' + i + '_desc']; if (multiplier > 0) { notice += '\n Level ' + i + ' ' + multiplier_goal + '@' + multiplier + ' = ' + Math.abs(series_tot(cb.settings.start_value,multiplier)) + ' tokens' } } cb.chatNotice(notice,cb['room_slug']); } init();
© Copyright Chaturbate 2011- 2025. All Rights Reserved.