Farming script?

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;
I second this.

You should change light!=0 should be light<200, I believe. Otherwise it will only work when you have exactly 0 lc.


There's also another problem: It only says you reached the last village when you're sending to the first coord in line already.
 
Last edited by a moderator:

DeletedUser

Guest
I have a problem with this. I really like some of these scripts but I can't find one that does them in order and works. The problem with the random ones is that they are not practical attacking the same village twice in 3 hours is a waste of time especially when you have 50 other coordinates lined up. I looked at some of the ones that say they do it in order but can't get them to work, it puts in the first vills coords and nothing else, btw I am a script noob so if anyone can help me I would really appreciate it.
 

DeletedUser62440

Guest
Check the date in the script that sets the cookie first
 

DeletedUser

Guest
Sorry I don't know what that means, could you or someone else please explain?
 

File Not Found

Guest
There will be somewhere in the script, that mentions a "cookie"

if you find that, it will also set a date by some means.

What you need to do, is check to see that the date that is being set, has not already passed.

If you still can't figure it out, PM it to me, and I will take a look.
 

DeletedUser

Guest
Thanks for the help guys, I am talking to one of the moderators and he is being very helpful so just a quick shout out to ICECO who has been really great, thanks.
 

DeletedUser

Guest
OK, here is what I try to use, but still get the "reached last village " any ideas? (obviously I had more coords in).
javascript:var[sp,sw,ax,ar,scout,lc,mount,hv,cat,ra,pal,no]=[0,0,0,0,4,0,0,0,0,0,0,0];coords='332|840';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(2011,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
you know that when it starts the farming sequence, it will begin with that message, right?

that is to say, the first time you use it, that message will be the first thing you see.
 

DeletedUser

Guest
you know that when it starts the farming sequence, it will begin with that message, right?

that is to say, the first time you use it, that message will be the first thing you see.
The thing is that it never jumps to the next coord I have in my script. It always says and stays the same.
can anyone see why it doesnt go to the next farm coord?
 

DeletedUser

Guest
Code:
javascript:function%20end(){c='225|610 224|612 226|612 229|611';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=150;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();

When I use this it sends to coordinates randomly and repeats a pair of coordinates.
What am I doing wrong
 

DeletedUser

Guest
Hey everyone,
Is there a script that will send different troops from each village as i have not go lc in my defencive village but i still want to farm with them. So is there a script that you can use for this?
Thanks
 

DeletedUser

Guest
[SPOIL]Nope actually

Code:
javascript:function%20end(){c='578|717';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=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();
This shoould work. Just edit

.value=0

to how ever many troops u want send on farming runs

Spear = spearmen
Sword= swordsmen
axe= axemen
spy=scout
light=light cav
heavy= heavy cav
ram=ram
cat=catapult
knight=Paladin
snob= Noble

New Units

marcher=mounted archer
archer=archer

Works for non-pap[/SPOIL]

Basically you edit the script so that it sends Spears or whatever to the edited co-ords.
 

DeletedUser

Guest
javascript:coords='446|499 447|497';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('(^|;) ?farm1=([^;]*)(;|$)');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(2099,11,11);document.cookie ="farm1="+index+";expires="+cookie_date.toGMTString ();doc.forms[0].x.value=coords[0];doc.forms[0].y.value=coords[1];Array.prototype.contains = function(obj) {var i, listed = false;for (i=0; i<this.length; i++) {if (this === obj) {listed = true;break;}}return listed;};function getGameDoc() {getdoc = window.document;if(! getdoc.URL.match('game\.php')) {for(var i=0; i<window.frames.length; i++) {if(window.frames.document.URL.match('game\.php')) {getdoc = window.frames.document;}}}return getdoc;};units = Array('spear','sword','axe','archer','spy','light','heavy','marcher','knight');doc = getGameDoc();form = doc.units;inputs = form.getElementsByTagName('input');for (var i=0; i<inputs.length; i++) {if (inputs.type == 'text') {if (units.contains(inputs.name)) {next = inputs.nextSibling;do {next = next.nextSibling;} while (next.nodeType != 1);s = next.firstChild.nodeValue;insertUnit(form.elements[inputs.name], next.firstChild.nodeValue.replace(/\(/g, "").replace(/\)/g, ""));}}}




will insert all troops you have in the vill except rams,cats and nobles just edit the co-ords to your farms
 

DeletedUser

Guest
Farming script

Hi,

Ive got this script and put in co-ords and changed date. The script works in the rally points but every second village it leaves out the LC...can someone tell me how to rectify it

javascript:var[sp,sw,ax,ar,scout,lc,mount,hv,cat,ra,pal,no]=[0,0,0,0,0,250,0,0,0,0,0,0];coords='789|574 788|573 787|573 786|573 786|571 789|571 790|571 788|569 789|569 790|569 791|569 789|568 790|568 783|571 784|568';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(2010,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();
 

File Not Found

Guest
Yes, I believe your problem is, that your clicking the script more than once without actually changing pages.

With the 'insertUnit(doc.forms[0].troop, variable)' method, the function insertUnit compares the number of troops your trying to put in, with the value in the box already, and if they match, it clears the box.

Either update to the method fluffy uses, or, actually send an attack, instead of just clicking through the script.
 

DeletedUser77700

Guest
Hey guys

Can somebody paste me the javascript for a farming script that inserts all troops into the village except any rams, cats and nobles.

Highly appreciated.

I've read through here and other places but nothing seems to be working for me.
 

busamad

Contributing Poster
Reaction score
34
How about this:

3 posts up

If it does not work then maybe more details world help.

Type of world
Browser
Why you think it does not work
Premium or not.
 
Top