Jump to content

Speed clicking


OmenSWE
 Share

Recommended Posts

Trying to make so when i hold down LMB it will click fast like hell and when i release it it will stop

#Include <Misc.au3> 

$go=false
HotKeySet('{end}', '_Exit')

If MouseDown("left") then $go2=true
If MouseUp("left") then $go2=false
        
while 1 
    While $go
        MouseClick('left')
    Wend
WEnd


Func _Exit()
    Exit
EndFunc
Link to comment
Share on other sites

This works but sometimes you need to click again to stop it :S

#Include <Misc.au3> 
HotKeySet('{end}', '_Exit')

while 1   
Sleep(10);I don't want it to eat my processor.
   If _IsPressed(01) Then
        Do 
        MouseUp("left")
        Sleep(10);If you don't add this it might not work right.
        MouseDown("left")
        until NOT _IsPressed(01)
    EndIf
WEnd


Func _Exit()
    Exit
EndFunc

Oh, and the previous example does work.

Edited by Nahuel
Link to comment
Share on other sites

get hook.dll

Const $WH_MOUSE = 7
Const $WM_AUTOITLBUTTONDOWN = 0x1400 + 0x0A30
Const $WM_AUTOITLBUTTONUP = 0x1400 + 0x0B30

$gui = GUICreate("test")

Global $DLLinst = DLLCall("kernel32.dll","hwnd","LoadLibrary","str",".\hook.dll")
Global $mouseHOOKproc = DLLCall("kernel32.dll","hwnd","GetProcAddress","hwnd",$DLLInst[0],"str","MouseProc")

Global $hhMouse = DLLCall("user32.dll","hwnd","SetWindowsHookEx","int",$WH_MOUSE, _
        "hwnd",$mouseHOOKproc[0],"hwnd",$DLLinst[0],"int",0)

DLLCall(".\hook.dll","int","SetValuesMouse","hwnd",$gui,"hwnd",$hhMouse[0])

GUIRegisterMsg($WM_AUTOITLBUTTONDOWN,"AddMouse")
GUIRegisterMsg($WM_AUTOITLBUTTONUP,"SubMouse")

Global $mousecount = 0

While 1
    $msg = GUIGetMsg()
    If $msg = -3 Then ExitLoop
    If $mousecount Then
        MouseClick("left")
        Sleep(50)
    EndIf
WEnd

Func AddMouse($hWndGUI, $MsgID, $WParam, $LParam)
    $mousecount += 1
EndFunc

Func SubMouse($hWndGUI, $MsgID, $WParam, $LParam)
    $mousecount -= 1
EndFunc

Func OnAutoItExit()
    DLLCall("user32.dll","int","UnhookWindowsHookEx","hwnd",$hhMouse[0])
    DLLCall("kernel32.dll","int","FreeLibrary","hwnd",$DLLinst[0])
EndFunc
Link to comment
Share on other sites

This works but sometimes you need to click again to stop it :S

#Include <Misc.au3> 
HotKeySet('{end}', '_Exit')

while 1   
Sleep(10);I don't want it to eat my processor.
   If _IsPressed(01) Then
        Do 
        MouseUp("left")
        Sleep(10);If you don't add this it might not work right.
        MouseDown("left")
        until NOT _IsPressed(01)
    EndIf
WEnd
Func _Exit()
    Exit
EndFunc

Oh, and the previous example does work.

Ok this start and newer stops

get hook.dll

Const $WH_MOUSE = 7
Const $WM_AUTOITLBUTTONDOWN = 0x1400 + 0x0A30
Const $WM_AUTOITLBUTTONUP = 0x1400 + 0x0B30

$gui = GUICreate("test")

Global $DLLinst = DLLCall("kernel32.dll","hwnd","LoadLibrary","str",".\hook.dll")
Global $mouseHOOKproc = DLLCall("kernel32.dll","hwnd","GetProcAddress","hwnd",$DLLInst[0],"str","MouseProc")

Global $hhMouse = DLLCall("user32.dll","hwnd","SetWindowsHookEx","int",$WH_MOUSE, _
        "hwnd",$mouseHOOKproc[0],"hwnd",$DLLinst[0],"int",0)

DLLCall(".\hook.dll","int","SetValuesMouse","hwnd",$gui,"hwnd",$hhMouse[0])

GUIRegisterMsg($WM_AUTOITLBUTTONDOWN,"AddMouse")
GUIRegisterMsg($WM_AUTOITLBUTTONUP,"SubMouse")

Global $mousecount = 0

While 1
    $msg = GUIGetMsg()
    If $msg = -3 Then ExitLoop
    If $mousecount Then
        MouseClick("left")
        Sleep(50)
    EndIf
WEnd

Func AddMouse($hWndGUI, $MsgID, $WParam, $LParam)
    $mousecount += 1
EndFunc

Func SubMouse($hWndGUI, $MsgID, $WParam, $LParam)
    $mousecount -= 1
EndFunc

Func OnAutoItExit()
    DLLCall("user32.dll","int","UnhookWindowsHookEx","hwnd",$hhMouse[0])
    DLLCall("kernel32.dll","int","FreeLibrary","hwnd",$DLLinst[0])
EndFunc
This start on the second i start the file and it dont stop. Edited by OmenSWE
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...