intel-screenbot

An Ingress Intel Map Bot for Hangoutsbot
git clone git://archive.git.mtrnord.blog/MTRNord/intel-screenbot.git
Log | Files | Refs | README | LICENSE

commit d767af2558c910296730176c923d4b7a5dc0a254
parent bd59c1f860811d1b6e0032a8bee7e26e16d2fe9e
Author: Marcel <MTRNord@users.noreply.github.com>
Date:   Tue, 15 Nov 2016 18:45:31 +0100

ERemove blocking func
Diffstat:
Mscreencap_iitc.js | 86++++++++++++++++++++++++++++++++++++++-----------------------------------------
1 file changed, 41 insertions(+), 45 deletions(-)

diff --git a/screencap_iitc.js b/screencap_iitc.js @@ -186,54 +186,50 @@ function afterPlainLogin(IntelURL, search) { loadLocalIitcPlugin(plugin); } } - var checkExist1 = setInterval(function() { - if (document.querySelector('.map')){ - setTimeout(function() { - if (search != "nix") { - page.evaluate(function(search) { - if (document.querySelector('#search')){ - window.setTimeout(function() { - document.getElementById("search").value=search; - var e = jQuery.Event("keypress"); - e.which = 13; - e.keyCode = 13; - $("#search").trigger(e); - }, 2000); - var checkExist = setInterval(function() { - if ($('.searchquery').length > 0) { - window.setTimeout(function() {$('.searchquery > :nth-child(2)').children()[0].click();}, 1000); - clearInterval(checkExist); - } - }, 100); - } - }, search); + setTimeout(function() { + if (search != "nix") { + page.evaluate(function(search) { + if (document.querySelector('#search')){ + window.setTimeout(function() { + document.getElementById("search").value=search; + var e = jQuery.Event("keypress"); + e.which = 13; + e.keyCode = 13; + $("#search").trigger(e); + }, 2000); + var checkExist = setInterval(function() { + if ($('.searchquery').length > 0) { + window.setTimeout(function() {$('.searchquery > :nth-child(2)').children()[0].click();}, 1000); + clearInterval(checkExist); + } + }, 100); } - waitFor({ - timeout: 240000, - check: function () { - return page.evaluate(function() { - if (document.querySelector('.map').textContent.indexOf('done') != -1) { - return true; - }else{ - return false; - } - }); - }, - success: function () { - hideDebris(); - prepare('1920', '1080'); - main(); - }, - error: function () { - hideDebris(); - prepare('1920', '1080'); - main(); + }, search); + } + waitFor({ + timeout: 240000, + check: function () { + return page.evaluate(function() { + if (document.querySelector('.map').textContent.indexOf('done') != -1) { + return true; + }else{ + return false; } }); - }, "5000"); - } - clearInterval(checkExist1); - }, 100); + }, + success: function () { + hideDebris(); + prepare('1920', '1080'); + main(); + }, + error: function () { + hideDebris(); + prepare('1920', '1080'); + main(); + } + }); + }, "5000"); + } }, "5000"); }); }