RedAlert

Senior In-Game Staff
Tribal Wars Team
Senior
Team
Script Moderator
Reaction score
608
Author
RedAlert
Contributors
N/A
Quickbar Entry
javascript:$.getScript('https://twscripts.dev/scripts/singleVillageSnipe.js');
Public?
Public
Single Village Snipe

single-village-snipe.png

Script needs to be run on this screen:
/game.php?screen=info_village&id=XXXX

Demo Video:

If you have an incoming and/or your own command landing on the current opened village, click on the command/incoming and landing time field will be updated to match the landing time of the command/incoming.

If you have any issues with the script, found a bug, or have some suggestion feel free to reply on this thread.
 
Changelog
-> v1.8.0 (2022-05-10) https://forum.tribalwars.net/index.php?threads/single-village-snipe.286731/post-7151444
-> v1.7.0 (2022-02-03) https://forum.tribalwars.net/index.php?threads/single-village-snipe.286731/post-7146917
-> v1.6.0 (2021-12-30): https://forum.tribalwars.net/index.php?threads/single-village-snipe.286731/post-7145234
-> v1.4.0 (2021-08-25): https://forum.tribalwars.net/index.php?threads/single-village-snipe.286731/post-7142703
-> v2.0.0 (2022-12-12): https://forum.tribalwars.net/index.php?threads/single-village-snipe.286731/post-7154518
-> v2.1.0 (2023-02-08): https://forum.tribalwars.net/index.php?threads/single-village-snipe.286731/post-7155136

===> 05/04/2021 (v.1.2.0)
Added export and import configurations capability

===> 23/03/2021 (v1.1.4)
Converted group filtering from buttons to select dropdown.
Added a new field "Min. Amount" (with a default value of 50, units).

===> 28/02/2021 (v1.1.0)
Added support for sigil snipe
Added destination village field allowing the player to enter custom village coordinates
Last edited:
Upvote 2

RedAlert

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

1630096607058.png

On this new script version I added a way for the player to clear the chosen group.

The script saves in browser memory the last group the player had chosen. However, it happened that players deleted those groups and that created an issue with the script since it could not fetch data when it initially loaded.

The new button "Reset Chosen Group" solves this problem by clearing the script memory.
 

RedAlert

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

Changelog:

- improved way how changing groups worked (when you change groups you can keep working no need to reload the page and restart script it works automatically)
- added more debug options on the script since I noticed people had issues (especially when it came to groups)

There where no UI changes made on this script update.
 

RedAlert

Senior In-Game Staff
Tribal Wars Team
Senior
Team
Script Moderator
Reaction score
608
Script has been updated to v1.7.0

1643901973283.png


There is no UI change that was done on this script update.

Changelog:
- When "Calculate Launch Times" is clicked the chosen units are saved in localStorage. So when you run the script again you will have selected the units you last chose.

Small QoL improvement.

Feel free to suggest ideas on how to make the script better.
 

RedAlert

Senior In-Game Staff
Tribal Wars Team
Senior
Team
Script Moderator
Reaction score
608
Script is updated to v1.8.0

IMG_20220510_175928.jpg

Added support for the mobile app.

If you have any issues with the script, found a bug, or have some suggestion feel free to reply on this thread.

Credits to @IIIII III since he suggested working on this and prepared some code samples that I utilized.
 
Last edited:

.MAXIMUS.

Well-Known Member
Reaction score
18
You have done an awesome job again and we all appreciate it.

There is just one small bug on the mobile version. When choosing Paladin or Noble, it finds nothing.
The exact same inputs (coords, groups or all) works perfectly on the desktop version but not on the mobile one.

Later edit:
Since Sunday it doesn't work at all on mobile, just on the desktop.
 
Last edited:

.MAXIMUS.

Well-Known Member
Reaction score
18
*Bump.

Ever since that mobile app support was added, the script is still broken for tablets and smartphone browsers, both in the mobile and also browser version. :(
 

RedAlert

Senior In-Game Staff
Tribal Wars Team
Senior
Team
Script Moderator
Reaction score
608
Hello @.MAXIMUS. ,

Thank you for bringing this issue up.

I will investigate it and see whats happening.
 

TuRBo-x

Active Member
Reaction score
13
I found a problem " when I click on the train needs sniping the time for sniping becomes 1 sec earlier"
Can you fix that.
 

RedAlert

Senior In-Game Staff
Tribal Wars Team
Senior
Team
Script Moderator
Reaction score
608
I found a problem " when I click on the train needs sniping the time for sniping becomes 1 sec earlier"
Can you fix that.
Thank you for reporting this issue.

This is an known issue that I have personally replicated while using the script multiple times.

I will have to investigate if its fixable though and if it is fixable, it will be fixed on a future script update.

Thank you again for reporting this issue.
 

Warkriget

New Member
Reaction score
0
I think this script stopped working, worked fine 1 week ago :/ When selecting a time I want to snipe, it gives me a message "no possible snipe options found", when there are villages close enough to snipe.
EDIT: NEVER MIND xd, I disabled some things in game settings that might have created some bug, enabling the game settings made the script work again :)
 
Last edited:

sirron

New Member
Reaction score
0
I think this script stopped working, worked fine 1 week ago :/ When selecting a time I want to snipe, it gives me a message "no possible snipe options found", when there are villages close enough to snipe.
EDIT: NEVER MIND xd, I disabled some things in game settings that might have created some bug, enabling the game settings made the script work again :)
What game settings did you change? Click the time inputs the incorrect time for me.
 

RedAlert

Senior In-Game Staff
Tribal Wars Team
Senior
Team
Script Moderator
Reaction score
608
I think this script stopped working, worked fine 1 week ago :/ When selecting a time I want to snipe, it gives me a message "no possible snipe options found", when there are villages close enough to snipe.
EDIT: NEVER MIND xd, I disabled some things in game settings that might have created some bug, enabling the game settings made the script work again :)
Hello,

Sorry for the very late answer :(

Your reply got lost from the other stuff I have been checking.

I have not changed anything on the script recently so I suspect whatever might have gone wrong could be related with bad data saved on the browser.

I would recommend trying with another browser and see if the script works fine there, or you could also try with the same browser, but on incognito mode.

If the script works fine there, then it means you need to reset the script configuration.

Added a new button on the script:

1668803456258.png

Reset Script, when you click that it should delete all the data that the script has saved in localStorage.

In theory, it should eliminate all possible issues.

Let me know if this solves the issue you have or not.
 

WILLPOWER

Non-stop Poster
Reaction score
231
Hello!

javascript:$.getScript('https://twscripts.dev/scripts/singleVillagePlanner.js');
This script is from your Scripts Pack and it is always gives +2 seconds to the Landing Time (2 sec late)
While the topic's script (singleVillageSnipe) is the same but it varies between +2 and +3.
Does something off at my end?

PS: I just saw the same thing being mentioned above, I'm sorry. So I tried Chrome and Edge, in incognito as well and used the Reset Script option, but the issue remained the same.
 
Last edited:

RedAlert

Senior In-Game Staff
Tribal Wars Team
Senior
Team
Script Moderator
Reaction score
608
Hello!

javascript:$.getScript('https://twscripts.dev/scripts/singleVillagePlanner.js');
This script is from your Scripts Pack and it is always gives +2 seconds to the Landing Time (2 sec late)
While the topic's script (singleVillageSnipe) is the same but it varies between +2 and +3.
Does something off at my end?
Thanks for reporting the issue.

I haven't experienced this issue on either of the scripts.

Since we are here on the Single Village Snipe script, I will only cover support for that script. Not the other.

First of all, let's see if reverting the script to default settings solves the issue.

1670110512291.png

You can revert the script to default settings by clicking Reset Script.

Click that button, the page will be reloaded and than re-run the script.

If you experience the same issue again very likely the issue is not related with the saved data but some sort of time based error in calculations.

If the issue persists then I will need you to provide some more details.

Prepare a plan using the TW Stats Attack Planner then prepare the same plan but using the script so I can see the time difference in launch times.
 

RedAlert

Senior In-Game Staff
Tribal Wars Team
Senior
Team
Script Moderator
Reaction score
608
Script updated to v2.0.0

1670801021716.png

No UI change was introduced on this script update.


The change constitutes on saving some more data into localStorage whenever Calculate Launch Times button is used.

So when you click that button all the user input (destination village, landing time, sigil, min amount, group, chosen units, etc) are collected and saved in localStorage. So next time you run the script those values will be pre-filled.

Some of the saved data are global, like for example the chosen units and group are globally saved. So no matter on which village you run the script, those inputs will always be pre-filled the same way.

The landing time, sigil and min amount instead are village specific, for obvious reasons. So on different villages you might have different sigil amounts and different landing times and if you run the script again on those villages then this values will be pre-filled.

If instead, you run the script on a village where you haven't saved any info on localStorage, these values will be pre-filled with default values.

Hope you find this update helpful.
 

RedAlert

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

1675889917836.png


This script updates introduces a new functionality to export a command so it can be imported into an attack plan tool on DS Ultimate.

The command details get copied into clipboard so the only thing you need to do is to open an attack plan or create a new attack plan on DS Ultimate, on the world where you are playing.

Open the world you are playing, go to Tools then Attack Planner, then Import/Export tab and on this field:

1675885850919.png

paste the exported command data and click Import.

The code regarding this feature was contributed by @secundum .
 
Last edited:

Escudo de Espinho

New Member
Reaction score
2
Hi @misteralb ! I appreciate your work!

The script works even if I'm not at the same timezone (thank you).

I did a translation for pt_BR:


JavaScript:
pt_BR: {
    'Single Village Snipe': 'Snip de Aldeia Única',
    Help: 'Ajuda',
    'This script can only be run on a single village screen!':
      'Este script só pode ser executado em uma única tela de aldeia!',
    'Landing Time': 'Hora de chegada',
    'Calculate Launch Times': 'Calcular horários de lançamento',
    'Export as BB Code': ' Exportar como código BB',
    'Landing time was updated!': 'A hora de chegada foi atualizada!',
    'Plan for:': 'Plano para:',
    'Landing Time:': 'Chegada:',
    Unit: 'Unidade',
    From: 'Origem',
    'Launch Time': 'Hora do lançamento',
    Command: 'Comando',
    Status: 'Estado',
    Send: 'Enviar',
    'Error fetching village groups!':
      'Erro a carregar os grupos de aldeias!',
    'Choose Units to Snipe': 'Escolha as unidades para o Snipe',
    Group: 'Grupo',
    'No possible snipe options found!':
      'Nenhuma opção possível de ataque encontrado!',
    Distance: 'Distância',
    'An error occured while fetching troop counts!':
      'Ocorreu um erro ao recolher as contagens das tropas!',
    'snipe attempts found': 'tentativas de snipe encontradas',
    'Nothing to export!': 'Nada para exportar!',
    'Target:': ' Alvo:',
    'Send in': 'Enviar em',
    'Destination Village': 'Aldeia de Destino',
    Sigil: 'Aflição',
    'Min. Amount': 'Min. quantidade',
    'Export Config': 'Exportar Config',
    'Import Config': 'Importar Config',
    'Configuration imported successfully!':
      'Configuração importada com sucesso!',
    'Nothing to import!': 'Nada para importar!',
    'There was an error fetching villages by group!':
      'Houve um erro ao importar as vilas por grupo!',
    'Reset Chosen Group': 'Reiniciar grupo escolhido',
    'Chosen group was reset!': 'Grupo escolhido foi reiniciado!',
    'There was an error!': 'Houve um erro!',
    'Configuration has been copied!': 'Configuração foi copiada!',
    'BBCode have been copied!': 'BBCode foi copiado!',
    'This script requires Premium Account!':
      'Este script requer uma conta premium!',
    'Reset Script': 'Reiniciar Script',
    'Script configuration has been reset!':
      'Configuração do Script foi reiniciada!',
    'Send in:': 'Enviar Em:',
    WB: 'WB',
    'Copied Command successfully': 'Comando copiado com sucesso',
    'today at': 'hoje às',
    'tomorrow at': 'amanhã às',
    'on': 'em',
  },

Sigil would be 'Sinal' but I found it more clear to use 'Aflição' ( Distress ) as I never heard someone using the word 'Sinal' (Sigil) for it in pt_BR. But feel free to change.

Thank you again!
 

Warkriget

New Member
Reaction score
0
I have some issues with the script on .net, the script works but when I select the attack that I want to snipe it does not fill in the information. Could it be because of the summertime change?

/W


1679995912272.png
 
Top