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 8c573017c34368ea81cc5091c4aed2d0e29c6af7
parent b0ae77b4c6a43b9a498eebcaa6eb68be7da438d3
Author: Marcel <MTRNord@users.noreply.github.com>
Date:   Wed,  8 Feb 2017 20:25:24 +0100

Prepare Portalinfo
Diffstat:
Mscreencap.js | 42+++++++++++++++++++++++++++++++++++++++++-
1 file changed, 41 insertions(+), 1 deletion(-)

diff --git a/screencap.js b/screencap.js @@ -280,7 +280,47 @@ function portalinfoScreen(){ } function portalinfoText(){ - + setTimeout(function() { + waitFor({ + timeout: 240000, + check: function () { + return page.evaluate(function() { + if (document.querySelector('.map').textContent.indexOf('done') != -1) { + return true; + }else{ + console.log('generateFakeOutput') + return false; + } + }); + }, + success: function () { + //Todo + var startTime = new Date().getTime(); + var startTime = new Date().getTime(); + var interval = setInterval(function(){ + if(new Date().getTime() - startTime > 5000){ + clearInterval(interval); + phantom.exit(0); + return; + } + console.log('doSomeOutput') + }, 1000); + }, + error: function () { + //TODO + var startTime = new Date().getTime(); + var startTime = new Date().getTime(); + var interval = setInterval(function(){ + if(new Date().getTime() - startTime > 5000){ + clearInterval(interval); + phantom.exit(0); + return; + } + console.log('doSomeOutput') + }, 1000); + } + }); + }, "1000"); } function afterLogin(url, search, mode) {