Ikariam missing resources

By iknietjij Last update Jan 14, 2011 — Installed 30,599 times.

NaN bug

in
Subscribe to  NaN bug 4 posts, 4 voices



oliezekat Scriptwright
FirefoxWindows

Hi,

I'm french and play on ikariam.fr

Sometime display "+NaN" :o( And some problems under v.0.3.2

NB: could I fix and re-publish your script if you don't want to repair it ?

 
iknietjij Script's Author
FirefoxWindows

Hmmm, can you give me more details on what causes it? Otherwise, feel free to mail/message me a fix :) as long as it doesn't interfere with any of the current functionality.

 
Lajtus User
FirefoxWindows

I confirm that bug. Script does not show wood or crystal (glass) requirements correctly.
Example: For Palace lvl 8. next resources are needed:
Wood 350,965, Wine: 96,702, Marble: 169,841, Glass: 145,917, Sulphur: 194,928
Wood 5,877, Wine: 22,596, Marble: 0, Glass: 679, Sulphur: 2,098 (currently in town)
Wood +NaN, Wine: -74,088, Marble: -169,841, Glass: +662, Sulphur: 194,928 (missing)

Please note that there is no wood in calculation and glass is stated in plus regardless the fact that there is 145k missing.

Kind regards

 
Scorpion_II Scriptwright
Firefox

Hi all,

The problem with the NaN is because we use translated versions of the game, and iknietjij wrote it only for English.
The fix is:
replace the lines:

elementText = 'Building Material';
elementText = 'Wine';
elementText = 'Marble';
elementText = 'Crystal Glass';
elementText = 'Sulphur';

with

elementText = liElement.title;

Then the script will take into account the translated name of the resource and will parse the needed value correctly.

That helped for me,
Scorpion

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