Farming script?

koa anubis

Guest
Greetings all.. Decided i would try some farming scripts instead of TwStat/Mapping.

Does anyone know a way to edit this script to not enter random co-ords but instead follow the list of co-ordinates i have already entered...

Otherwise there is no point in randomly farming villages, when you have just cleared it of resources anyway... Just wastes valuable farming time!
Ty to anyone that can help.. Would be appreciated...

Code:
javascript:function%20end(){c='332|840 333|839 333|838 335|843 337|838 337|839 338|839 339|841 337|843 337|844 337|846 331|846 329|844 329|840 328|840 328|839 ';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=0;d.forms[0].light.value=33;d.forms[0].heavy.value=0;d.forms[0].ram.value=0;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();

Regards,
Anubis
 

DeletedUser62440

Guest
So you want it to be ordered, here you go:

Code:
javascript:var[sp,sw,ax,ar,scout,lc,mount,hv,cat,ra,pal,no]=[0,0,0,0,0,33,0,0,0,0,0,0];coords='332|840 333|839 333|838 335|843 337|838 337|839 338|839 339|841 337|843 337|844 337|846 331|846 329|844 329|840 328|840 328|839';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;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%20Date(2009,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].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);insertUnit(doc.forms[0].snob,no);insertUnit(doc.forms[0].knight,pal);end();
 

DeletedUser

Guest
I do not think there is a Non-PA that does sequential fakes, is there?
 

DeletedUser62440

Guest
It's possible to make one though I haven't seen one around :(
 

2004 Artemis

Guest
Here's one that was made for me a few months ago. I believe it's also buried on page 30 something of the fakes thread. It's for a nonarcher world, but it would be easy to edit.

Code:
javascript:var units=[0,0,0,1,0,0,1,0];coords='Coordinates Here';function insertUnit(input, count){if(input.value != count){input.value=count;}else{input.value='';}}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=0;farmcookie=doc.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(2009,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,units[0]);insertUnit(doc.forms[0].sword,units[1]);insertUnit(doc.forms[0].axe,units[2]);insertUnit(doc.forms[0].spy,units[3]);insertUnit(doc.forms[0].light,units[4]);insertUnit(doc.forms[0].heavy,units[5]);insertUnit(doc.forms[0].ram,units[6]);insertUnit(doc.forms[0].catapult,units[7]);end();
 

crackdown

Guest
Multiple Vills

Can you set it to work on multiple villages?

Thanks
 

DeletedUser

Guest
I know this is a long shot, but suppose one have 50 villages? How does one farm then, or is it an impossibility? Wouldn'tyou run out of QB room?
 

2004 Artemis

Guest
Not everyone uses a separate script for each village with which they farm. I certainly don't. If you do wish to do that, you can always use bookmarks, or don't use a name for the group instead using a symbol which will drastically reduce the used quickbar space.
 

DeletedUser

Guest
Not everyone uses a separate script for each village with which they farm. I certainly don't. If you do wish to do that, you can always use bookmarks, or don't use a name for the group instead using a symbol which will drastically reduce the used quickbar space.

Then how do you farm? You have a script for a large cluster?
 

DeletedUser

Guest
Then how do you farm? You have a script for a large cluster?

I try to do a script per section... 9 scripts per k. Although if you farm both offensive and defensive villages you'll need a script for each.
 

DeletedUser

Guest
How do you round up all the village coordinates of a section? One section has > 900 coordinates.
 

DeletedUser

Guest
Blood angels farm finder. I use the point in the center of the section and the radius of a section with maybe a little overlap.

This is why if a farm script could choose the closest unused coordinate it would help me greatly.
 

2004 Artemis

Guest
I personally use a mix of notebook farming and the SRE depending upon how diligent I'm feeling.
 

DeletedUser16995

Guest
Easiest way to enter all troops is to add this at the end of a script: selectAllUnits(true)

If you then do not want rams and cats, you add this afterwards: insertUnit(doc.forms[0].ram,0); insertUnit(doc.forms[0].cat,0)
 

DeletedUser

Guest
Easiest way to enter all troops is to add this at the end of a script: selectAllUnits(true)

If you then do not want rams and cats, you add this afterwards: insertUnit(doc.forms[0].ram,0); insertUnit(doc.forms[0].cat,0)
Personally I would rather use a home-made one tbh.
I use a loop,
Code:
var inputs = doc.getElementsByTagName("input");
for( var i=0; i<inputs.length-5; i++ ) {
   inputs[i].value = inputs[i].getNext().innerHTML.match(/[1-9]\d*/);
}
The -5 in that code removes the 'Attack', 'Support', x and y coord boxes and the fifth element is the Noble input box, so if you used -6 it won't enter cats and so on.

But for ease of use I would probably just throw in the inbuilt function you mentioned, but its not that great really..
 

DeletedUser

Guest
This was my first time trying out scripts, so I used a couple that are in this post to come up with what I wanted it to do.

The only problem is that the coords do not start at the beginning of the sequence, but in a random place. They DO go in sequence after that; however, that defeats the purpose of the alert('last village').

What am I missing to do that? I think it would go right before coords=, I don't know I'm new at this.

Code:
javascript:var[sp,sw,ax,ar,scout,lc,mount,hv,cat,ra,pal,no]=[0,0,900,0,0,0,0,0,0,0,0,0];function insertUnit(input,count){if(input.value = count){input.value=count;}else{input.value='';}}coords='236|436 237|434 237|436 235|436 234|435';var%20doc=document;if(window.frames.length>0)doc=window.main.document;url=document.URL;if(url.indexOf('screen=place')==-1);coords=coords.split("%20");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%20Date(2009,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].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);insertUnit(doc.forms[0].snob,no);insertUnit(doc.forms[0].knight,pal);end();
 

DeletedUser

Guest
Is there a way to have a script farm normally with light=200, but if light<200, then it adds in heavy=200?

I tried adding this but it doesn't seem to work:
if (light!=0)doc.forms[0].heavy.value = 200;else doc.forms[0].light.value = 200;
 

DeletedUser

Guest
@Tarlin

the script saves your place in a cookie, so you can pick up where you left off as the troops return home. there is a cookie clearing script you can use between runs if you want it to start at the beginning again.

Code:
javascript:document.cookie="farm=0";void 0;
 
Top