Script Summary: Major revamp of Utopia Kingdoms/Khan Wars interface
Version: 1.2.6
License: Public Domain
Announcement
As of 2010-02-03, I have added native support for Khan Wars into this script.
I have not played UK seriously since October 2009, and consequently cannot access many of the pages to debug. Therefore this update will be my last major version of this script for UK. Likewise, I am not a KW player. Major updates or new features are not planned.
If anyone wants to take over the task of maintaining this script, please send me a private message via userscripts.org. I would be happy to link to your work via this page.
| Sites Supported | Translation Credits |
|---|---|
| utopiakingdoms.com | |
| khanwars.com | |
| guerrakhan.com | Ailton Sobral |
| lesseigneurs.fr | |
| khanwars.com.pt | CCLXX |
| khanwars.cl | liofk |
| khanwars.es | carlesmu |
| deche.vn | (partial support only) |
| khanwars.ro | (partial support only) |
| khanwars.pl | (partial support only) |
| hansavaslari.com | (partial support only) |
| khanwars.it | (partial support only) |
| zarenkriege.de | (partial support only) |
| hanovete.com | (partial support only) |
| khanratnik.com | (partial support only) |
| draugas.lt | (partial support only) |
| khanwars.nl | (partial support only) |
| khanwars.no | (partial support only) |
| khanwars.se | (partial support only) |
| pravyteli.com | (partial support only) |
| khanwars.hu | (partial support only) |
| khanwars.ae | (partial support only) |
| khanwars.jp | (partial support only) |
| khanwars.ir | (partial support only) |
| lordwars.co.il | (partial support only) |
Known Issues
- Map timing tool sometimes does not function on the first page load of the map page, but only on the Hungarian server. I have no idea why this is happening.
- Script interface does not display in correct direction for right-to-left languages. I do not plan on fixing this.
Version 1.2.6
Bug Fixes
- The underlying KW map code was updated, causing the map timing tool to fail. This should be fixed now.
Version 1.2.5
Partial Language Support
- Refined Spanish translation; partial support for Hungarian, Arabic, Japanese, Iranian, Israeli servers.
Version 1.2.4
Partial Language Support
- Partially supports Lithuanian, Dutch, Norwegian, Swedish, and Ukrainian servers.
Version 1.2.3
Bug Fixes/Partial Language Support
- Fixed issues with Firefox 3.6 changes (duplicate scavenge counts should no longer appear on map, approximate march return timer on march page should work, battle reports section of message page should show extra data).
- Added partial language support (script interface is in UK text, but buildings/units/resources/skills should all be OK for native language) for Vietnamese, Romanian, Polish, Turkish, Italian, German, Croatian, Bulgarian servers.
Version 1.2.2
Bug Fix/Language Support
- Added support for Spanish/Latin American servers.
- Added support for https protocol (Croatian server, no translation yet).
- Fixed bug with quick march commands not completing when there are no saved formations.
Version 1.2.1
Bug Fixes
- Fixed logic error that didn't run script on all map tooltips.
- Fixed error preventing formation pasting in the army order page.
Version 1.2.0
Bug Fixes
- Fixed yet more... problems with battle reports not calculating upgrades properly.
- Blank grids should now have their saved map data cleared when visited.
- Map timing tool should have an additional row when the active city is a camp.
New "Features"
- Suppressed advisor pointing out buildings to construct on the city page.
- All map squares, including blanks, should now be clickable in order to send marches (i.e., scavenge/camp--it's easier than ever to keep your army safe while offline). As a consequence, to prevent clutter, the scavenge numbers on the map are now only shown when there is actual scavenge to pick up. Additionally, the "highlighted" square is now identified with a thick border, rather than black scavenge text.
- Due to the preceding change, the map timing tool was also updated so all squares can be timed. It may be tricky at first to get used to the numbers changing when hovering over a blank square.
Version 1.1.5
Bug Fixes
- Fixed march timer issues when sending from camps.
- Fixed coordinate learning code after breaking it in the previous update.
Version 1.1.4
Bug Fixes
- Fixed translation bug preventing battle reports from having upgrades calculated properly.
- Using the quick roads checkbox on the map will now affect the map tooltips as well as the castle timers below the map.
- Added march timing estimation support for KhanGuard units on the first and second march pages, as well as the map.
Version 1.1.3
Bug Fixes
- Spy reports where too many QWs die no longer crash the script.
- Fixed issue where different page structure between UK and KW was causing supporter battles to stop parsing in UK.
- Fixed issues with quick troop transfer tools.
Version 1.1.2
Maintenance Release
- Added support for Portuguese and French versions.
Version 1.1.1
Maintenance Release
- Added support for Brazilian server.
- Tweaked the way settings were being stored so when the KW codebase updates to a new subdomain (e.g., game4->game5), settings will not be lost.
Version 1.1.0
Maintenance Release
Native Support for KhanWars
There were a couple of attempts to port this code to work with the KhanWars skin (KhanWars, GuerraKhan), but with reduced functionality. My major goal of this release was to ensure the script worked both on the UK codebase on which it started, and as well on the KW codebase--no matter the language involved. To that end, users wishing to port this script to KW in a language other than English can now easily do so, in a manner that should be obvious from the top part of the code itself. I will also start a topic in the script forum for users needing more explicit instructions. I would be happy to update the script for user-provided translations if they post in the script forum or send me a PM, as pasting a block of text would not be too much work for me. Note that I have not tested the script on languages that flow right to left (e.g., Arabic), so I have no idea whether the script logic will work in those cases. I have tested it on KW English and a couple of other languages, but cannot guarantee it will always work, because there are slight differences in formatting between servers which could affect the node traversal logic.Removed Features
- No more tool to total the amount scavenged according to market messages. With multilanguage support, it was going to be difficult to filter scavenging messages from the other message types.
- Unfortunately, since the script now supports several sites simultaneously, the method used to save data had to be rewritten. Consequently, old saved data, including map data, will be inaccessible. Users wishing to proceed with the upgrade are advised to completely uninstall the script via the Greasemonkey menu ("also uninstall associated preferences") and then install the new version of the script.
Fixed Bugs
- Saved messages are loaded even when doing so from the Sent Messages category.
- Battles that go "too quickly" will no longer stop the rest of the reports page from being scripted.
- When pasting an army into the march setup page, the script will now correctly give an error message when there are not enough units to make up the pasted army.
- Fixed issues with copying units from spy reports.
Version 1.0.3
Maintenance Release
- Added compatibility for 2009-12-08 revision of Greasemonkey, which broke the way coordinates were being learned.
- Added some more convenience links.
- Removed some preferences not used by the script.
- Visiting the hero and upgrades pages now automatically learns the page data. In the case of upgrades, the game displays them with minimal information (shows upgraded level even when the upgrade is not complete; does not show whether upgrades in progress are attack or defense), so it estimates the attack level as the smallest possible--either zero, or the shown upgrade level minus the number of upgrades in progress for the unit.
Version 1.0.2
Bug Fixes
- Removed code that was supposed to clear map data for empty grids (was deleting data in populated grids for some unknown reason).
- Saved messages now display even when initiating retrieval from a message category with no messages.
- Spy reports with no known map data no longer show inverted coordinates as the town name.
Version 1.0.1
Bug Fixes
- Fixed map learning code so coordinate associations/blank squares are properly learned/cleared.
- Fixed coordinate link in battle report message's attacker node to link to map, and not march.
- Fixed issues with "send resource" page when having only one castle. Actually implemented auto-uncheck "without unloading" for using saved beneficiary pulldown.
Version 1.0.0
General
- Configuration screen enables user to specify default attack formation, server time offset, hero scout level (for timing estimates), and unit upgrades for estimating damage against walls.
- The script memorises data as pages are visited (merchant capacity, association between coordinates and player/city names, etc).
- Replaces static server time node with a timer, showing local time and approximate server time.
- Converts most server times to local times.
- Coin reminders automatically closed. Links to convert resources, send resources, and overview on every page.
- Shows total resources and amount exceeding maximum merchant capacity on every screen.
Castle
- Automatically calculates total resources/needed resources for the next level of each building (20% premium for third queue item not calculated).
Map
- Squares have digits showing number of light cav/cav archer needed to loot all scavenge from square (green for minimum user-configurable amount, blue for nonzero, white for zero; black for targeted square).
- Tooltip calculates one-way march time and local return time for merchant, quickest, and slowest units. Also converts last activity server time to local, and sums total scavenge available in square.
- Mouseover square for march timing tool.
- Program learns coordinate/name/clan associations as player navigates over map. These data can be copied into a spreadsheet via a button on the map page.
Army
- Button to release troops from all training facilities in city.
- Calculation of resources returned when cancelling unit training, and resources and time used to train selected number of troops at a given speed.
- Ability to paste formations copied from battle reports (only units observed in the report will be placed).
Sim
- Tools to max upgrades/skills, zero all unit counts, paste/add unit counts, paste skills copied from battle report.
Battle Reports
- Coordinates complemented with player/city name if known.
- Buttons to copy skills/armies/formations.
- Shows unit upgrades.
- Calculates pop/life/resources lost; calculates maximum total scavenge based on losses.
- Calculates total light cav/cav archer needed to haul stolen/scavenged resources. Calculates attacker's stolen resources as capacity of surviving units.
Marches
- March info page lists city names where known, calculates effective speed, percent capacity, time from origin. Also has a copy button for when units are shown.
- "Contents" field's alert() replaced with formatted numbers inline.
- Coordinates replaced with city name, where the code has learned the square's information (mouseover to see coordinates).
- Added clickable "Time" field for marches en route, to show time from start of march and time remaining to target.
- Unhid coordinate boxes so attacks can be sent directly from the marches page; added pulldown of player's own cities so troop transfers can be done on a single page.
- Added icons to reattack/go to map square for "To" field. Current target is asterisked.
- Fixed issues with sorting/paging not retaining sort/filter parameters.
- Added single infantry, paste (e.g., copied from sims), invert, and other troop selection tools.
- Wall damage, mystic wall damage, carry weight, non-mystic pop shown on march page for current troop selection.
- Shows castles ordered by distance to target.
- Timing tool in local time for current troop selection and target coordinates. Mouseover for one-way arrival time. Click "A"ttack, "S"cavenge, or "T"ransfer to perform that action at that travel speed.
- Added support for sending simple (coinless) marches from a single page. After submit, page automatically redirects to same coordinates.
- For complicated marches, use "continue" to access second march page. This page has server arrive/return times which should be calculated to within a second of actual server.
Market
- Calculates profit/profit ratios of trades on open market.
- Conversion tool to calculate minimum number of one res to get another in internal market.
- Facility to save/delete coordinates for sending resources. Top-up and even distribution tools added, with march timer. Automatically checks "without unload" for cities not owned by player or in the saved beneficiaries.
Messages
- Added facility to save messages to a local computer.
- Added option to delete page of messages for most categories.
- Coordinates are complemented with their city/player names if known. Convenience links to march/map in most cases. Message age noted and coloured.
- Battle report notifications show battle scavenge and stolen resource capacity.
- Market page has tool to calculate the total scavenge retrieved from a square.
- Spy reports reformatted to show closest cities and march times for current city. Ability to copy supports/camps. Total/max stealable resources calculated based on buildings. Two copy-and-pasteable text boxes for saving spy data to spreadsheet (columns are date, city name, x, y, max resource production, wall, guard station, storehouse, stealable resources, maximum observed resources, maximum possible resources, homes, order, maximum unit production; second line omits max observed onward so it doesn't overwrite old data on paste).



