Posts by johnsonbryce on scripts

Subscribe to Discussions on your scripts 1 post

Jul 19, 2008

Travian: Village Manager 1.6: Archived Comments

I was having trouble keeping track of which contact/village I wanted to work with when I had multiple villages. So I decided to change your code to allow you to have a different list for each village. Here you go

....
//create unique suffix
var ownerId = getOwnerId();
var activeVillage = getActiveVillageId();
if (ownerId) suffix = server+'_'+ownerId+'_'+activeVillage;
else return;
.....

//retrieve current village id
function getActiveVillageId()
{
var z = dom.xs("//a[contains(@href,'newdid')][@class='active_vl']");
if (!z || z.snapshotLength == 0) return false;
aVillageID = z.textContent;
aVillageID = cleanStr(aVillageID);
return aVillageID;
}