important question about controller joystick script

Ask gaming related questions (AHK v1.1 and older)
user32552
Posts: 1
Joined: 19 Sep 2021, 14:59

important question about controller joystick script

Post by user32552 » 25 Sep 2021, 05:44

Hello, this is a complex question and i will try to ask it as simple as i can. I hope you can help me out. The provided script work very well on some games, but on some they dont.

The first script is simulating button8(rt button on joystick) as a left click mouse button

Code: Select all


#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

Joy8::
Send {LButton down}   ; Hold down the left mouse button.
SetTimer, WaitForButtonUp3, 10
return

WaitForButtonUp3:
if GetKeyState("Joy8")  ; The button is still, down, so keep waiting.
    return
; Otherwise, the button has been released.
Send {LButton up}  ; Release the left mouse button.
SetTimer, WaitForButtonUp3, Off
return

The second script is an antirecoil script allowing to reduce recoil while rt button on joystick is clicked.

Code: Select all


#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.


 
_auto := true
 
~Joy8::recoil() 

Numlock::_auto := ! _auto
XButton1::Suspend
 
 
 
recoil()
{
global _auto
if _auto
{
Loop
{
if GetKeyState("Joy8", "P")
{
MouseXY(0,4)
sleep 1
}
else
break
} ;; loop
} ;; if
} ;; recoil()
 
mouseXY(x,y)
{
DllCall("mouse_event",uint,1,int,x,int,y,uint,0,int,0)
}

Now these scripts work perfectly on windows and also on some games. On games with controller support, i disable in the xinput.exe file the rt button, because autohotkey is taking that function. But this rt button emulation in combination with the joystick recoil script controlled by autohotkey only work in games, that allow controller and mouse input at the same time. For example, in battlefield 4 or crysis 3 it is no issue. It works perfectly without any delay.
The rt button in games is the button for shooting and the recoil script also triggers the antirecoil once rt(Joy8) is pressed

But sadly on games like warzone with new aim assist function, where you have to chose between controller or mouse input. you have to force one. so these games dont accecpt joystick inputs by autohotkey, so both scripts dont work. only the inputs by xinput.dll are accepted.
I wanted to ask , how can in inject the antirecoil script for rt button posted above(second script) into xinput.dll, so that games with only one "input device support" will aslo work with that antirecoil script.
On many games, which accept both inputs same time its really perfect. sadly those are generally old less played games with bad aim assist support.
I want to get that antirecoil script work also at games with only one input device support example warzone or apex etc...

The solution should be simple, as it already works on some games. But since i am very inexperienced i would be glad for help and a solution for all games. For me its really important. I hope my question was understandable.

Obviously best and easiest solution would be to somehow enable mouse and joystick input at the same time on warzone. sot it would work like on crysis 3. no dll modifications needed. But this is not possible on warzone, because it forces you to only one input in game. I dont know if thats condifugurable somehow in some files to allow multiple inputs at same time. The delay is really 0.
This would be much easier than injecting antirecoil script in xinput dll file.


Thanks in Advance

Return to “Gaming Help (v1)”