Tribal Wars village overview

This script was taken offline, as I figured it violates the rules. I did not realize it was not allowed to re-create premium functionalities, nor did I realize some of the features are available in premium. I will probably re-publish new scripts that do not violate these rules at a later point.

One of the challenges of Tribal Wars is keeping track of what actions are being performed by your village. There are some premium features that help with this, but I felt like writing something that can help me with that myself.

In order to do so I wrote a javascript file that, when executed on a page in tribal wars, does two things.

  1. It scrapes data that’s on the current page and saves it in local storage. Local storage is a mechanism browsers provide to allow saving data and retrieving it later, when visiting a different page within the same domain.
  2. It reads all data it previously scraped into local storage, and uses that data to generate a nice overview of what all your buildings are doing.

Because of how the script works, up until all pages have been scraped once, it will show quite a weird screen, showing a couple lines of “undefined”.

(Please note, the script currently is only available in dutch.)

Once “Ververs informatie” gets clicked, the script will automatically go by all pages that it can scrape. After doing so, it will look something like this:

The overview in all it’s glory.

As you can see the overview keeps track of exactly when what task will finish. When a task finishes, that task will start flashing red to pull your attention to it.

So, how do you run this script? There’s multiple ways of running it. The latest version of the script will always be available on https://daniel.dmvandenberg.nl/site/wp-content/uploads/2020/04/tool.js. I use the chrome browser extension called “Custom JavaScript for Websites 2”. This extension can be used to automatically run javascript when a page from a given domain is loaded. In order to configure this extension, go to your Tribal Wars village, click the CJS icon, and paste the following:

var script = document.createElement('script');
script.src = "https://daniel.dmvandenberg.nl/site/wp-content/uploads/2020/04/tool.js";
document.body.appendChild(script);

This piece of code will dynamically load the tool into your page, giving you the overview screen.

Work is also in progress to give you more insight using a multi-village overview, which decorates and complements the normal overview page. Currently this overview shows your building levels and troops, but it might be expanded upon.

Leave a Reply

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

CAPTCHA ImageChange Image