RedAlert

Senior In-Game Staff
Tribal Wars Team
Senior
Team
Script Moderator
Reaction score
622
Author
RedAlert
Contributors
N/A
Quickbar Entry
javascript:$.getScript('https://twscripts.dev/scripts/farmingEfficiencyCalculator.js');
Public?
Public
Farming Efficiency Calculator

Approved: t13970817

This script should be ran on Reports Overview -> Attacks screen.

Screenshot_3.png

Basically the script runs on the Reports Overview -> Attacks screen and goes through each report and grabs looted resources amounts.
Based on all the data collected it calculates how efficient farming has been.

This is how it will look to the end-user:

Screenshot:
(also on this screenshot im showing debug messages)

Changelog:
- v1.2:
Script is now translation-ready. Added first translation for .BR server. Thanks @natanprog for preparing the translations.
- v1.1: Added new stats (Villages Looted and Looted/Village)

For suggestions, bugs, or if you need help using this script please reply on this thread.
 

Attachments

  • Screenshot_3.png
    Screenshot_3.png
    105.5 KB · Views: 106
Last edited:
Upvote 1

Deleted User - 11598416

Guest
Nice script!

You have found a nice way to read the report page. How did you find out that if you go to "/game.php?screen=report&ajax=view&id=${reportId}" you get it formatted in ajax?
 

RedAlert

Senior In-Game Staff
Tribal Wars Team
Senior
Team
Script Moderator
Reaction score
622
When you hover over a report thats how you see a preview of that report. When you hover over a report, a request goes back on server (to that url you have posted above) ... the rest is parsing the response and doing the farm calculations.
 

natanprog

Member
Reaction score
11
@misteralb

In the .BR market where I play, according to the rules, I can only use scripts approved in the .NET market
I don't know, if it is in your interest to add support for other languages/markets but here is the Brazilian Portuguese translation


JavaScript:
//if (game_data.locale == "pt_BR") || (game_data.market == "br")
'Farming Efficiency Calculator' = 'Calculadora Eficiência de Saque'
'Efficiency:'                   = 'Eficiência:'
'Total Looted:'                 = 'Total Saqueado:'
'Total Estimated:'              = 'Total Estimado:'
'Villages Looted:'              = 'Aldeias Saqueadas:'
'Looted/Village:'               = 'Saqueado/Aldeia'
'Total Wood:'                   = 'Total de Madeira:'
'Total Clay:'                   = 'Total de Argila:'
'Total Iron:'                   = 'Total de Ferro'
'Script must be run from'       = 'O script deve ser usado em'
'Reports Overview'              = 'Relatórios/Ataques'
'Help'                          = 'Ajuda'

thanks
 
Last edited:

RedAlert

Senior In-Game Staff
Tribal Wars Team
Senior
Team
Script Moderator
Reaction score
622
Hello @natanprog ,

So if Brasilian server has automatically approved all scripts that are approved on Internations server, it could be good to have these scripts i have build translation-ready. At the moment they are not so i will have to rework them partially.

Thank you for the translations on this script. Will add translation capability in the coming days.
 

RedAlert

Senior In-Game Staff
Tribal Wars Team
Senior
Team
Script Moderator
Reaction score
622
@natanprog
I am a programmer myself.

The thing we programmers hate the most is when someone says "It does not work" without giving more info.

It does not work is very broad and starts from the popup not showing up to it does not work as i expected, which are very different things.

So whenever saying it does not work, its better to say, this specific thing here, does not work correctly. I was expecting this but this other thing happened or something like that.

Now regarding the if check, i improved it to make it more universal (pls check the last version of the script).
Regarding strings, I used the ones provided by you so i would recommend that If you have updated the text strings for "pt_BR" language please send them again here (I already updated those myself so check my version, if all looks okay then all good).

Thanks,
Red.
 

jaro

Active Member
Reaction score
6
Here you have .es, would be cool to add it, thanks!

JavaScript:
//if (game_data.locale == "es_ES") || (game_data.market == "es)
'Farming Efficiency Calculator' = 'Calculadora Eficiencia Saqueando'
'Efficiency:' = 'Eficiencia::'
'Total Looted:' = 'Total Saqueado:'
'Total Estimated:' = 'Estimación Total:'
'Villages Looted:' = 'Pueblos Saqueados:'
'Looted/Village:' = 'Recursos/Pueblo'
'Total Wood:' = 'Total de Madera:'
'Total Clay:' = 'Total de Barro:'
'Total Iron:' = 'Total de Hierro'
'Script must be run from' = 'El script debe ser usado desde'
'Reports Overview' = 'Informes'
'Help' = 'Ayuda'
 

RedAlert

Senior In-Game Staff
Tribal Wars Team
Senior
Team
Script Moderator
Reaction score
622
@jaro Thank you for the translation. Translation is now added and should work correctly.

Red.
 

subliminal9999

New Member
Reaction score
11
Translation for .it, it will be great to add it too. Thanks :D

JavaScript:
//if (game_data.locale == "it_IT") || (game_data.market == "it)
'Farming Efficiency Calculator' = 'Calcolatore Efficienza Farming'
'Efficiency:' = 'Efficienza:'
'Total Looted:' = 'Totale Saccheggiato:'
'Total Estimated:' = 'Totale Stimato:'
'Villages Looted:' = 'Villaggi Saccheggiati:'
'Looted/Village:' = 'Risorse/Villaggio'
'Total Wood:' = 'Totale di Legno:'
'Total Clay:' = 'Totale di Argilla:'
'Total Iron:' = 'Totale di Ferro:'
'Script must be run from' = 'Lo script deve essere lanciato da'
'Reports Overview' = 'Report'
'Help' = 'Aiuto'
 
Reaction score
10
Here is the translation for .gr
Thanks for the script :D

JavaScript:
//if (game_data.locale == "el_GR") || (game_data.market == "gr)
'Farming Efficiency Calculator' = 'Υπολογισμός Απόδοσης Farming'
'Efficiency:' = 'Αποδοτικότητα::'
'Total Looted:' = 'Συνολικοί Πόροι:'
'Total Estimated:' = 'Μέγιστη Εκτιμώμενη Απόδοση:'
'Villages Looted:' = 'Λεηλατημένα Χωριά:'
'Looted/Village:' = 'Πόροι/Χωριό'
'Total Wood:' = 'Συνολικό Ξύλο:'
'Total Clay:' = 'Συνολικό Πηλό:'
'Total Iron:' = 'Συνολικό Σίδερο'
'Script must be run from' = 'Το Script πρέπει να τρέξει απο'
'Reports Overview' = 'Αναφορές-Επίθεση'
'Help' = 'Βοήθεια'
 

RedAlert

Senior In-Game Staff
Tribal Wars Team
Senior
Team
Script Moderator
Reaction score
622
Thank you guys. Translations for both Italian and Greek are added.
 

slowwwww

New Member
Reaction score
0
JavaScript:
//if (game_data.locale == "pt_PT") || (game_data.market == "br")
'Farming Efficiency Calculator' = 'Calculadora de Eficiência de Saque'
'Efficiency:'                   = 'Eficiência:'
'Total Looted:'                 = 'Total Saqueado:'
'Total Estimated:'              = 'Total Estimado:'
'Villages Looted:'              = 'Aldeias Saqueadas:'
'Looted/Village:'               = 'Saqueado/Aldeia'
'Total Wood:'                   = 'Total de Madeira:'
'Total Clay:'                   = 'Total de Argila:'
'Total Iron:'                   = 'Total de Ferro'
'Script must be run from'       = 'O script deve ser usado em'
'Reports Overview'              = 'Relatórios/Ataques'
'Help'                          = 'Ajuda'
 

RedAlert

Senior In-Game Staff
Tribal Wars Team
Senior
Team
Script Moderator
Reaction score
622
@slowwwww,
This seems exactly the same as the "pt_BR" translation I already had, so I used that one.

Thanks for contribution.
 

Deleted User - 848917031

Guest
Is there a possibility that you could make a script mutually similar but instead of getting loot stats, you can get casualty/KIA stats? Would be awesome knowing how many of my soldiers I sent to the grave in my campaigns lmao
 

merhabalar

New Member
Reaction score
0
JavaScript:
//if (game_data.locale == "tr_TR") || (game_data.market == "it)
'Farming Efficiency Calculator' = 'Yağma Verimliliği Hesaplayıcısı'
'Efficiency:' = 'verimlilik:'
'Total Looted:' = 'Toplam Yağmalanan:'
'Total Estimated:' = 'Tahmini Toplam:'
'Villages Looted:' = 'Yağmalanan Köyler:'
'Looted/Village:' = 'Yağmalanmış ham / Köy'
'Total Wood:' = 'Toplam Odun:'
'Total Clay:' = 'Toplam Kil:'
'Total Iron:' = 'Toplam Demir:'
'Script must be run from' = 'Komut dosyası şuradan çalıştırılmalıdır'
'Reports Overview' = 'Raporlar'
'Help' = 'Yardım'
 

RedAlert

Senior In-Game Staff
Tribal Wars Team
Senior
Team
Script Moderator
Reaction score
622
Script Loader Updated!

Update your quick-bar script with the new script loader.
 
Top