javascript:var radius=0.0;var barb_size={min:0,max:0};var village_size={min:0,max:500};function fnFindFarms(){var url=window.location.href;if(url.match(/screen\=map/i)){var home=$("title").html().match(/(\d+)\|(\d+)/);var coords=[];$("table[class=map] td:has(a[onmouseover*=Map.map_popup])").each(function(i,e){var params=e.innerHTML.match(/map_popup\((.*?)\)\"/i);if(params){var paramsplit=params[0].split(/,/);var points=parseInt(paramsplit[4],10);var village=String(paramsplit[1].match(/\d+\|\d+/));var owner=(owner=paramsplit[5].match(/\'(.+)\s\(/))?owner[1]:null;var tribe=(tribe=paramsplit[6].match(/\'(.+)\s\(/))?tribe[1]:null;if(owner){if((!village_size.min||(points>=village_size.min))&&(!village_size.max||(points<=village_size.max))){coords.push(village);}}else{if((!barb_size.min||(points>=barb_size.min))&&(!barb_size.max||(points<=barb_size.max))){coords.push(village);}}}});coords=coords.filter(function(item,index,arr){return(index===arr.lastIndexOf(item));});if(radius>0.0){coords=coords.filter(function(item,index,arr){var aa=item.split("|");return(Math.sqrt(Math.pow(home[1]-aa[0],2)+Math.pow(home[2]-aa[1],2))<=radius);});}coords=coords.sort(function(a,b){var aa=a.split("|");bb=b.split("|");return(Math.sqrt(Math.pow(home[1]-aa[0],2)+Math.pow(home[2]-aa[1],2))-Math.sqrt(Math.pow(home[1]-bb[0],2)+Math.pow(home[2]-bb[1],2)));});alert((coords.length>0)?coords.join(" "):"No villages match the Criteria");}else{alert("Run this script from the Map.\nRedirecting now...");self.location="/game.php?"+url.match(/village\=\d+/i)+"&"+String(url.match(/[\&\?]t\=\d+/i)).replace(/[\?\&]/,"")+"&screen=map";}void(0);}fnFindFarms();