Nice! Any chance of implementing multi-language support? I can provide the necessary translations for English and Bulgarian, if you modify the script to support multiple languages, depending on the language of the server.
Just keep in mind that the different servers use different naming conventions. Most use uni*.ogame.COUNTRY (e.g., uni8.ogame.ru, uni2.ogame.fr, etc.) but some use uni*.COUNTRY.ogame.org (e.g., uni1.bg.ogame.org).
If you're interested, feel free to contact me at email@example.com. I understand Russian freely, but prefer to write in English.
|AlexeyTokar Script's Author||
I'm glad that u interested the script :)
I'll implement l10n asap and notify u about that
Some additional suggestions for improvements:
2) The original article also says to add 30% of the resource cost of any ships stationed around the planet (i.e., the eventual debris that the attacker can take if he crashes the ships). It is especially important to account for the solar sats, since those cannot be fleetsaved.
Ah, some additional remarks:
1) I don't know how it is on the Russian server, but the English server says something like
Light Laser (NNN available)
which means that the regular expression you're using - /([0-9]+)\)$/ - won't match it. I suggest using just /([0-9]+)/ instead.
2) Your math doesn't make sense to me. If I have understood the original article correctly, for every 100k resources (of any kind) residing on the planet, you need 6 Plasma Turrets, 9 Gauss Cannons, 36 Heavy Lasers and 42 Light Lasers. But this isn't what your script is computing.
3) Your script can display fractional numbers (e.g., 1.6666666) for the number of needed defense type. I suggest rounding the number up with Math.ceil().
4) It's faster if you break the first for loop, once you've found the Plasma Turret.
OK, I fixed some of the problems mentioned above and implemented multi-language support. I currently support the following languages: Russian, Bulgarian, English, German, French, Dutch, Spanish, Portuguese, Swedish, Greek, Polish and Balkanic.
"Support" means that the script will run on those language versions of OGame and will compute correctly the defense needed to protect the resources residing on the current planet. However, in most cases the user interface of the script is in English (the exceptions being Russian and Bulgarian, where the user interface of the script is that of the language of the OGame server). In order to translate the user interface for all the supported languages, I'll need translations for the phrases "available" and "needed" in those languages.
Please contact me, so that I can send you the modified version - you're the author of the original script, after all, and I don't want to publish my version without your approval.
Nevermind. Implemented support for all the languages supported by OGame with the exception of Turkish (couldn't find the names of the ground defenses; WebSim doesn't support this language) and those that use hieroglyphs (Chinese, Taiwanese, Japanese, Korean), because my text editor doesn't support them.