Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- / / == == Userscript
- / / @ Name Ikariam Resources Expanded Display FINAL
- / / @ Author Emilio, J.A. and Shuko
- / / @ Date 28/11/2007
- / / @ Version 1.0
- / / @ Namespace Ikariam Resources Expanded Display FINAL
- / / @ Description Display Expanded Resources.
- / / @ Include http:// *. Ogame. * / Game / index.php? Page = *
- / / @ Exclude http:// *. Ogame. * / Game / index.php? Page = Notizen *
- / / @ Exclude http:// *. Ogame. * / Game / index.php? Page = galaxy *
- / / @ Exclude http:// *. Ogame. * / Game / index.php? Page = phalanx *
- / / == / == Userscript
- / / Original script: http://userscripts.org/scripts/show/12003 and / 14643
- / / Modified by Emilio, J.A. and Shuko.
- / / Added on 28-11-2007
- / / Display Expanded Resources, shows a table more to the total resources from all the colonies.
- / / For use it must pass through the screen of all world resources and thus update the cookies that contain the data accumulated in the colonies.
- / / This script creates three cookies:
- / / Cookie planets: the value of this cookie is a string with all the coordinates of the planets
- / / Cookie resources: contains the value of metal resources, crystal and deuterium, the production per hour.
- / / Cookie stores: contains the warehouse capacity.
- / / Cookies are idependientes in each universe, so you can have several open universes perfectly.
- / / Thanks to all those who work anonymously
- / / Revised 2/6/2009:
- / / - Compatible with the latest version, v 0.84.
- / / Revised 1/18/2008:
- / / - Compatible with the latest version, v 0.78c.
- / / - Fixed bug with stores
- / / - Is hidden resources by month ... the server.
- / / - Code Optimization
- / / Revised 9/12/2007:
- / / - From cookies to Modifiacion from deletion if ogame is closed or the session ends.
- / / Revised 29/11/2007:
- / / - Correction of increased resources when the warehouse is full.
- / / - Update time update of resources in real time.
- / / - Creation of a new cookie stores: contains the warehouse capacity.
- / / Revised 28/11/2007:
- / / - Correction of increased resources on the Moon (no production)
- / / Revised 27/11/2007:
- / / - Added resources in real time across OGame
- / / Revised 24/11/2007:
- / / - Added resources in real time.
- / / Revised 4/11/2007:
- / / - Added the total production.
- / / - Faster progress bar and change in appearance.
- / / - Change in storage time visualization if a unit is zero.
- / / Revised 3/11/2007:
- / / - Modification cookies general, remain two but now store all of the planets resources daily.
- / / - Modified to include no moons.
- / / - Fixed to not fail when there is added or master in this world on the moon.
- / / - Implemented the detection of the deletion of any planet and removed from the production statistics.
- / / - Updated correctly changes increase mine production or changes in energy or production
- / / - Implemented animation in percentage bars. (Motion)
- / / Revised 1/11/2007:
- / / - Fixed error overlimit resources.
- / / -% Format with two decimal places.
- / / Revised 31/10/2007:
- / / - Happens to have two cookies, planets and resources
- / * / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / AUXILIARY FUNCTIONS / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / * /
- formatNmb function (number) {
- nNmb var = String (number);
- Messrs. var = "";
- for (var j, i = nNmb.length - 1, j = 0, i> = 0, i - j + +)
- Messrs. = nNmb.charAt (i) + ((j> 0) && (j% 3 == 0)? ".": "") + SRes;
- Messrs. return;
- }
- roundNumber function (rnum) {
- RLENGTH var = 0; / / The number of decimal places to round to
- if (rnum> 8191 && rnum <10485) {
- rnum = rnum-5000;
- newnumber var = Math.round (rnum * Math.pow (10, RLENGTH)) / Math.pow (10, RLENGTH);
- newnumber newnumber = +5000;
- Else {}
- newnumber var = Math.round (rnum * Math.pow (10, RLENGTH)) / Math.pow (10, RLENGTH);
- }
- newnumber return;
- }
- function setcookie (name, value) {
- var argv = SetCookie.arguments;
- SetCookie.arguments.length var = argc;
- / / Var expires = (2 <argc)? argv [2]: null;
- var now = new Date () / / current date
- unAño var = new Date (ahora.getTime () +1000 * 60 * 60 * 24 * 365) / / we add one year
- var expires = unAño ;/ / expires in one year
- var path = (3 <argc)? argv [3]: null;
- var domain = (4 <argc)? argv [4]: null;
- var secure = (5 <argc)? argv [5]: false;
- document.cookie = name + "=" + escape (value) +
- ((Expires == null)? "": ("Expires =" + expires.toGMTString ())) +
- ((Path == null)? "": ("Path =" + path)) +
- ((Domain == null)? "": ("Domain =" + domain)) +
- ((Secure == true)? "Secure": "");
- }
- getCookieVal function (offset) {
- document.cookie.indexOf endstr var = ("", offset);
- if (endstr == -1)
- endstr = document.cookie.length;
- return unescape (document.cookie.substring (offset, endstr));
- }
- GetCookie function (name) {
- var arg = name + "=";
- var alen = arg.length;
- var = document.cookie.length clen;
- var i = 0;
- while (i <clen) {
- var j = i + alen;
- if (document.cookie.substring (i, j) == arg)
- getCookieVal return (j);
- i = document.cookie.indexOf ("", i) + 1;
- if (i == 0)
- break;
- }
- return null;
- }
- / * / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / RESOURCES EXPANDED SCREEN / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / * /
- var parent resources;
- parent = document.getElementById ('content');
- resources = document.getElementById ('resources');
- T_Recursos var / / iniciamlizado on the resource
- recursos.getElementsByTagName T_Recursos2 var = ("td");
- Metal var = T_Recursos2 [10]. innerHTML.replace (/ \. / g,'');
- Crystal var = T_Recursos2 [11]. innerHTML.replace (/ \. / g,'');
- var Dt = T_Recursos2 [12]. innerHTML.replace (/ \. / g,'');
- var PMetal, PCristal, PDeut;
- var AlmM, AMLC, OHCA;
- var T_Factor;
- var Factor, FactorPorc;
- / / Display detected only resource for these variables determined
- if (location.href.indexOf ('resources')! = -1) {
- T_Recursos = padre.getElementsByTagName ("td");
- PMetal = T_Recursos [10]. InnerHTML.replace (/ \. / G,'');
- PCristal = T_Recursos [11]. InnerHTML.replace (/ \. / G,'');
- PDeut = T_Recursos [12]. InnerHTML.replace (/ \. / G,'');
- AlmM = T_Recursos [5]. InnerHTML.replace (/ \. / G,'');
- AMLC = T_Recursos [6]. InnerHTML.replace (/ \. / G,'');
- OHCA = T_Recursos [7]. InnerHTML.replace (/ \. / G,'');
- PMetal = eval (PMetal);
- PCristal = eval (PCristal);
- PDeut = eval (PDeut);
- AlmM.replace AlmM = (/ k /, '000 ');
- AlmC.replace AMLC = (/ k /, '000 ');
- OHCA = AlmD.replace (/ k /, '000 ');
- if (PMetal.indexOf ('<font color')! = -1) {
- PMetal.substring PMetal = (57, PMetal.indexOf ('</ font'));
- }
- if (PCristal.indexOf ('<font color')! = -1) {
- PCristal.substring PCristal = (57, PCristal.indexOf ('</ font'));
- }
- if (PDeut.indexOf ('<font color')! = -1) {
- PDeut.substring PDeut = (57, PDeut.indexOf ('</ font'));
- }
- if (AlmM.indexOf ('<font color')! = -1) {
- AlmM.substring AlmM = (22, AlmM.indexOf ('</ font'));
- }
- if (AlmC.indexOf ('<font color')! = -1) {
- AMLC = AlmC.substring (22, AlmC.indexOf ('</ font'));
- }
- if (AlmD.indexOf ('<font color')! = -1) {
- OHCA = AlmD.substring (22, AlmD.indexOf ('</ font'));
- }
- / / Search Factor of Production
- T_Factor = / factor (.) * \: (.) * [0-9.] / Gi.exec (document.body.innerHTML);
- if (T_Factor.length) {
- T_Factor Factor = [0]. Split (":");
- Factor = parseFloat (Factor [1]) * 100;
- FactorPorc = parseInt (parseFloat (Factor) * 2.5);
- }
- Else {}
- PMetal = 0;
- PCristal = 0;
- PDeut = 0;
- Metal = eval (Metal);
- Metal = parseInt (Metal);
- Crystal = eval (Crystal);
- Crystal = parseInt (Crystal);
- Dt = eval (Dt);
- Dt = parseInt (Dt);
- AlmM = 0;
- AMLC = 0;
- OHCA = 0;
- }
- XMetaL var = new Array (3);
- XCristal var = new Array (3);
- XDeut var = new Array (3);
- var ResFormC, T_Form, ResForm;
- / / Calculations screen unique resources, unnecessary if we use another page
- if (location.href.indexOf ('resources')! = -1) {
- XMetaL [0] = PMetal * 24;
- XCristal [0] = PCristal * 24;
- XDeut [0] = PDeut * 24;
- XMetaL [1] = PMetal * 168;
- XCristal [1] = PCristal * 168;
- XDeut [1] = PDeut * 168;
- XMetaL [2] = PMetal * 720;
- XCristal [2] = PCristal * 720;
- XDeut [2] = PDeut * 720;
- / / Search Resources Form
- ResFormC = document.getElementsByTagName ('table');
- for (var i = 0; i <ResFormC.length i + +) {
- ResFormC T_Form = [i];
- if (T_Form.getAttribute ('width') == '550 ') {
- ResForm = T_Form;
- }
- }
- } / / End of display features unique resource
- / / Expansion
- header_top var = document.getElementById ('header_top');
- header_top.getElementsByTagName planeta_coord var = ("select");
- / / Get the coordinates of the current planets
- planeta_coord planetas_actuales = var [0]. options;
- var tmp = new Array (planetas_actuales.length);
- for (var i = 0; i <planetas_actuales.length i + +) {
- tmp [i] = planeta_coord [0]. options [i]. text;
- tmp [i] = tmp [i]. split ("[");
- tmp [i] = tmp [i] [1]. split ("]");
- tmp [i] = tmp [i] [0]. split ("");
- }
- planetas_actuales = tmp;
- planetas_actuales = planetas_actuales.sort ();
- / / Get the selected planet, the coordinates
- var world = new Array (2);
- planeta_coord planet = [0]. options [planeta_coord [0]. selectedIndex]. text;
- planet = planeta.split ("[");
- planet = planet [1]. split ("]");
- planet = planet [0]. split ("");
- tmppp var = planet;
- world = new Array (2);
- planet [0] = 1;
- planet [1] = tmppp;
- / / Calculations screen unique resources, unnecessary if we use another page
- if (location.href.indexOf ('resources')! = -1) {
- / / Output per hour of selected planet
- var resource = new Array (3);
- resource [0] = 1;
- action [1] = PMetal;
- action [2] = PCristal;
- action [3] = PDeut;
- / / Stores the selected planet
- var store = new Array (3);
- store [0] = 1;
- storage [1] = AlmM;
- storage [2] = AMLC;
- storage [3] = OHCA;
- planets var / / cookie value planets with an array of all the planets added
- resources var / / array of production resources when the planets added
- var store / / array stores the planets added
- / / If not Exiten cookies, create and add the planet if this is not a moon
- if (GetCookie ("planets") == null) {
- / / Check that there is a moon, metal and deuterium zero
- if (action [1]! = "0" && action [2]! = "0") {
- Setcookie ('planets, planet);
- Setcookie ('resources', resource);
- Setcookie ('stores' warehouse);
- }
- Else {}
- = GetCookie planets ("planet");
- planetas.split planets = ("");
- = GetCookie resources ("resources");
- recursos.split resources = ("");
- = GetCookie stores ("stores");
- almacenes.split stores = ("");
- / / Temporary varibles for comparison with current planet saved in cookies
- var tmp_planetas;
- var tmp_recursos_planetas;
- var tmp_almacenes_planetas;
- / / The cookie begins with a 1, always keep in qeu cookies als arrays
- tmp_planetas = new Array ();
- tmp_planetas [0] = 1;
- tmp_recursos_planetas = new Array (recursos.length-3);
- tmp_recursos_planetas [0] = 1;
- tmp_almacenes_planetas = new Array (almacenes.length-3);
- tmp_almacenes_planetas [0] = 1;
- / / Make a string of planets eliminated deleted.
- for (var i = 1, i <planetas.length i + +) {
- for (var j = 0, j <planetas_actuales.length j + +) {
- if (planets [i] == planetas_actuales [j]) {
- j = planetas_actuales.length;
- Else {}
- / / If there is no planet and you are finished go through the array, delete the planet
- if ((j +1) == planetas_actuales.length) {
- planets [i] = "remove" / / changes the coordenas by a string with the contents "elimiar"
- }
- }
- }
- }
- / / New array of planets and their right resources right
- var cont = 1;
- for (var i = 1, i <planetas.length i + +) {
- if (planets [i]! = "delete") {
- tmp_planetas [cont] = planets [i];
- tmp_recursos_planetas [cont + ((cont-1) * 2)] = resources [i + ((i-1) * 2)];
- tmp_recursos_planetas [cont + ((cont-1) * 2) +1] = resources [i + ((i-1) * 2) +1];
- tmp_recursos_planetas [cont + ((cont-1) * 2) +2] = resources [i + ((i-1) * 2) +2];
- tmp_almacenes_planetas [cont + ((cont-1) * 2)] = storage [i + ((i-1) * 2)];
- tmp_almacenes_planetas [cont + ((cont-1) * 2) +1] = storage [i + ((i-1) * 2) +1];
- tmp_almacenes_planetas [cont + ((cont-1) * 2) +2] = storage [i + ((i-1) * 2) +2];
- count + +;
- }
- }
- / / Update the array planets and resources
- = tmp_planetas planets;
- = tmp_recursos_planetas resources;
- = tmp_almacenes_planetas stores;
- / / Check for changes in the planet's production methods selected for possible upgrade.
- for (var t = 1, t <planetas.length, t + +) {
- if (planets [t] == planet [1]) {
- / / Check that is not a moon, metal and glass to zero
- if (action [1]! = "0" && action [2]! = "0") {
- if (resources [t + ((t-1) * 2)], = action [1]) {
- resources [t + ((t-1) * 2)] = action [1];
- }
- if (resources [t + ((t-1) * 2) +1], = action [2]) {
- resources [t + ((t-1) * 2) +1] = action [2];
- }
- if (resources [t + ((t-1) * 2) +2], = action [3]) {
- resources [t + ((t-1) * 2) +2] = action [3];
- }
- }
- }
- }
- for (var t = 1, t <almacenes.length, t + +) {
- if (planets [t] == planet [1]) {
- / / Check that is not a moon, metal and glass to zero
- if (action [1]! = "0" && action [2]! = "0") {
- if (stores [t + ((t-1) * 2)]! = storage [1]) {
- stores [t + ((t-1) * 2)] = storage [1];
- }
- if (stores [t + ((t-1) * 2) +1]! = storage [2]) {
- stores [t + ((t-1) * 2) +1] = storage [2];
- }
- if (stores [t + ((t-1) * 2) +2]! = storage [3]) {
- stores [t + ((t-1) * 2) +2] = storage [3];
- }
- }
- }
- }
- / / Save changes
- Setcookie ('planets, planets);
- Setcookie ("resources", resources);
- Setcookie ('warehouse' stores);
- = GetCookie planets ("planet");
- planetas.split planets = ("");
- = GetCookie resources ("resources");
- recursos.split resources = ("");
- = GetCookie stores ("stores");
- almacenes.split stores = ("");
- / / To add a new planet
- for (var i = 1, i <planetas.length i + +) {
- / / If the world ended the exite for
- if (planets [i] == planet [1]) {
- i = planetas.length;
- Else {}
- / / If there is no planet and you are finished going through all the array, add the planet
- if ((i +1) == planetas.length) {
- / / Check that there is a moon, metal and deuterium zero
- if (action [1]! = "0" && action [2]! = "0") {
- planets [i +1] = world [1];
- resources [i +1 + (i * 2)] = action [1];
- resources [i +1 + (i * 2) +1] = action [2];
- resources [i +1 + (i * 2) +2] = action [3];
- store [i +1 + (i * 2)] = storage [1];
- store [i +1 + (i * 2) +1] = storage [2];
- store [i +1 + (i * 2) +2] = storage [3];
- Setcookie ('planets, planets);
- Setcookie ("resources", resources);
- Setcookie ('warehouse' stores);
- }
- }
- }
- }
- }
- }
- / / If there ResForm == A screen as shown recurusos resource extensions
- if (ResForm) {
- / / We hide table generated by server
- los_tr = document.getElementById ("ressourcen"). getElementsByTagName ("table") [0]. rows;
- los_tr [los_tr.length-2]. style.display = "none";
- los_tr [los_tr.length-1]. style.display = "none";
- if (los_tr [los_tr.length-1]. getElementsByTagName ("iframe"). length == 1) {
- los_tr [los_tr.length-3]. style.display = "none" ;/ / pub commander Damn xD
- }
- / / Process Tables
- ProdFact var = document.createElement ('div');
- ProdFact.innerHTML = '<table width="550"> <tr>' + '<th> Production Level </ th>' + '<th width="100" id="factor_P">' + Factor + '% </ th>' + '<th width="250"> <div style="border: 1px solid #FFFFFF; width: 250px;"> <div id = "factorP" style = "background-color:' + (Factor <100? '# C00000', '# 00C000') + ', width:' + FactorPorc + "px"> </ div> </ div> </ th> '+' </ tr> </ table> <br /> ';
- CuentaRec var = document.createElement ('div');
- / / Check that there is a moon, metal and deuterium zero
- if (action [1]! = "0" && action [2]! = "0") {
- / / If a moon, not showing the widespread production table
- CuentaRec.innerHTML = '<br /> <table width="550">' + '<td class="c" colspan="4"> Extended Production </ td> </ tr>' + '<tr>' + '<td class="c"> </ td>' + '<th> Daily </ th>' + '<th> Weekly </ th>' + 'Monthly <th> </ th> '+' </ tr> '+' <tr> '+' class="c" <td width="110"> <img src = "http://uni43.ogame.com.es/ evolution / images / metall.gif "width =" 24 "style =" margin-right: 15px; "/> <font color="#F1531E" style="margin-right:15px;font-style:italic;"> Metal </ font> </ td> '+' <th> <font color="#00ff00"> '+ formatNmb (XMetaL [0]) +' </ font> </ th> '+' <th> < font color = "# 00FF00"> '+ formatNmb (XMetaL [1]) +' </ font> </ th> '+' <th> <font color="#00ff00"> '+ formatNmb (XMetaL [2] ) + '</ font> </ th>' + '</ tr>' + '<tr>' + 'class="c" <td width="110"> <img src = "http://uni43 .ogame.com.es / evolution / images / kristall.gif "width =" 24 "style =" margin-right: 15px; "/> <font color =" # 54B0DC "style =" margin-right: 15px; font -style: italic "> Crystal </ font> </ td> '+' <th> <font color="#00ff00"> '+ formatNmb (XCristal [0]) +' </ font> </ th> '+' <th> <font color="#00ff00"> '+ formatNmb (XCristal [1]) +' </ font> </ th> '+' <th> <font color="#00ff00"> ' + formatNmb (XCristal [2]) + '</ font> </ th>' + '</ tr>' + '<tr>' + 'class="c" <td width="110"> <img src = "http://uni43.ogame.com.es/evolution/images/deuterium.gif" width = "24" style = "margin-right: 15px;" /> <font color = "# 9AACCB" style = " margin-right: 15px; font-style: italic "> Deuterium </ font> </ td> '+' <th> <font color="#00ff00"> '+ formatNmb (XDeut [0]) +' < / font> </ th> '+' <th> <font color="#00ff00"> '+ formatNmb (XDeut [1]) +' </ font> </ th> '+' <th> <font color = "# 00FF00"> '+ formatNmb (XDeut [2]) +' </ font> </ th> '+' </ tr> '+' </ table> <br /> ';
- Else {}
- CuentaRec.innerHTML = '<br />';
- }
- Metal = eval (Metal);
- Metal = parseInt (Metal);
- Crystal = eval (Crystal);
- Crystal = parseInt (Crystal);
- Dt = eval (Dt);
- Dt = parseInt (Dt);
- EAlmM var = (Metal / AlmM) * 100;
- EAlmMPorc var = parseInt ((Metal / AlmM) * 250);
- EAlmC var = (Crystal / AMLC) * 100;
- EAlmCPorc var = parseInt ((Crystal / AMLC) * 250);
- EAlmD var = (Dt / OHCA) * 100;
- EAlmDPorc var = parseInt ((Dt / OHCA) * 250);
- EAlmM = Math.round (EAlmM * 100) / 100;
- EAlmC = Math.round (EAlmC * 100) / 100;
- EAlmD = Math.round (EAlmD * 100) / 100;
- LlenoM var = 0;
- LlenoC var = 0;
- LlenoD var = 0;
- if (Metal> = AlmM)
- LlenoM = 1;
- if (Crystal> = AMLC)
- LlenoC = 1;
- if (Deut> = OHCA)
- LlenoD = 1;
- McadaSeg = PMetal/3600;
- CcadaSeg = PCristal/3600;
- DcadaSeg = PDeut/3600;
- if ((LlenoM) | | (PMetal == 0)) = 0 segundosM
- else segundosM = (AlmM-Metal) / McadaSeg;
- if ((LlenoC) | | (PCristal == 0)) = 0 segundosC
- else segundosC = (AMLC-Crystal) / CcadaSeg;
- if ((LlenoD) | | (PDeut == 0)) = 0 segundosD
- else segundosD = (OHCA-Dt) / DcadaSeg;
- minutes = segundosM/60;
- hours = minutes/60;
- days = hours/24;
- tiemMd days-days% = 1;
- tiemMh = (hours-hours% 1) - ((days-days% 1) * 24);
- tiemMm = (min-minutes% 1) - ((hours-hour% 1) * 60);
- tiemMs = segundosM% 60-segundosM% 1;
- tiemMetal = "";
- if ((tiemMd == 0) && (tiemMh == 0) && (tiemMm == 0) && (tiemMs == 0)) {
- tiemMetal = "Complete";
- }
- minutes = segundosC/60;
- hours = minutes/60;
- days = hours/24;
- tiemCd days-days% = 1;
- tiemCh = (hours-hours% 1) - ((days-days% 1) * 24);
- tiemCm = (min-minutes% 1) - ((hours-hour% 1) * 60);
- tiemCs = segundosC% 60-segundosC% 1;
- tiemCristal = "";
- if ((tiemCd == 0) && (tiemCh == 0) && (tiemCm == 0) && (tiemCs == 0)) {
- tiemCristal = "Complete";
- }
- minutes = segundosD/60;
- hours = minutes/60;
- days = hours/24;
- tiemDd days-days% = 1;
- tiemDh = (hours-hours% 1) - ((days-days% 1) * 24);
- tiemDm = (min-minutes% 1) - ((hours-hour% 1) * 60);
- tiemDs = segundosD% 60-segundosD% 1;
- tiemDeuterio = "";
- if ((tiemDd == 0) && (tiemDh == 0) && (tiemDm == 0) && (tiemDs == 0)) {
- tiemDeuterio = "Complete";
- }
- CuentaRec.innerHTML + = '<table width="550">' +
- 'Class="c" <td colspan="3"> State of the Stores </ td> </ tr>' + '<tr>' + '<th id="alm_M"> Metal (' + EAlmM + '%) </ th>' +
- '<th>' + (TiemMd! = 0? TiemMd + 'days':'') +' '+ (tiemMh! = 0? TiemMh +' h ':'') +' '+ (tiemMm! = 0? TiemMm +' m ':'') +' '+ (tiemMs! = 0? tiemMs +' s':'') + tiemMetal + '</ th>' +
- '<th Width="250"> <div style="border: 1px solid #FFFFFF; width: 250px; text-align: center;"> <div id = "almM" style = "background-color:' + ( EAlmM> 99.99? '# C00000', '# 00C000') + ', width:' + (EAlmMPorc> 250? 250: EAlmMPorc) + 'px "> </ div> </ div> </ th> '+
- '</ Tr>' +
- '<tr>' +
- '<th Id="alm_C"> Cristal (' + EAlmC + '%) </ th>' +
- '<th>' + (TiemCd! = 0? TiemCd + 'days':'') +' '+ (tiemCh! = 0? TiemCh +' h ':'') +' '+ (tiemCm! = 0? TiemCm +' m ':'') +' '+ (tiemCs! = 0? tiemCs +' s':'') + tiemCristal + '</ th>' +
- '<th Width="250"> <div style="border: 1px solid #FFFFFF; id="almC" width: 250px;"> <div style="background-color:'+(EAlmC> 99.99?' # C00000 ',' # 00C000 ') +', width: '+ (EAlmCPorc> 250? 250: EAlmCPorc) +' px "> </ div> </ div> </ th> '+
- '</ Tr>' +
- '<tr>' +
- '<th Id="alm_D"> Deuterium (' + EAlmD + '%) </ th>' +
- '<th>' + (TiemDd! = 0? TiemDd + 'days':'') +' '+ (tiemDh! = 0? TiemDh +' h ':'') +' '+ (tiemDm! = 0? TiemDm +' m ':'') +' '+ (tiemDs! = 0? tiemDs +' s':'') + tiemDeuterio + '</ th>' +
- '<th Width="250"> <div style="border: 1px solid #FFFFFF; id="almD" width: 250px;"> <div style="background-color:'+(EAlmD> 99.99?' # C00000 ',' # 00C000 ') +', width: '+ (EAlmDPorc> 250? 250: EAlmDPorc) +' px "> </ div> </ div> </ th> '+
- '</ Tr>' +
- '</ Table> <br />';
- / / Table of the expansion with total resources of planets added
- if (GetCookie ("planets") == null) {
- / / Check that there is a moon, metal and deuterium zero
- if (action [1]! = "0" && action [2]! = "0") {
- CuentaRec.innerHTML + = '<table width="550">' + '<td class="c" colspan="4"> Production Total of 0 planets </ td> </ tr> <tr > <td class="c" colspan="4"> has not added any planet, go to the display of the resources of the planets </ td> </ tr> </ table> <br /> ';
- Else {}
- CuentaRec.innerHTML + = '<table width="550">' + '<td class="c" colspan="4"> Production Total </ td> </ tr> <tr> <td class = "c" colspan = "4"> Are you in a moon and it does not produce. </ td> </ tr> </ table> <br /> ';
- }
- Else {}
- planetas_format = GetCookie ("planets");
- planetas_format.split planetas_format = ("");
- planetas_format = planetas_format.sort ();
- planetas_format_final = "";
- for (var i = 1, i <planetas_format.length i + +) {
- planetas_format_final + = '[' + planetas_format [i] + ']';
- }
- planetas_recursos = GetCookie ("resources");
- planetas_recursos.split planetas_recursos = ("");
- planetas_recursos_metal = 0;
- planetas_recursos_cristal = 0;
- planetas_recursos_deuterio = 0;
- / / Sum of daily recuros each planet
- for (var i = 1, i <planetas_recursos.length i + +) {
- if (i% 3 == 1) {
- planetas_recursos_metal planetas_recursos_metal + = parseInt (planetas_recursos [i]);
- }
- if (i% 3 == 2) {
- planetas_recursos_cristal planetas_recursos_cristal + = parseInt (planetas_recursos [i]);
- }
- if (i% 3 == 0) {
- planetas_recursos_deuterio planetas_recursos_deuterio + = parseInt (planetas_recursos [i]);
- }
- }
- CuentaRec.innerHTML + = '<table width="550">' + '<td class="c" colspan="4"> Total Production' + (planetas_format.length-1) + 'planets </ td> </ tr> <td width="110" class="c" style="text-align:center;"> Planets </ td> <td class = "c" colspan = "3 "> '+ planetas_format_final +' </ td> </ tr> '+' <tr> '+' <td class="c"> </ td> '+' <th> Daily </ th> '+ '<th> Weekly </ th>' + '<th> Monthly </ th>' + '</ tr>' + '<tr>' + '<td class="c"> <img src = "http :/ / uni43.ogame.com.es/evolution/images/metall.gif "width =" 24 "style =" margin-right: 15px; "/> <font color =" # F1531E "style =" margin-right : 15px; font-style: italic "> Metal </ font> </ td> '+' <th> <font color="#00ff00"> '+ formatNmb (planetas_recursos_metal * 24) +' </ font> < / th> '+' <th> <font color="#00ff00"> '+ formatNmb (planetas_recursos_metal * 168) +' </ font> </ th> '+' <th> <font color = "# 00FF00" > '+ formatNmb (planetas_recursos_metal * 720) +' </ font> </ th> '+' </ tr> '+' <tr> '+' <td class="c"> <img src = "http: / / uni43.ogame.com.es/evolution/images/kristall.gif "width =" 24 "style =" margin-right: 15px; "/> <font color =" # 54B0DC "style =" margin-right: 15px; font-style: italic "> Crystal </ font> </ td> '+' <th> <font color="#00ff00"> '+ formatNmb (planetas_recursos_cristal * 24) +' </ font> </ th> '+' <th> <font color="#00ff00"> '+ formatNmb (planetas_recursos_cristal * 168) +' </ font> </ th> '+' <th> <font color="#00ff00"> '+ formatNmb (planetas_recursos_cristal * 720) +' </ font> </ th> '+' </ tr> '+' <tr> '+' <td class="c"> <img src = "http:/ / uni43.ogame.com.es/evolution/images/deuterium.gif "width =" 24 "style =" margin-right: 15px; "/> <font color =" # 9AACCB "style =" margin-right: 15px ; font-style: italic "> Deuterium </ td> '+' <th> <font color="#00ff00"> '+ formatNmb (planetas_recursos_deuterio * 24) +' </ font> </ th> '+' <font <th> color="#00ff00"> '+ formatNmb (planetas_recursos_deuterio * 168) +' </ font> </ th> '+' <th> <font color="#00ff00"> '+ formatNmb (planetas_recursos_deuterio * 720) + '</ font> </ th>' + '</ tr>' + '<tr>' + '<td class="c" style="text-align:center;"> <font> Total </ td> '+' <th> <font /> ';
- }
- ResForm.parentNode.insertBefore (CuentaRec, ResForm.nextSibling);
- ResForm.parentNode.insertBefore (ProdFact, ResForm);
- document.body.innerHTML.replace document.body.innerHTML = (/ production factor (.) + n \: (.) * [0-9.] / gi,'');
- / / Move the bars
- for (var i = 0; i <= FactorPorc i + +) {
- setTimeout ('document.getElementById ("factorP"). style.width = "' + i + 'px'" 20 * (i +2));
- setTimeout ('document.getElementById ("factor_P"). innerHTML = "' + Math.round (((100 * i) / 250)) +"% "', 20 * (i +2));
- }
- setTimeout ('document.getElementById ("factor_P"). innerHTML = "' + Factor +"% "', FactorPorc * 20 * (i +2));
- for (var i = 0; i <= (EAlmMPorc> 250? 250: EAlmMPorc) i + +) {
- setTimeout ('document.getElementById ("almM"). style.width = "' + i + 'px'" 20 * (i +2));
- setTimeout ('document.getElementById ("alm_M"). innerHTML = "Metal -' + Math.round (((100 * i) / 250)) +"% "', 20 * (i +2));
- }
- setTimeout ('document.getElementById ("alm_M"). innerHTML = "Metal -' + EAlmM + '%', '(EAlmMPorc> 250? 250: EAlmMPorc) * 20 * (i +2));
- for (var i = 0; i <= (EAlmCPorc> 250? 250: EAlmCPorc) i + +) {
- setTimeout ('document.getElementById ("AMLC"). style.width = "' + i + 'px'" 20 * (i +2));
- setTimeout ('document.getElementById ("alm_C"). innerHTML = "Glass -' + Math.round (((100 * i) / 250)) +"% "', 20 * (i +2));
- }
- setTimeout ('document.getElementById ("alm_C"). innerHTML = "Glass -' + EAlmC + '%', '(EAlmCPorc> 250? 250: EAlmCPorc) * 20 * (i +2));
- for (var i = 0; i <= (EAlmDPorc> 250? 250: EAlmDPorc) i + +) {
- setTimeout ('document.getElementById ("OHCA"). style.width = "' + i + 'px'" 20 * (i +2));
- setTimeout ('document.getElementById ("alm_D"). innerHTML = "Deuterium -' + Math.round (((100 * i) / 250)) +"% "', 20 * (i +2));
- }
- setTimeout ('document.getElementById ("alm_D"). innerHTML = "Deuterium -' + EAlmD + '%', '(EAlmDPorc> 250? 250: EAlmDPorc) * 20 * (i +2));
- }
- / * / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / RESOURCES REAL TIME / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / * /
- if (GetCookie ("planets") == null) {
- Else {}
- planetas_format = GetCookie ("planets");
- planetas_format.split planetas_format = ("");
- planetas_recursos = GetCookie ("resources");
- planetas_recursos.split planetas_recursos = ("");
- planetas_almacenes = GetCookie ("store");
- planetas_almacenes.split planetas_almacenes = ("");
- done = 0;
- for (var i = 1, i <planetas_format.length i + +) {
- if (planetas_format [i] == planet [1]) {
- a = (i * 3) -3;
- PMetal = parseInt (planetas_recursos [a +1]);
- PCristal = parseInt (planetas_recursos [a +2]);
- PDeut = parseInt (planetas_recursos [a +3]);
- AlmM = parseInt (planetas_almacenes [a +1]);
- AMLC = parseInt (planetas_almacenes [a +2]);
- OHCA = parseInt (planetas_almacenes [a +3]);
- done = 1;
- i = planetas_format.length;
- }
- }
- }
- var = T_Recursos2 Energy [14]. innerHTML;
- if (PMetal! = "0" && PCristal! = "0" && Energy! = "<font> 0 </ font> / 0") {/ / to be different from a moon
- / * Output per second for resources "live" * /
- SMetal = PMetal/3600;
- SCristal = PCristal/3600;
- SDeut = PDeut/3600;
- window.dat = new Date ();
- window.Mold = Metal;
- window.Cold = Crystal;
- window.Dold = Dt;
- window.setInterval (function () {
- var recs = document.getElementById ('resources'). getElementsByTagName ("td");
- Dat2 var = new Date ();
- Startime dat.getTime var = ();
- dat2.getTime var endtime = ();
- var secs = (endtime-Startime) / 1000;
- if (Metal <AlmM) {
- RoundNumber Mposeido = ((SMetal * secs) + Metal);
- recs [10]. innerHTML = recs [10]. innerHTML.split (formatNmb (window.Mold)). join (formatNmb (Mposeido));
- window.Mold = Mposeido;
- }
- if (crystal <AMLC) {
- RoundNumber Cposeido = ((SCristal * secs) + Glass);
- recs [11]. innerHTML = recs [11]. innerHTML.split (formatNmb (window.Cold)). join (formatNmb (Cposeido));
- window.Cold = Cposeido;
- }
- if (Deut <OHCA) {
- RoundNumber Dposeido = ((SDeut * secs) + Dt);
- recs [12]. innerHTML = recs [12]. innerHTML.split (formatNmb (window.Dold)). join (formatNmb (Dposeido));
- window.Dold = Dposeido;
- }
- }, 250);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement