From e43db59f83fa39a9fda06e4df779e2c1e7001756 Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Thu, 26 May 2016 10:51:38 -0400 Subject: [PATCH] Click the right button --- public/bot.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/public/bot.js b/public/bot.js index fbc4132..0e0e06a 100644 --- a/public/bot.js +++ b/public/bot.js @@ -40,8 +40,11 @@ function mainLoop() { botLastRandom = botTimestamp(); break; case 'Are you sure?': - clickButton('Drop Item'); - clickButton('Activate Item'); + if(checkPopupContent('drop')) { + clickButton('Drop Item'); + } else { + clickButton('Activate Item'); + } break; case 'ARE YOU SURE?': case 'CONFIRM PURCHASE': @@ -415,6 +418,14 @@ function clickSelector(selector) { $(selector).get(0).click(); } +function checkPopupContent(text) { + if($('#popup div[name="content"]:contains("' + text + '")').length > 0) { + return true; + } else { + return false; + } +} + function botSetTarget(username) { botRaidTarget = username; }