Apps Home
|
Create an App
TCKY31 Test Multi-Goal Drain
Author:
atthem
Description
Source Code
Launch App
Current Users
Created by:
Atthem
// Title /* TCKY31's Multi-Goal Keep It Going */ // Summary /* Kind of a mix of a multi-goal and 'keep it going' app */ // Description /* Written by atthem for TCKY31. Model enters tip goals like in a multi-goal app, and when the token count reaches those totals, the model performs action for that goal. Model also sets a rate for token count drain. The tracked token count is decreased at this rate. When the token total falls below amounts for each pre-set goal, the model stops doing the action (or undoes it) For example, 100 tks = take off top 200 tks = take off bottoms 500 tks = use dildo As viewers tip, the token total increases. But it also slowly decreases with time (based on rate model set). When the token total reaches 100, model takes off top. Viewers keep tipping, and token total reaches 200 (an additional 100 tks). Model takes off bottoms. There is a tip slump, and the tokens fall below the goal level model set (there is an adjustable grace period). The model puts bottoms back on. So as the tip total goes up and down, the model does whatever is appropriate for the new level reached. The app will track and notify as this happens. */ /* Update Log ---------------------------------------------------------------- ------------------------------------------------------------------------------*/ // variables { var intTokenCount = 0; var goalLevel = 0; var goalItem = ""; var nextLevel = cb.settings.goalAmt01; var nextItem = cb.settings.goal01; var warned = false; var onDelay = false; var backColor = '#ffffff'; var textColor = '#004d00'; var warnBackColor = '#ffffff'; var warnTextColor = '#734d26'; var lostBackColor = '#ffffff'; var lostTextColor = '#ff0000'; } const setup = function() { // set token drain timer cb.setTimeout(tokenDrain, 1000 * cb.settings.drainFrequency); // update the room subject cb.changeRoomSubject("Next goal at " + cb.settings.goalAmt01 + ". " + cb.settings.roomSubSfx); // notify room of app start var note = "----------------------------------------------\n"; note += "Multi-Goal Keep Going by Atthem\n"; note += "----------------------------------------------"; cb.sendNotice(note,'',backColor,textColor); }; // Settings cb.settings_choices = [ { name: 'drainFrequency', type: 'int', minValue: 1, maxValue: 60, label: 'How many seconds between each token drain (1-60)? Higher number = slower drain.', required: true, defaultValue: 10 }, { name: 'drainAmount', type: 'int', minValue: 1, maxValue: 100, label: 'How many tokens to drain each time (1-100)? Higher number = faster drain.', required: true, defaultValue: 1 }, { name: 'drainDelay', type: 'int', minValue: 1, maxValue: 100, label: 'How many seconds (1-100) should the token drain pause for high tips?', required: true, defaultValue: 20 }, { name: 'delayMinTip', type: 'int', minValue: 1, maxValue: 1000, label: 'What is the smallest tip that can trigger the drain delay (1-1000)?', required: true, defaultValue: 25 }, {name: 'gracePeriod', type: 'int', minValue: 25, maxValue: 100, label: 'Enter the token grace period to give your viewers (25-100). (If a goal is met at 100, and the grace period is 25, then the goal is not lost until 75)', required: true, defaultValue: 25 }, {name: 'roomSubSfx', type: 'str', minLength: 1, maxLength: 1000, label: 'This app changes the room subject often. Enter any additional hashtags or other info the app should keep in the room subject any time it is changed.', required: true, defaultValue: '#bigtits #lush' }, {name: 'goalAmt01', type: 'int', minValue: 1, maxValue: 10000, label: 'Enter the token level to reach goal 1 (1-10000). When the token counter meets or passes up this number, the goal is reached.', required: true, defaultValue: 100 }, {name: 'goal01', type: 'str', minLength: 1, maxLength: 1000, label: 'Enter goal number 1.', required: true, defaultValue: 'Take off top' }, {name: 'goalAmt02', type: 'int', minValue: 1, maxValue: 10000, label: 'Enter the token level to reach goal 2 (1-10000). When the token counter meets or passes up this number, the goal is reached.', required: false, defaultValue: 200 }, {name: 'goal02', type: 'str', minLength: 1, maxLength: 1000, label: 'Enter goal number 2.', required: false, defaultValue: 'Take off bottoms' }, {name: 'goalAmt03', type: 'int', minValue: 1, maxValue: 10000, label: 'Enter the token level to reach goal 3 (1-10000). When the token counter meets or passes up this number, the goal is reached.', required: false, defaultValue: 400 }, {name: 'goal03', type: 'str', minLength: 1, maxLength: 1000, label: 'Enter goal number 3.', required: false, defaultValue: 'Take off bra' }, {name: 'goalAmt04', type: 'int', minValue: 1, maxValue: 10000, label: 'Enter the token level to reach goal 4 (1-10000). When the token counter meets or passes up this number, the goal is reached.', required: false, defaultValue: 600 }, {name: 'goal04', type: 'str', minLength: 1, maxLength: 1000, label: 'Enter goal number 4.', required: false, defaultValue: 'Take off panties' }, {name: 'goalAmt05', type: 'int', minValue: 1, maxValue: 10000, label: 'Enter the token level to reach goal 5 (1-10000). When the token counter meets or passes up this number, the goal is reached.', required: false, defaultValue: 1000 }, {name: 'goal05', type: 'str', minLength: 1, maxLength: 1000, label: 'Enter goal number 5.', required: true, defaultValue: 'Use dildo' }, ]; const tokenDrain = function() { // if we aren't on a delay if (!onDelay) { // decrease the tokens intTokenCount -= cb.settings.drainAmount; // token amount can't be below 0 if (intTokenCount < 0) intTokenCount = 0; // check the goal level checkGoal(intTokenCount); } cb.setTimeout(tokenDrain, 1000 * cb.settings.drainFrequency); } cb.onTip(function(tip) { var tokens = tip.amount; var source = tip.from_user; // if this is a high tip, delay the token drain if (tokens >= cb.settings.delayMinTip) { // delay drain timer onDelay = true; // set timer to turn off delay cb.setTimeout(endDelay, 1000 * cb.settings.drainDelay); // alert room var note = "WOW! " + source + "'s tip was so nice, I forgot to drain any tokens! I'll get back to it in " + cb.settings.drainDelay + " seconds..."; cb.sendNotice(note,'',backColor,textColor); } // increase the tokens intTokenCount += tokens; // check the goal level checkGoal(intTokenCount); }); var endDelay = function() { onDelay = false; } var checkGoal = function(tokens) { // go up to level 1 if (tokens >= cb.settings.goalAmt01 && goalLevel < 1) { // set the goal level and item goalLevel = 1; goalItem = cb.settings.goal01; // set next goal level and item nextLevel = cb.settings.goalAmt02 nextItem = cb.settings.goal02; // notify the room var note = "------------- GOAL REACHED -------------\n"; note += "Goal 1 reached: " + cb.settings.goal01 + "! Thanks to all my tippers! Please keep it up!"; cb.sendNotice(note,'',backColor,textColor); // update the room subject cb.changeRoomSubject("Goal 1 Reached! Next goal at " + cb.settings.goalAmt02 + ". " + cb.settings.roomSubSfx); // set warned flag warned = false; } // go up to level 2 if (tokens >= cb.settings.goalAmt02 && goalLevel < 2) { // set the goal level and item goalLevel = 2; goalItem = cb.settings.goal02; // set next goal level and item nextLevel = cb.settings.goalAmt03 nextItem = cb.settings.goal03; // notify the room var note = "------------- GOAL REACHED -------------\n"; note += "Goal 2 reached: " + cb.settings.goal02 + "! Thanks to all my tippers! Please keep it up!"; cb.sendNotice(note,'',backColor,textColor); // update the room subject cb.changeRoomSubject("Goal 2 Reached! Next goal at " + cb.settings.goalAmt03 + ". " + cb.settings.roomSubSfx); // set warned flag warned = false; } // go up to level 3 if (tokens >= cb.settings.goalAmt03 && goalLevel < 3) { // set the goal level and item goalLevel = 3; goalItem = cb.settings.goal03; // set next goal level and item nextLevel = cb.settings.goalAmt04 nextItem = cb.settings.goal04; // notify the room var note = "------------- GOAL REACHED -------------\n"; note += "Goal 3 reached: " + cb.settings.goal03 + "! Thanks to all my tippers! Please keep it up!"; cb.sendNotice(note,'',backColor,textColor); // update the room subject cb.changeRoomSubject("Goal 3 Reached! Next goal at " + cb.settings.goalAmt04 + ". " + cb.settings.roomSubSfx); // set warned flag warned = false; } // go up to level 4 if (tokens >= cb.settings.goalAmt04 && goalLevel < 4) { // set the goal level and item goalLevel = 4; goalItem = cb.settings.goal04; // set next goal level and item nextLevel = cb.settings.goalAmt05 nextItem = cb.settings.goal05; // notify the room var note = "------------- GOAL REACHED -------------\n"; note += "Goal 4 reached: " + cb.settings.goal04 + "! Thanks to all my tippers! Please keep it up!"; cb.sendNotice(note,'',backColor,textColor); // update the room subject cb.changeRoomSubject("Goal 4 Reached! Next goal at " + cb.settings.goalAmt05 + ". " + cb.settings.roomSubSfx); // set warned flag warned = false; } // go up to level 5 if (tokens >= cb.settings.goalAmt05 && goalLevel < 5) { // set the goal level and item goalLevel = 5; goalItem = cb.settings.goal05; // set next goal level and item nextLevel = ""; nextItem = ""; // notify the room var note = "------------- GOAL REACHED -------------\n"; note += "Goal 5 reached: " + cb.settings.goal05 + "! Thanks to all my tippers! Please keep it up!"; cb.sendNotice(note,'',backColor,textColor); // update the room subject cb.changeRoomSubject("Goal 5 Reached! " + cb.settings.roomSubSfx); // set warned flag warned = false; } // warning before losing goal 5 if (tokens < cb.settings.goalAmt05 && tokens >= cb.settings.goalAmt05 - cb.settings.gracePeriod && goalLevel > 4 && warned == false) { // warn the room var note = "------------- GOAL IN DANGER -------------\n"; note += "Goal 5 is in danger of being lost! Don't let the tokens fall below " + (cb.settings.goalAmt05 - cb.settings.gracePeriod) + "!"; cb.sendNotice(note,'',warnBackColor,warnTextColor); // set warned flag warned = true; } // warning before losing goal 4 if (tokens < cb.settings.goalAmt04 && tokens >= cb.settings.goalAmt04 - cb.settings.gracePeriod && goalLevel > 3 && warned == false) { // warn the room var note = "------------- GOAL IN DANGER -------------\n"; note += "Goal 4 is in danger of being lost! Don't let the tokens fall below " + (cb.settings.goalAmt04 - cb.settings.gracePeriod) + "!"; cb.sendNotice(note,'',warnBackColor,warnTextColor); // set warned flag warned = true; } // warning before losing goal 3 if (tokens < cb.settings.goalAmt03 && tokens >= cb.settings.goalAmt03 - cb.settings.gracePeriod && goalLevel > 2 && warned == false) { // warn the room var note = "------------- GOAL IN DANGER -------------\n"; note += "Goal 3 is in danger of being lost! Don't let the tokens fall below " + (cb.settings.goalAmt03 - cb.settings.gracePeriod) + "!"; cb.sendNotice(note,'',warnBackColor,warnTextColor); // set warned flag warned = true; } // warning before losing goal 2 if (tokens < cb.settings.goalAmt02 && tokens >= cb.settings.goalAmt02 - cb.settings.gracePeriod && goalLevel > 1 && warned == false) { // warn the room var note = "------------- GOAL IN DANGER -------------\n"; note += "Goal 2 is in danger of being lost! Don't let the tokens fall below " + (cb.settings.goalAmt02 - cb.settings.gracePeriod) + "!"; cb.sendNotice(note,'',warnBackColor,warnTextColor); // set warned flag warned = true; } // warning before losing goal 1 if (tokens < cb.settings.goalAmt01 && tokens >= cb.settings.goalAmt01 - cb.settings.gracePeriod && goalLevel > 0 && warned == false) { // warn the room var note = "------------- GOAL IN DANGER -------------\n"; note += "Goal 1 is in danger of being lost! Don't let the tokens fall below " + (cb.settings.goalAmt01 - cb.settings.gracePeriod) + "!"; cb.sendNotice(note,'',warnBackColor,warnTextColor); // set warned flag warned = true; } // lose level 5 if (tokens < cb.settings.goalAmt05 - cb.settings.gracePeriod && goalLevel > 4) { // set the goal level and item goalLevel = 4; goalItem = cb.settings.goal04; // set next goal level and item nextLevel = cb.settings.goalAmt05 nextItem = cb.settings.goal05; // notify the room var note = "------------- GOAL LOST -------------\n"; note += "Goal 5 LOST: " + cb.settings.goal05 + "! Let's get it back, tippers!"; cb.sendNotice(note,'',lostBackColor,lostTextColor); // update the room subject cb.changeRoomSubject("Goal 5 Lost! Get it back at " + cb.settings.goalAmt05 + ". " + cb.settings.roomSubSfx); // set warned flag warned = false; } // lose level 4 if (tokens < cb.settings.goalAmt04 - cb.settings.gracePeriod && goalLevel > 3) { // set the goal level and item goalLevel = 3; goalItem = cb.settings.goal03; // set next goal level and item nextLevel = cb.settings.goalAmt04 nextItem = cb.settings.goal04; // notify the room var note = "------------- GOAL LOST -------------\n"; note += "Goal 4 LOST: " + cb.settings.goal04 + "! Let's get it back, tippers!"; cb.sendNotice(note,'',lostBackColor,lostTextColor); // update the room subject cb.changeRoomSubject("Goal 4 Lost! Get it back at " + cb.settings.goalAmt04 + ". " + cb.settings.roomSubSfx); // set warned flag warned = false; } // lose level 3 if (tokens < cb.settings.goalAmt03 - cb.settings.gracePeriod && goalLevel > 2) { // set the goal level and item goalLevel = 2; goalItem = cb.settings.goal02; // set next goal level and item nextLevel = cb.settings.goalAmt03 nextItem = cb.settings.goal03; // notify the room var note = "------------- GOAL LOST -------------\n"; note += "Goal 3 LOST: " + cb.settings.goal03 + "! Let's get it back, tippers!"; cb.sendNotice(note,'',lostBackColor,lostTextColor); // update the room subject cb.changeRoomSubject("Goal 3 Lost! Get it back at " + cb.settings.goalAmt03 + ". " + cb.settings.roomSubSfx); // set warned flag warned = false; } // lose level 2 if (tokens < cb.settings.goalAmt02 - cb.settings.gracePeriod && goalLevel > 1) { // set the goal level and item goalLevel = 1; goalItem = cb.settings.goal01; // set next goal level and item nextLevel = cb.settings.goalAmt02 nextItem = cb.settings.goal02; // notify the room var note = "------------- GOAL LOST -------------\n"; note += "Goal 2 LOST: " + cb.settings.goal02 + "! Let's get it back, tippers!"; cb.sendNotice(note,'',lostBackColor,lostTextColor); // update the room subject cb.changeRoomSubject("Goal 2 Lost! Get it back at " + cb.settings.goalAmt02 + ". " + cb.settings.roomSubSfx); // set warned flag warned = false; } // lose level 1 if (tokens < cb.settings.goalAmt01 - cb.settings.gracePeriod && goalLevel > 0) { // set the goal level and item goalLevel = 0; goalItem = ""; // set next goal level and item nextLevel = cb.settings.goalAmt01 nextItem = cb.settings.goal01; // notify the room var note = "------------- GOAL LOST -------------\n"; note += "Goal 1 LOST: " + cb.settings.goal01 + "! Let's get it back, tippers!"; cb.sendNotice(note,'',lostBackColor,lostTextColor); // update the room subject cb.changeRoomSubject("Goal 1 Lost! Get it back at " + cb.settings.goalAmt01 + ". " + cb.settings.roomSubSfx); // set warned flag warned = false; } // update the panel cb.drawPanel(); } cb.onDrawPanel(function(user) { return { 'template': '3_rows_of_labels', 'row1_label': "Token Count: ", 'row1_value': intTokenCount, 'row2_label': "Current Goal: ", 'row2_value': goalItem, 'row3_label': "Next Goal at: ", 'row3_value': nextLevel, }; }); // Init cb.setTimeout(setup(), 1000);
© Copyright Chaturbate 2011- 2025. All Rights Reserved.