NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript== // @name fin batiment // @namespace toto // @version 1.1 // @include *.ogame*gameforge.com/game/index.php?page=* // @copyright 2019, benneb (https://openuserjs.org/users/benneb) // @license MIT // @updateURL https://openuserjs.org/meta/benneb/fin_batiment.meta.js // @downloadURL https://openuserjs.org/install/benneb/fin_batiment.user.js // ==/UserScript== var finbat = (function(){ if((location.href.indexOf('page=ingame&component=supplies',0))>=0){ function parseIntFormat(a) { return "string" === typeof a ? +a.replace(/[^\d\-]/g, "") || 0 : "number" === typeof a ? Math.floor(a) : 0;} function d(a) {return 0 > a || 9 < a ? a : "0" + a;} function format(a) { //var datemm = new Date((new Date()).getTime()+(a*1000)); var datemm = new Date(a*1000); var datestring = d(datemm.getDate()) +"/" + d((datemm.getMonth()+1)) + "/" + datemm.getFullYear() + " " + datemm.getHours() + ":" + datemm.getMinutes(); return datestring; } if(document.getElementById("countdownbuildingDetails")) { var countdownbuildingDetails = document.getElementById("countdownbuildingDetails"); var timestamp = countdownbuildingDetails.dataset.end; var adate = parseIntFormat(timestamp); var productionboxbuildingcomponent = document.getElementById("productionboxbuildingcomponent"); var contentWrapper = productionboxbuildingcomponent.getElementsByClassName("footer")[0]; contentWrapper.style.marginTop = "0px"; contentWrapper.style.textAlign = "center"; contentWrapper.style.marginBottom = "10px"; contentWrapper.innerHTML += format(adate); } } }).toString(); var script = document.createElement("script"); script.text = "(" + finbat + ")();"; document.body.appendChild(script);