I would just like to say that I did something absolutely rediculous and I changed a few lines of code...
Code:
/*if(w1dh==w2dh){ lwd=w1d>w1dh?w1d:w1dh; } else{ if(w1d>w1dh||w2d>w2dh){ lwd=w1d>w2d?w1d:w2d; } else{ lwd=w1dh>w2dh?w1dh:w2dh; } }*/
Changed to...
Code:
lwd=w1dh==w2dh?w1d>w1dh?w1d:w1dh:w1d>w1dh||w2d>w2dh?w1d>w2d?w1d:w2d:w1dh>w2dh?w1dh:w2dh;
LOL
So yeah here's version 2:
Spoiler for Haste Calculator :
Code:
<!DOCTYPE html PUBLIC "-/W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Haste Calculator</title> <meta http-equiv="content-type" content="text/html;charset=iso-8859-1" /> <script type="text/javascript"><!-- function grab(o){ return document.all?document.all[o]:document.getElementById?document.getElementById(o):""; } function recalc(){ var w1d=grab("weapon1_delay").value; var w2d=grab("weapon2_delay").value; var h=grab("haste").value; var w2iu=grab("weapon2_inuse").checked; grab("weapon2_delay").disabled=grab("weapon2_inuse").checked?"":"disabled"; if(!isNaN(w1d)&&!isNaN(w2d)&&!isNaN(h)){ var w1dh=w1d-(w1d*((h*.01)/2)); var w2dh=w2d-(w2d*((h*.01)/2)); w1dh*=w2iu?1.3:1; w2dh*=w2iu?1.3:!w2iu?0:1; var hpm=(60/w1dh)+(w2dh==0?0:(60/w2dh)); var lwd=w1dh==w2dh?w1d>w1dh?w1d:w1dh:w1d>w1dh||w2d>w2dh?w1d>w2d?w1d:w2d:w1dh>w2dh?w1dh:w2dh; lwd=!w2iu?w1d>w1dh?w1d:w1dh:lwd; g_w1d=Math.round((100/lwd)*w1d); g_w1dh=Math.round((100/lwd)*w1dh); g_w2d=w2iu?Math.round((100/lwd)*w2d):0; g_w2dh=w2iu?Math.round((100/lwd)*w2dh):0; grab("g_w1d").style.width=g_w1d+"%"; grab("g_w1dh").style.width=g_w1dh+"%"; grab("g_w2d").style.width=g_w2d+"%"; grab("g_w2dh").style.width=g_w2dh+"%"; grab("weapon1_delay_actual").innerHTML=Math.round(w1dh*10)/10+" sec"; grab("weapon2_delay_actual").innerHTML=Math.round(w2dh*10)/10+" sec"; grab("hitspermin").innerHTML=Math.round(hpm*10)/10+"/min"; } } //--></script> <style type="text/css"><!-- table tr{ padding:0; margin:0; } table td{ padding:0; margin:0; } .bar1{ background-color:#c00; } .bar2{ background-color:#00c; } .bar1,.bar2{ height:20px; } .barbox{ background-color:#ccc; } //--></style> </head> <body onload="recalc();"> <div align="center"> <table style="width:600px;"> <tr> <td style="width:5%;"> </td> <td style="width:35%;">Weapon 1 Delay:</td> <td style="width:60%;"><input type="text" id="weapon1_delay" value="4" onkeydown="recalc();" onkeyup="recalc();" /></td> </tr> <tr> <td><input type="checkbox" id="weapon2_inuse" checked="checked" onclick="recalc();" /></td> <td>Weapon 2 Delay:</td> <td><input type="text" id="weapon2_delay" value="4" onkeydown="recalc();" onkeyup="recalc();" /></td> </tr> <tr> <td> </td> <td>Haste %:</td> <td><input type="text" id="haste" value="35" onkeydown="recalc();" onkeyup="recalc();" /></td> </tr> <tr> <td> </td> <td>Actual Weapon 1 Delay:</td> <td><span id="weapon1_delay_actual" class="result">?</span></td> </tr> <tr> <td> </td> <td>Actual Weapon 2 Delay:</td> <td><span id="weapon2_delay_actual" class="result">?</span></td> </tr> <tr> <td> </td> <td>Hits/min:</td> <td><span id="hitspermin" class="result">?</span></td> </tr> </table> <table style="width:600px;"> <tr> <td style="width:40%;">Weapon 1 Delay:</td> <td style="width:60%" class="barbox"><div id="g_w1d" class="bar1"></div></td> </tr> <tr> <td>Actual Weapon 1 Delay:</td> <td class="barbox"><div id="g_w1dh" class="bar2"></div></td> </tr> <tr> <td>Weapon 2 Delay:</td> <td class="barbox"><div id="g_w2d" class="bar1"></div></td> </tr> <tr> <td>Actual Weapon 2 Delay:</td> <td class="barbox"><div id="g_w2dh" class="bar2"></div></td> </tr> </table> </div> </body> </html>