Eakshow McGee

Non-stop Poster
Reaction score
390
Author
Unknown
Contributors
N/A
Quickbar Entry
javascript: if (document.URL.match(/mode=commands/)) {var troopsArray = new Array(); var numvil = 0; var main = $("#commands_table")[0]; var names = new Array(); var vilCoords = new Array(); var village = new Array(); var CurVill; var units =['[unit]spear[/unit]', '[unit]sword[/unit]', '[unit]axe[/unit]', '[unit]archer[/unit]', '[unit]spy[/unit]', '[unit]light[/unit]', '[unit]marcher[/unit]', '[unit]heavy[/unit]', '[unit]ram[/unit]', '[unit]catapult[/unit]', '[unit]knight[/unit]']; var farmused =['1', '1', '1', '1', '0', '4', '5', '4', '5', '8', '10']; var rows = main.getElementsByTagName('tr'); for (var j = 1;j < rows.length;j++) {var cells = rows[j].getElementsByTagName('td'); if ($(cells[0]).text().match(/Support/) == "Support") {CurVill = $(cells[0]).text().split(/\(/); CurVill = CurVill[CurVill.length - 1]; CurVill = CurVill.match(/\d+\|\d+/); var val = 0; if (vilCoords[CurVill] == null) {village.push(CurVill); vilCoords[CurVill] = new Array(); var p = 0; for (var k = 3;k <= (cells.length - 1);k++) {val = cells[k].firstChild.nodeValue; if ( ! val) {val = cells[k].firstChild.innerHTML.replace( /<[^>]*>/g, '').replace(/\s+/, '').match(/\d+/)[0]; } vilCoords[CurVill][p] = parseInt(val); p = p + 1; } } else {var p = 0; for (var k = 3;k <= (cells.length - 1);k++) {val = cells[k].firstChild.nodeValue; if ( ! val) {val = cells[k].firstChild.innerHTML.replace( /<[^>]*>/g, '').replace(/\s+/, '').match(/\d+/)[0]; } vilCoords[CurVill][p] += parseInt(val); p = p + 1; } } } } var msg = "Total Support Sent<br>" + "---------------------------------<br>"; for (var g = 0;g < village.length;g++) {msg += "Sent to <b>"+village[g]+"</b> -- "; var villageCoords = village[g]; var troops = vilCoords[villageCoords]; var farmspace = 0; for (var h = 0;h <= 11;h++) {if (troops[h] == 0){} else {msg += units[h] + troops[h] + " "; farmspace += parseInt(troops[h] * farmused[h]); var packets=Math.round(farmspace/1500); } } msg += " (farm pop: " + farmspace +")<br><br>"; } function openPopup() {var TheNewWin = window.open('', 'name', 'height=255,width=800, toolbar=no,directories=no,status=no,menubar=no'); TheNewWin.document.write( '<html>'); TheNewWin.document.write( '<head><title>Popup<\/title><\/head><body style="overflow:auto; font-family:verdana,arial;font-size:10pt"> <p>' + msg + '<\/p>'); TheNewWin.document.write(' <hr \/> <p align="right"><a href="#" onclick="self.close(); return false;">Close'); TheNewWin.document.write(' Window<\/a><\/p> <\/body><\/html>'); } openPopup(); } else {self.location = "http://" + window.location.hostname + "/game.php?screen=overview_villages&mode=commands"; } void%200;
Public?
Public
Counts support sent to villages.

* Run from Commands --> Support
* Counts HC as 4 Pop (can be changed)
* Doesnt seems to work on Renamed commands.
* Allows to be sent with BB-codes in PM/Forum with total popcount sent to each village:


Should be similar to this script.