Apps Home
|
Create an App
Tip Goal! New / Faster
Author:
tacokingrulerofall
Description
Source Code
Launch App
Current Users
Created by:
Tacokingrulerofall
var total_tipped=0,high_tip_username=null,high_tip_amount=0,last_tip_username=null,last_tip_amount=0,subject_is_set_with_0=!1;function update_subject(){if(0==tips_remaining()){if(subject_is_set_with_0)return;subject_is_set_with_0=!0}else subject_is_set_with_0=!1;var t=cb.settings.goal_description+" ["+tips_remaining()+" tokens remaining]";cb.log("Changing subject to: "+t),cb.changeRoomSubject(t)}function tips_remaining(){var t=cb.settings.tokens-total_tipped;return t<0?0:t}function format_username(t){return null===t?"--":t.substring(0,12)}function init(){update_subject()}cb.settings_choices=[{name:"tokens",type:"int",minValue:1,default:100},{name:"goal_description",type:"str",minLength:1,maxLength:255}],cb.onTip(function(t){(total_tipped+=t.amount)>cb.settings.tokens&&(total_tipped=cb.settings.tokens),update_subject(),last_tip_amount=t.amount,last_tip_username=t.from_user,t.amount>high_tip_amount&&(high_tip_amount=t.amount,high_tip_username=t.from_user),cb.drawPanel()}),cb.onDrawPanel(function(t){return{template:"3_rows_of_labels",row1_label:"Tip Received / Goal :",row1_value:total_tipped+" / "+cb.settings.tokens,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+")"}}),init();
© Copyright Chaturbate 2011- 2026. All Rights Reserved.