Soft Stuff
Guest
Is their an OD calculator anywhere on a website that TW uses
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.
Wow this is quite useful! Is it possible to create one that says how many of each troop were killed on a red report or is this too hard/illegal?
much cred to FluffyCode: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);
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);
Wow this is quite useful! Is it possible to create one that says how many of each troop were killed on a red report or is this too hard/illegal?
There's a lot that could be done to tidy that code up other than using a tool like that...it actually pains me to look at that switch statement.
Lets just run that through http://javascriptcompressor.com/ to tidy it up a bit:icon_wink:
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);
Lol i still don't understand how to use the script. I have a Mac, does that make a difference?
*BUMP*
Been looking for an ODA/ODD Calc, here's the previous one I used, but it's not working for me anymore, it used to work with IE but now it doesn't :icon_cry:
javascript:var purpose="Good shot man !";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 9da=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 10da=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]*40+dl[9]*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]*20+al[9]*200;break;case 11da=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 12da=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(purpose + "\n\nTotal 'Opponents Defeated' points gained from battle: "+od+ " points." + "\n\n'Opponents Defeated' for Attacker: "+oda+ " points." + "\n\n'Opponents Defeated' for Defender: "+odd + " points." + "\n\n ... d[]b ...");
Code:javascript:var purpose="Good shot man :P !";var win=window.frames.length?window.main:window;var doc=win.document;var J=win.$;var oda=0;var odd=0;function fetch(x){x=J("table:has(th:contains('"+x+"')):last table td:contains('Losses:')").parent().html();return(x==null)?[]:x.match(/\d+/g)}var al=fetch('Attacker:');var dl=fetch('Defender:');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]*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 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]*40+dl[9]*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]*20+al[9]*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;default:}oda=isNaN(oda)?0:oda;odd=isNaN(odd)?0:odd;od=oda+odd;alert(purpose + "\n\nTotal 'Opponents Defeated' points gained from battle: "+od+ " points." + "\n\n'Opponents Defeated' for Attacker: "+oda+ " points." + "\n\n'Opponents Defeated' for Defender: "+odd + " points." + "\n\n ... d[o_O]b ...");
javascript:var ls=$("table tr[class=center] td:contains('Losses:')");var al=((ls&&(ls.length>0))?ls[0].parentNode.innerHTML.match(/\d+/g):[]);var dl=((ls&&(ls.length>1))?ls[1].parentNode.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);void(0);
Here is the one I use. Don't know if it works in I.E. as I only use Chrome, but it works fine in Chrome:[...]
Code:javascript:var ls=$("table tr[class=center] td:contains('Losses:')");var al=((ls&&(ls.length>0))?ls[0].parentNode.innerHTML.match(/\d+/g):[]);var dl=((ls&&(ls.length>1))?ls[1].parentNode.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]*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 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]*40+dl[9]*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]*20+al[9]*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);void(0);