Soft Stuff
Guest
Is their an OD calculator anywhere on a website that TW uses
ok thnaks
Anyone seen an OD calculator if not then is it possible to make
Ofcourse is it possible to make. If I found one I shall post it here.
You can request it at TWTamer and maybe they shall make one.
I dont know how
Could you request?
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);
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.
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.
yeah a ODD one would be good as well.
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);