daily pastebin goal
62%
SHARE
TWEET

Senstool for Quake Live

a guest Jan 4th, 2016 20 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!doctype html>
  2. <html>
  3.     <head>
  4.         <meta charset="utf-8">
  5.         <title>Sensitivity calculation for Quake Live </title>
  6.         <script>
  7.             function calc(){
  8.        
  9.                 // get info from forms
  10.                 var old_dpi=document.getElementById('old_dpi').value;
  11.                 var new_dpi=document.getElementById('new_dpi').value;
  12.                 var sens=document.getElementById('sens').value;
  13.                 var accel=document.getElementById('accel').value;
  14.                 var yaw=document.getElementById('yaw').value;
  15.                
  16.            
  17.                 // calculate new accel and sens
  18.                 var bas = old_dpi/new_dpi;
  19.                 var exponent = 2;  
  20.                 var newint = Math.pow(bas, exponent);
  21.  
  22.                 var new_sens=sens*(old_dpi/new_dpi);
  23.                 var new_accel=accel*newint;
  24.                 var new_cm = (360/ (yaw*new_dpi*1*sens )) * 2.54;
  25.                
  26.  
  27.  
  28.                 document.getElementById('result').innerHTML="<b>New sens: </b>" + new_sens + "</br><b> New accel: </b>" +   new_accel + "</br><b>CM/360: </b>" + new_cm ;
  29.                 return false;
  30.             }
  31.         </script>
  32.     </head>
  33.     <body> 
  34.         <b>Quake Live sensitivity and acceleration calculation:</b>
  35.         <form>
  36.             <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>
  37.             <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>
  38.             <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>
  39.             <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>
  40.             <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>
  41.             <p title="  1/11    0.0625
  42.                 2/11    0.0125
  43.                 3/11    0.25
  44.                 4/11    0.5
  45.                 5/11    0.75
  46.                 6/11 (Default)  1
  47.                 7/11    1.5
  48.                 8/11    2
  49.                 9/11    2.5
  50.                 10/11   3
  51.                 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>
  52.  
  53.  
  54.             <input type="button" onClick="calc()" value="Calculate" />
  55.         </form>
  56.         <div id="result"></div>
  57.     </body>
  58. </html>
RAW Paste Data
Top