Script Summary: Calculate the Generals Score of the units in a garrison spy report
The purpose of this script is to determine how much of a players Generals Score is in the spied town. Very handy for determining if the player has units in other towns.
This script runs only on pages that display the data from a garrison spy report (url contains "view=safehouseReports" or "function=executeMission*mission=6"). It picks up the type of unit and number of units that are stationed in a town, and then adds a column with a total Generals Score for each of the units in the table. It will only calculate the score for the units that belong to the player that owns the town.
Update: 2009.11.14 21:30 PST
I don't like scripts that wildcard the URL so they run on every page. I was a bit too restrictive and it was only working when viewing a previously executed report. The URL for the view when the mission is executed is different and is now one of the includes.
Update: 2009.11.12 17:12 PST
Realized that I had some errors from cleaning up the code before posting. Also realized that it was breaking some of the other spy reports. This should fix all that.



