Apps Home
|
Create an App
Faster Slower
Author:
bobob1121
Description
Source Code
Launch App
Current Users
Created by:
Bobob1121
var CurrentSetting = 0; var TotalTips = 0; var LastTipper = null; var GoalsRunning = new Boolean; var FirstGoal = null; var SecondGoal = null; var ThirdGoal = null; var NextGoalName = null; var NextGoalCost = 0; cb.settings_choices = [{ name : "StopCost", type : "int", minValue : 1, required : true, default : 40, label : "Cost to stop" }, { name : "LowCost", type : "int", minValue : 1, required : true, default : 10, label : "Cost for lower" }, { name : "HighCost", type : "int", minValue : 1, required : true, default : 20, label : "Cost for higher" }, { name : "RunnableGoals", type : "choice", label : "Activate Goals?", choice1 : "Yes", choice2 : "No", defaultValue : "No" }, { name : "FirstGoalName", type : "str", minLength : 1, required : false, label : "First Goal" }, { name : "FirstGoalCost", type : "int", minValue : 1, required : false, label : "First Goal Cost" }, { name : "SecondGoalName", type : "str", minLength : 1, required : false, label : "Second Goal" }, { name : "SecondGoalCost", type : "int", minValue : 1, required : false, label : "Second Goal Cost" }, { name : "ThirdGoalName", type : "str", minLength : 1, required : false, label : "Third Goal" }, { name : "ThirdGoalCost", type : "int", minValue : 1, required : false, label : "Third Goal cost" }]; cb.onTip(function(response) { /** @type {number} */ TipAmount = parseInt(response["amount"]); TotalTips = TotalTips + TipAmount; LastTipper = response["from_user"]; if (TipAmount === HighCost && CurrentSetting < 4) { CurrentSetting = CurrentSetting + 1; cb.chatNotice("Speed set to :speed" + CurrentSetting, "", "", "", "bold"); } if (TipAmount === LowCost && CurrentSetting > "1") { /** @type {number} */ CurrentSetting = CurrentSetting - 1; cb.chatNotice("Speed set to :speed" + CurrentSetting, "", "", "", "bold"); } if (TipAmount === StopCost && CurrentSetting !== 0) { /** @type {number} */ CurrentSetting = 0; cb.chatNotice("Speed set to :speed" + CurrentSetting, "", "", "", "bold"); } if (GoalsRunning) { if (NextGoalName === FirstGoalName && NextGoalCost <= TotalTips) { NextGoalName = SecondGoalName; NextGoalCost = SecondGoalCost; cb.chatNotice("Goal Reached for: " + FirstGoalName + "!\n Next Goal: " + NextGoalName + " at " + NextGoalCost + " tokens!", "", "#71D8EB", "#000000", "bold"); cb.changeRoomSubject("Machine: Lower-" + LowCost + " Higher-" + HighCost + " Stop-" + StopCost + " [Next Goal: " + NextGoalName + "]"); } if (NextGoalName === SecondGoalName && NextGoalCost <= TotalTips) { NextGoalName = ThirdGoalName; NextGoalCost = ThirdGoalCost; cb.chatNotice("Goal Reached for: " + SecondGoalName + "!\n Next Goal: " + NextGoalName + " at " + NextGoalCost + " tokens!", "", "#71D8EB", "#000000", "bold"); cb.changeRoomSubject("Machine: Lower-" + LowCost + " Higher-" + HighCost + " Stop-" + StopCost + " [Next Goal: " + NextGoalName + "]"); } if (NextGoalName === ThirdGoalName && NextGoalCost <= TotalTips) { /** @type {string} */ NextGoalName = "All Goals Reached"; /** @type {string} */ NextGoalCost = "<3"; cb.chatNotice("Goal Reached for: " + ThirdGoalName + "!", "", "#71D8EB", "#000000", "bold"); cb.changeRoomSubject("Machine: Lower-" + LowCost + " Higher-" + HighCost + " Stop-" + StopCost); } } cb.drawPanel(); }); cb.onDrawPanel(function(canCreateDiscussions) { if (GoalsRunning) { return { "template" : "3_rows_of_labels", "row1_label" : "Current Setting: ", "row1_value" : CurrentSetting, "row2_label" : "Next Goal: ", "row2_value" : NextGoalName + " (" + NextGoalCost + ")", "row3_label" : "Total Tips: ", "row3_value" : TotalTips }; } else { return { "template" : "3_rows_of_labels", "row1_label" : "Current Setting: ", "row1_value" : CurrentSetting, "row2_label" : "Last Tipper: ", "row2_value" : LastTipper, "row3_label" : "Total Tips: ", "row3_value" : TotalTips }; } }); function init() { HighCost = cb.settings.HighCost; LowCost = cb.settings.LowCost; StopCost = cb.settings.StopCost; RunnableGoals = cb.settings.RunnableGoals; FirstGoalName = cb.settings.FirstGoalName; FirstGoalCost = cb.settings.FirstGoalCost; SecondGoalName = cb.settings.SecondGoalName; SecondGoalCost = cb.settings.SecondGoalCost; ThirdGoalName = cb.settings.ThirdGoalName; ThirdGoalCost = cb.settings.ThirdGoalCost; NextGoalName = FirstGoalName; NextGoalCost = FirstGoalCost; if (RunnableGoals === "Yes") { /** @type {boolean} */ GoalsRunning = true; cb.changeRoomSubject("Hitachi Torture: Lower-" + LowCost + " Higher-" + HighCost + " Stop-" + StopCost + " [Next Goal: " + FirstGoalName + "]"); cb.chatNotice("Machine: Lower-" + LowCost + " Higher-" + HighCost + " Stop-" + StopCost + "\n Next Goal: " + FirstGoalName + " at " + FirstGoalCost + " tokens!", "", "#71D8EB", "#000000", "bold"); } else { /** @type {boolean} */ GoalsRunning = false; cb.changeRoomSubject("Machine: Lower-" + LowCost + " Higher-" + HighCost + " Stop-" + StopCost); cb.chatNotice("Machine: Lower-" + LowCost + " Higher-" + HighCost + " Stop-" + StopCost, "", "#71D8EB", "#000000", "bold"); } } init();
© Copyright Chaturbate 2011- 2026. All Rights Reserved.