From ad10c8c7221e0b60700ff9f11ee309d38130541f Mon Sep 17 00:00:00 2001 From: Jan Bader Date: Sun, 15 Jun 2014 00:58: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 | 42 ++++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/grepolis.user.js b/grepolis.user.js index cd4fcef..a0ee494 100644 --- a/grepolis.user.js +++ b/grepolis.user.js @@ -10,7 +10,7 @@ // // @match http://*.grepolis.com/game/* // -// @version 1.0.75 +// @version 1.0.76 // @updateURL http://git.javil.eu/jan/userscripts/raw/master/grepolis.user.js // ==/UserScript== @@ -41,26 +41,28 @@ }); logWindowElement.empty(); - var s = document.createElement("script"); - s.type = "text/javascript"; - s.innerHTML = 'function countdown(t, id){' - +'console.log(""+t);' - +'h = Math.floor(t/(60*60)) % 24;' - +'m = Math.floor(t/60) %60;' - +'s = t %60;' - +'h = (h < 10) ? "0"+h : h;m = (m < 10) ? "0"+m : m;s = (s < 10) ? "0"+s : s;' - +'strZeit = h + ":" + m + ":" + s;' - +'durations[id]=durations[id]-1;' - +'window.setTimeout(\'countdown(\'+durations[id]+\',\\\'\'+id+\'\\\')\',1000);' - +'document.getElementById(id).innerHTML = strZeit;}'; - document.getElementsByTagName("head")[0].appendChild(s); + setTimeout(function() { + var s = document.createElement("script"); + s.type = "text/javascript"; + s.innerHTML = 'function countdown(t, id){' + +'console.log(""+t);' + +'h = Math.floor(t/(60*60)) % 24;' + +'m = Math.floor(t/60) %60;' + +'s = t %60;' + +'h = (h < 10) ? "0"+h : h;m = (m < 10) ? "0"+m : m;s = (s < 10) ? "0"+s : s;' + +'strZeit = h + ":" + m + ":" + s;' + +'durations[id]=durations[id]-1;' + +'window.setTimeout(\'countdown(\'+durations[id]+\',\\\'\'+id+\'\\\')\',1000);' + +'document.getElementById(id).innerHTML = strZeit;}'; + document.getElementsByTagName("head")[0].appendChild(s); - farm_ids.forEach(function(xFarmId) { - var tmout = 5000 + rand(5); - setTimeout(getWaresTick(xFarmId), tmout); - var tmoutId = 'farm-' + xFarmId - logWindowElement.append('Farm ID ' + xFarmId + ':
'); - }); + farm_ids.forEach(function(xFarmId) { + var tmout = 5000 + rand(5); + setTimeout(getWaresTick(xFarmId), tmout); + var tmoutId = 'farm-' + xFarmId + logWindowElement.append('Farm ID ' + xFarmId + ':
'); + }); + }, 5000); $("#ui-id-1").empty().append(""); var choose = $("#choosefarmduration")[0];