Apps Home
|
Create an App
goaltestingthing
Author:
sillyfidgetest
Description
Source Code
Launch App
Current Users
Created by:
Sillyfidgetest
// Goals // by SillyFidget cb.settings_choices = [ //Simple Goal {name: 'simpleGoalAmt', type: 'int', minValue: 1, maxValue: 99999999, defaultValue: 100, label: 'Token Goal'}, {name:'simpleGoalDesc', type:'str', minLength: 0, maxLength: 255, label: 'Goal Description'}, {name:'simpleGoalHash', type:'str', minLength: 0, maxLength: 255, label: 'Hashtags For After Goal Info'} ]; //Variables var goalAmount = cb.settings.simpleGoalAmt; var goalDesc = cb.settings.simpleGoalDesc; var goalAfter = cb.settings.simpleGoalHash; //Set Initial Subject cb.changeRoomSubject(goalDesc + " [ " + goalAmount + " tokens remaining ] " + goalAfter); cb.onTip(function (tip) { var tip = tip['amount']; var tipper = tip['from_user']; if(goalAmount > 0){ goalAmount = goalAmount - tip; if (goalAmount <= 0){ goalAmount = 0; } }else{ goalAmount = 0; } updateSubject(tip); cb.drawPanel(); }); cb.onMessage(function (msg) { return msg; }); //Update Subject Function function updateSubject(tip){ if(tip >= 25){ cb.changeRoomSubject(goalDesc + " [ " + goalAmount + " tokens remaining ]" + goalAfter); } } //Update Panel Function cb.onDrawPanel(function(user) { return { 'template': '3_rows_11_21_31', 'row1_value': goalAmount + ' tokens remaining', 'row2_value': 'xo xo xo xo xo xo xo xo xo xo xo xo xo', 'row3_value': 'thank you!' }; });
© Copyright Chaturbate 2011- 2025. All Rights Reserved.