OD calculator

Vampire.Prince

Guest
Tehehe ... I knowz that '... d[o_O]b ...' from somewhere :icon_wink: ...

P.S.

Check this out, mate :) !
Thanks it works :lol:
I'm guessing the one I posted was one of your old pieces of work? :icon_cool:
 

Niko.

Guest
[...]
I'm guessing the one I posted was one of your old pieces of work? :icon_cool:
... in the 'textual' part, yes :icon_razz: . It was my addition :icon_biggrin: (text + mentioned above little fixes in calculating :icon_wink: ).
 

Vampire.Prince

Guest
Anyway we can get the script kindly posted for us stuck into a stickied topic somewhere more... permenant?
 

pyker42

Guest
Try this one:

[spoil]
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]*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);
[/spoil]
 

BandFlow

Guest
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:eek:da=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:eek:da=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:eek:da=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:eek:da=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:eek:da;odd=isNaN(odd)?0:eek:dd;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 ...");
 

Niko.

Guest
:( it's not working

it's show me only this
[spoil][/spoil]
Scripts above are designed for the reports in English (from .net, .co.uk, .us servers :icon_wink: ).

For Romanian servers, please use this special version below :icon_razz: :

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('Pierderi:')").parent().html();return(x==null)?[]:x.match(/\d+/g)}var al=fetch('Agresor:');var dl=fetch('Apărător:');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 ...");
 

DaWolf85

Guest
W54 runs V7.0, unlike the rest of the worlds. Ask someone who knows what they're talking about (i.e. A script writer, developer, or probably an ingame mod) to check it for compatibility issues.
 

seventh cavalry

Guest
I tried all of them and all not working how come ? do i open in a new page ?
 

Niko.

Guest
I tried all of them and all not working how come ? do i open in a new page ?
This one below works of course :) (and works well - without mistakes in calculations for 9 and 10 units worlds, where most scripts fail):
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;      var od=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:');      al=al.slice(1);      var dl=fetch('Defender:');      dl=dl.slice(1);      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(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 ...");
This form of the script, does not work properly with defeated militia units tho (simply doesn't count them).
/what is pretty easy to fix by adding additional parameter (+ dl["nth parameter"] * 4) to the specific case (world in fact - with specific amount of units) :icon_wink: /

How to use it?
Just run it with the report in the background.
And your result will pop up!

Enjoy :icon_biggrin: !