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);