Autoit Basic Macro - Mouse movement NOT smooth ingame

Posts 1–3 of 3 · Page 1 of 1
Autoit Basic Macro - Mouse movement NOT smooth ingame
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...
Quote Originally Posted by tester123321 View Post
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...
Doubt you coded you need good amount of english to write codes.


---------- Post added at 04:48 PM ---------- Previous post was at 04:47 PM ----------

If you did write it I suggest removing it and pming macro makers since ppl will leech.
Quote Originally Posted by Chrome Boy View Post


Doubt you coded you need good amount of english to write codes.


---------- Post added at 04:48 PM ---------- Previous post was at 04:47 PM ----------

If you did write it I suggest removing it and pming macro makers since ppl will leech.
i dunt understand ... why i have to remove it? "pming = pmang" is it? ... ppl will leech...? .... T_T
sorry my bad english... i have no interested in macro anymore... how can i request thread removal?
Posts 1–3 of 3 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us