Farmscript + döpa om byar v.26

Osfrid

New Member
Reaktionspoäng
0
Haloj!

Någon som sitter på ett farmscript till v.26?

Även glad om någon har ett script för att snabbt byta namn på ens byar.. :)

MVH
 

xouz

Member
Reaktionspoäng
0
Källkod:
javascript:/*@contributor Lekensteyn <lekensteyn@gmail.com> @version 0.4.20101108*/void(function(){var l=(frames.main||self).document,h=prompt("Rename villages\n\n*Fill in {#k} for continent.\n*Fill in {#x} for x-coordinate\n*fill in {#y} for y-coordinate\n*Fill in {#xxx} for x-coordinate (1 will be 001)\n*Fill in {#yyy} for y-coordinate (1 will be 001)\n*Fill in {#c} for co\xf6rdinates\n*Fill in {#old} for old village name\n*Fill in {#nr} for village numbering. Next you will be asked how many numbers should be displayed(4 will result in 0001, 0002, etc)\n*Fill in {#cd} for xx.xx.xx notation.", ""), g=$('a.rename-icon').get(),n=g.length,e=1;if(h)if(h.length<3)alert("Use at least 3 characters");else{var o=/((\d{1,3})\|(\d{1,3}))\) .(\d{1,2})$/,f=0,c,b,k,a,m=/{#nr}/.test(h),p=/{#cd}/.test(h),j=function(i){return i>9?i>99?i:"0"+i:"00"+i};if(m){var d=prompt("How many digits should be used? (an input of \"4\" will result in 0001, 0002, etc)\n\nNot filling this in will result in no leading zeros (1,2,3,4,5,6,7,etc)\nIf the number of the village exceeds the amount of specified digits, it will use the entire number (ie 4 digits, village #12345 will be 12345, not 2345)", "");if(d)d=d.match(/\d+/);if((d=d?d*1:0)&&(e=prompt("Begin numbering at:",e)))e=e.match(/\d+/);e=e?e*1:0;var q=-1*d,r=Array(d).join("0")}for(;f<n;f++){g[f].click();y=$('.quickedit-edit input').get();a=$.trim($(y[f]).closest(".quickedit-vn").find(".quickedit-content").find("a").first().text()).match(o);b=h.replace(/{#c}/g,a[1]).replace(/{#x}/g,a[2]).replace(/{#y}/g,a[3]).replace(/{#k}/g,a[4]).replace(/{#kk}/g,("0"+a[4]).substr(-2)).replace(/{#xxx}/g,j(a[2])).replace(/{#yyy}/g,j(a[3]));k=y[f].value;if(m){c=""+e++;if(d>c.length)c=(r+c).substr(q);b=b.replace(/{#nr}/g,c)}if(p){c=j(a[2]).split("");a=j(a[3]).split("");b=b.replace(/{#cd}/g,a[0]+c[0]+"."+a[1]+c[1]+"."+a[2]+c[2])}if(k!=""&&k!=b){y[f].value=b.replace(/{#old}/g,y[f].value)}y[f+1].click()}}})()
Källkod:
javascript:sp=0;sw=0;ax=0;scout=1;lc=3;hv=0;cat=0;ra=0;coords='511|440 508|441 510|443 509|439 512|440 511|439 512|442 511|443 512|439 508|443 510|438 510|444 513|441 507|442 513|439 507|443 506|440 511|445 506|442 507|438 513|438 506|439 508|445 514|439 515|441 506|444 509|446 511|446 505|443 512|446 514|437 514|445 505|438 505|444 510|435 504|441 516|441 504|440 509|447 516|443 506|436 515|445 514|446 504|444 517|441 505|436 515|446 517|442 504|437 517|439 507|434 503|444 513|448 517|444 504|436 504|446 516|446 518|442 517|445 506|448 502|443 508|449 512|449 513|449 503|436 506|449 501|439 516|448 501|443 508|450 519|439 502|436 518|446 505|449 501|444 513|450 501|445 506|450 517|448 518|447 504|449 516|449 500|440 500|439 500|443 501|446 505|450 519|446 518|448 517|449 500|436 518|449 501|448 519|448 501|449 519|449 518|450 501|450 519|450 500|450';var doc=document;if(window.frames.length>0)doc=window.main.document;url=document.URL;if(url.indexOf('screen=place')==-1)alert('This script needs to be run from the rally point');coords=coords.split(" ");index=0;farmcookie=document.cookie.match('(^|;) ?farm=([^;]*)(;|$)');if(farmcookie!=null)index=parseInt(farmcookie[2]);if(index>=coords.length)alert('last village');if(index>=coords.length)index=0;coords=coords[index];coords=coords.split("|");index=index+1;cookie_date=new Date(2199,11,11);document.cookie ="farm="+index+";expires="+cookie_date.toGMTString ();doc.forms[0].x.value=coords[0];doc.forms[0].y.value=coords[1];insertUnit(doc.forms[0].spear,sp);insertUnit(doc.forms[0].sword,sw);insertUnit(doc.forms[0].axe,ax);insertUnit(doc.forms[0].spy,scout);insertUnit(doc.forms[0].light,lc);insertUnit(doc.forms[0].heavy,hv);insertUnit(doc.forms[0].ram,ra);insertUnit(doc.forms[0].catapult,cat);end();
 
Topp