/ ‘grepolis.user.js’

This commit is contained in:
Jan Bader 2014-08-07 21:13:34 +02:00
parent 3e4e2f9d10
commit 8a2e73d09e

View File

@ -10,7 +10,7 @@
//
// @match http://*.grepolis.com/game/*
//
// @version 1.1.37
// @version 1.1.38
// @updateURL http://git.javil.eu/jan/userscripts/raw/master/grepolis.user.js
// ==/UserScript==
@ -95,7 +95,6 @@
var choose = $("#choosefarmduration")[0];
choose.onchange = function() {
farmDuration = this.value;
log("Duration changed to: " + farmDuration);
}
}, 15000);
@ -118,11 +117,10 @@
return function() {
var timeout = 60000;
try {
var amounts = $.map($(".indicator .amount"),function(v){return $(v).text()}).join(", ");
if(amounts != lastAmounts) {
log(amounts);
lastAmounts = amounts;
}
// var amounts = $.map($(".indicator .amount"),function(v){return $(v).text()}).join(", ");
// if(amounts != lastAmounts) {
// lastAmounts = amounts;
// }
var windowId = windows[xFarmId];
if(windowId == undefined){
@ -161,10 +159,7 @@
var hours = ts.substring(0,1);
var minutes = ts.substring(2,4);
var seconds = hours * 60 * 60 + minutes * 60 + ts.substring(5,7) * 1;
log("Wait " + ts + " for Farm " + xFarmId);
wnd.close();
timeout = seconds * 1000 + 1000;
return;
}
@ -174,9 +169,7 @@
var loot_maximum = parseFloat(loots[1]);
var count_per_loot = parseFloat($(wndElement).find(".farm_claim_res0").text());
if(loot_current + count_per_loot*3 > loot_maximum) {
log("Wait 15:00 for Farm " + xFarmId + " to reset");
wnd.close();
timeout = 15 * 60 * 1000;
return;
}
@ -196,14 +189,14 @@
var town = ITowns.getTown(xTownId);
if(town.getCastedPower("forced_loyalty")) {
log("Plündere " + xFarmId + " @ forced_loyalty ");
// log("Plündere " + xFarmId + " @ forced_loyalty ");
xWindow.call('claimLoad', xFarmId.toString(), 'double', farmDuration);
} else if(xMood-6 > 80) {
log("Plündere " + xFarmId + " @ Mood: " + xMood);
// log("Plündere " + xFarmId + " @ Mood: " + xMood);
xWindow.call('claimLoad', xFarmId.toString(), 'double', 300);
return 300;
} else {
log("Fordere " + xFarmId + " @ Mood: " + xMood);
// log("Fordere " + xFarmId + " @ Mood: " + xMood);
xWindow.call('claimLoad', xFarmId.toString(), 'normal', farmDuration);
}
return farmDuration;