Ikariam Military

By Toranaga Last update Sep 1, 2009 — Installed 79,398 times.

Bug for not english server

in
Subscribe to Bug for not english server 5 posts, 3 voices



oliezekat Scriptwright

Hi, it's nice idea but fully failed for me :o(

I'm french, and I believe code bellow couldn't work for me because "title" use "Niveau" word for levels ^^

wallLevel = parseInt(wall["title"].replace(/.*evel (\d+).*/, "$1"), 10);

Use this tip to fetch integer number into alphanumeric string.

var temp = ""+str;
temp = temp.replace(/[^-0-9]+/g, "");
temp = parseInt(temp);

NB: support negative numbers.

I don't know which anothers bugs disturb this script for me. Good luck...

 
Toranaga Script's Author

Thanks for the feedback.
Due to my inability of running DOMParser.parseFromString on the barracks/shipyard pages, the script is peppered with string scans which, I'm afraid, will fail for non-English languages.
I will create an account on such a server and look for alternative ways of scanning for the required values.

Update:
Here's another string scan that will fail:

	var key = "<div class=\"unitcount\"><span class=\"textLabel\">Available: </span>";
	var start = unitHTML.indexOf(key);

 
Toranaga Script's Author

v0.0.3 should fix the non-English woes.
I've done very summary testing: no wall, wall level 1, no barracks, empty barracks, one slinger in barracks. All looked ok.

 
oliezekat Scriptwright

It's fine, so cute ^^

I submit to add your toolbox into cityMilitary-army/fleet, barracks, and shipyard views but lonely if you cached data because it's forbidden to make lot of HTTP requests...

 
la faucille Scriptwright

+1

i have suggested a feature in your other post

Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel