Changes in 8.21 for script authors

Hi guys,

In 8.21 we’ve made some small changes to our Javascript code and also introduced a new tagging feature that can be customized via scripts.

Incomings overview – mass tagging

When we updated the game to version 8.20 the changes we made to the renaming system unfortunately stopped some scripts from working. The most missed script was the incomings tagger, so we’ve now implemented this into the game. Whilst on the incomings overview you can now select any number of incomings and then click the ‘Label’ button at the bottom of the screen. This will label all of the incomings by guessing the slowest unit based on the remaining travel time, the same way as scripts would.

One of the challenges we face when implementing new features like this is balancing the customization wanted by more experienced players without making the game seem too complicated and alienating to new players. As such, by default, the tagger will currently only rename incomings to include the unit name. If you wish to customize the naming you can use a script. We’ve designed our tagger to make it easy for you to use a script with your own naming format with only one line of code:

var format = ‘%unit% %coords% %player%’; $(‘input[name=label_format]’).val(format).parents(‘form’).find(‘input[name=label]’).click();

This would label any selected incomings to include the unit, coordinates and player name.

The format supports the following variables:

%unit% %distance% %coords% %duration% %return% %sent% %arrival% %player% %origin% %destination%

Improvements to timing

We’ve made improvements to our handling of time related elements, such as the server time, resource counts and decreasing timers. Using new technology available in modern browsers we can now ensure that the times shown in your browser are more precisely synced with the actual server time. These improvements are available in IE10+, Firefox 27+, Chrome 31+ and Opera 20+.

These changes will stop any scripts designed to pause server time. If you wish to pause server time, you can click the server time display at the bottom of the page. You can also use the following code:

Timing.pause();

A subsequent call will unpause the timers.

Further changes in the next version

Please note that in the version after 8.21 will be changing the ‘attack ID’ that is visible when viewing a command so that it is obfuscated. Scripts that maintain a database of attack IDs will no longer be of any use.

Thanks for reading,
Jon/Morthy

Fixes, patches and updates!

3 comments


  1. Thanks for your sharing. It’s helpful.

  2. Hi,

    Looking good :) One question what’s the data of %sent%?
    Just wondering ;)

    Regards,
    Kevin

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload the CAPTCHA.