Advertisement
technopredator

OGame Pantalla de Recursos Ampliada FINAL,English translated

Aug 9th, 2012
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. / / == == Userscript
  2. / / @ Name Ikariam Resources Expanded Display FINAL
  3. / / @ Author Emilio, J.A. and Shuko
  4. / / @ Date 28/11/2007
  5. / / @ Version 1.0
  6. / / @ Namespace Ikariam Resources Expanded Display FINAL
  7. / / @ Description Display Expanded Resources.
  8. / / @ Include http:// *. Ogame. * / Game / index.php? Page = *
  9. / / @ Exclude http:// *. Ogame. * / Game / index.php? Page = Notizen *
  10. / / @ Exclude http:// *. Ogame. * / Game / index.php? Page = galaxy *
  11. / / @ Exclude http:// *. Ogame. * / Game / index.php? Page = phalanx *
  12. / / == / == Userscript
  13.  
  14. / / Original script: http://userscripts.org/scripts/show/12003 and / 14643
  15. / / Modified by Emilio, J.A. and Shuko.
  16. / / Added on 28-11-2007
  17. / / Display Expanded Resources, shows a table more to the total resources from all the colonies.
  18. / / 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.
  19. / / This script creates three cookies:
  20. / / Cookie planets: the value of this cookie is a string with all the coordinates of the planets
  21. / / Cookie resources: contains the value of metal resources, crystal and deuterium, the production per hour.
  22. / / Cookie stores: contains the warehouse capacity.
  23. / / Cookies are idependientes in each universe, so you can have several open universes perfectly.
  24.  
  25. / / Thanks to all those who work anonymously
  26.  
  27. / / Revised 2/6/2009:
  28. / / - Compatible with the latest version, v 0.84.
  29. / / Revised 1/18/2008:
  30. / / - Compatible with the latest version, v 0.78c.
  31. / / - Fixed bug with stores
  32. / / - Is hidden resources by month ... the server.
  33. / / - Code Optimization
  34. / / Revised 9/12/2007:
  35. / / - From cookies to Modifiacion from deletion if ogame is closed or the session ends.
  36. / / Revised 29/11/2007:
  37. / / - Correction of increased resources when the warehouse is full.
  38. / / - Update time update of resources in real time.
  39. / / - Creation of a new cookie stores: contains the warehouse capacity.
  40. / / Revised 28/11/2007:
  41. / / - Correction of increased resources on the Moon (no production)
  42. / / Revised 27/11/2007:
  43. / / - Added resources in real time across OGame
  44. / / Revised 24/11/2007:
  45. / / - Added resources in real time.
  46. / / Revised 4/11/2007:
  47. / / - Added the total production.
  48. / / - Faster progress bar and change in appearance.
  49. / / - Change in storage time visualization if a unit is zero.
  50. / / Revised 3/11/2007:
  51. / / - Modification cookies general, remain two but now store all of the planets resources daily.
  52. / / - Modified to include no moons.
  53. / / - Fixed to not fail when there is added or master in this world on the moon.
  54. / / - Implemented the detection of the deletion of any planet and removed from the production statistics.
  55. / / - Updated correctly changes increase mine production or changes in energy or production
  56. / / - Implemented animation in percentage bars. (Motion)
  57. / / Revised 1/11/2007:
  58. / / - Fixed error overlimit resources.
  59. / / -% Format with two decimal places.
  60. / / Revised 31/10/2007:
  61. / / - Happens to have two cookies, planets and resources
  62.  
  63. / * / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / AUXILIARY FUNCTIONS / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / * /
  64.  
  65. formatNmb function (number) {
  66. nNmb var = String (number);
  67. Messrs. var = "";
  68. for (var j, i = nNmb.length - 1, j = 0, i> = 0, i - j + +)
  69. Messrs. = nNmb.charAt (i) + ((j> 0) && (j% 3 == 0)? ".": "") + SRes;
  70. Messrs. return;
  71. }
  72.  
  73.    roundNumber function (rnum) {
  74. RLENGTH var = 0; / / The number of decimal places to round to
  75. if (rnum> 8191 && rnum <10485) {
  76. rnum = rnum-5000;
  77. newnumber var = Math.round (rnum * Math.pow (10, RLENGTH)) / Math.pow (10, RLENGTH);
  78. newnumber newnumber = +5000;
  79. Else {}
  80. newnumber var = Math.round (rnum * Math.pow (10, RLENGTH)) / Math.pow (10, RLENGTH);
  81. }
  82. newnumber return;
  83. }
  84.    
  85. function setcookie (name, value) {
  86. var argv = SetCookie.arguments;
  87. SetCookie.arguments.length var = argc;
  88. / / Var expires = (2 <argc)? argv [2]: null;
  89. var now = new Date () / / current date
  90. unAño var = new Date (ahora.getTime () +1000 * 60 * 60 * 24 * 365) / / we add one year
  91. var expires = unAño ;/ / expires in one year
  92. var path = (3 <argc)? argv [3]: null;
  93. var domain = (4 <argc)? argv [4]: ​​null;
  94. var secure = (5 <argc)? argv [5]: false;
  95.  
  96. document.cookie = name + "=" + escape (value) +
  97. ((Expires == null)? "": ("Expires =" + expires.toGMTString ())) +
  98. ((Path == null)? "": ("Path =" + path)) +
  99. ((Domain == null)? "": ("Domain =" + domain)) +
  100. ((Secure == true)? "Secure": "");
  101. }
  102.  
  103. getCookieVal function (offset) {
  104. document.cookie.indexOf endstr var = ("", offset);
  105. if (endstr == -1)
  106. endstr = document.cookie.length;
  107. return unescape (document.cookie.substring (offset, endstr));
  108. }
  109.  
  110. GetCookie function (name) {
  111. var arg = name + "=";
  112. var alen = arg.length;
  113. var = document.cookie.length clen;
  114. var i = 0;
  115. while (i <clen) {
  116. var j = i + alen;
  117. if (document.cookie.substring (i, j) == arg)
  118. getCookieVal return (j);
  119. i = document.cookie.indexOf ("", i) + 1;
  120. if (i == 0)
  121. break;
  122. }
  123. return null;
  124. }
  125.  
  126.  
  127. / * / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / RESOURCES EXPANDED SCREEN / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / * /
  128.  
  129. var parent resources;
  130. parent = document.getElementById ('content');
  131. resources = document.getElementById ('resources');
  132. T_Recursos var / / iniciamlizado on the resource
  133. recursos.getElementsByTagName T_Recursos2 var = ("td");
  134. Metal var = T_Recursos2 [10]. innerHTML.replace (/ \. / g,'');
  135. Crystal var = T_Recursos2 [11]. innerHTML.replace (/ \. / g,'');
  136. var Dt = T_Recursos2 [12]. innerHTML.replace (/ \. / g,'');
  137.  
  138. var PMetal, PCristal, PDeut;
  139. var AlmM, AMLC, OHCA;
  140. var T_Factor;
  141. var Factor, FactorPorc;
  142. / / Display detected only resource for these variables determined
  143. if (location.href.indexOf ('resources')! = -1) {
  144.  
  145. T_Recursos = padre.getElementsByTagName ("td");
  146.  
  147. PMetal = T_Recursos [10]. InnerHTML.replace (/ \. / G,'');
  148. PCristal = T_Recursos [11]. InnerHTML.replace (/ \. / G,'');
  149. PDeut = T_Recursos [12]. InnerHTML.replace (/ \. / G,'');
  150.  
  151. AlmM = T_Recursos [5]. InnerHTML.replace (/ \. / G,'');
  152. AMLC = T_Recursos [6]. InnerHTML.replace (/ \. / G,'');
  153. OHCA = T_Recursos [7]. InnerHTML.replace (/ \. / G,'');
  154.  
  155. PMetal = eval (PMetal);
  156. PCristal = eval (PCristal);
  157. PDeut = eval (PDeut);
  158.  
  159. AlmM.replace AlmM = (/ k /, '000 ');
  160. AlmC.replace AMLC = (/ k /, '000 ');
  161. OHCA = AlmD.replace (/ k /, '000 ');
  162.  
  163. if (PMetal.indexOf ('<font color')! = -1) {
  164. PMetal.substring PMetal = (57, PMetal.indexOf ('</ font'));
  165. }
  166. if (PCristal.indexOf ('<font color')! = -1) {
  167. PCristal.substring PCristal = (57, PCristal.indexOf ('</ font'));
  168. }
  169. if (PDeut.indexOf ('<font color')! = -1) {
  170. PDeut.substring PDeut = (57, PDeut.indexOf ('</ font'));
  171. }
  172.  
  173. if (AlmM.indexOf ('<font color')! = -1) {
  174. AlmM.substring AlmM = (22, AlmM.indexOf ('</ font'));
  175. }
  176. if (AlmC.indexOf ('<font color')! = -1) {
  177. AMLC = AlmC.substring (22, AlmC.indexOf ('</ font'));
  178. }
  179. if (AlmD.indexOf ('<font color')! = -1) {
  180. OHCA = AlmD.substring (22, AlmD.indexOf ('</ font'));
  181. }
  182.  
  183. / / Search Factor of Production
  184. T_Factor = / factor (.) * \: (.) ​​* [0-9.] / Gi.exec (document.body.innerHTML);
  185. if (T_Factor.length) {
  186. T_Factor Factor = [0]. Split (":");
  187. Factor = parseFloat (Factor [1]) * 100;
  188. FactorPorc = parseInt (parseFloat (Factor) * 2.5);
  189. }
  190.  
  191. Else {}
  192.  
  193. PMetal = 0;
  194. PCristal = 0;
  195. PDeut = 0;
  196. Metal = eval (Metal);
  197. Metal = parseInt (Metal);
  198. Crystal = eval (Crystal);
  199. Crystal = parseInt (Crystal);
  200. Dt = eval (Dt);
  201. Dt = parseInt (Dt);
  202. AlmM = 0;
  203. AMLC = 0;
  204. OHCA = 0;
  205. }
  206.  
  207. XMetaL var = new Array (3);
  208. XCristal var = new Array (3);
  209. XDeut var = new Array (3);
  210. var ResFormC, T_Form, ResForm;
  211. / / Calculations screen unique resources, unnecessary if we use another page
  212. if (location.href.indexOf ('resources')! = -1) {
  213.  
  214.  
  215. XMetaL [0] = PMetal * 24;
  216. XCristal [0] = PCristal * 24;
  217. XDeut [0] = PDeut * 24;
  218. XMetaL [1] = PMetal * 168;
  219. XCristal [1] = PCristal * 168;
  220. XDeut [1] = PDeut * 168;
  221. XMetaL [2] = PMetal * 720;
  222. XCristal [2] = PCristal * 720;
  223. XDeut [2] = PDeut * 720;
  224.  
  225. / / Search Resources Form
  226.  
  227. ResFormC = document.getElementsByTagName ('table');
  228.  
  229. for (var i = 0; i <ResFormC.length i + +) {
  230.  
  231. ResFormC T_Form = [i];
  232. if (T_Form.getAttribute ('width') == '550 ') {
  233. ResForm = T_Form;
  234. }
  235. }
  236.  
  237. } / / End of display features unique resource
  238.  
  239. / / Expansion
  240. header_top var = document.getElementById ('header_top');
  241. header_top.getElementsByTagName planeta_coord var = ("select");
  242.  
  243. / / Get the coordinates of the current planets
  244. planeta_coord planetas_actuales = var [0]. options;
  245. var tmp = new Array (planetas_actuales.length);
  246. for (var i = 0; i <planetas_actuales.length i + +) {
  247. tmp [i] = planeta_coord [0]. options [i]. text;
  248. tmp [i] = tmp [i]. split ("[");
  249. tmp [i] = tmp [i] [1]. split ("]");
  250. tmp [i] = tmp [i] [0]. split ("");
  251. }
  252. planetas_actuales = tmp;
  253. planetas_actuales = planetas_actuales.sort ();
  254.  
  255. / / Get the selected planet, the coordinates
  256. var world = new Array (2);
  257. planeta_coord planet = [0]. options [planeta_coord [0]. selectedIndex]. text;
  258. planet = planeta.split ("[");
  259. planet = planet [1]. split ("]");
  260. planet = planet [0]. split ("");
  261. tmppp var = planet;
  262. world = new Array (2);
  263. planet [0] = 1;
  264. planet [1] = tmppp;
  265.  
  266.  
  267. / / Calculations screen unique resources, unnecessary if we use another page
  268. if (location.href.indexOf ('resources')! = -1) {
  269.  
  270. / / Output per hour of selected planet
  271. var resource = new Array (3);
  272. resource [0] = 1;
  273. action [1] = PMetal;
  274. action [2] = PCristal;
  275. action [3] = PDeut;
  276.  
  277. / / Stores the selected planet
  278. var store = new Array (3);
  279. store [0] = 1;
  280. storage [1] = AlmM;
  281. storage [2] = AMLC;
  282. storage [3] = OHCA;
  283.  
  284. planets var / / cookie value planets with an array of all the planets added
  285. resources var / / array of production resources when the planets added
  286. var store / / array stores the planets added
  287.  
  288. / / If not Exiten cookies, create and add the planet if this is not a moon
  289. if (GetCookie ("planets") == null) {
  290. / / Check that there is a moon, metal and deuterium zero
  291. if (action [1]! = "0" && action [2]! = "0") {
  292. Setcookie ('planets, planet);
  293. Setcookie ('resources', resource);
  294. Setcookie ('stores' warehouse);
  295. }
  296. Else {}
  297.  
  298. = GetCookie planets ("planet");
  299. planetas.split planets = ("");
  300. = GetCookie resources ("resources");
  301. recursos.split resources = ("");
  302. = GetCookie stores ("stores");
  303. almacenes.split stores = ("");
  304.  
  305. / / Temporary varibles for comparison with current planet saved in cookies
  306. var tmp_planetas;
  307. var tmp_recursos_planetas;
  308. var tmp_almacenes_planetas;
  309. / / The cookie begins with a 1, always keep in qeu cookies als arrays
  310. tmp_planetas = new Array ();
  311. tmp_planetas [0] = 1;
  312. tmp_recursos_planetas = new Array (recursos.length-3);
  313. tmp_recursos_planetas [0] = 1;
  314. tmp_almacenes_planetas = new Array (almacenes.length-3);
  315. tmp_almacenes_planetas [0] = 1;
  316.  
  317. / / Make a string of planets eliminated deleted.
  318. for (var i = 1, i <planetas.length i + +) {
  319. for (var j = 0, j <planetas_actuales.length j + +) {
  320. if (planets [i] == planetas_actuales [j]) {
  321. j = planetas_actuales.length;
  322. Else {}
  323. / / If there is no planet and you are finished go through the array, delete the planet
  324. if ((j +1) == planetas_actuales.length) {
  325. planets [i] = "remove" / / changes the coordenas by a string with the contents "elimiar"
  326. }
  327. }
  328. }
  329. }
  330.  
  331. / / New array of planets and their right resources right
  332. var cont = 1;
  333. for (var i = 1, i <planetas.length i + +) {
  334. if (planets [i]! = "delete") {
  335. tmp_planetas [cont] = planets [i];
  336. tmp_recursos_planetas [cont + ((cont-1) * 2)] = resources [i + ((i-1) * 2)];
  337. tmp_recursos_planetas [cont + ((cont-1) * 2) +1] = resources [i + ((i-1) * 2) +1];
  338. tmp_recursos_planetas [cont + ((cont-1) * 2) +2] = resources [i + ((i-1) * 2) +2];
  339. tmp_almacenes_planetas [cont + ((cont-1) * 2)] = storage [i + ((i-1) * 2)];
  340. tmp_almacenes_planetas [cont + ((cont-1) * 2) +1] = storage [i + ((i-1) * 2) +1];
  341. tmp_almacenes_planetas [cont + ((cont-1) * 2) +2] = storage [i + ((i-1) * 2) +2];
  342. count + +;
  343. }
  344. }
  345.  
  346.  
  347. / / Update the array planets and resources
  348. = tmp_planetas planets;
  349. = tmp_recursos_planetas resources;
  350. = tmp_almacenes_planetas stores;
  351.  
  352. / / Check for changes in the planet's production methods selected for possible upgrade.
  353. for (var t = 1, t <planetas.length, t + +) {
  354. if (planets [t] == ​​planet [1]) {
  355. / / Check that is not a moon, metal and glass to zero
  356. if (action [1]! = "0" && action [2]! = "0") {
  357. if (resources [t + ((t-1) * 2)], = action [1]) {
  358. resources [t + ((t-1) * 2)] = action [1];
  359. }
  360. if (resources [t + ((t-1) * 2) +1], = action [2]) {
  361. resources [t + ((t-1) * 2) +1] = action [2];
  362. }
  363. if (resources [t + ((t-1) * 2) +2], = action [3]) {
  364. resources [t + ((t-1) * 2) +2] = action [3];
  365. }
  366. }
  367. }
  368. }
  369.  
  370. for (var t = 1, t <almacenes.length, t + +) {
  371. if (planets [t] == ​​planet [1]) {
  372. / / Check that is not a moon, metal and glass to zero
  373. if (action [1]! = "0" && action [2]! = "0") {
  374. if (stores [t + ((t-1) * 2)]! = storage [1]) {
  375. stores [t + ((t-1) * 2)] = storage [1];
  376. }
  377. if (stores [t + ((t-1) * 2) +1]! = storage [2]) {
  378. stores [t + ((t-1) * 2) +1] = storage [2];
  379. }
  380. if (stores [t + ((t-1) * 2) +2]! = storage [3]) {
  381. stores [t + ((t-1) * 2) +2] = storage [3];
  382. }
  383. }
  384. }
  385. }
  386.  
  387. / / Save changes
  388. Setcookie ('planets, planets);
  389. Setcookie ("resources", resources);
  390. Setcookie ('warehouse' stores);
  391.  
  392. = GetCookie planets ("planet");
  393. planetas.split planets = ("");
  394. = GetCookie resources ("resources");
  395. recursos.split resources = ("");
  396. = GetCookie stores ("stores");
  397. almacenes.split stores = ("");
  398.  
  399. / / To add a new planet
  400. for (var i = 1, i <planetas.length i + +) {
  401. / / If the world ended the exite for
  402. if (planets [i] == planet [1]) {
  403. i = planetas.length;
  404. Else {}
  405. / / If there is no planet and you are finished going through all the array, add the planet
  406. if ((i +1) == planetas.length) {
  407. / / Check that there is a moon, metal and deuterium zero
  408. if (action [1]! = "0" && action [2]! = "0") {
  409. planets [i +1] = world [1];
  410. resources [i +1 + (i * 2)] = action [1];
  411. resources [i +1 + (i * 2) +1] = action [2];
  412. resources [i +1 + (i * 2) +2] = action [3];
  413. store [i +1 + (i * 2)] = storage [1];
  414. store [i +1 + (i * 2) +1] = storage [2];
  415. store [i +1 + (i * 2) +2] = storage [3];
  416. Setcookie ('planets, planets);
  417. Setcookie ("resources", resources);
  418. Setcookie ('warehouse' stores);
  419. }
  420. }
  421. }
  422. }
  423.  
  424.  
  425. }
  426.  
  427.  
  428. }
  429. / / If there ResForm == A screen as shown recurusos resource extensions
  430. if (ResForm) {
  431.  
  432. / / We hide table generated by server
  433. los_tr = document.getElementById ("ressourcen"). getElementsByTagName ("table") [0]. rows;
  434. los_tr [los_tr.length-2]. style.display = "none";
  435. los_tr [los_tr.length-1]. style.display = "none";
  436. if (los_tr [los_tr.length-1]. getElementsByTagName ("iframe"). length == 1) {
  437. los_tr [los_tr.length-3]. style.display = "none" ;/ / pub commander Damn xD
  438. }
  439.  
  440.  
  441. / / Process Tables
  442. ProdFact var = document.createElement ('div');
  443.  
  444. 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 /> ';
  445.  
  446. CuentaRec var = document.createElement ('div');
  447.  
  448. / / Check that there is a moon, metal and deuterium zero
  449. if (action [1]! = "0" && action [2]! = "0") {
  450. / / If a moon, not showing the widespread production table
  451. 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 /> ';
  452.  
  453. Else {}
  454. CuentaRec.innerHTML = '<br />';
  455. }
  456.  
  457. Metal = eval (Metal);
  458. Metal = parseInt (Metal);
  459. Crystal = eval (Crystal);
  460. Crystal = parseInt (Crystal);
  461. Dt = eval (Dt);
  462. Dt = parseInt (Dt);
  463.  
  464.  
  465. EAlmM var = (Metal / AlmM) * 100;
  466. EAlmMPorc var = parseInt ((Metal / AlmM) * 250);
  467. EAlmC var = (Crystal / AMLC) * 100;
  468. EAlmCPorc var = parseInt ((Crystal / AMLC) * 250);
  469. EAlmD var = (Dt / OHCA) * 100;
  470. EAlmDPorc var = parseInt ((Dt / OHCA) * 250);
  471.  
  472.  
  473. EAlmM = Math.round (EAlmM * 100) / 100;
  474. EAlmC = Math.round (EAlmC * 100) / 100;
  475. EAlmD = Math.round (EAlmD * 100) / 100;
  476.  
  477.  
  478. LlenoM var = 0;
  479. LlenoC var = 0;
  480. LlenoD var = 0;
  481.  
  482. if (Metal> = AlmM)
  483. LlenoM = 1;
  484. if (Crystal> = AMLC)
  485. LlenoC = 1;
  486. if (Deut> = OHCA)
  487. LlenoD = 1;
  488.  
  489.  
  490. McadaSeg = PMetal/3600;
  491. CcadaSeg = PCristal/3600;
  492. DcadaSeg = PDeut/3600;
  493.  
  494.  
  495. if ((LlenoM) | | (PMetal == 0)) = 0 segundosM
  496. else segundosM = (AlmM-Metal) / McadaSeg;
  497.  
  498. if ((LlenoC) | | (PCristal == 0)) = 0 segundosC
  499. else segundosC = (AMLC-Crystal) / CcadaSeg;
  500.  
  501. if ((LlenoD) | | (PDeut == 0)) = 0 segundosD
  502. else segundosD = (OHCA-Dt) / DcadaSeg;
  503.  
  504.  
  505.  
  506. minutes = segundosM/60;
  507. hours = minutes/60;
  508. days = hours/24;
  509.  
  510.  
  511. tiemMd days-days% = 1;
  512. tiemMh = (hours-hours% 1) - ((days-days% 1) * 24);
  513. tiemMm = (min-minutes% 1) - ((hours-hour% 1) * 60);
  514. tiemMs = segundosM% 60-segundosM% 1;
  515. tiemMetal = "";
  516. if ((tiemMd == 0) && (tiemMh == 0) && (tiemMm == 0) && (tiemMs == 0)) {
  517. tiemMetal = "Complete";
  518. }
  519.  
  520. minutes = segundosC/60;
  521. hours = minutes/60;
  522. days = hours/24;
  523.  
  524.  
  525. tiemCd days-days% = 1;
  526. tiemCh = (hours-hours% 1) - ((days-days% 1) * 24);
  527. tiemCm = (min-minutes% 1) - ((hours-hour% 1) * 60);
  528. tiemCs = segundosC% 60-segundosC% 1;
  529. tiemCristal = "";
  530. if ((tiemCd == 0) && (tiemCh == 0) && (tiemCm == 0) && (tiemCs == 0)) {
  531. tiemCristal = "Complete";
  532. }
  533.  
  534.  
  535. minutes = segundosD/60;
  536. hours = minutes/60;
  537. days = hours/24;
  538.  
  539.  
  540. tiemDd days-days% = 1;
  541. tiemDh = (hours-hours% 1) - ((days-days% 1) * 24);
  542. tiemDm = (min-minutes% 1) - ((hours-hour% 1) * 60);
  543. tiemDs = segundosD% 60-segundosD% 1;
  544. tiemDeuterio = "";
  545. if ((tiemDd == 0) && (tiemDh == 0) && (tiemDm == 0) && (tiemDs == 0)) {
  546. tiemDeuterio = "Complete";
  547. }
  548.  
  549.  
  550.  
  551.  
  552. CuentaRec.innerHTML + = '<table width="550">' +
  553. 'Class="c" <td colspan="3"> State of the Stores </ td> </ tr>' + '<tr>' + '<th id="alm_M"> Metal (' + EAlmM + '%) </ th>' +
  554. '<th>' + (TiemMd! = 0? TiemMd + 'days':'') +' '+ (tiemMh! = 0? TiemMh +' h ':'') +' '+ (tiemMm! = 0? TiemMm +' m ':'') +' '+ (tiemMs! = 0? tiemMs +' s':'') + tiemMetal + '</ th>' +
  555. '<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> '+
  556. '</ Tr>' +
  557. '<tr>' +
  558. '<th Id="alm_C"> Cristal (' + EAlmC + '%) </ th>' +
  559. '<th>' + (TiemCd! = 0? TiemCd + 'days':'') +' '+ (tiemCh! = 0? TiemCh +' h ':'') +' '+ (tiemCm! = 0? TiemCm +' m ':'') +' '+ (tiemCs! = 0? tiemCs +' s':'') + tiemCristal + '</ th>' +
  560. '<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> '+
  561. '</ Tr>' +
  562. '<tr>' +
  563. '<th Id="alm_D"> Deuterium (' + EAlmD + '%) </ th>' +
  564. '<th>' + (TiemDd! = 0? TiemDd + 'days':'') +' '+ (tiemDh! = 0? TiemDh +' h ':'') +' '+ (tiemDm! = 0? TiemDm +' m ':'') +' '+ (tiemDs! = 0? tiemDs +' s':'') + tiemDeuterio + '</ th>' +
  565. '<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> '+
  566. '</ Tr>' +
  567. '</ Table> <br />';
  568.  
  569.  
  570.  
  571. / / Table of the expansion with total resources of planets added
  572.  
  573. if (GetCookie ("planets") == null) {
  574.  
  575. / / Check that there is a moon, metal and deuterium zero
  576. if (action [1]! = "0" && action [2]! = "0") {
  577. 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 /> ';
  578. Else {}
  579. 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 /> ';
  580. }
  581.  
  582. Else {}
  583.  
  584. planetas_format = GetCookie ("planets");
  585. planetas_format.split planetas_format = ("");
  586. planetas_format = planetas_format.sort ();
  587. planetas_format_final = "";
  588.  
  589. for (var i = 1, i <planetas_format.length i + +) {
  590. planetas_format_final + = '[' + planetas_format [i] + ']';
  591. }
  592.  
  593. planetas_recursos = GetCookie ("resources");
  594. planetas_recursos.split planetas_recursos = ("");
  595. planetas_recursos_metal = 0;
  596. planetas_recursos_cristal = 0;
  597. planetas_recursos_deuterio = 0;
  598.  
  599. / / Sum of daily recuros each planet
  600. for (var i = 1, i <planetas_recursos.length i + +) {
  601. if (i% 3 == 1) {
  602. planetas_recursos_metal planetas_recursos_metal + = parseInt (planetas_recursos [i]);
  603. }
  604. if (i% 3 == 2) {
  605. planetas_recursos_cristal planetas_recursos_cristal + = parseInt (planetas_recursos [i]);
  606. }
  607. if (i% 3 == 0) {
  608. planetas_recursos_deuterio planetas_recursos_deuterio + = parseInt (planetas_recursos [i]);
  609. }
  610. }
  611.  
  612.  
  613. 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 /> ';
  614.  
  615.  
  616. }
  617.  
  618. ResForm.parentNode.insertBefore (CuentaRec, ResForm.nextSibling);
  619. ResForm.parentNode.insertBefore (ProdFact, ResForm);
  620. document.body.innerHTML.replace document.body.innerHTML = (/ production factor (.) + n \: (.) ​​* [0-9.] / gi,'');
  621.  
  622.  
  623. / / Move the bars
  624. for (var i = 0; i <= FactorPorc i + +) {
  625. setTimeout ('document.getElementById ("factorP"). style.width = "' + i + 'px'" 20 * (i +2));
  626. setTimeout ('document.getElementById ("factor_P"). innerHTML = "' + Math.round (((100 * i) / 250)) +"% "', 20 * (i +2));
  627. }
  628. setTimeout ('document.getElementById ("factor_P"). innerHTML = "' + Factor +"% "', FactorPorc * 20 * (i +2));
  629.  
  630. for (var i = 0; i <= (EAlmMPorc> 250? 250: EAlmMPorc) i + +) {
  631. setTimeout ('document.getElementById ("almM"). style.width = "' + i + 'px'" 20 * (i +2));
  632. setTimeout ('document.getElementById ("alm_M"). innerHTML = "Metal -' + Math.round (((100 * i) / 250)) +"% "', 20 * (i +2));
  633. }
  634. setTimeout ('document.getElementById ("alm_M"). innerHTML = "Metal -' + EAlmM + '%', '(EAlmMPorc> 250? 250: EAlmMPorc) * 20 * (i +2));
  635.  
  636. for (var i = 0; i <= (EAlmCPorc> 250? 250: EAlmCPorc) i + +) {
  637. setTimeout ('document.getElementById ("AMLC"). style.width = "' + i + 'px'" 20 * (i +2));
  638. setTimeout ('document.getElementById ("alm_C"). innerHTML = "Glass -' + Math.round (((100 * i) / 250)) +"% "', 20 * (i +2));
  639. }
  640. setTimeout ('document.getElementById ("alm_C"). innerHTML = "Glass -' + EAlmC + '%', '(EAlmCPorc> 250? 250: EAlmCPorc) * 20 * (i +2));
  641.  
  642. for (var i = 0; i <= (EAlmDPorc> 250? 250: EAlmDPorc) i + +) {
  643. setTimeout ('document.getElementById ("OHCA"). style.width = "' + i + 'px'" 20 * (i +2));
  644. setTimeout ('document.getElementById ("alm_D"). innerHTML = "Deuterium -' + Math.round (((100 * i) / 250)) +"% "', 20 * (i +2));
  645. }
  646. setTimeout ('document.getElementById ("alm_D"). innerHTML = "Deuterium -' + EAlmD + '%', '(EAlmDPorc> 250? 250: EAlmDPorc) * 20 * (i +2));
  647.  
  648. }
  649.  
  650.  
  651. / * / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / RESOURCES REAL TIME / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / * /
  652.  
  653. if (GetCookie ("planets") == null) {
  654.  
  655. Else {}
  656. planetas_format = GetCookie ("planets");
  657. planetas_format.split planetas_format = ("");
  658.  
  659. planetas_recursos = GetCookie ("resources");
  660. planetas_recursos.split planetas_recursos = ("");
  661.  
  662. planetas_almacenes = GetCookie ("store");
  663. planetas_almacenes.split planetas_almacenes = ("");
  664.  
  665. done = 0;
  666. for (var i = 1, i <planetas_format.length i + +) {
  667. if (planetas_format [i] == planet [1]) {
  668. a = (i * 3) -3;
  669. PMetal = parseInt (planetas_recursos [a +1]);
  670. PCristal = parseInt (planetas_recursos [a +2]);
  671. PDeut = parseInt (planetas_recursos [a +3]);
  672. AlmM = parseInt (planetas_almacenes [a +1]);
  673. AMLC = parseInt (planetas_almacenes [a +2]);
  674. OHCA = parseInt (planetas_almacenes [a +3]);
  675. done = 1;
  676. i = planetas_format.length;
  677. }
  678. }
  679. }
  680.  
  681.  
  682.  
  683.  
  684.  
  685. var = T_Recursos2 Energy [14]. innerHTML;
  686.  
  687. if (PMetal! = "0" && PCristal! = "0" && Energy! = "<font> 0 </ font> / 0") {/ / to be different from a moon
  688.  
  689. / * Output per second for resources "live" * /
  690. SMetal = PMetal/3600;
  691. SCristal = PCristal/3600;
  692. SDeut = PDeut/3600;
  693.  
  694.  
  695. window.dat = new Date ();
  696. window.Mold = Metal;
  697. window.Cold = Crystal;
  698. window.Dold = Dt;
  699.  
  700.  
  701. window.setInterval (function () {
  702.  
  703. var recs = document.getElementById ('resources'). getElementsByTagName ("td");
  704. Dat2 var = new Date ();
  705. Startime dat.getTime var = ();
  706. dat2.getTime var endtime = ();
  707. var secs = (endtime-Startime) / 1000;
  708.  
  709. if (Metal <AlmM) {
  710. RoundNumber Mposeido = ((SMetal * secs) + Metal);
  711. recs [10]. innerHTML = recs [10]. innerHTML.split (formatNmb (window.Mold)). join (formatNmb (Mposeido));
  712. window.Mold = Mposeido;
  713. }
  714.  
  715. if (crystal <AMLC) {
  716. RoundNumber Cposeido = ((SCristal * secs) + Glass);
  717. recs [11]. innerHTML = recs [11]. innerHTML.split (formatNmb (window.Cold)). join (formatNmb (Cposeido));
  718. window.Cold = Cposeido;
  719. }
  720.  
  721. if (Deut <OHCA) {
  722. RoundNumber Dposeido = ((SDeut * secs) + Dt);
  723. recs [12]. innerHTML = recs [12]. innerHTML.split (formatNmb (window.Dold)). join (formatNmb (Dposeido));
  724. window.Dold = Dposeido;
  725. }
  726.  
  727. }, 250);
  728. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement