Apps Home
|
Create an App
Milk The Man
Author:
cassanova502
Description
Source Code
Launch App
Current Users
Created by:
Cassanova502
// vars var total_tipped = 0; var high_tip_username = null; var high_tip_amount = 0; var goals_reached = 0; var purple = '#B3A3FC'; var pink = '#FE86D5'; var backgroundImage = 'f4e5421a-a2e2-4c72-a994-cdecfbbf24bd'; var fontSize = 12; var fontFamily = "'Courier New', Courier, monospace"; cb.settings_choices = [ { name: 'tokens', type: 'int', minValue: 1, default: 100 } ]; // handlers cb.onTip(function (tip) { total_tipped += tip['amount']; var goal_aux = Math.floor(total_tipped/cb.settings.tokens); if (goal_aux > goals_reached) { //GOAL REACHED goals_reached = goal_aux; var stars = "**************"; if (goals_reached >= 10) stars += "*"; if (goals_reached >= 100) stars += "*"; if (goals_reached >= 1000) stars += "*"; if (goals_reached >= 10000) stars += "*"; if (goals_reached >= 100000) stars += "*"; cb.sendNotice(stars,"","#000000",purple,"bold"); cb.sendNotice("Goal #"+goals_reached+" reached!","","#000000",pink,"bold"); cb.sendNotice(stars,"","#000000",purple,"bold"); } if (tip['amount'] > high_tip_amount) { high_tip_amount = tip['amount'] high_tip_username = tip['from_user'] } cb.drawPanel(); }); cb.onDrawPanel(function (user) { return { "template": "image_template", "layers": [ { 'type': 'image', 'fileID': backgroundImage }, { 'type': 'text', 'text': 'GOALS REACHED', 'top': 5, 'left': 5, 'font-size': fontSize, 'font-family': fontFamily, 'font-weight': 'bold', 'color': purple, }, { 'type': 'text', 'text': 'CURRENT GOAL', 'top': 28, 'left': 12, 'font-size': fontSize, 'font-family': fontFamily, 'font-weight': 'bold', 'color': purple, }, { 'type': 'text', 'text': 'HIGHEST TIP', 'top': 51, 'left': 19, 'font-size': fontSize, 'font-family': fontFamily, 'font-weight': 'bold', 'color': purple, }, { 'type': 'text', 'text': Math.floor(total_tipped/cb.settings.tokens), 'top': 5, 'left': 105, 'font-size': fontSize, 'font-family': fontFamily, 'font-weight': 'bold', 'color': pink, }, { 'type': 'text', 'text': '' + goal_tipped() + ' / ' + cb.settings.tokens +' ('+tips_remaining()+')', 'top': 28, 'left': 105, 'font-size': fontSize, 'font-family': fontFamily, 'font-weight': 'bold', 'color': pink, }, { 'type': 'text', //'text': format_username("12345678901234567890") + '(123456)', 'text': format_username(high_tip_username) + ' (' + high_tip_amount + ')', 'top': 51, 'left': 105, 'font-size': fontSize, 'font-family': fontFamily, 'font-weight': 'bold', 'color': pink, }, ], }; }); function tips_remaining() { var r = cb.settings.tokens - goal_tipped(); return r; } function goal_tipped() { var r = total_tipped % cb.settings.tokens; return r; } function format_username(val) { if (val === null) { return "--"; } else { return val.substring(0, 14); } } function init() { } init();
© Copyright Freesexcam 2011- 2024. All Rights Reserved.