From 86b6a3b267baa78e898acf1320a4d0f811664573 Mon Sep 17 00:00:00 2001 From: TemporaryName <39608279+TemporaryName@users.noreply.github.com> Date: Sat, 18 Aug 2018 18:29:52 -0700 Subject: [PATCH] Added options/keys to calibrate revolution when yaw/sens is not known. * Update SensitivityMatcher.au3 * Update SensitivityMatcher.au3 * Update SensitivityMatcher.au3 * Update SensitivityMatcher.au3 * Update SensitivityMatcher.au3 * Update SensitivityMatcher.au3 * Update SensitivityMatcher.au3 * Update SensitivityMatcher.au3 * Update SensitivityMatcher.au3 * Update RunScript.vbs * Update SensitivityMatcher.au3 * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update SensitivityMatcher.au3 * Update SensitivityMatcher.au3 * Update SensitivityMatcher.au3 * Update README.md * Add files via upload * Update SensitivityMatcher.au3 * Update SensitivityMatcher.au3 * Update SensitivityMatcher.au3 * Update SensitivityMatcher.au3 * Update README.md * Update README.md * Update README.md * Update SensitivityMatcher.au3 * Update README.md * Update SensitivityMatcher.au3 * Update SensitivityMatcher.au3 * Update SensitivityMatcher.au3 * Update SensitivityMatcher.au3 * Update SensitivityMatcher.au3 * Update SensitivityMatcher.au3 * Update SensitivityMatcher.au3 * Update SensitivityMatcher.au3 * Update SensitivityMatcher.au3 * Update SensitivityMatcher.au3 * Update README.md * Update SensitivityMatcher.au3 * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update SensitivityMatcher.au3 * Update SensitivityMatcher.au3 * Update SensitivityMatcher.au3 * Update SensitivityMatcher.au3 * Update SensitivityMatcher.au3 * Update SensitivityMatcher.au3 * Update RunScript.vbs * Rename RunScript.vbs to asset/RunAu3Script.vbs * Create SensitivityMatcher.vbs * Rename asset/RunAu3Script.vbs to RunScript.vbs * Rename asset/SensitivityMatcher.vbs to SensitivityMatcher.vbs * Rename SensitivityMatcher.vbs to release/SensitivityMatcher.vbs * Rename release/SensitivityMatcher.vbs to ReleaseAssets/SensitivityMatcher.vbs * move icon * Update SensitivityMatcher.vbs * Update README.md * Update RunScript.vbs * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Create ReleaseTemplate.md * Rename ReleaseTemplate.md to ReleaseNotesTemplate.md * Update and rename ReleaseNotesTemplate.md to ReleaseNotes.md * Update ReleaseNotes.md * Update ReleaseNotes.md * Update ReleaseNotes.md * Update ReleaseNotes.md * Update ReleaseNotes.md * Update ReleaseNotes.md * Update ReleaseNotes.md * Update ReleaseNotes.md * Update ReleaseNotes.md * Update ReleaseNotes.md * Update ReleaseNotes.md * Update ReleaseNotes.md * Update ReleaseNotes.md * Update ReleaseNotes.md * Update ReleaseNotes.md * Update ReleaseNotes.md * Update ReleaseNotes.md * Update ReleaseNotes.md * Update ReleaseNotes.md * Update ReleaseNotes.md * Update ReleaseNotes.md * Update ReleaseNotes.md * Update ReleaseNotes.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update ReleaseNotes.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Grammar adjustment * Update SensitivityMatcher.au3 * Update README.md --- README.md | 39 +++- ReleaseAssets/ReleaseNotes.md | 15 ++ ReleaseAssets/SensitivityMatcher.vbs | 2 + ReleaseAssets/shell32_16739.ico | Bin 0 -> 52218 bytes RunScript.vbs | 2 + SensitivityMatcher.au3 | 279 ++++++++++++++++++++------- 6 files changed, 257 insertions(+), 80 deletions(-) create mode 100644 ReleaseAssets/ReleaseNotes.md create mode 100644 ReleaseAssets/SensitivityMatcher.vbs create mode 100644 ReleaseAssets/shell32_16739.ico create mode 100644 RunScript.vbs diff --git a/README.md b/README.md index 036c540..e9e8cff 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,39 @@ -# SensitivityMatcher -This is a script that can be used to convert your mouse sensitivity between different 3D games. +![Screenshot 1](https://i.redd.it/zt2a1a1yzyf11.png) +# Sensitivity Matcher + +This script lets you match your mouse sensitivity between any 3D games directly, and forego paywalled calculators. [Download link.](https://github.com/KovaaK/SensitivityMatcher/releases/latest) Run the script, then: -1) Select the Preset/game that you are coming from. +1) Select the preset/game that you are coming from. 2) Input your sensitivity value from your old game. 3) In your new game, adjust its sens until the test matches. -Press Alt+[ to perform one full revolution. -Press Alt+] to perform multiple full revolutions. -Press Alt+\ to halt. +Press `Alt` `[` to perform one full revolution. + +Press `Alt` `]` to perform multiple full revolutions. + +Press `Alt` `\` to halt (and clear residuals). + +  + +If the game that you are coming from is not listed, the script can also measure your old sensitivity.\ +Select "Measure any game" and enter your best guess, then: + +1) Perform rotation(s) to see if the estimate under- or overshoots. +2) Make corrections using the hotkeys below. +3) Test again. Repeat the process until the script always lands on the exact origin even after many turns. +4) Once you're done measuring, you can match it to any game you like with procedures outlined in the first section.\ +Or, if the game is already listed, simply select it from the dropdown to convert immediately. + +Press `Alt` `-` to correct overshoots. + +Press `Alt` `+` to correct undershoots. + +Press `Alt` `0` to start over if you made a wrong correction. + +  + +With this script, sub-increment accuracy is preserved between rotations, rapidly quenching the uncertainty with each cycle. This means that the script can measure any base yaw to high degree of precision by monitoring for drifts over many cycles. + +You no longer need to trust paywalled calculators that derive their measurement from single-rotation estimates approximated by integer counts, which amplifies their measurement error multiplicatively with each successive turn. diff --git a/ReleaseAssets/ReleaseNotes.md b/ReleaseAssets/ReleaseNotes.md new file mode 100644 index 0000000..5a017db --- /dev/null +++ b/ReleaseAssets/ReleaseNotes.md @@ -0,0 +1,15 @@ +## Release Notes + +[version 1.1] + +_New Feature: Measurement Mode_ + +You can now measure any unknown sensitivity/game, by telling the script whether you're under- or overshooting. \ +Turn rate during measurement mode is dynamically adjusted according to measurement uncertainty. + +## Download + +[**SensitivityMatcher.exe**](https://github.com/KovaaK/SensitivityMatcher/releases/download/1.1/SensitivityMatcher.exe) \ +[**SensitivityMatcher_a3x.zip**](https://github.com/KovaaK/SensitivityMatcher/releases/download/1.1/SensitivityMatcher_a3x.zip) (Use this instead if .exe is triggering false positives) + +[_Go to newest release_](https://github.com/KovaaK/SensitivityMatcher/releases/latest) diff --git a/ReleaseAssets/SensitivityMatcher.vbs b/ReleaseAssets/SensitivityMatcher.vbs new file mode 100644 index 0000000..15e818a --- /dev/null +++ b/ReleaseAssets/SensitivityMatcher.vbs @@ -0,0 +1,2 @@ +Set WshShell = WScript.CreateObject("WScript.Shell") +WshShell.Run "bin\AutoIt3.exe bin\SensitivityMatcher.a3x" diff --git a/ReleaseAssets/shell32_16739.ico b/ReleaseAssets/shell32_16739.ico new file mode 100644 index 0000000000000000000000000000000000000000..777e6ec128aa6ba621ec477a474015f8e9ce7fe0 GIT binary patch literal 52218 zcmeHw30zEH`}iHDLR6&EqO@qQNtOs@m!xdp5SmJx(t;MHnxaKT2-zoFD5OG2W@tkQ zS)w$f>|x5*lVAuw$S=0LVmhBB)_cfb7c@DaYiU{0~EnayH zx>UlzxVyVC94KlKRKmurfYM~QH9V$)cbV2k>JPB>URg1Q`H?_isg=$-xs@U zh~kJLgmM$CAxv=V%v+nqjMcNnCNY^q+&t|EKFg~#_lCQYK9 z@0l568#gn`VBWTKmG#&ioRwnYxsYs+^}g45xxCNkMZTVcg~z0sy7jK~bWy$|d5+po zuvdgimFZ)c~Yj}w&dju((BvQ{*&Y` zov0Q?a1$)5M)egiAj=+5^=HK8;WeYy-?=*bjMYxlxmCRnBz)WB_XK;moU+Fvoq0A zVY;)=c&#UyOH$4SubDbuV8N^dq|N)xwm^IPEVfXJNRLOXAHuLT3-iRH2>zi0>Xf%{zKOU9+BgVizE>@g zvblSCuqbKtr{k)t-e|s@Yc?|nJ3rIF@VuYduyqe|#q6;es~CsN`!w`?{i)}f>8Eug z9-h1SI$=(n(CKX#=54LJFS+WtYR}^74tuUVs?~eoe2Y|S`z6$rbc8iQ)O7UHy6j97 zw+Tld_E(d6Itd=uKb`hM>Wc@a);sCSVl6YLx8wU5YU%|3^K7iwn)F%eVJkw;1~w(o zUmrN4cBx{G0XD_|#o_W^dwbLe5p?^{l>jZp=Db-6F%V>1nT+deMsi;Mp4p=X0-!eV)b8k!oz3vs-b6?b(wu*rq|WIZj81 z?$Yclrc)~NA>>1lN|cV-w>>)!H^Nw~p3J(V=(6G7>694L!upizTH)FOB3`maQ;3qTB@e=-(&jd9Y$~zG=H+2CC#k1`dkvC+??}ShHjvRmI8`_rW&IRmP{zMtPVvY@a%etR|mcP$yuTD&?wv{%GKX(QB_`H(YGXj51SU*9@H}=Tbnclolq=$YC)PdZDDr&GR*OewW`2^fL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1&=VEG@5nd8M4lmg{wz(MNg;Bu6^UT+)Nl zt>f@Z!G=u4o3?}pd{ZfC-YeNWs=2`W8pnxulOETm}8ZY{PudUG33mLb)e9;@43&T8u{O%I8-!` zGq#O{@uTzW_-SD;<~!GW=z8UlTN}Ti1BUT?!bOIPWQ*43PWJcX-OBgVtV=^<2gPo+ zguk=DxpNs6AB}GoQ)N42kp(a;G!)7+3?n}?AmR9M;DATrk%VD*WT+-3G*m;JM!+C< O0r+k80-vfz4Euja$$(k_ literal 0 HcmV?d00001 diff --git a/RunScript.vbs b/RunScript.vbs new file mode 100644 index 0000000..6a462db --- /dev/null +++ b/RunScript.vbs @@ -0,0 +1,2 @@ +Set WshShell = WScript.CreateObject("WScript.Shell") +WshShell.Run ".\AutoIt3.exe .\SensitivityMatcher.au3" diff --git a/SensitivityMatcher.au3 b/SensitivityMatcher.au3 index b295e1f..a3597ca 100644 --- a/SensitivityMatcher.au3 +++ b/SensitivityMatcher.au3 @@ -1,4 +1,4 @@ -#NoTrayIcon +#NoTrayIcon #include #include #include @@ -18,61 +18,71 @@ Global Const $gPi = 3.141592653589793238462643383279502884197169399375105820974 Global Const $yawQuake = 0.022 Global Const $yawOverwatch = 0.0066 Global Const $yawReflex = 0.018/$gPi -Global Const $yawFortniteConfig = 2.222 -Global Const $yawFortniteSlider = 0.5555 -;Global Const $yawPaladins = 0.009157 ; This is wrong - Paladins sens scales by FOV -;Global Const $yawBattalion = 0.017501 ; Not sure if this is right +Global Const $yawFortniteConfig = 2.2220 +Global Const $yawFortniteSlider = 0.55550 +Global Const $yawMeasureDeg = 1 +Global Const $yawMeasureMrad = 0.180/$gPi Global $gValid = 1 +Global $gBounds[2] = [0,0] +Global Const $defaultTurnPeriod = 1000 + If _Singleton("Sensitivity Matcher", 1) = 0 Then - MsgBox(0, "Warning", "An occurrence of Sensitivity Matcher is already running.") + MsgBox(0, "Warning", "An instance of Sensitivity Matcher is already running.") Exit EndIf -HotKeySet("!{[}" , "SingleCycle") +HotKeySet("!{[}", "SingleCycle") HotKeySet("!{]}", "AutoCycle") -HotKeySet("!{\}" , "Halt") +HotKeySet("!{\}", "Halt") MakeGUI() - - Func MakeGUI() - $idGUI = GUICreate("Sensitivity Matcher", 295, 235) ; used to be 250, 180 - - GUICtrlCreateLabel( "Select preset yaw:" , 5, 7, 90, 15, $SS_LEFT ) - GUICtrlCreateLabel( "Sens" , 5, 50, 75, 15, $SS_CENTER) - GUICtrlCreateLabel( "×" , 80, 33, 15, 15, $SS_CENTER) - GUICtrlCreateLabel( "Yaw (deg)" , 95, 50, 105, 15, $SS_CENTER) - GUICtrlCreateLabel( "=" , 200, 33, 15, 15, $SS_CENTER) - GUICtrlCreateLabel( "Increment" , 215, 50, 75, 15, $SS_CENTER) + $idGUI = GUICreate("Sensitivity Matcher", 295, 235) + + GUICtrlCreateLabel( "Select preset yaw:" , 0, 7, 95, 15, $SS_RIGHT ) + GUICtrlCreateLabel( "Sens" , 5, 50, 80, 15, $SS_CENTER) + GUICtrlCreateLabel( "×" , 85, 33, 15, 15, $SS_CENTER) + GUICtrlCreateLabel( "Yaw (deg)" , 100, 50, 95, 15, $SS_CENTER) + GUICtrlCreateLabel( "=" , 195, 33, 15, 15, $SS_CENTER) + GUICtrlCreateLabel( "Increment" , 210, 50, 80, 15, $SS_CENTER) GUICtrlCreateGraphic( 5, 70, 285, 2, $SS_SUNKEN) ; horizontal line GUICtrlCreateLabel( "Optional Testing Parameters" , 5, 80, 285, 15, $SS_CENTER) - GUICtrlCreateLabel( "One Revolution is" , 5, 102, 98, 15, $SS_RIGHT ) + GUICtrlCreateLabel( "One Revolution of" , 0, 102, 95, 15, $SS_RIGHT ) GUICtrlCreateLabel( "counts." , 200, 102, 60, 15, $SS_LEFT ) - GUICtrlCreateLabel( "Move in Partitions of" , 5, 127, 98, 15, $SS_RIGHT ) + GUICtrlCreateLabel( "Move Partitions of" , 0, 127, 95, 15, $SS_RIGHT ) GUICtrlCreateLabel( "counts" , 200, 127, 60, 15, $SS_LEFT ) - GUICtrlCreateLabel( "at a Frequency of" , 5, 152, 98, 15, $SS_RIGHT ) + GUICtrlCreateLabel( "at a Frequency of" , 0, 152, 95, 15, $SS_RIGHT ) GUICtrlCreateLabel( "Hz" , 200, 152, 60, 15, $SS_LEFT ) - GUICtrlCreateLabel( "for a Cycle of" , 5, 177, 98, 15, $SS_RIGHT ) - GUICtrlCreateLabel( "rotations." , 200, 177, 60, 15, $SS_LEFT ) - - - Local $sYawPresets = GUICtrlCreateCombo( "Quake/Source" , 95, 5, 120, 20) - GUICtrlSetData( $sYawPresets , "Overwatch|Rainbow6/Reflex|Fortnite Config|Fortnite Slider|Custom", "Quake/Source") - Local $sSens = GUICtrlCreateInput( "1" , 5, 30, 75, 20) - Local $sYaw = GUICtrlCreateInput( "0.022" , 95, 30, 105, 20) - Local $sIncr = GUICtrlCreateInput( "0.022" , 215, 30, 75, 20) ; hardcoded to initialize to product of above two + GUICtrlCreateLabel( "for a Cycle of" , 0, 177, 95, 15, $SS_RIGHT ) + GUICtrlCreateLabel( "revolutions." , 200, 177, 60, 15, $SS_LEFT ) + + Local $sYawPresets = GUICtrlCreateCombo( "Quake/Source" , 100, 5, 110, 20) + GUICtrlSetData( $sYawPresets , "Overwatch|" & _ + "Rainbow6/Reflex|" & _ + "Fortnite Config|" & _ + "Fortnite Slider|" & _ + "Measure any game|" & _ + "Custom|" _ + , "Quake/Source") + Local $sSens = GUICtrlCreateInput( "1" , 5, 30, 80, 20) + Local $sYaw = GUICtrlCreateInput( "0.022" , 100, 30, 95, 20) + Local $sIncr = GUICtrlCreateInput( "0.022" , 210, 30, 80, 20) ; hardcoded to initialize to product of above two GUICtrlSendMsg( $sIncr , $EM_SETREADONLY, 1, 0) - Local $sCounts = GUICtrlCreateInput( 360/0.022 , 105, 100, 90, 20) ; once again, hardcoding initialization + Local $sCounts = GUICtrlCreateInput( 360/0.022 , 100, 100, 95, 20) ; once again, hardcoding initialization GUICtrlSendMsg( $sCounts , $EM_SETREADONLY, 1, 0) - Local $sPartition = GUICtrlCreateInput( "800" , 105, 125, 90, 20) - Local $sTickRate = GUICtrlCreateInput( "60" , 105, 150, 90, 20) - Local $sCycle = GUICtrlCreateInput( "20" , 105, 175, 90, 20) + Local $sPartition = GUICtrlCreateInput( "959" , 100, 125, 95, 20) + Local $sTickRate = GUICtrlCreateInput( "60" , 100, 150, 95, 20) + Local $sCycle = GUICtrlCreateInput( "20" , 100, 175, 95, 20) - Local $idHelp = GUICtrlCreateButton("Info" , 105, 205, 90, 25) + ; Local $idSave = GUICtrlCreateButton("Save as yaw" , 210, 4, 80, 23) + ; GUICtrlSetState( $idSave , $GUI_DISABLE ) + Local $idHelp = GUICtrlCreateButton("Info" , 100, 205, 95, 25) + ; Local $idCalc = GUICtrlCreateButton("Handy Calculator", 5, 205, 95, 25) + ; Local $idBind = GUICtrlCreateButton("Hotkeys..." , 195, 205, 95, 25) Local $hToolTip =_GUIToolTip_Create(0) ; default tooltip @@ -94,32 +104,55 @@ Func MakeGUI() Local $hTickRate = GUICtrlGetHandle($sTickRate) _GUIToolTip_AddTool($hToolTip, 0, "How many times per second to send mouse movements. Make sure this isn't higher than your framerate, especially for non-rawinput games.", $hTickRate) Local $hCycle = GUICtrlGetHandle($sCycle) - _GUIToolTip_AddTool($hToolTip, 0, "How many full revolutions to perform when pressing Alt+Home.", $hCycle) + _GUIToolTip_AddTool($hToolTip, 0, "How many full revolutions to perform when pressing Alt+].", $hCycle) - ; Initialize Global Variables to UI Inputs. Once initialized, the global variables are individually self-updating wihtin the main loop, no need for a whole refresh function. + ; Initialize Global Variables to UI Inputs. Once initialized, they are individually self-updating wihtin the main loop, no need for a whole refresh function. $gResidual = 0.0 $gMode = 1 $gSens = _GetNumberFromString(GuiCtrlRead($sSens)) * _GetNumberFromString(GuiCtrlRead($sYaw)) $gPartition = _GetNumberFromString(GuiCtrlRead($sPartition)) - $gDelay = int(1000/_GetNumberFromString(GuiCtrlRead($sTickRate))) + $gDelay = Ceiling( 1000/_GetNumberFromString( GuiCtrlRead($sTickRate) ) ) $gCycle = _GetNumberFromString(GuiCtrlRead($sCycle)) GUISetState(@SW_SHOW) - - Local $idMsg + Local $lPartition = $gPartition + Local $lastgSens = $gSens + Local $idMsg, $lBoundedError While 1 ; Loop until the user exits. $idMsg = GUIGetMsg() + + If $gSens == $lastgSens Then + Else + $gResidual = 0 + $lastgSens = $gSens + GUICtrlSetData( $sCounts, String( 360/$gSens ) ) + _GUICtrlEdit_SetSel( $sCounts, 0, 0 ) + GUICtrlSetData( $sIncr , String( $gSens ) ) + _GUICtrlEdit_SetSel( $sIncr , 0, 0 ) + GUICtrlSetData( $sSens , String( $gSens / _GetNumberFromString( GuiCtrlRead($sYaw) ) ) ) + _GUICtrlEdit_SetSel( $sSens , 0, 0 ) + $lBoundedError = 1 + If $gBounds[1] Then ; no need to check min $lPartition Then + $gPartition = $lPartition + EndIf + EndIf + Select Case $idMsg == $GUI_EVENT_CLOSE Exit Case $idMsg == $sSens - $gSens = _GetNumberFromString( GuiCtrlRead($sSens) ) * _GetNumberFromString( GuiCtrlRead($sYaw) ) $gResidual = 0 + $gSens = _GetNumberFromString( GuiCtrlRead($sSens) ) * _GetNumberFromString( GuiCtrlRead($sYaw) ) + $lastgSens = $gSens GUICtrlSetData( $sCounts, String( 360/$gSens ) ) _GUICtrlEdit_SetSel( $sCounts, 0, 0 ) GUICtrlSetData( $sIncr , String( $gSens ) ) @@ -131,13 +164,8 @@ Func MakeGUI() _GUICtrlEdit_SetSel( $sSens , 0, 0 ) _GUICtrlEdit_SetSel( $sYaw , 0, 0 ) -;~ ; Uncomment these, and comment out the above two lines if you would rather have increment update instead of sens. -;~ GUICtrlSetData($sCounts,String(Round(360/(_GetNumberFromString(GuiCtrlRead($sSens)) * _GetNumberFromString(GuiCtrlRead($sYaw))),3))) -;~ GUICtrlSetData($sIncr,String(_GetNumberFromString(GuiCtrlRead($sSens)) * _GetNumberFromString(GuiCtrlRead($sYaw)))) -;~ _GUICtrlEdit_SetSel($sIncr, 0, 0) -;~ _GUICtrlEdit_SetSel($sYaw, 0, 0) - - If _GetNumberFromString(GuiCtrlRead($sYaw)) == $yawQuake Then + If GUICtrlRead($sYawPresets) == "Measure any game" Then + ElseIf _GetNumberFromString(GuiCtrlRead($sYaw)) == $yawQuake Then _GUICtrlComboBox_SelectString($sYawPresets, "Quake/Source") ElseIf _GetNumberFromString(GuiCtrlRead($sYaw)) == $yawOverwatch Then _GUICtrlComboBox_SelectString($sYawPresets, "Overwatch") @@ -152,6 +180,11 @@ Func MakeGUI() EndIf Case $idMsg == $sYawPresets + $gResidual = 0 + $gPartition = $lPartition + HotKeySet("!{-}") + HotKeySet("!{=}") + HotKeySet("!{0}") If GUICtrlRead($sYawPresets) == "Quake/Source" Then GUICtrlSetData($sYaw, String($yawQuake)) ElseIf GUICtrlRead($sYawPresets) == "Overwatch" Then @@ -162,40 +195,93 @@ Func MakeGUI() GUICtrlSetData($sYaw, String($yawFortniteConfig)) ElseIf GUICtrlRead($sYawPresets) == "Fortnite Slider" Then GUICtrlSetData($sYaw, String($yawFortniteSlider)) + ElseIf GUICtrlRead($sYawPresets) == "Measure any game" Then + GUICtrlSetData($sYaw, String($yawMeasureDeg)) + ClearBounds() + HotKeySet("!{-}", "DecreasePolygon") + HotKeySet("!{=}", "IncreasePolygon") + HotKeySet("!{0}", "ClearBounds") + ; ElseIf GUICtrlRead($sYawPresets) == "Custom" Then + ; Else + ; GUICtrlSetState($idSave, $GUI_ENABLE) EndIf GUICtrlSetData( $sSens , String( $gSens / _GetNumberFromString( GuiCtrlRead($sYaw) ) ) ) _GUICtrlEdit_SetSel( $sSens , 0, 0 ) _GUICtrlEdit_SetSel( $sYaw , 0, 0 ) -;~ ; Uncomment these, and comment out the above two lines if you would rather have increment update instead of sens. -;~ GUICtrlSetData($sCounts,String(Round(360/(_GetNumberFromString(GuiCtrlRead($sSens)) * _GetNumberFromString(GuiCtrlRead($sYaw))),3))) -;~ GUICtrlSetData($sIncr,String(_GetNumberFromString(GuiCtrlRead($sSens)) * _GetNumberFromString(GuiCtrlRead($sYaw)))) -;~ _GUICtrlEdit_SetSel($sIncr, 0, 0) -;~ _GUICtrlEdit_SetSel($sYaw, 0, 0) - Case $idMsg == $sPartition + $gResidual = 0 $gPartition = _GetNumberFromString( GuiCtrlRead($sPartition) ) + $lPartition = $gPartition Case $idMsg == $sTickRate - $gDelay = int( 1000 / _GetNumberFromString( GuiCtrlRead($sTickRate) ) ) + $gResidual = 0 + $gDelay = Ceiling( 1000 / _GetNumberFromString( GuiCtrlRead($sTickRate) ) ) Case $idMsg == $sCycle + $gResidual = 0 $gCycle = _GetNumberFromString( GuiCtrlRead($sCycle) ) + + ; Case $idMsg == $idSave + ; GUICtrlSetState($idSave, $GUI_DISABLE) + + ; Case $idMsg == $idCalc + ; GUISetState(@SW_DISABLE,$idGUI) + ; GUICreate("Handy Calculator",100,100) + ; GUISetState(@SW_SHOW) + ; HandyCalculator() + ; GUIDelete() + ; GUISetState(@SW_ENABLE,$idGUI) + ; GUISetState(@SW_RESTORE,$idGUI) Case $idMsg == $idHelp If InputsValid($sSens, $sPartition, $sYaw, $sTickRate, $sCycle) Then $time = round($gCycle*$gDelay*(int(360/$gSens/$gPartition)+1)/1000) - MsgBox(0, "Info", "1) Select the Preset/game that you are coming from." & @crlf _ + MsgBox(0, "Info", "------------------------------------------------------------" & @crlf _ + & "To match your old sensitivity to a new game:" & @crlf _ + & "------------------------------------------------------------" & @crlf _ + & "1) Select the preset/game that you are coming from." & @crlf _ & "2) Input your sensitivity value from your old game." & @crlf _ & "3) In your new game, adjust its sens until the test matches." & @crlf _ & @crlf _ - & "Press Alt+[ to perform one full revolution." & @crlf _ - & "Press Alt+] to perform " & $gCycle & " full revolutions." & @crlf _ - & "Press Alt+\ to halt." & @crlf _ + & "Press Alt+[ to perform one full revolution." & @crlf _ + & "Press Alt+] to perform " & $gCycle & " full revolutions." & @crlf _ + & "Press Alt+\ to halt and/or clear residuals (for realignment)" & @crlf _ + & @crlf _ + & "------------------------------------------------------------" & @crlf _ + & "If your old game is not listed/yaw is unknown:" & @crlf _ + & "------------------------------------------------------------" & @crlf _ + & "1) Select ''Measure any game'' to enable measurement." & @crlf _ + & "2) Perform rotations in old game to test your estimate." & @crlf _ + & "3) Use the following hotkeys to adjust the estimate." & @crlf _ + & @crlf _ + & "Increase counts with Alt+= if it's undershooting." & @crlf _ + & "Decrease counts with Alt+- if it's overshooting." & @crlf _ + & "Clear all memory with Alt+0 if you made a wrong input." & @crlf _ + & @crlf _ + & "The estimate will converge to your exact sensitivity as you nudge " _ + & "measurement bounds with hotkeys. You can then use the measured " _ + & "sensitivity and match your new game to it." & @crlf _ + & @crlf _ + & "------------------------------------------------------------" & @crlf _ + & "Additional Info:" & @crlf _ + & "------------------------------------------------------------" & @crlf _ + & "Interval: " & $gDelay & " ms (round up to nearest milisecond)"& @crlf _ + & "Estimated Completion Time for " & $gCycle _ + & " cycles: " & $time & " sec" & @crlf _ & @crlf _ - & "Interval: " & $gDelay & " ms (rounded to nearest milisecond)" & @crlf _ - & "Estimated Completion Time for " & $gCycle & " cycles: " & $time & " sec") + & "Current Residual Angle: " & $gResidual & "°" & @crlf _ + & "Current Lower Bound: " & $gBounds[0] & "°" & @crlf _ + & "Current Increment: " & $gSens & "°" & @crlf _ + & "Current Upper Bound: " & $gBounds[1] & "°" & @crlf _ + & @crlf _ + & "NOTE: " _ + & "under/overshoot drifts might take multiple cycles before it becomes " _ + & "observable. Slight shifts that snaps back periodically are simply " _ + & "visual artifacts of residual angles that cancels itself out over " _ + & "many rotations. It only counts as an under/overshoot if you observe " _ + & "systematic drift in spite of the snapback.") Else MsgBox(0, "Error", "Inputs must be a number") EndIf @@ -211,21 +297,21 @@ Func MakeGUI() EndFunc Func TestMouse($cycle) - If $gMode > 0 Then - $gMode = 0 + If $gMode > 0 Then ; three states of $gMode: -1, 0, 1. A 0 means in-progress and exits the command without doing anything. + $gMode = 0 ; -1 means manual override and is checked for before performing every operation, 1 means all is good to go. $partition = $gPartition ; how many movements to perform in a single go. Don't let this exceed half of your resolution. $delay = $gDelay ; delay in milliseconds between movements. Making this lower than frametime causes dropped inputs for non-rawinput games. $turn = 0.0 $totalcount = 1 - While $cycle + While $cycle > 0 $cycle = $cycle - 1 - - $turn = 360 ; one revolution in deg - $totalcount = ( $turn + $gResidual ) / ( $gSens ) ; partitioned by user-defined increments - $totalcount = Round( $totalcount ) ; round to nearest integer - $gResidual = ( $turn + $gResidual ) - ( $gSens * $totalcount ) ; save the residual angles + + $turn = 360 ; one revolution in deg + $totalcount = ( $turn + $gResidual ) / ( $gSens ) ; partitioned by user-defined increments + $totalcount = Round( $totalcount ) ; round to nearest integer + $gResidual = ( $turn + $gResidual ) - ( $gSens * $totalcount ) ; save the residual angles While $totalcount > $partition If $gMode < 0 Then @@ -255,10 +341,6 @@ Func Halt() EndIf EndFunc -Func InputsValid($sSens, $sPartition, $sYaw, $sTickRate, $sCycle) - return _StringIsNumber(GuiCtrlRead($sSens)) AND _StringIsNumber(GuiCtrlRead($sPartition)) AND _StringIsNumber(GuiCtrlRead($sYaw)) AND _StringIsNumber(GuiCtrlRead($sTickrate)) AND _StringIsNumber(GuiCtrlRead($sCycle)) -EndFunc - Func SingleCycle() if $gValid Then TestMouse(1) @@ -275,6 +357,55 @@ Func AutoCycle() EndIf EndFunc +Func DecreasePolygon() + $gResidual = 0 + $gBounds[0] = $gSens + if $gBounds[1] < $gBounds[0] then + $gBounds[1] = 0 + $gSens = $gBounds[0] * 2 + else + $gSens =($gBounds[0] + $gBounds[1]) / 2 + endif +EndFunc + +Func IncreasePolygon() + $gResidual = 0 + $gBounds[1] = $gSens + if $gBounds[1] < $gBounds[0] then + $gBounds[0] = 0 + $gSens = $gBounds[1] / 2 + else + $gSens =($gBounds[0] + $gBounds[1]) / 2 + endif + if $gSens == 0 then + $gSens = $gBounds[1] + if $gSens == 0 then + $gSens = 0.022 + endif + endif +EndFunc + +Func ClearBounds() + $gResidual = 0 + $gBounds[0] = 0 + $gBounds[1] = 0 + $gPartition = NormalizedPartition($defaultTurnPeriod) +EndFunc + +Func NormalizedPartition($turntime) + Local $incre = $gSens + Local $total = round( 360 / $incre ) + Local $slice = ceiling( $total * $gDelay / $turntime ) + If $slice > $total Then + $slice = $total + EndIf + Return $slice +EndFunc + +Func InputsValid($sSens, $sPartition, $sYaw, $sTickRate, $sCycle) + return _StringIsNumber(GuiCtrlRead($sSens)) AND _StringIsNumber(GuiCtrlRead($sPartition)) AND _StringIsNumber(GuiCtrlRead($sYaw)) AND _StringIsNumber(GuiCtrlRead($sTickrate)) AND _StringIsNumber(GuiCtrlRead($sCycle)) +EndFunc + Func _MouseMovePlus($X = "", $Y = "") Local $MOUSEEVENTF_MOVE = 0x1 DllCall("user32.dll", "none", "mouse_event", _ @@ -303,4 +434,4 @@ Func _GetNumberFromString($input) ; uses the above regular expression to pull a Return Number($array[0] & $array[1]) ; $array[0] is "" or "-", $array[1] is the number. EndIf Return "error" -EndFunc \ No newline at end of file +EndFunc