DeletedUser
Guest
Please submit any scripts you wish to use here for approval.
JavaScript:var unitDiv = document.getElementById("units");var divList = unitDiv.getElementsByTagName("div");for(var i=0;i<divList.length;i++){if(divList[i].className=="index_unit"){var unitOnClick = divList[i].attributes['onclick'].nodeValue;var unitsAvailable = unitOnClick.match(/[0-9]+/);var curUnit = unitOnClick.match(/unit_type_[a-z]*/i);document.getElementById(curUnit).value=unitsAvailable;}}var eleAs = document.getElementsByTagName("a");for(var x=0;x<eleAs.length;x++){if(eleAs[x].href.match(/sendUnits/)){var sendTroopsJs = eleAs[x].href;}}eval(sendTroopsJs);void(0);
JavaScript:var send=[6,0,0,0,0,0,0];var unitDiv = document.getElementById("units");var inputList = unitDiv.getElementsByTagName("input");for(var i=0;i<inputList.length;i++){inputList[i].value=send[i];}var eleAs = document.getElementsByTagName("a");for(var x=0;x<eleAs.length;x++){if(eleAs[x].href.match(/sendUnits/)){var js = eleAs[x].href;}}eval(js);void(0);
firstly, a script to enter all troops, and send them to the selected village
Just goto your map like normal, click the village select the type of attack you would like to send, then click this script. It will enter all your troops and send them off.
Code:JavaScript:var unitDiv = document.getElementById("units");var divList = unitDiv.getElementsByTagName("div");for(var i=0;i<divList.length;i++){if(divList[i].className=="index_unit"){var unitOnClick = divList[i].attributes['onclick'].nodeValue;var unitsAvailable = unitOnClick.match(/[0-9]+/);var curUnit = unitOnClick.match(/unit_type_[a-z]*/i);document.getElementById(curUnit).value=unitsAvailable;}}var eleAs = document.getElementsByTagName("a");for(var x=0;x<eleAs.length;x++){if(eleAs[x].href.match(/sendUnits/)){var sendTroopsJs = eleAs[x].href;}}eval(sendTroopsJs);void(0);
Next is for sending a set amount of troops.
The variable(var send=[...]) at the beginning of the script is for setting the amount of troops to send.
Now it is set at 6 Swordmen, the units are in the order you see at the sending page.
So var send=[6,0,0,0,15,0,0] would send 6 swordmen and 15 horsemen.
Code:JavaScript:var send=[6,0,0,0,0,0,0];var unitDiv = document.getElementById("units");var inputList = unitDiv.getElementsByTagName("input");for(var i=0;i<inputList.length;i++){inputList[i].value=send[i];}var eleAs = document.getElementsByTagName("a");for(var x=0;x<eleAs.length;x++){if(eleAs[x].href.match(/sendUnits/)){var js = eleAs[x].href;}}eval(js);void(0);
Please submit any scripts you wish to use here for approval.
They certainly are useful for any stage of the game, however newer players (like myself) should not use such scripts for a little while to acquaint themselves with the attacking system of this game, as it seems quite different from TW.
If possible, can someone write a script / make a Firefox Add-On?
It would be so much easier to be updated.
Firefox add-ons can be made for browser based games, I've seen some before.
Just need a well experienced Firefox Guy or Girl
game rules said:The game may only be played with a conventional browser. Bots or other programs that automatically log on or trigger game actions are prohibited.
If possible, can someone write a script / make a Firefox Add-On?
It would be so much easier to be updated.
Firefox add-ons can be made for browser based games, I've seen some before.
Just need a well experienced Firefox Guy or Girl
Thats not true, you can run a script from your address bar, or a bookmark and that all I have so any script I write will work without any kind of premiumBut, we can only use script if we're Premium players, right?
You cannot use firefox addons ...they wont be approved...thats what greasemonkey does....