From 412ba7c116ec6d08391c26d20b75358139521819 Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Thu, 23 Apr 2015 10:29:23 -0400 Subject: [PATCH] Use item if we have 20 --- public/bot.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/public/bot.js b/public/bot.js index 039210c..8b3b8f9 100644 --- a/public/bot.js +++ b/public/bot.js @@ -172,7 +172,7 @@ function activateBuffs() { $('div[name="items_holder"]').children().each(function() { var itemHolder = $(this); - if(itemHolder.attr('item') != 'godspear_fragment' || botSaveSpears === false) { + if(itemHolder.attr('item') != 'godspear_fragment' || botSaveSpears === false || haveMaxItems()) { var itemButton = itemHolder.find('button:contains("Activate")'); if(itemButton.length > 0) { itemButton.get(0).click() @@ -181,6 +181,10 @@ function activateBuffs() { }); } +function haveMaxItems() { + return $('span[name="item_count"').text() == '20/20'; +} + function setBotToPurchasing() { botPurchasing = true; botLastPurchase = botTimestamp();