DaWolf85

Non-stop Poster
Reaction score
583
Author
Fluffy88
Contributors
Superdog
DaWolf85
Quickbar Entry
javascript:
$.getScript('https://dl.dropboxusercontent.com/s/3edjw9gv5b06uo9/mass_sniper.js');
Public?
Public
This is an adaptation of the fluffy88 snipe script that seems to be very popular on the quickbars of players I sit.

This version will take multiple snipe targets at once, and output the results all together (as opposed to the original, which did targets one-by-one).

It is primarily intended for backline sniping, where you are primarily sniping trains for others, and is designed to be very quick to recalculate your snipes as new targets become apparent and snipe troops roll out, allowing players to spend more time sniping and less time fiddling with tools. Your tribe will also need some method of creating a list of necessary snipes. The design intent is to use a Sniping forum, as we did in Cicada, and copy the thread titles; however, you could also make a single forum thread with many needed snipes and copy-paste from there.

For examples of viable formats, please see this image. Every thread title in this image should parse correctly. As you can see, extraneous data is not usually a problem; missing data, however, can be much more difficult for the script to handle (see the spoiler if you need to understand what the bare minimum is). You will also notice the script handles sigils and friendship bonuses - this is a major reason we loved this script in Cicada.

If your tribe has a list of necessary snipes in a reasonable format, using the script is easy. Just go to your sniping group (or any appropriate group), run the script, paste in your list of snipes, check off all the troop types you want to snipe with, and click "Go". The script will usually take a few moments, and then the output will appear directly below your input, where you can copy-paste it into your notebook. Coordinates and times that parsed correctly will be shown in green; while coordinates that parsed correctly but did not have a land time associated will be shown in red. Input that was ignored will not be colored.

There are a couple options that will change how the script formats the output, but they should be self-explanatory. The script will also remember what you entered last time you ran it, so if you only need to refresh what villages have troops, you should only need to hit one button.

By a happy accident, the text input box will actually correctly format HTML. So, depending on how your browser captures copying a full page, you may be able to paste a page exactly as it appears. I actually find this slightly easier to read, and the script handles it perfectly fine, so I do not intend to remove that ability.

If there are any issues, here is how the script finds the land times, so you can understand what you are dealing with:
The script will search for three things in each line of text that it sees:

- Coordinates. The script will take the first coordinates it sees, and ignore further coordinates.
- A date. The script will accept dates in the following formats:
May 1, 2021 May 01, 2021 May 1, May 01, today at tomorrow at
- A time. The script will accept times in the following formats:
9:01:02 09:01:02 9:01:02:345 09:01:02:345 9:01:02.345 09:01:02.345
- The date and the time must be separated by at least one space.

Copy-pasting from the incomings page should work without any issue.

The script supports the Sigil of Distress item, and the tribal Friendship bonus. Simply place "Sigil" or "Friendship" on the same line of text as the village in question, and then the bonus amount followed by a percent symbol. For example, Sigil & Friendship 30% would parse correctly.

The "Adjust all times by this many hours" option does just that. It is meant for brief periods during Daylight Savings Time where the times the script is producing may not line up with the game. In that case, you can use this option. I'm sure there is some other weird use for the thing, but that's not the intent, so I can't guarantee other uses will remain supported.
 
Changelog
24 Mar 2021 - redesign UI
23 Apr 2021 - add option to adjust land hour (for DST shenanigans)
23 Apr 2021 - functional options: formatting and truncated output for notebook restrictions
23 Apr 2021 - functional options: hour adjustment, arrival times
23 Apr 2021 - save options to localstorage
23 Apr 2021 - fix bug where script would redirect to combined overview when already on it
29 Apr 2021 - regex check for coords (more robust)
29 Apr 2021 - shorten date output
1 May 2021 - regex check for dates/times (more robust)
3 May 2021 - slight edit to regex checks to make them more robust
4 May 2021 - add colors to snipe input, representing accepted/rejected input
4 May 2021 - move output to be underneath input
10 May 2021 - fix for parsing sigil/friendship item
29 Jan 2022 - update to support new 5k bracket limit
Last edited:
Upvote 7

DaWolf85

Non-stop Poster
Reaction score
583
Updated to include new options, a shiny new UI, and what I hope will be a speedier user experience. As Cicada has deleted from 112, this script will also now become public, as promised.
 

DaWolf85

Non-stop Poster
Reaction score
583
Updated again - should now parse dates and times more reliably and consistently. Also updated the main post to contain a reference on acceptable date and time formats.
 

DaWolf85

Non-stop Poster
Reaction score
583
Another quick upgrade, this time adding the ability to see what the script is reading in your input. When the script correctly parses a set of coordinates, a date, and a time, it will mark them in green. When it detects a set of coordinates, but no date or time to go with it, it will mark the coordinates in red. Ignored input will remain its usual color.

I also moved the output up nearer the top of the page, because it's just better that way.
 

DaWolf85

Non-stop Poster
Reaction score
583
Thanks to @=Bit Cloud= for reporting an issue where sigils and friendship items would break the script. This has now been resolved, and the red/green coloring has additionally been updated to include the percentage for the sigil. Only the percentage (not "Sigil" or "Friendship") will show in green if it is parsed correctly. However, the script will also mark in red any stray percentages that are not parsed, so this should be fairly clear nonetheless.

Additionally, the script should now support multiple sigil/friendship items on one line. Previously, you had to add the percentages together; now it will add them for you if you prefer to write the items separately.
 

DaWolf85

Non-stop Poster
Reaction score
583
Updated again to support the new 5000 bracket limit in the notebook. Using the 'limit output to notebook page length' option should now utilize the full capacity of the notebook.

I did not test this, because I don't have a good way to do so at the moment, but I see no reason why it shouldn't work. Please let me know if there are any issues.
 
Top