Wonderfull script
![]() ![]() |
Thanks author for the script. I'm looking for the script for this game long long time ago and today I found your script. I installed, tried it and I have some questions + suggestions for improvement this script: Questions:
Suggestions:
2. Beside of the half of army user can select (ex: Max (140) Min (0) / (70)), I think we should have the carry weight for every army unit and total carry weight for all selected units according with the number of units has been selected. Ex: a light cavalry has carry weight 90, a quickwalker has carry weight 2. User select 1 quickwalker and 50 light cavalry so the total carry weight for them are 4502. At that time, the screen look like: Quickwalker: Total (10) Selected (1) Max (10) Min (0) / (5) / Carry weight (2)
Popular: 202 Carry weight: 4502 The reason for this request is we can know the total carry weight when we select the army units immediately instead of we must go to the next confirm page. 3. In the market page and the 2nd page of march page (/pohod.php), can we have a favorite castle list beside the "target coordinate" drop down field? User can enter that two lists in the "script options" popup look like (following this parttern: "Name x:y"): Castle A 100:20
4.Support multi languages (define string constants in the top of the source so users can edit the string values following their language). We can discuss more if you need some clarifications. Thanks in advance. Have a nice weekend. |
![]() ![]() |
Answers:
About suggestions:
Thank you for your post. |
![]() ![]() |
Hi there, I made small modify in your script for showing marches info as below:
function marchesInfo() {
var n = document.getElementsByTagName('a');
if (n.length>0) {
for (var i=0;i<n>-1) {
var m = n[i].href.split('%20');
var str = 'Population: ' + m[11];
var hasRes = (m[1] != 0 || m[3] != 0 || m[5] != 0 || m[8] != 0);
if (hasRes)
str = ' G: ' + m[1] + ', I: ' + m[3] + ', W: ' + m[5]+ ', M: ' + m[8];
var brr = document.createTextNode(str);
n[i].parentNode.appendChild(brr);
if (!hasRes)
n[i].parentNode.removeChild(n[i]);
}
}
}
You will see new variable "str" for containing the text string. If the current actions are on the way going to (attackings) or on the way back to (transportings), we just only show the population "P: xxx" instead of showing 0, 0, 0, 0, xxx as you did; otherwise, we show the information button and the text "G: xxx, I: yyy, W: zzz, M: www" About "3. How can I use the feature which was descible in "script options" page?", could you please show me (by using images) how to use "Auto build Building" feature? How can we determine the building number? And what we can do with the text area in the script options popup? About "Additional map table", can you give me a picture for that table's content? In my page, I also saw that link as the same with your link in image but when I click mouse on it, it didn't work. New question for you: why and what are the meanings for colors in market page? Regards,
|
![]() ![]() |
Hi author, I updated your source for adding new feature: save and restore last march action for more conveniences. Please get my codes and update to your origin source. And if you can, please let users decide that they want to use this feature or not in the script options page.
function optionEnlarger() {
var obj = document.getElementsByTagName("select")[3];
if (obj.id=='type') {
obj.setAttribute("size",obj.getElementsByTagName("option").length);
//restore last march action
var lastMarchAction = getCookie('lastMarchAction');
if (lastMarchAction) {
obj.options[lastMarchAction].selected = true;
}
obj.setAttribute('onchange','setLastMarchAction();');
embedFunction(setLastMarchAction);
}
}
function setLastMarchAction() {
var obj = document.getElementsByTagName("select")[3];
if (obj.id=='type') {
var i = 0;
for(i = obj.options.length - 1; i >= 0; i--) {
if(obj.options[i].selected)
setCookie('lastMarchAction', i);
}
}
}
I found a small bug: when we don't have any transporter for transporting the goods, your script will throw an error to the browser (gold is null). Please check the variable gold is null or not before you continue to add new action scripts setResLikeGold and setResColor into gold, iron, wood and food object. Thanks,
PS: I formatted the source codes (a tab to 02 spaces) for easy reading. Sorry for this action. |

