RedAlert

Senior In-Game Staff
Tribal Wars Team
Senior
Team
Script Moderator
Reaction score
676
Author
RedAlert
Contributors
Aviendha
Quickbar Entry
javascript:var HC_AMOUNT=4;$.getScript('https://twscripts.dev/scripts/supportCounterEvolved.js');
Public?
Public
support-counter-evolved.jpg

This script can be run on 3 screens:
  • Overview Troop -> Supports (/game.php?screen=overview_villages&mode=units&type=away_detail&filter_villages=1)
  • Map (/game.php?screen=map)
  • Single Village (/game.php?screen=info_village&id=XXXX)
On the supports screen you will be able to see where you have sent support in a table format and also you can withdraw the support from those villages. On the map screen you will be able to visually see the villages where you have sent support and how much support (in population) you have sent to those villages).

On the single village screen you can withdraw support you have sent in a custom way:

1667350020823.png

You can specify which units you want to withdraw and also how much of the support currently stationed you want to withdraw.
Whatever you chose (units picked or amounted to withdraw) are also saved in localStorage so the next time you run the script these fields will be prefilled.

Here is how the script looks like in practice:


Contributors:
From Aviendha's script I got the idea behind this script and some functions (such as the one that parses the DOM and gathers supports data).

For any bugs, suggestions or if you need help with the script, let me know by replying on the thread.
 
Last edited:
Upvote 1

RedAlert

Senior In-Game Staff
Tribal Wars Team
Senior
Team
Script Moderator
Reaction score
676
Script updated to v1.1.0

1674078816316.png

Added a way to manually input amounts of units to be called back. Keep in mind that you can not do this kind of call back with defenses that have been sent from other players, so while their troops will appear as def, you can not actually select those defenses stationed on your village.

If you experience any issue while using this new feature let me know.
 

RedAlert

Senior In-Game Staff
Tribal Wars Team
Senior
Team
Script Moderator
Reaction score
676
Script updated to v1.1.2

There is no UI change on this update. Added support for counting Heavy cavalry pop amount as 4, instead of the default 6.

In order for the script to be able to do that, the player needs to pass this variable HC_AMOUNT with a value of 4, otherwise it defaults to 6.

However, I updated the quick-bar link, so please re-grab it from above so it includes this parameter.
 

Aviendha

Active Member
Reaction score
38
This script is awesome, thank you so much for this, I wanted to make some of these improvements but couldn't find the time, especially the single village screen, it's amazing :)
 

RedAlert

Senior In-Game Staff
Tribal Wars Team
Senior
Team
Script Moderator
Reaction score
676
This script is awesome, thank you so much for this, I wanted to make some of these improvements but couldn't find the time, especially the single village screen, it's amazing :)
Thank you! Appreciate your kind words, especially when they come from another scripter. Your script Support Counter gave me the initial idea to work on this script, you had done a great work with that.

Let me know if you have any suggestion for the script and I might add it on future versions.
 

NunoF-

Member
Reaction score
8
Hi @RedAlert , as we discussed, I have a suggestion that I think would make the script better.

Do you know how scripts such as Support Sender send troops from all villages in bits until they reach the levels desired by the player? This can be a mess to properly remove from a village when support is partially no longer needed.
Example:
I have 3 villages:
001 - 70 spears
002 - 20 spears
003 - 10 spears

Now let's imagine that I say that I want to send 50 spears to someone else's village. The Support Sender script would make it so, on the mass support page, all my villages be selected with the following units:

001 - 35 spears
002 - 10 spears
003 - 5 spears

This kind of mechanic seems interesting to implement in your script. I know that we can already manually say how many units we want to withdraw, but what the script then does is pick up the number of villages we have, in the bellow example, 3, and divide the 50 spears by 3, which leads the withdraw page to be filled with the following values:

001 - 17 spears
002 - 17 spears
003 - 17 spears

(It's either 16 or 17 on all, I didn't test it, but you get my point).
This would be impossible since villages 002 and 003 don't even have 17 spears. Therefore, the above-mentioned solution could be implemented.


Otherwise, there could always be a setting to "Try to remove as many units from this villages", where a user would select villages from where wants to take as many units out.

Example:
I have 3 villages:
001 - 70 spears
002 - 10 spears
003 - 60 spears
004 - 30 spears
005 - 40 spears

In the script, I say that I want to withdraw 150 spears, but to give priority to villages 003 and 004.
The script would then immediately try to get 150 spears from villages 003 and 004, but would come short with just 90. The rest, would be removed from the other villages in the same way as the first proposed solution for this. The values would look like:
001 - 70 * ((60 * 100)/120)/100 = 35
002 - 10 * ((60 * 100)/120)/100 = 5
003 - 60
004 - 30
005 - 40 * ((60 * 100)/120)/100 = 20
35 + 5 + 60 + 30 + 20 = 150

After the support is removed, the villages would be left with the following support on that village:
001 - 35 spears
002 - 5 spears
003 - 0 spears
004 - 0 spears

005 - 20 spears


This feature would be implemented in this screen:
1727893378520.png


This is just an idea, I know for sure it would have been extremely useful for me... As always, if possible, I am always willing to land a hand


Thanks for reading,
NunoF-
 

RedAlert

Senior In-Game Staff
Tribal Wars Team
Senior
Team
Script Moderator
Reaction score
676
Hi @RedAlert , as we discussed, I have a suggestion that I think would make the script better.

Do you know how scripts such as Support Sender send troops from all villages in bits until they reach the levels desired by the player? This can be a mess to properly remove from a village when support is partially no longer needed.
Example:
I have 3 villages:
001 - 70 spears
002 - 20 spears
003 - 10 spears

Now let's imagine that I say that I want to send 50 spears to someone else's village. The Support Sender script would make it so, on the mass support page, all my villages be selected with the following units:

001 - 35 spears
002 - 10 spears
003 - 5 spears

This kind of mechanic seems interesting to implement in your script. I know that we can already manually say how many units we want to withdraw, but what the script then does is pick up the number of villages we have, in the bellow example, 3, and divide the 50 spears by 3, which leads the withdraw page to be filled with the following values:

001 - 17 spears
002 - 17 spears
003 - 17 spears

(It's either 16 or 17 on all, I didn't test it, but you get my point).
This would be impossible since villages 002 and 003 don't even have 17 spears. Therefore, the above-mentioned solution could be implemented.


Otherwise, there could always be a setting to "Try to remove as many units from this villages", where a user would select villages from where wants to take as many units out.

Example:
I have 3 villages:
001 - 70 spears
002 - 10 spears
003 - 60 spears
004 - 30 spears
005 - 40 spears

In the script, I say that I want to withdraw 150 spears, but to give priority to villages 003 and 004.
The script would then immediately try to get 150 spears from villages 003 and 004, but would come short with just 90. The rest, would be removed from the other villages in the same way as the first proposed solution for this. The values would look like:
001 - 70 * ((60 * 100)/120)/100 = 35
002 - 10 * ((60 * 100)/120)/100 = 5
003 - 60
004 - 30
005 - 40 * ((60 * 100)/120)/100 = 20
35 + 5 + 60 + 30 + 20 = 150

After the support is removed, the villages would be left with the following support on that village:
001 - 35 spears
002 - 5 spears
003 - 0 spears
004 - 0 spears

005 - 20 spears


This feature would be implemented in this screen:
View attachment 12987


This is just an idea, I know for sure it would have been extremely useful for me... As always, if possible, I am always willing to land a hand


Thanks for reading,
NunoF-
Hello and thank you for the suggestion.

I think I got the idea of what you mean.

You want the script to have the capability to select a list of villages from the which the script needs to withdraw all support and the remaining withdraw amount to be spread evenly among the remaining villages.

In theory it should be possible. However in practice I suspect might need some work to be implemented so will see if I will work on this in the future. It's a cost/benefit analysis so will see how much work it needs and what or how many benefit from this because if it's too niche very likely might not work on this.
 

ferreoli

New Member
Reaction score
0
Hi Red, how are you? Is there an approved script that counts support troops from other players in my villages? So that I can know how much each player has supported to control active players. This script of yours is great, but it only shows my support, I wanted a way to do this automatic counting.
 
Top