Tribal Wars, Tribal Wars Guide, Tribal Wars Guides, Tribal Wars Strategy,TW, Guides, Troops
Tribal_Wars_Wikipedia

Fake Scripts [Instructions and code]

Preface: These fake scripts are written for worlds with archers and paladin enabled. They may need to be edited if you intend to use them on a world that has no archers or no paladin.

In most cases, fake scripts should include 1 scout, as you will be able to get quick & nasty scout reports against players who do not know how to use a white screen defense. (Hint: add at least 10 scouts to all your mass-recruit scripts)

Non-premium, random fakes. Instructions:
Does not require premium
Edit coordinates before using
Add script to a bookmark
Optional/Recommended: make the bookmark a button on your browser for easy access

Picks random coordinates from your list

javascript:function%20end(){c='111|111 222|222 333|333';var%20d=document;if(window.frames.length>0)d=window.main.document;url=d.URL;if(url.indexOf('screen=place')==-1)alert('This%20script%20needs%20to%20be%20run%20from%20the%20rally%20point');a=c.match(/(\d+\|\d+)/g);b=a[Math.round(Math.random()*(a.length-1))].split("|");d.forms[0].x.value=b[0];d.forms[0].y.value=b[1];d.forms[0].spear.value=0;d.forms[0].sword.value=0;d.forms[0].axe.value=0;d.forms[0].spy.value=1;d.forms[0].light.value=0;d.forms[0].heavy.value=0;d.forms[0].ram.value=1;d.forms[0].catapult.value=0;d.forms[0].snob.value=0;d.forms[0].archer.value=0;d.forms[0].marcher.value=0;d.forms[0].knight.value=0;}end();

---

Premium, random fakes. Instructions:
Requires premium
Edit coordinates before using

Picks random coordinates from your list

javascript:coords='111|111 222|222 333|333';var%20doc=document;if(window.frames.length>0)doc=window.main.document;url=document.URL;if(url.indexOf('screen=place')==-1)alert('This%20script%20needs%20to%20be%20run%20from%20the%20rally%20point');coords=coords.split("%20");index=Math.round(Math.random()*(coords.length-1));coords=coords[index];coords=coords.split("|");doc.forms[0].x.value=coords[0];doc.forms[0].y.value=coords[1];insertUnit(doc.forms[0].spear,0);insertUnit(doc.forms[0].sword,0);insertUnit(doc.forms[0].axe,0);insertUnit(doc.forms[0].archer,0);insertUnit(doc.forms[0].spy,1);insertUnit(doc.forms[0].light,0);insertUnit(doc.forms[0].marcher,0);insertUnit(doc.forms[0].heavy,0);insertUnit(doc.forms[0].ram,1);insertUnit(doc.forms[0].catapult,0);insertUnit(doc.forms[0].knight,0);insertUnit(doc.forms[0].snob,0);end();

---

Fake trains. Instructions:
Requires premium
Edit coordinates before using
This will send 4 attacks to each village, allowing you to quickly send fake trains to multiple targets.

Goes through coordinates from beginning to end. Lets you know when it reaches the end.

javascript:var[sp,sw,ax,ar,scout,lc,mount,hv,cat,ra]=[0,0,0,0,1,0,0,0,0,1];coords='111|111 222|222 333|333';var%20doc=document;if(window.frames.length>0)doc=window.main.document;url=document.URL;if(url.indexOf('screen=place')==-1)alert('This%20script%20needs%20to%20be%20run%20from%20the%20rally%20point');coords=coords.split("%20");index=0;counter=1;traincookie=document.cookie.match('(^|;) ?train=([^;]*)(;|$)');countcookie=document.cookie.match('(^|;) ?count=([^;]*)(;|$)');if(traincookie!=null)index=parseInt(traincookie[2]);if(countcookie!=null)counter=parseInt(countcookie[2]);if(index>=coords.length)alert('last village');if(index>=coords.length)index=0;coords=coords[index];coords=coords.split("|");counter=counter+1;if(counter==5)index=index+1;if(counter==5)counter=1;cookie_date=new%20Date(2009,11,11);document.cookie ="train="+index+";expires="+cookie_date.toGMTString ();;cookie_date=new%20Date(2009,11,11);document.cookie ="count="+counter+";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].archer,ar);insertUnit(doc.forms[0].spy,scout);insertUnit(doc.forms[0].light,lc);insertUnit(doc.forms[0].marcher,mount);insertUnit(doc.forms[0].heavy,hv);insertUnit(doc.forms[0].ram,ra);insertUnit(doc.forms[0].catapult,cat);end();

---

Sequential fakes. Instructions:
Requires premium
Edit coordinates before using
This will send attacks to each village in a sequential order, meaning that it won't send a fake to the same coordinates more than once, unless you reach the end of the script and it starts going through the coordinates again

Warnings:
cookieName="Fake" - This needs to be edited if you have more than one of these scripts on your quickbar. Do not put a space in this variable, or the script will not work.
Date(2009,11,11) - This script expires after this date. You will need to edit the date after it has expired.


Goes through coordinates from beginning to end. Does not let you know when it reaches the end.

javascript: var cookieName="Fake"; var sp=0; var sw=0; var ax=0; var scout=1; var lc=0; var hv=0; var cat=0; var ra=1; var coords='111|111 222|222 333|333'; var doc=document; if(window.frames.length>0)doc=window.main.document; var url=doc.URL; if(url.search(/screen=place/)!= -1 && doc.forms[0].x.value==="" && doc.forms[0].y.value==="") { if(window.frames.length>0) { doc=window.main.doc; } url=doc.URL; if(url.indexOf('screen=place')==-1) { alert('This script needs to be run from the rally point'); } coords=coords.split(" "); var index=0; farmcookie=doc.cookie.match('(^|;) ?'+ cookieName +'=([^;]*)(;|$)'); if(farmcookie!=null) { index=parseInt(farmcookie[2]); } if(index>=coords.length) { index=0; } coords=coords[index];coords=coords.split("|"); index=index+1; cookie_date=new Date(2009,11,11); doc.cookie =cookieName+"="+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();

Fake Script Generator

Entry name: Get Coords
Image-URL: http://img196.imageshack.us/img196/2435/scripticon.gif
Target-URL: javascript:var D=document;if(window.frames.length>0)D=window.main.document;url=D.URL;if(url.indexOf('screen=info_player')==-1){alert('Goto Player Information 1st!');end();}var tds=D.getElementsByTagName("TD");var K=new Array();for(var idx=0;idx<100;idx++)K[idx]=new Array();var C=new Array();for(var idx=0;idx<tds.length;idx++){var xy=tds[idx].innerHTML;if(/^\d+\|\d+$/.test(xy)){C.push(xy);var xys=xy.split('|');K[Math.floor(parseInt(xys[0])/100)+Math.floor(parseInt(xys[1])/100)*10].push(xy);}}C=C.join(' ');var prefix='<textarea cols=80 rows=10>javascript:coords=\'';var postfix='\';var doc=document;if(window.frames.length>0)doc=window.main.document;url=doc.URL;if(url.indexOf(\'screen=place\')==-1)alert(\'This script needs to be run from the rally point\');coords=coords.split(\' \');index=Math.round(Math.random()*(coords.length-1));coords=coords[index];coords=coords.split(\'|\');doc.forms[0].x.value=coords[0];doc.forms[0].y.value=coords[1];insertUnit(doc.forms[0].ram,0);insertUnit(doc.forms[0].ram,1);void(0)</textarea><br><br>';var S='<b>TW Fake Script Generator v0.2</b><hr>Whole Villages:<br>'+prefix+C+postfix;for(var idx=0;idx<100;idx++)if(K[idx].length>0){var Ks=K[idx].join(' ');S+='<br><br>K'+idx+' Villages:<br>'+prefix+Ks+postfix;}var popup=window.open('about:blank','twfg','width=640,height=480,scrollbars=1');popup.document.open('text/html','replace');popup.document.write(S);popup.document.close();void(0)

---

Insert troops, custom!:

Requires premium
Just like a fake script, this will insert troop numbers. However it will not do anything to the coordinates, so if you have existing coordinates it won't replace them, and nor will it insert any coordinates if there are none.

I'm aware that there is an existing script on the externals which plugs in troops for you, however I find that script rather useless, as it can only insert the maximum numbers of any type of troop. You don't want to send all your scouts and all your rams in a nuke, you need some scouts to stay behind and act as a white screen, and some rams to stay behind for faking purposes. The script is derived from a fake script so it's a tad messy (I was lazy), but who cares, it gets the job done. Just edit the troop numbers to suit your nuke, nothing else is required.

javascript: var cookieName="Insert"; var sp=0; var sw=0; var ax=6000; var scout=7; var lc=2500; var ma=500; var hv=0; var cat=0; var ra=219; var coords=''; var doc=document; { if(window.frames.length>0) { doc=window.main.doc; } url=doc.URL; if(url.indexOf('screen=place')==-1) { alert('This script needs to be run from the rally point'); } 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].marcher,ma); insertUnit(doc.forms[0].heavy,hv); insertUnit(doc.forms[0].ram,ra); insertUnit(doc.forms[0].catapult,cat); } end();

Pure troops insertion script: This one has been cleaned up, it holds no cookies etc.

javascript:insertUnit(document.forms[0].spear,0); insertUnit(document.forms[0].sword,0); insertUnit(document.forms[0].axe,0); insertUnit(document.forms[0].spy,0); insertUnit(document.forms[0].light,0); insertUnit(document.forms[0].marcher,0); insertUnit(document.forms[0].heavy,0); insertUnit(document.forms[0].ram,1); insertUnit(document.forms[0].catapult,0);