Click the right button

This commit is contained in:
Andrew Tomaka 2016-05-26 10:51:38 -04:00
parent 3b9553b365
commit e43db59f83

View file

@ -40,8 +40,11 @@ function mainLoop() {
botLastRandom = botTimestamp(); botLastRandom = botTimestamp();
break; break;
case 'Are you sure?': case 'Are you sure?':
clickButton('Drop Item'); if(checkPopupContent('drop')) {
clickButton('Activate Item'); clickButton('Drop Item');
} else {
clickButton('Activate Item');
}
break; break;
case 'ARE YOU SURE?': case 'ARE YOU SURE?':
case 'CONFIRM PURCHASE': case 'CONFIRM PURCHASE':
@ -415,6 +418,14 @@ function clickSelector(selector) {
$(selector).get(0).click(); $(selector).get(0).click();
} }
function checkPopupContent(text) {
if($('#popup div[name="content"]:contains("' + text + '")').length > 0) {
return true;
} else {
return false;
}
}
function botSetTarget(username) { function botSetTarget(username) {
botRaidTarget = username; botRaidTarget = username;
} }