/ ‘grepolis.user.js’
This commit is contained in:
parent
0b459dcdd7
commit
72983e71d0
@ -10,7 +10,7 @@
|
||||
//
|
||||
// @match http://*.grepolis.com/game/*
|
||||
//
|
||||
// @version 1.0.37
|
||||
// @version 1.0.38
|
||||
// @updateURL http://git.javil.eu/jan/userscripts/raw/master/grepolis.user.js
|
||||
// ==/UserScript==
|
||||
|
||||
@ -45,6 +45,8 @@
|
||||
setTimeout(getWaresTick, 5000);
|
||||
function getWaresTick(xFarmId) {
|
||||
return function() {
|
||||
var timeout = 60000;
|
||||
try {
|
||||
var d = new Date();
|
||||
var dformat = "[" + [d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds()].join(':') + "]";
|
||||
$('.town_name').text(dformat);
|
||||
@ -59,7 +61,7 @@
|
||||
{'action': "claim_info"},
|
||||
xFarmId);
|
||||
windows[xFarmId] = wnd.getID();
|
||||
setTimeout(getWaresTick(xFarmId), 500);
|
||||
timeout = 500;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -67,7 +69,7 @@
|
||||
if(wnd == undefined){
|
||||
windows[xFarmId] = undefined;
|
||||
console.log("Window not open any more");
|
||||
setTimeout(getWaresTick(xFarmId), 50);
|
||||
timeout = 50;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -80,7 +82,7 @@
|
||||
} catch(e) {
|
||||
console.warn("Could not close Window");
|
||||
}
|
||||
setTimeout(getWaresTick(xFarmId), 50);
|
||||
timeout = 50;
|
||||
return;
|
||||
}
|
||||
var btn = $(wndElement).find(".farm_claim_box .farm_claim_res0 + div + a");
|
||||
@ -93,18 +95,19 @@
|
||||
var minutes = ts.substring(2,4);
|
||||
var seconds = minutes * 60 + ts.substring(5,7) * 1;
|
||||
|
||||
|
||||
$('.town_name').text(dformat + " +" + ts);
|
||||
console.log("btn is inactive, trying again in " + ts);
|
||||
wnd.close();
|
||||
|
||||
setTimeout(getWaresTick(xFarmId), seconds * 1000 + 1000);
|
||||
timeout = seconds * 1000 + 1000;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
getWaresFromFarm(btn[0], mood, xFarmId);
|
||||
setTimeout(getWaresTick(xFarmId), 60 * 1000);
|
||||
} finally {
|
||||
setTimeout(getWaresTick(xFarmId), timeout);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user