Troop Counter/Vault Troops Counter by dalesmckay (FIXED)

RedAlert

Senior In-Game Staff
Tribal Wars Team
Senior
Team
Script Moderator
Reaction score
623
Author
dalesmckay
Contributors
RedAlert
Quickbar Entry
javascript:$.getScript('https://twscripts.dev/scripts/troopsCounterFixed.js');
Public?
Public
Troops Counter by dalesmckay (FIXED)

Approved, ticket nr. t13362682

This is basically the old troop counter script by dalesmckay which was broken from the game updates.
This is the fixed version of that script.

The script can be run only from the Troops overview.
On first run it might require you to enable popups (since most of the browsers block those by default).

Premium Account is needed for this script.

I'm not gonna support this script other then probably bug fixes. Its not my script, I only did the fix on the original one so everyone could have this piece of wonder working again.
So im not gonna add new features on this script.
 
Last edited:
Upvote 3

Deleted User - 11598416

Guest
This does not work for me. I run the script in Rally point -> Troops. Looking at the code, it seems to look for #units_table. When I look at the HTML, the tables are #units_home and #units_transit. I don't have premium, so maybe Troops overview is a different page I don't have access to?
 

SwedishBlueCheese

Non-stop Poster
Reaction score
1,051
This does not work for me. I run the script in Rally point -> Troops. Looking at the code, it seems to look for #units_table. When I look at the HTML, the tables are #units_home and #units_transit. I don't have premium, so maybe Troops overview is a different page I don't have access to?

Overviews > Troops. Not in rally point
 

Deleted User - 11598416

Guest
Ah I see, so you need account manager to run this script. Thanks
 

RedAlert

Senior In-Game Staff
Tribal Wars Team
Senior
Team
Script Moderator
Reaction score
623
Premium account is needed, no need for Account Manager.
 

RedAlert

Senior In-Game Staff
Tribal Wars Team
Senior
Team
Script Moderator
Reaction score
623
Updated link of scripts. If script is not working for you anymore, replace the old link with the new one and it should all work fine.
 

RedAlert

Senior In-Game Staff
Tribal Wars Team
Senior
Team
Script Moderator
Reaction score
623
To anyone who has problems with Troops Counter script, i have added some more debug messages on the script.

  • Keep in mind that the script needs to be run from the Troops Overview (so Premium Account is needed).
  • Keep in mind that the current script requires popups to be allowed on the browser (or at least whitelist the tribalwars world so popups from tribalwars will open).

Both of these are mandatory, skipping either one of these will make the script to not work. If both of those are "green" (so you are on troops overview screen and you have whitelisted or allowed popups) and script is still not working fine ... then pls get in touch with me in private (first thing, pls send screenshot of the browser console).

Red.
 

RedAlert

Senior In-Game Staff
Tribal Wars Team
Senior
Team
Script Moderator
Reaction score
623
Script is updated.
Popup has been removed so this should solve a lot of problems now.

Red.
 

RedAlert

Senior In-Game Staff
Tribal Wars Team
Senior
Team
Script Moderator
Reaction score
623
People have asked to have the element draggable again and coords ... coords are back. Draggable will be activated by user choice.

JavaScript:
javascript:var DRAGGABLE=true;$.getScript('https://dl.dropboxusercontent.com/s/g9mwm1yiq1iqhkh/troopsCounterFixed.js');
 

Turambar

Active Member
Reaction score
41
is possible to the nobleman population on the nukes ( nobleman.pop < 100 ) and defence army being optional?

right now if i have a full nuke and a noble it shows that i have 0 full nukes and 1 "other nobles". i perfect world would be both display one. semi-perfect world would be the full nuke overwriting the "other noble".
 

RedAlert

Senior In-Game Staff
Tribal Wars Team
Senior
Team
Script Moderator
Reaction score
623
@Turambar , unfortunately no. That would require quite a lot of changes. I'm not ready to invest that much time on this script (which is not the easiest script to add or change functionalities).

I did some improvements to the original script but all of them don't affect the logical part (which is very tied together). My changes affected the UI and made the script work without popups so it was easier for everyone to use this and not have problems anymore just because of the popups being blocked.

Other then this, right now im not thinking on adding other features or changing the current logic (which has done the job for probably more then 7 years of TW or even more).

Red.
 

Deleted User - 11595623

Guest
so... a couple of things :)

more presentation than any logic change

can you display the current server time, and the current group filter in the heading.

to help with sharing this via screenshots...
 

RedAlert

Senior In-Game Staff
Tribal Wars Team
Senior
Team
Script Moderator
Reaction score
623
Hello @slowtarget ,

As you can see the logic that you and/or dalesmckay have created still is the same. I havent touched that.

I found the script to be one of the best at this category (Troop Counter scripts) and one of the more reliable ones (it has literally been battle tested) :)

That's why i did not change its logic in any way ... plus its very hard to change it :p

Nice idea about adding the server time, will do that.

About the group filter ... you mean to show inside the "popup" the current group (example [All], [Offense], etc)?

Red.
 

Deleted User - 11595623

Guest
@misteralb I didn't contribute to this code (not my fault :)) and about the group filter - yes exactly right - so that if someone has several clusters they can report for each one, and know which is which later ...
 

Frying Pan Warrior

Still Going Strong
Reaction score
578
is possible to the nobleman population on the nukes ( nobleman.pop < 100 ) and defence army being optional?

right now if i have a full nuke and a noble it shows that i have 0 full nukes and 1 "other nobles". i perfect world would be both display one. semi-perfect world would be the full nuke overwriting the "other noble".

@Turambar , unfortunately no. That would require quite a lot of changes. I'm not ready to invest that much time on this script (which is not the easiest script to add or change functionalities).

I did some improvements to the original script but all of them don't affect the logical part (which is very tied together). My changes affected the UI and made the script work without popups so it was easier for everyone to use this and not have problems anymore just because of the popups being blocked.

Other then this, right now im not thinking on adding other features or changing the current logic (which has done the job for probably more then 7 years of TW or even more).

Red.

For some reason the script creator's logic was, if a player has a noble in a village, they are building a noble train there so the village doesn't show up as nuke or noble train because the train is not yet 4 nobles.

I'm not sure if everyone wants this script to put villages into more than one category. So I would propose @misteralb if you are able to make a UI element config option for choosing whether to place each village in multiple groups, I can update the script logic to accommodate it.

(Or do you want a quick and dirty variable edit when adding the script to the quickbar.)
 

RedAlert

Senior In-Game Staff
Tribal Wars Team
Senior
Team
Script Moderator
Reaction score
623
@slowtarget , your suggestions are added and improved uppon.

@Frying Pan Warrior honestly changing that logic its not something im interested on doing :(
Atm i have sent another script for approval and working on another bigger script. So dissecting that script is not something i would like to do.
However if you want to dissect it, and you think you can come up with some short and nice way to implement that feature (especially if its easy enough to be implemented through quickbar variables only, even better).

Feel free to contact me via DM also if needed regarding the script.

Red.
 

DPROKZ

New Member
Reaction score
2
Overall this is a fantastic script so thank you for keeping it going.

I suspect your response will be that this is a "logic" item that you aren't interested in doing but just to confirm: there is no easy way to edit what is considered a "full" build right? My village fully stocked and built out is only showing up as "3/4 Defense" rather than "Full Defense". If it's too much work that's fine, just figured I would ask. Thanks.
 

RedAlert

Senior In-Game Staff
Tribal Wars Team
Senior
Team
Script Moderator
Reaction score
623
Overall this is a fantastic script so thank you for keeping it going.

I suspect your response will be that this is a "logic" item that you aren't interested in doing but just to confirm: there is no easy way to edit what is considered a "full" build right? My village fully stocked and built out is only showing up as "3/4 Defense" rather than "Full Defense". If it's too much work that's fine, just figured I would ask. Thanks.

The troops calculations part, this part at least can be changed but I'm not gonna change it.

The script has worked with this logic for more then 7-8 years. It was the same troops config then, it will be the same one in the future.

Troops/village build is different from player to player so what to you is considered a nuke to someone else is not, etc.

Don't want to start changing the script this way so just to change troop builds/counts.

Thank you for the suggestion but I'm not gonna implement it.
 
Top