/ ‘grepolis.user.js’
This commit is contained in:
parent
392ab827db
commit
303920b2a6
@ -14,6 +14,10 @@
|
|||||||
// @updateURL http://git.javil.eu/jan/userscripts/raw/master/grepolis.user.js
|
// @updateURL http://git.javil.eu/jan/userscripts/raw/master/grepolis.user.js
|
||||||
// ==/UserScript==
|
// ==/UserScript==
|
||||||
|
|
||||||
|
|
||||||
|
//double
|
||||||
|
//
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
console.logCopy = console.log.bind(console);
|
console.logCopy = console.log.bind(console);
|
||||||
console.log = function()
|
console.log = function()
|
||||||
@ -52,6 +56,7 @@
|
|||||||
var dformat = "[" + [d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds()].join(':') + "]";
|
var dformat = "[" + [d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds()].join(':') + "]";
|
||||||
$('.town_name').text(dformat);
|
$('.town_name').text(dformat);
|
||||||
console.log($.map($(".indicator .amount"),function(v){return $(v).text()}).join(", "));
|
console.log($.map($(".indicator .amount"),function(v){return $(v).text()}).join(", "));
|
||||||
|
mood = 0;
|
||||||
if(!buttonIsInitialized() || w(btn[0]) == null) {
|
if(!buttonIsInitialized() || w(btn[0]) == null) {
|
||||||
console.log("Need to get btn again");
|
console.log("Need to get btn again");
|
||||||
if(GPWindowMgr.is_open(GPWindowMgr.TYPE_FARM_TOWN) < 1) {
|
if(GPWindowMgr.is_open(GPWindowMgr.TYPE_FARM_TOWN) < 1) {
|
||||||
@ -65,6 +70,7 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
btn = $(".farm_claim_box .farm_claim_res0 + div + a");
|
btn = $(".farm_claim_box .farm_claim_res0 + div + a");
|
||||||
|
mood = parseFloat($('#mood1').siblings().last().text());
|
||||||
}
|
}
|
||||||
if(btn.hasClass("farm_claim_button_inactive")) {
|
if(btn.hasClass("farm_claim_button_inactive")) {
|
||||||
var ts = $(".farm_next_claim_time").text();
|
var ts = $(".farm_next_claim_time").text();
|
||||||
@ -82,19 +88,24 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
getWares(btn[0]);
|
getWares(btn[0], mood);
|
||||||
setTimeout(getWaresTick, 60 * 1000);
|
setTimeout(getWaresTick, 60 * 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getWares(xGetWaresButton) {
|
function getWares(xGetWaresButton, xMood) {
|
||||||
console.log("getting wares");
|
console.log("getting wares");
|
||||||
farm_ids.forEach(function(xFarmId) {
|
farm_ids.forEach(function(xFarmId) {
|
||||||
getWaresFromFarm(xGetWaresButton, xFarmId);
|
getWaresFromFarm(xGetWaresButton, xMood, xFarmId);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function getWaresFromFarm(xGetWaresButton, xFarmId) {
|
function getWaresFromFarm(xGetWaresButton, xFarmId) {
|
||||||
w(xGetWaresButton).call('claimLoad', xFarmId.toString(), 'normal', 300);
|
if(xMood > 80)
|
||||||
|
{
|
||||||
|
w(xGetWaresButton).call('claimLoad', xFarmId.toString(), 'dobule', 300);
|
||||||
|
} else {
|
||||||
|
w(xGetWaresButton).call('claimLoad', xFarmId.toString(), 'normal', 300);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function buttonIsInitialized() {
|
function buttonIsInitialized() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user