Sign in to follow this  
Followers 0
OmenSWE

Speed clicking

16 posts in this topic

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

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

click mouse while mouse down = crazy talk.

click mouse sends mouseup = catch22. :crazy: ~Jap

edit- i mean :) ~Jap

Edited by JBeef

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Try this;

While MouseDown("left")
        $go2=true
Wend
did not work..

I want it for a game when you fire with a pistol you need to press the button agen and agen.

Now i want so it auto repress it when i just hold it down.

Edited by OmenSWE

Share this post


Link to post
Share on other sites

#Include <Misc.au3>

While 1

While _IsPressed("01")

MouseDown("left")

MouseUp("left")

WEnd

WEnd

Nope did not work

Share this post


Link to post
Share on other sites

children think more.

mousehook and variable to count mousedown.

mousedown add 1.

click while mousedown is 1

mouseup delete 1.

please dont make me show. someone has smarts here? ~Jap

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

oh well. should work. logically perfect. ~Jap

Share this post


Link to post
Share on other sites

Ok this start and newer stops

It works here. But sometimes it doesn't stop and you need to click again.

The thing is that everyone gave you ideas. Try to put them all together and come up with a working script.

Share this post


Link to post
Share on other sites

I want it for Half-Life 2

Share this post


Link to post
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
Sign in to follow this  
Followers 0