FANDOM


javascript:var units = Array(Array(0,'Spear fighters'),Array(1,'Swordsmen'),Array(2,'Axemen'),Array(3,'Scouts'),Array(4,'Light Cav.'),Array(5,'Heavy Cav.'),Array(6,'Rams'),Array(7,'Catapults'));var units_count = units.length;var troups = new Array(units_count);for(var i=0; i<units_count; i++)troups[i]=0;var numvil = 0;var doc;if(top.frames.length > 1){doc = (top.frames[1].document.URL.match('game.php') =='game.php') ? top.frames[1].document : top.frames[0].document;}else{doc = document;}if(!doc.URL.match('mode=combined')){alert('You must be in the "Combined" overview!');}else{var main = doc.getElementsByTagName('table');for(var a = 0; a < main.length; a++){if(main[a].className == 'main'){var par = main[a].getElementsByTagName('table');for(var i = 0; i < par.length; i++){if(par[i].className = 'vis'){var rows = par[i].getElementsByTagName('tr');for(var j = 0; j < rows.length; j++){if(rows[j].className == 'nowrap row_a' || rows[j].className == 'nowrap row_b'){var cells = rows[j].getElementsByTagName('td');for(var k = 7; k <= 6+units_count; k++){troups[k-7] += parseInt(cells[k].firstChild.nodeValue);}numvil++;}}}}}}if(numvil > 0) {var output = ;for(var i=0; i<units_count; i++){output += units[i][1] + ': ' + troups[i] + " (" + Math.round(troups[i]/numvil) + ")\n"}alert("Type - Troops - Average\n" +"---------------------------------\n" +output);} else {alert('Villages / troops can not be found!');}}