From 674d3608b4ea9b76e39f3a44aef6c2dc4ac53fd1 Mon Sep 17 00:00:00 2001 From: Christopher Szucko Date: Sat, 20 Jun 2015 14:30:27 -0500 Subject: [PATCH] Fixed Bugs with Badge Points Which were Breaking Auto Upgrades Calling TrySpendBadgePoints() with a count <= 0 will get past its error checking and set m_bUpgradesBusy to true, but since no items get added to m_rgPurchaseItemsQueue SendSpendBadgePointsRequest()'s error checking prevents it from attempting to make a purchase resulting in m_bUpgradesBusy remaining true. --- autoPlay.user.js | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/autoPlay.user.js b/autoPlay.user.js index cb6cf07..2ae1979 100644 --- a/autoPlay.user.js +++ b/autoPlay.user.js @@ -354,23 +354,31 @@ var badgePoints = w.g_Minigame.CurrentScene().m_rgPlayerTechTree.badge_points; // Determine how many other things to buy - var buy_count = (w.g_steamID % 10) + 1; + var buy_count = Math.min((w.g_steamID % 10) + 1, Math.floor(badgePoints / 200)); // Buy some - w.g_Minigame.CurrentScene().TrySpendBadgePoints( w.$J(""), buy_count ); + if (buy_count > 0) { + w.g_Minigame.CurrentScene().TrySpendBadgePoints( w.$J(""), buy_count ); + } badgePoints -= buy_count*200; // How many WH/LN do we buy too? var purchaseCount = Math.floor(badgePoints / 200); // Buy mostly WH - w.g_Minigame.CurrentScene().TrySpendBadgePoints( w.$J(""), purchaseCount ); + if (purchaseCount > 0) { + w.g_Minigame.CurrentScene().TrySpendBadgePoints( w.$J(""), purchaseCount ); + } // Buy a few LN - w.g_Minigame.CurrentScene().TrySpendBadgePoints( w.$J(""), purchaseCount ); + if (purchaseCount > 0) { + w.g_Minigame.CurrentScene().TrySpendBadgePoints( w.$J(""), purchaseCount ); + } //Rest is Pumped Up - w.g_Minigame.CurrentScene().TrySpendBadgePoints(w.$J(""), badgePoints % 100 ); + if ((badgePoints % 100) > 0) { + w.g_Minigame.CurrentScene().TrySpendBadgePoints(w.$J(""), badgePoints % 100 ); + } } function updateLaneData() {