NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript== // @name oRecuAmp // @namespace http://ogame.com.es // @version 0.1 // @description Calculadora Producción y minas desde recursos // @author Pepe Bono // @match http://*.ogame.gameforge.com/game/index.php?page=resourceSettings* // @grant none // @require http://code.jquery.com/jquery-latest.js // ==/UserScript== // ==OpenUserJS== // @author Pepe_Bono // ==/OpenUserJS== function Planeta (){ this.Coord = null; this.MinaMetal = 0; this.MinaCristal = 0; this.MinaDeuterio = 0; } var CoordActivas = document.getElementsByClassName('planetlink active tooltipRight js_hideTipOnMobile')[0].childNodes[5].innerHTML; var unPlaneta = new Planeta(); unPlaneta.Coord = CoordActivas; var extraerMinas = document.getElementsByClassName('label'); var patron = /\d+/; unPlaneta.MinaMetal = patron.exec(extraerMinas[1].innerHTML)[0]; unPlaneta.MinaCristal = patron.exec(extraerMinas[2].innerHTML)[0]; unPlaneta.MinaDeuterio = patron.exec(extraerMinas[3].innerHTML)[0]; //Leo las coordenadas de todos los planetas y compruebo que existan en el almacenamiento var ExtraerPlanetas = new Array(); ExtraerPlanetas = document.getElementsByClassName('planet-koords '); var i = ExtraerPlanetas.length; var ListaColonias = new Array(); while(i--) {ListaColonias.push(ExtraerPlanetas[i].innerHTML);} i = ListaColonias.length; while(i--){ if (localStorage.getItem(ListaColonias[i]+"_coord")===null){ localStorage.setItem(ListaColonias[i]+"_metal",0); localStorage.setItem(ListaColonias[i]+"_cristal",0); localStorage.setItem(ListaColonias[i]+"_deuterio",0); localStorage.setItem(ListaColonias[i]+"_coord",ListaColonias[i]); } if (ListaColonias[i] == unPlaneta.Coord){ localStorage.setItem(ListaColonias[i]+"_metal",unPlaneta.MinaMetal); localStorage.setItem(ListaColonias[i]+"_cristal",unPlaneta.MinaCristal); localStorage.setItem(ListaColonias[i]+"_deuterio",unPlaneta.MinaDeuterio); } } var tabla = document.getElementsByTagName('tbody'); i = ListaColonias.length; while(i--){ var filaPlaneta = document.createElement("tr"); filaPlaneta.innerHTML = '<td colspan="2" class="label">'+localStorage.getItem(ListaColonias[i]+'_coord')+'</td>'; filaPlaneta.innerHTML += '<td>'+localStorage.getItem(ListaColonias[i]+'_metal')+'</td>'; filaPlaneta.innerHTML += '<td>'+localStorage.getItem(ListaColonias[i]+'_cristal')+'</td>'; filaPlaneta.innerHTML += '<td>'+localStorage.getItem(ListaColonias[i]+'_deuterio')+'</td>'; filaPlaneta.innerHTML += '<td></td>'; filaPlaneta.innerHTML += '<td></td>'; tabla[0].appendChild(filaPlaneta); }