|
Script Summary:
Displays how many resources are in flight on the fleet movement page Version: 1.05 |
this script has 2 topics, 4 posts |
this script has 1 review |
||||||||||||||||||||||||
OK, I finally caved in and wrote a version of the Ogame Resources in Flight script for the hateful new design. :D
Works pretty much like the original version (and, just like it, works in Opera too, and is mostly language-independent). Tried to use a style similar to those used by the game. Now, if only I could figure out how to add those cute green triangle buttons for expanding and contracting the table - you know, the ones used by the game to expand and contract the information about the flights...
This script works only on the "Fleet movement" page. I couldn't figure out how to get the information about the cargo of the various flights in the EventList window. Probably because it uses this crappy AJAX technology and the information simply isn't there until the mouse is hovered over one of the triangles representing the fleets - in which case the information about that particular fleet is queried from the server. If I'm wrong and there is a way to obtain this information in the script - I'm open to suggestions...
Change log:
2009-09-20: Version 1.01. In expanded mode, the script was displaying fleets that were empty (i.e., carried no resources). Fixed.
2009-09-22: Version 1.02. Removed some unnecessary code and streamlined the rest a bit.
Since the fleet movement page doesn't show any attacking fleets, it's OK to start the script in expanded mode - it won't "overshadow" anything important and it is at the end of the fleet info anyway. If you don't like this, change "expanded=true" to "expanded=false" near the beginning of the script.
Now if the table is contracted and expanded multiple times (without refreshing the fleet movement page), the last line of the table is updated to account for the resources that have been produced on the planet during this time.
Somebody has to test if this script works correctly when the "current planet" is a moon. I won't have a moon any time soon in the redesign universes, so I can't test it myself.
Should I move the information displayed by this script before the information about the fleets - instead of after them, as it is now? (If I do that, the script will start in contracted state, of course.)
2009-09-23: Version 1.03. Figured out how to add the green triangles to expand and contract the table - the same way the game does with the flight information. So, now the table is expanded and contracted this way, instead of clicking on "Resources in flight".
Moved the information (in contracted mode) above the flights instead of below them, just like in the version of this script for the old design of OGame. If you don't like this, set the variable "below" to true near the beginning of the script.
In expanded mode, the script was counting in the number in parentheses even the empty flights (the flights that carried no resources), even though it wasn't displaying them. Fixed, in the sense that they are no longer counted.
2009-09-29: Version 1.04. Got rid of the XPath calls and implemented a custom getElementsByClassId method, so that now the script works not only in Firefox (both 2.x and 3.x)+GreaseMonkey and Opera, but also in IE+IE7Pro. Had to do some minor tweaks here and there, in order to overcome some IE-related incompatibilities. (I hate IE... Why can't Microsoft do anything right?)
2009-09-30: Version 1.05. Now, when running in Firefox or IE, the script remembers its state (expanded or contracted) between screen refreshes. This is not the case in Opera, since the only way to save the state there would be in a cookie, and for various reasons I don't want to do that.
When running in expanded mode, the script no longer shows in the last row of the table the sum of all flying resources and those on the current planet. Instead, now it shows only the sum of all resources flying towards the current planet plus the resources on the current planet. If you prefer the old behavior, set the constant onlyToCurrent to false near the beginning of the script.





