OD calculator

Soft Stuff

Guest
Is their an OD calculator anywhere on a website that TW uses
 

DeletedUser

Guest
Never seen it, but you can calculate it yourself.

The ODD and ODA Points :


Troop Type : when attacking / when defending

Spear: 4 / 1

Sword: 5 / 2

Axe: 1 / 4

Archer: 5 / 2

Scout: 1 / 2

Light Cavalry: 5 / 13

Mounted Archer: 6 / 12

Heavy Cavalry 23 / 15

Ram: 4 / 8

Catapult: 12 / 10

Paladin: 40 / 20

Nobleman: 200 / 200


I hope this help you a bit. :icon_wink:
 
Upvote 0

DeletedUser

Guest
CORaven is going to make a js one that can be run from a report to tell you how much ODA you gained
 
Upvote 0

DeletedUser

Guest
Code:
javascript:var doc=(window.frames.length>0)?window.main.document:document;table="";qu=doc.getElementsByTagName('td');ths=doc.getElementsByTagName('th');for(i=0;i<ths.length&&table=="";i++){if(ths[i].innerHTML=='Defender:'){table=ths[i].parentNode.parentNode;for(j=0;j<qu.length;j++){if(qu[j].innerHTML=='Quantity:'){the=qu[j].parentNode;}if(qu[j].innerHTML=='Losses:'){them=qu[j].parentNode;}}}}Quantity=the.innerHTML.match(/\d+/g);losses=them.innerHTML.match(/\d+/g);if(losses.length==12){Sp=losses[0]*(4);Sw=losses[1]*(5);Ax=losses[2]*(1);Ar=losses[3]*(5);Sc=losses[4]*(1);Lc=losses[5]*(5);Ma=losses[6]*(6);Hc=losses[7]*(23);Ra=losses[8]*(4);Ca=losses[9]*(12);Pa=losses[10]*(40);No=losses[11]*(200);total=(Sp+Sw+Ax+Ar+Sc+Lc+Ma+Hc+Ra+Ca+Pa+No);}else if (losses.length==9){Sp=losses[0]*(4);Sw=losses[1]*(5);Ax=losses[2]*(1);Sc=losses[3]*(1);Lc=losses[4]*(5);Hc=losses[5]*(23);Ra=losses[6]*(4);Ca=losses[7]*(12);No=losses[8]*(200);total=Sp+Sw+Ax+Sc+Lc+Hc+Ra+Ca+No;}else if (losses.length==10){Sp=losses[0]*(4);Sw=losses[1]*(5);Ax=losses[2]*(1);Sc=losses[3]*(1);Lc=losses[4]*(5);Hc=losses[5]*(23);Ra=losses[6]*(4);Ca=losses[7]*(12);Pa=losses[8]*(40);No=losses[9]*(200);total=Sp+Sw+Ax+Sc+Lc+Hc+Ra+Ca+Pa+No;}else if (losses.length==11){Sp=losses[0]*(4);Sw=losses[1]*(5);Ax=losses[2]*(1);Ar=losses[3]*(5);Sc=losses[4]*(1);Lc=losses[5]*(5);Ma=losses[6]*(6);Hc=losses[7]*(23);Ra=losses[8]*(4);Ca=losses[9]*(12);No=losses[10]*(200);total=Sp+Sw+Ax+Ar+Sc+Lc+Ma+Hc+Ra+Ca+No;}alert(total);

Above calculates ODA produced from a report.
Much cred to Fluffy88
Should work in all worlds.
 
Upvote 0

DeletedUser

Guest
possibly.
yes

By possibly, I mean that it does no actions in no clicks. There is no reason why is should be not legal.
 
Upvote 0

DeletedUser

Guest
doesn't look like a very eloquently written script through a simple pass thorough, but it also obviously does nothing more than reading the page w/o modifying anything.
 
Upvote 0

Soft Stuff

Guest
doesn't look like a very eloquently written script through a simple pass thorough, but it also obviously does nothing more than reading the page w/o modifying anything.

yes all it does it calculator ODA gained so its legal and i have bookmarked as i dont have premium
 
Upvote 0

DeletedUser43974

Guest
Does this calculate ODD as well?

If not could anyone help me make one?

Thnaks
 
Upvote 0

07041989

Guest
Im not sure this works correctly, if you click the link whilst on a report where all of your troops have died it still brings back a value.
 
Upvote 0

DeletedUser

Guest
Im not sure this works correctly, if you click the link whilst on a report where all of your troops have died it still brings back a value.

you still get oda, it just takes longer for it to register on a red report.

I believe they did this intentionally to keep people from calculating peoples remaining troop based on ODA change.
 
Upvote 0

DeletedUser

Guest
Code:
javascript:
	var doc=(window.frames.length>0)?window.main.document:document;
	
	attTable = doc.getElement("th:contains('Attacker:')").getParent('table');
	defTable = doc.getElement("th:contains('Defender:')").getParent('table');
	
	attLosses = attTable.getElement('table').getElement("td:contains('Losses:')").getParent();
	if (defTable.getElement('table') != null) {
		defLosses = defTable.getElement('table').getElement("td:contains('Losses:')").getParent();
		dl = defLosses.innerHTML.match(/\d+/g);
		}
	else {
		dl = new Array();
		}
	al = attLosses.innerHTML.match(/\d+/g);

	switch(al.length) {
		case 9:
			oda = dl[0]*4+dl[1]*5+dl[2]*1+dl[3]*1+dl[4]*5+dl[5]*23+dl[6]*4+dl[7]*200;
			odd = al[0]*1+al[1]*2+al[2]*4+al[3]*2+al[4]*13+al[5]*15+al[6]*8+al[7]*200;
			break;
		case 10:
			oda = dl[0]*4+dl[1]*5+dl[2]*1+dl[3]*1+dl[4]*5+dl[5]*23+dl[6]*4+dl[7]*12+dl[8]*200;
			odd = al[0]*1+al[1]*2+al[2]*4+al[3]*2+al[4]*13+al[5]*15+al[6]*8+al[7]*10+al[8]*200;
			break;
		case 11:
			oda = dl[0]*4+dl[1]*5+dl[2]*1+dl[3]*5+dl[4]*1+dl[5]*5+dl[6]*6+dl[7]*23+dl[8]*4+dl[9]*12+dl[10]*200;
			odd = al[0]*1+al[1]*2+al[2]*4+al[3]*2+al[4]*2+al[5]*13+al[6]*12+al[7]*15+al[8]*8+al[9]*10+al[10]*200;
			break;
		case 12:
			oda = dl[0]*4+dl[1]*5+dl[2]*1+dl[3]*5+dl[4]*1+dl[5]*5+dl[6]*6+dl[7]*23+dl[8]*4+dl[9]*12+dl[10]*40+dl[11]*200;
			odd = al[0]*1+al[1]*2+al[2]*4+al[3]*2+al[4]*2+al[5]*13+al[6]*12+al[7]*15+al[8]*8+al[9]*10+al[10]*20+al[11]*200;
			break;
		}
	od=oda+odd;
	alert("Total OD gained from battle: " + od + "\n\nODA: " + oda + "\n\nODD: " + odd);

much cred to Fluffy
 
Upvote 0
Top