From c87d2769bd47e81bf932c4189e9a1f2656c38755 Mon Sep 17 00:00:00 2001 From: Jan Bader Date: Fri, 6 Jun 2014 22:50:05 +0200 Subject: [PATCH] =?UTF-8?q?/=20=E2=80=98grepolis.user.js=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- grepolis.user.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/grepolis.user.js b/grepolis.user.js index dee4dae..33276d2 100644 --- a/grepolis.user.js +++ b/grepolis.user.js @@ -10,7 +10,7 @@ // // @match http://*.grepolis.com/game/* // -// @version 1.0.51 +// @version 1.0.52 // @updateURL http://git.javil.eu/jan/userscripts/raw/master/grepolis.user.js // ==/UserScript== @@ -102,6 +102,17 @@ return; } + var loots = $(wndElement).find("#farmtown_loot").children().last().text().split('/'); + var loot_current = parseFloat(loots[0]); + var loot_maximum = parseFloat(loots[1]); + if(loot_current + 24*3 > loot_maximum) { + log("Wait 15:00 for Farm " + xFarmId + " to reset"); + wnd.close(); + + timeout = 15 * 60 * 1000; + return; + } + getWaresFromFarm(wnd, mood, xFarmId); } finally { setTimeout(getWaresTick(xFarmId), timeout);