Travian MarketPlace helper

By Ankur Saxena Last update Dec 5, 2006 — Installed 4,396 times. Daily Installs: 0, 1, 0, 0, 3, 0, 0, 5, 1, 1, 2, 0, 3, 0, 0, 3, 6, 0, 2, 2, 0, 0, 0, 3, 0, 1, 1, 1, 0, 1, 1

Archived Comments (locked)

Subscribe to Archived Comments 3 posts, 2 voices

Jesse Andrews Admin

The following is an archive of comments made before threaded discussions was implemented (November 16th, 2008)

 
Guy Fraser Scriptwright

Ok, I got carried away and made a completely new script which automatically populates the list of villages:

http://userscripts.org/scripts/show/9544

 
Guy Fraser Scriptwright

Hopefully this won't get mangled, but here is a new version of the function which just seems cleaner:

(function() {

// define cities (make sure there is no comma after the last "}" otherwise it will chimp)
var cities = [
{name:'village name',x:150,y:-150},
{name:'village name',x:149,y:-150},
{name:'village name',x:150,y:-153}
];

// get node to attach the select list to
var node = document.getElementsByName('y')[0];

// build the select list
var sel = "<select>";
var i = cities.length;
while (-1<--i>
//alert(cities[i].name);
sel += "<option>"+cities[i].name+"</option> ";
}
sel += "</select>";

// add the select box to the node
node.parentNode.parentNode.innerHTML += sel;
})();

Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel