Add left click hold.

Ask gaming related questions (AHK v1.1 and older)
reggaeboi
Posts: 19
Joined: 22 Feb 2021, 06:40

Add left click hold.

Post by reggaeboi » 04 Mar 2021, 12:43

Code: Select all

        ControlSend,, {w}, ahk_id %id%
        ControlSend,, {w}, ahk_id %id%
        ControlSend,, {w}, ahk_id %id%
        Sleep, 250
        ControlClick,, ahk_id %id%,,,, NA
        wTitle = ahk_id %id%
        ControlSend,, {a down}, %wTitle%
        start := A_TickCount
        While (A_TickCount - start < 16500)
         Click
        ControlSend,, {a up}, %wTitle%
        ControlClick,, ahk_id %id%,,,, NA
        Sleep, 250
        ControlSend,, {w}, ahk_id %id%
        ControlSend,, {w}, ahk_id %id%
        ControlSend,, {w}, ahk_id %id%
        Sleep, 250
        ControlClick,, ahk_id %id%,,,, NA
        wTitle = ahk_id %id%
        ControlSend,, {d down}, %wTitle%
        start := A_TickCount
        While (A_TickCount - start < 16500)
         Click
        ControlSend,, {d up}, %wTitle%
      }
Is there anything I can add to this to make it hold down click along with a and d? that just clicks once from my experience?

Arsonistic
Posts: 20
Joined: 10 Oct 2019, 13:51

Re: Add left click hold.

Post by Arsonistic » 04 Mar 2021, 13:05

Replace "Click" with "Send, {LButton Down}" (and put Up at a later point ofc).
Or "ControlSend,, {LButton Down}, ahk_id %id%" in your case, if you really need to send it to a program that is out of focus.

reggaeboi
Posts: 19
Joined: 22 Feb 2021, 06:40

Re: Add left click hold.

Post by reggaeboi » 04 Mar 2021, 13:19

Arsonistic wrote:
04 Mar 2021, 13:05
Replace "Click" with "Send, {LButton Down}" (and put Up at a later point ofc).
Or "ControlSend,, {LButton Down}, ahk_id %id%" in your case, if you really need to send it to a program that is out of focus.

Code: Select all

        ControlSend,, {w}, ahk_id %id%
        ControlSend,, {w}, ahk_id %id%
        ControlSend,, {w}, ahk_id %id%
        Sleep, 250
        ControlClick,, ahk_id %id%,,,, NA
        wTitle = ahk_id %id%
        ControlSend,, {a down}, %wTitle%
        start := A_TickCount
        While (A_TickCount - start < 16500)
         ControlSend,, {LButton Down}, ahk_id %id%
        ControlSend,, {a up}, %wTitle%
         ControlSend,, {LButton Up}, ahk_id %id%
        ControlClick,, ahk_id %id%,,,, NA
        Sleep, 250
        ControlSend,, {w}, ahk_id %id%
        ControlSend,, {w}, ahk_id %id%
        ControlSend,, {w}, ahk_id %id%
        Sleep, 250
        ControlClick,, ahk_id %id%,,,, NA
        wTitle = ahk_id %id%
        ControlSend,, {d down}, %wTitle%
        start := A_TickCount
        While (A_TickCount - start < 16500)
         ControlSend,, {LButton Down}, ahk_id %id%
        ControlSend,, {d up}, %wTitle%
         ControlSend,, {LButton Up}, ahk_id %id%
Now have this but it still only clicks once?

Arsonistic
Posts: 20
Joined: 10 Oct 2019, 13:51

Re: Add left click hold.

Post by Arsonistic » 04 Mar 2021, 14:46

Well, now you just gotta place the Down and Up sends in the right spots to do what you want to do.
I think you want to place "Send, {LButton Down}" at the first Click, then do "Send, {LButton Up}" at the second one.

Post Reply

Return to “Gaming Help (v1)”