Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!doctype html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>Sensitivity calculation for Quake Live </title>
- <script>
- function calc(){
- // get info from forms
- var old_dpi=document.getElementById('old_dpi').value;
- var new_dpi=document.getElementById('new_dpi').value;
- var sens=document.getElementById('sens').value;
- var accel=document.getElementById('accel').value;
- var yaw=document.getElementById('yaw').value;
- // calculate new accel and sens
- var bas = old_dpi/new_dpi;
- var exponent = 2;
- var newint = Math.pow(bas, exponent);
- var new_sens=sens*(old_dpi/new_dpi);
- var new_accel=accel*newint;
- var new_cm = (360/ (yaw*new_dpi*1*sens )) * 2.54;
- document.getElementById('result').innerHTML="<b>New sens: </b>" + new_sens + "</br><b> New accel: </b>" + new_accel + "</br><b>CM/360: </b>" + new_cm ;
- return false;
- }
- </script>
- </head>
- <body>
- <b>Quake Live sensitivity and acceleration calculation:</b>
- <form>
- <div title="Your old mouse dpi"><b>old dpi: </b><input type="text" onChange="calc()" id="old_dpi" value="400" onblur="if(this.value==''){ this.value='400'; this.style.color='#BBB';}" onfocus="if(this.value=='400'){ this.value=''; this.style.color='#000';}" style="color:#BBB;"/></div>
- <div title="Your new mouse dpi."><b>new dpi: </b><input type="text" onChange="calc()" id="new_dpi" value="500" onblur="if(this.value==''){ this.value='500'; this.style.color='#BBB';}" onfocus="if(this.value=='500'){ this.value=''; this.style.color='#000';}" style="color:#BBB;" /></div>
- <div title="Default 4"><b>sensitivity: </b><input type="text" onChange="calc()" id="sens" value="4" onblur="if(this.value==''){ this.value='4'; this.style.color='#BBB';}" onfocus="if(this.value=='4'){ this.value=''; this.style.color='#000';}" style="color:#BBB;" /></div>
- <div title="Default 0.0"><b>cl_mouseAccel: </b><input type="text" onChange="calc()" id="accel" value="0.0" onblur="if(this.value==''){ this.value='0.0'; this.style.color='#BBB';}" onfocus="if(this.value=='0.0'){ this.value=''; this.style.color='#000';}" style="color:#BBB;" /></div>
- <div title="Default 0.0222"><b>m_yaw: </b><input type="text" onChange="calc()" id="yaw" value="0.022" onblur="if(this.value==''){ this.value='0.022'; this.style.color='#BBB';}" onfocus="if(this.value=='0.022'){ this.value=''; this.style.color='#000';}" style="color:#BBB;" /></div>
- <p title=" 1/11 0.0625
- 2/11 0.0125
- 3/11 0.25
- 4/11 0.5
- 5/11 0.75
- 6/11 (Default) 1
- 7/11 1.5
- 8/11 2
- 9/11 2.5
- 10/11 3
- 11/11 3.5"><b>Windows multiplier: </b><input type="text" onChange="calc()" id="yaw" value="1" onblur="if(this.value==''){ this.value='1'; this.style.color='#BBB';}" onfocus="if(this.value=='1'){ this.value=''; this.style.color='#000';}" style="color:#BBB;" /></p>
- <input type="button" onClick="calc()" value="Calculate" />
- </form>
- <div id="result"></div>
- </body>
- </html>
Add Comment
Please, Sign In to add comment