Thursday, 24 March 2011

Attack Renamer

For this script to work you must first go to the command section, view all villages and hit the script, it should then rename all your attacks to either scout,real,noble.... etc

javascript:var doc=(window.frames.length>0)?window.main.document:document;var eleSpans=doc.getElementsByTagName("span");table=doc.getElementById("commands_table");function theInnerText(theNode){return typeof(theNode.innerText)=='undefined'?theNode.textContent:theNode.innerText}function overView(){var eleTrs=table.rows;var headers=eleTrs[0].getElementsByTagName("th");function getHeader(ele){for(i=0;i<headers.length;i++){if(headers[i].innerHTML.match(ele,"i"))return i}}for(x=1;x<eleTrs.length;x++){var inputs=eleTrs[x].getElementsByTagName("input");if(inputs[0].value.match(/(Attack on)/i)){var spear=eleTrs[x].cells[getHeader('spear')].innerHTML;var sword=eleTrs[x].cells[getHeader('sword')].innerHTML;var axe=eleTrs[x].cells[getHeader('axe')].innerHTML;var scout=eleTrs[x].cells[getHeader('spy')].innerHTML;var lc=eleTrs[x].cells[getHeader('light')].innerHTML;var hc=eleTrs[x].cells[getHeader('heavy')].innerHTML;var ram=eleTrs[x].cells[getHeader('ram')].innerHTML;var cat=eleTrs[x].cells[getHeader('catapult')].innerHTML;var noble=eleTrs[x].cells[getHeader('snob')].innerHTML;var coord=inputs[0].value.match(/(\d+\|\d+)\) (K\d+)/);inputs[0].value='Fake';if(scout>5){inputs[0].value='Scout'}if(lc>10){inputs[0].value='Real'}if(hc>50){inputs[0].value='Real'}if(cat==1){inputs[0].value='Fake'}if(ram==1){inputs[0].value='Fake'}if(axe>10){inputs[0].value='Real'}if(ram==1&&scout==1){inputs[0].value='Intel Fake'}if(cat==1&&scout==1){inputs[0].value='Intel Fake'}if(noble==1){inputs[0].value='**NOBLE**'}inputs[0].value=coord[1]+' '+coord[2]+' '+inputs[0].value;inputs[1].click()}}}overView();

the highlighted green bit is where you change it to what you want.

e.g  you whant to change the "real" to "nuke" you replace the "real" highlighted in green to "nuke" and then when u use it next it should rename them nuke instead of real.

No comments:

Post a Comment