[private] Barb scouter


This script is two parts. I have a program that takes text from the /map/village.txt file available on the server and creates a string containing a list of barb villages in comma-separated format with "xxx|yyy". Then, I run this script on any page on us17x.tribalwars.us to save it into localStorage with a counter:


var barbList = window.prompt("Please enter World Village List data"); 
var barbCounter = window.prompt("Please enter desired counter position"); 

localStorage.setItem("barbList", barbList);
localStorage.setItem("barbCounter", barbCounter);

Then I run this script from the Rally Point (with all relevant info contained in the comment block):


This script only works at the Rally Point screen.

This script reads in a string, saved to localStorage by a separate, simple script, 
containing a comma-separated list of village coords in "xxx|yyy" format as well 
as a counter, takes the appropriate set of coordinates as given by the counter, 
and fills in the rally point with the appropriate village coordinates and 5 scouts.  
It then increments the counter and stores it for later use.

This way the village list can be updated programmatically without needing to 
adjust the quickbar script, with the current position within the list saved for easy 
stepping through the list.

var barbCounter = Number(localStorage.barbCounter);
var barbString = localStorage.barbList;
var barbArray = barbString.split(",");
var barb = barbArray[barbCounter].split("|");
localStorage.barbCounter = barbCounter + 1;

All the script really does is read a string value, parse it for a specific set of coordinates, and then fills in Rally Point inputs for coordinates and a single scout. Really, the only reason I'm asking for approval is because in my limited experience of using/studying TW scripts I have yet to see someone use localStorage, which I can't imagine would cause a problem but I feel like I should check.


Approved (all it does is fill in a form, which is automatically allowed, and it doesn't really have instructions for how to use it, so won't be publicizing it (would just confuse people)).

Sent him a PM letting him know it's OK.