Troop Counter/Vault Troop Report Generator

DeletedUser122570

Guest
Author
Lunacystudy
Contributors
N/A
Quickbar Entry
https://pastebin.com/raw/ATBXWvxS
Public?
Public
This is a script that goes through each of your villages and generates a nicely-formatted message for the troop totals and currently available troops.

The code is available here: https://pastebin.com/ATBXWvxS - I've not minified it because I'm extremely lazy and don't care. You can copy-paste the whole code into your Link Target box in the Edit Quickbar Link page.

(Mods: the pastebin link above is different to the one I submitted, I just removed a couple of debug lines and closed a </label> tag)

Screenshot_20190404_062003.png

Output:

Screenshot_20190404_064641.png

[coord]459|629[/coord]
Code:
Spear fighter | Available: 11 | Total: 19
    Swordsman | Available: 21 | Total: 29
       Archer | Available: 15 | Total: 15
        Scout | Available: 65 | Total: 15
[coord]460|632[/coord]
Code:
Spear fighter | Available:  5 | Total: 66
    Swordsman | Available:  9 | Total: 50
       Axeman | Available:  2 | Total:  2
       Archer | Available: 70 | Total: 70
        Scout | Available: 47 | Total: 97
Light cavalry | Available:  3 | Total:  3
Heavy cavalry | Available:  3 | Total:  3
          Ram | Available:  1 | Total:  1
[coord]459|632[/coord]
Code:
 Spear fighter | Available: 11 | Total: 11
     Swordsman | Available: 11 | Total: 11
        Axeman | Available:  7 | Total:  7
        Archer | Available:  3 | Total:  3
         Scout | Available:  4 | Total:  6
 Light cavalry | Available:  5 | Total:  5
Mounted archer | Available:  6 | Total:  6
 Heavy cavalry | Available:  5 | Total: 10
           Ram | Available:  9 | Total: 19
      Catapult | Available: 15 | Total: 15

Caveats:

- It navigates to the Troops Overviews page to get the data
-- Doesn't work if you don't have a Premium Account
-- This means the next time you click the Overviews button, it takes you to the Troops Overviews, not the one you used last. It's annoying and should be fixable, I just have to get around to it. Fixed
-- That also means it narrows down the villages available to report on by your current group, which uh... was totally intended.
-- It only navigates to the first page because I'm scared of the Bot detection.
--- The message format isn't great for hundreds or thousands of villages anyway, so I'm not super interested in supporting the larger page sizes.
 
Last edited by a moderator:
Upvote 0

DeletedUser121895

Guest
Beautiful script. Could you set it to give also a final review with all the troops counted?
Or an easy method to select only Off/Def village (working on groups)

^^

@LunacyStudy
 

JayH

Guest
Are you going to fix it? (After-patch problems are showing up, mostly in the troops count)
 

DeletedUser122570

Guest
Sorry guys, been super busy with work. I'll take a look this weekend.
 

DeletedUser122570

Guest
Update:

- Add a Support column to show how many troops are supporting other villages
- Add a Total Troops category at the top that shows the total of all selected villages.

Couldn't see any bugs, troop counts appear to be correct in my testing. Can you give more information about what you were doing when you encountered the bug?
 
Last edited by a moderator:

Shinko to Kuma

Still Going Strong
Reaction score
776
Update:

- Add a Support column to show how many troops are supporting other villages
- Add a Total Troops category at the top that shows the total of all selected villages.

Couldn't see any bugs, troop counts appear to be correct in my testing. Can you give more information about what you were doing when you encountered the bug?

The bug most troop counters have rn, is when you for example send village A’s troops to B to support. It will count the troops in both A, as in B, on top of B’s own troops, giving wrong totals
 

DeletedUser122570

Guest
Small fix for mobile.

The bug most troop counters have rn, is when you for example send village A’s troops to B to support. It will count the troops in both A, as in B, on top of B’s own troops, giving wrong totals

Cheers, I'll take a look.
 

DeletedUser122570

Guest
It looks like my script never had that bug. The Troops overview includes a Total value that includes any troops supporting the village, but I never used that value.

For each village, my script calculates total values based on the "Your own" + "Outward" + "In transit" values, which should be correct for all villages.
 

GeeGee

Active Member
Reaction score
67
Could not find a textbox to fill is the error I keep getting.
am I doing anything wrong or ....
 

EmperorFluff

Non-stop Poster
Reaction score
96
tried the script, got the same error


your supposed to click the script while on the mail

so you go to mail the write message or go to an old message
then you click reply
and then the mail will fill with your troop totals
________________________________________________________________________________________


Very Nice script any chance you could add a column for total supporting troops in your village but do not add in to the total at the top. because there not actually yours.
 

nikchop

Guest
hi! would it be possible to also get info on how many villages have full population (to get an idea of how many full off/deff villages you currently have)
 
Top