Apps Home
|
Create an App
Santas Tip Tracker
Author:
garterxxx
Description
Source Code
Launch App
Current Users
Created by:
Garterxxx
// ====================================== // 🎅 Santa's Tip Tracker // A Christmas-themed tip panel // Tracks total tips, highest tip, and latest tip // ====================================== // ---------- VARIABLES ---------- var total_tipped = 0; var high_tip_username = null; var high_tip_amount = 0; var last_tip_username = null; var last_tip_amount = 0; // ---------- SETTINGS ---------- cb.settings_choices = [ // No settings needed for this basic Christmas tracker ]; // ---------- TIP HANDLER ---------- cb.onTip(function(tip) { total_tipped += tip['amount']; 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(); }); // ---------- DRAW PANEL ---------- cb.onDrawPanel(function(user) { return { 'template': '3_rows_of_labels', 'row1_label': '🎄 Total Holiday Gifts:', 'row1_value': '' + total_tipped + ' 🎁', 'row2_label': '⭐ Biggest Gift:', 'row2_value': format_username(high_tip_username) + ' (' + high_tip_amount + ' 🎅)', 'row3_label': '🎁 Latest Gift:', 'row3_value': format_username(last_tip_username) + ' (' + last_tip_amount + ' ❄️)' }; }); // ---------- HELPER FUNCTION ---------- function format_username(val) { if (val === null) { return "--"; } else { return val.substring(0, 12); } }
© Copyright Chaturbate 2011- 2026. All Rights Reserved.