Large

Ikariam Empire Board

By oliezekat Last update Feb 10, 2012 — Installed 624,488 times.

upkeep

in
Subscribe to upkeep 22 posts, 8 voices



M.Right User
FirefoxWindows

tried to update upkeep but it s just showing question marks
does somebody know what to do to update upkeep?

 
oliezekat Script's Author
FirefoxWindows

display any of your barrack and shipyard... to fetch upkeep costs per units ;o)

 
Sracz66 User
FirefoxWindows

hungarian translation:
upkeep = fenntartás

previous canceled translations:
Research = Fejlesztés
Incomes = Bevételek

 
matteo466 Scriptwright
FirefoxWindows

hi oliezekat,
could you implement the real upkeeps considering research's reductions?

you could use information diplayed in 'view research library' link.

here is some code that helps to extract datas from that page:

mainview=document.getElementById('mainview');
content=mainview.getElementsByClassName('content')[0];

reduction={
	'sea':function(){
		seaul=content.getElementsByTagName('h4')[0].nextSibling.nextSibling;
		searesearches=seaul.getElementsByClassName('explored').length;
		seafut=seaul.getElementsByTagName('li')[13].textContent;
		seafutlevel=seafut.slice(seafut.lastIndexOf('('),seafut.indexOf(')')+1);
		seafutlevel=seafutlevel.slice(seafutlevel.lastIndexOf(' '),seafutlevel.indexOf(')'));
		seafutlevelno=parseInt(seafutlevel);
		red=[0,0,0,2,2,2,6,6,6,6,6,14,14,14,14+2*seafutlevelno];
		return red[searesearches];
	},
	'mil':function(){
		milul=content.getElementsByTagName('h4')[3].nextSibling.nextSibling;
		milresearches=milul.getElementsByClassName('explored').length;
		milfut=milul.getElementsByTagName('li')[13].textContent;
		milfutlevel=milfut.slice(milfut.lastIndexOf('('),milfut.indexOf(')')+1);
		milfutlevel=milfutlevel.slice(milfutlevel.lastIndexOf(' '),milfutlevel.indexOf(')'));
		milfutlevelno=parseInt(milfutlevel);
		red=[0,0,2,2,2,6,6,6,6,6,14,14,14,14,14+2*milfutlevelno];
		return red[milresearches];
	},
}
alert(reduction.sea()+' '+reduction.mil());

sorry but i'm not a good programmer, you can write a better code...

 
oliezekat Script's Author
FirefoxWindows

Barrack and Shipyard costs (per units) not include reduction ??!

 
matteo466 Scriptwright
FirefoxWindows

no. look this screenshoot:
http://prntscr.com/31q3

in a city i have only one ram ship and the upkeep is 40, without considering reduction of researches

 
oliezekat Script's Author
FirefoxWindows

Could you explain me your functions : is it percentage of reduction ? Are you author of this source-code ?

 
Rowdy User
FirefoxWindows

I still get "?" even after I go to the barracks and/or shipyard. Any ideas?

 
matteo466 Scriptwright
FirefoxWindows

@ oliezekat

yes i wrote that code and you could use it.

the 2 functions will work in the overview reserach page (there is the link in the first table of your script) where are listed all researches.
the done researches are 'highlighted' with class 'explored'.
searesearches variable represent how many reasearches are researched.
seafutlevelno variable represent the future level reached in a research field (seafering for example).
red array represent the total reduction (2=2%) of upkeep after a research.
2 research completed in a field correspond to index 2 of array.
the function returns the total amount of reduction after a number of researches in each seafering (for ship) and military (for units) reasearch field.
you can use this number to calculate the real upkeep.

i hope you have understood what i wrote, i'm not very good in english...

 
Patibar User
FirefoxWindows

I get only question marks. Even when I update barracks or shipyard.

 
oliezekat Script's Author
FirefoxWindows

thank matteo :)

@patibar & rowdy: change your scripts order if another scripts modify these pages ;)

 
Rowdy User
FirefoxWindows

Changing order didn't seem to change it, but, all seemed to fix itself after I deleted the script and re-installed it. I re-populated the data from each of my towns and all is well.

 
M.Right User
FirefoxWindows

yeah just delete all your script and re-install ikariam empire board and voila it works ^^

 
Patibar User
FirefoxWindows

Now, after deleting all my scripts, re-opening firefox and installing version 182 I see no "?" but I see "-" in upkeep column. Any idea how to make it work?

PS> Thx for putting some polish translations.

 
oliezekat Script's Author
FirefoxWindows

I feel your Firefox had kept old version 180 into its cache database. Notice "upgrade" red link display by Empire Board prevent Firefox's cache instead "install" button on Userscripts ;)

 
Patibar User
FirefoxWindows

Hej, it unblocked itself suddenly when I produced some army.
Weird thing is, that I produced in one city but I see all upkeep data.
Works great now!

thank you.

 
oliezekat Script's Author
FirefoxWindows

Fine :o) You could "Favorite this script" and become "Fan" now ?! :Op

 
Patibar User
FirefoxWindows

I am the biggest fan of it! :D (now officially)

 
courageduke User
FirefoxWindows

NICE! I figured it out. Just to sum it up for people with the same problem.

-Have to uninstall all your scripts. Reinstall Empire board (5 star script btw ;)

-build a few spearmen or something in your barracks, and build a ship in the shipyard.

Boom. Done!

 
oliezekat Script's Author
FirefoxWindows

You don't need to build something ; just display barrack/shipyard one time ;o)

 
Hawksoul09 User
FirefoxWindows

Does the upkeep represent the cost per day?

 
oliezekat Script's Author
FirefoxWindows

yes, but don't include upkeep of units which travelling ;o)

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