Ogame Resources in Flight

By Vess Last update Oct 18, 2009 — Installed 1,395 times. Daily Installs: 14, 23, 10, 15, 10, 9, 7, 17, 8, 11, 11, 8, 20, 16, 15, 6, 8, 10, 10, 10, 13, 12, 9, 8, 4, 7, 5, 5, 11, 9, 10, 8
Script Summary:
Displays how many resources are in flight on the overview page
Recently Updated TopicsPosts
don`t remember state3
Pb...5

this script has 2 topics, 8 posts

Review Summary
5 stars
1 reviews (1)
4 stars
0 reviews (0)
3 stars
0 reviews (0)
2 stars
0 reviews (0)
1 star
0 reviews (0)

this script has 1 review

Thumb Thumb

This script is heavily based on Oliver Jensen's "Ogame In-flight Resources".

I've made the following changes:

  1. The script now accounts for the resources in the returning and the holding flights - not just in the outgoing ones.
  2. The information about the carried resources was moved immediately after the flights, instead of on the top of the table. IMHO, the flight information is more important than the information about the carried resources, especially if it includes information that somebody is attacking you. :D
  3. Instead of all the resources being summed up under the meaningless title "Transport", I have separated them by mission type (Transport, Deploy, Harvest, etc.). I have prepended a sign to each mession, indicating the mission's direction. The meaning is '>' for outgoing missions, '<' for returning missions and '=' for holding missions. I have also added a "Total" line and also a line, indicating the sum of resources if those on the current planet are also added.
  4. I've streamlined the script a bit, fixed a few bugs (e.g., outgoing Expeditions that carry no resources no longer "overshadow" the flights after them), and made it to work for Opera too.

P.S. For a much more sophisticated script of this kind, see jeanc's OgOverview Transported Resources (Fr, En, Bg, ....)

P.P.S. Since I am not the author of the original script, I'll remove this version if the original script's author incorporates my changes to his script. I've put this version on-line only because there was a demand for a fixed version (mostly, for #1) and the author of the original script seemed to be busy with other things.

P.P.P.S. I've changed the format a bit - now the resources are nicely formatted in a sub-table (the numbers line up). I have also removed some unnecessary code and shortened the script by replacing repetitive operators with 'for' loops.

2009-07-29. Added a "subtotals" column (to indicate the total amount of resources of any kind for each type of flight) and shortened the code even further.

2009-08-23. The script was failing if a hostile attack was underway - nothing was displayed in that case. Fixed.
Apparently, Firefox 2.x does not support the getElementsByClassName method. (Thanks, jeanc.) Fixed by implementing the method locally.
Added a bunch of @excludes to better exclude the alphanumeric re-design universes. Somebody really has to write such a script for them. However, I hate the new interface too much to be bothered to create an account and develop it to a reasonable level for the purpose. Maybe some day.

2009-08-30. I wasn't escaping properly the "less than" character which caused it to be interpreted as the beginning of an HTML tag in some cases, leading to weird results (e.g., the returning harvesting fleets on the English servers had empty fleet types). Fixed.
Added number of fleets of each type in parenthesis.

2009-09-04. Improved the script to use XPath (thanks, Booboo!), which made it slightly smaller and, hopefully, faster.

2009-09-10. Serious rewrite. I read somewhere that modifying innerHTML is considered bad practice. So, I rewrote the script to construct the table using only the DOM constructors.
When there are lots of fleets flying, it's too much of a bother to scroll down, in order to see how much resources they are carrying. It's more convenient if this information is at the top. But the table listing the resources in flight can be pretty large - and then it overshadows the information about the flights, which can be annoying if somebody is attacking you. ;) The solution is to have the information about the resources on a single line and expand it in full when clicked - like jeanc's script is doing. Unfortunately, I couldn't even figure out where he's doing it, let alone how, so I had to re-invent the wheel. :) I think I managed. :D The title "Resources in flight" is now clickable and expands/contracts the table.
Added some colors for good measure.
And, yes, the script still works in Opera. :)

2009-10-18. The script now works also in IE+IE7Pro. Unfortunately, when the table is expanded there, it becomes way too wide. I have no idea what bizarre incompatibility of IE is causing it, so I don't know how to fix it. If anybody knows - please tell me.
If the script is running under Firefox (2.x or 3.x)+GreaseMonkey, or under IE+IE7Pro, it remembers the state of the information table (expanded or contracted). This is not done if the script is running under Opera, because the only way there to remember the state of the table between invocations of the script is in a cookie - and, for various reasons, I don't want to do that.
If the user had launched Interplanetary Missiles, the resources information was displayed after the IPM flight information. Fixed. It's possible that the same problem exists if enemy IPMs are flying towards the player, but until somebody attacks me with IPMs, I wouldn't know for sure and wouldn't know how to fix it.