The problem is mouse movement really NOT smooth ingame (after mouse hook _WinAPI_SetWindowsHookEx, but unhook its fine)...
(mouse lag? lol what ever it is)
Sorry about my bad english and im totally noob... then any advice
I test this in AVA SEA
~.~ i dont really sure what leech code mean... but i wrote this... and this simple... cuz i noob... nvm
Code:
#NoTrayIcon
#region ;**** Directives created by AutoIt3Wrapper_GUI ****
#Obfuscator_Parameters=/cs /cn /cf /sf 0 /sv 1 /sci 0
#endregion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <Timers.au3>
#include <WinAPI.au3>
#include <Constants.au3>
#include <WindowsConstants.au3>
HotKeySet("{END}", "A5B00301A3D")
HotKeySet("{HOME}", "OnAutoItExit")
Global $bActive = False
Global $hTimer
Global $iDelay = 10
Global $hTimerDelay = _Timer_Init()
Global $hTimer = _Timer_Init()
Global $hHook, $hStub_KeyProc
Global $bFire = False
Global $hmod
Global $iRecoil = 0.5
While 1
If $bActive Then
If $bFire Then
If _Timer_Diff($hTimer) > $iDelay Then
If $iRecoil < 0.5 Then $iRecoil += 0.02 ; ~.~ this quite useless
If $iRecoil = 0.5 Then $iRecoil = 0.1 ;
_WinAPI_Mouse_Event($MOUSEEVENTF_MIDDLEDOWN, 0, $iRecoil)
;_WinAPI_Mouse_Event($MOUSEEVENTF_MIDDLEDOWN, 0, 0.1) ; No $iRecoil ctrl
_WinAPI_Mouse_Event($MOUSEEVENTF_MIDDLEUP, 0, 0)
EndIf
EndIf
Else
Sleep(100)
EndIf
WEnd
Func _KeyProc($nCode, $wParam, $lParam)
;Local $tKEYHOOKS
If $nCode < 0 Then Return _WinAPI_CallNextHookEx($hHook, $nCode, $wParam, $lParam)
If $wParam = $WM_MBUTTONDOWN Or $wParam = $WM_MBUTTONUP Then Return _WinAPI_CallNextHookEx($hHook, $nCode, $wParam, $lParam)
If $wParam = $WM_LBUTTONDOWN Then
$bFire = True
EndIf
If $wParam = $WM_LBUTTONUP Then
$bFire = False
$iRecoil = 0.5
EndIf
Return _WinAPI_CallNextHookEx($hHook, $nCode, $wParam, $lParam)
EndFunc ;==>_KeyProc
Func OnAutoItExit()
_WinAPI_UnhookWindowsHookEx($hHook)
DllCallbackFree($hStub_KeyProc)
EndFunc ;==>OnAutoItExit
#Obfuscator_off
Func A5B00301A3D()
#Obfuscator_on
$iTimer = _Timer_Diff($hTimerDelay)
If $iTimer > 5000 Then
$hTimerDelay = TimerInit()
If $bActive Then
ConsoleWrite("! Deactivate" & @CRLF)
_WinAPI_UnhookWindowsHookEx($hHook)
DllCallbackFree($hStub_KeyProc)
SoundPlay("dea.wav", 1)
$bActive = False
Else
ConsoleWrite("! Activate" & @CRLF)
SoundPlay("act.wav", 1)
$hStub_KeyProc = DllCallbackRegister("_KeyProc", "long", "int;wparam;lparam")
$hmod = _WinAPI_GetModuleHandle("AVA.exe")
$hHook = _WinAPI_SetWindowsHookEx($WH_MOUSE_LL, DllCallbackGetPtr($hStub_KeyProc), $hmod)
$bActive = True
EndIf
EndIf
EndFunc ;==>A5B00301A3D
Thanks for your help...