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 04715b8639fa4e6df89dbea4b670f239778d8b9b
parent 8d6c092217a791ed96eed0d6e44f68b7b07001c0
Author: Marcel <MTRNord@users.noreply.github.com>
Date:   Thu, 10 Nov 2016 21:13:00 +0100

Timeout to 5seconds because map is loading very slow

Also do screenshot if loading did not completly finished
Diffstat:
Mintel_screenbot/screencap.js | 12++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/intel_screenbot/screencap.js b/intel_screenbot/screencap.js @@ -77,7 +77,7 @@ function afterCookieLogin(IntelURL, search) { waitFor({ debug: false, // optional interval: 0, // optional - timeout: 1000, // optional + timeout: 5000, // optional check: function () { return page.evaluate(function() { if (document.querySelector('#percent_text').textContent == "90") { @@ -95,7 +95,15 @@ function afterCookieLogin(IntelURL, search) { prepare('1920', '1080', search); main(); }, - error: function () {} // optional + error: function () { + system.stdout.writeLine('map did not finish loading in time...'); + page.evaluate(function() { + document.querySelector("#filters_container").style.display= 'none'; + }); + hideDebris(); + prepare('1920', '1080', search); + main(); + } // optional }); }, "5000"); });