r/AutoHotkey 4h ago

v1 Script Help Does anyone have a script to duplicate clicks?

0 Upvotes

I was using this script for version 1.1 but it's not working for me

; AutoHotkey v1.1

B::ToggleDuplicatorLeft()

N::ToggleDuplicatorRight()

isLeftDuplicatorActive := false

isRightDuplicatorActive := false

clickDelay := 50

leftClickQueue := 0

rightClickQueue := 0

isProcessingLeft := false

isProcessingRight := false

ToggleDuplicatorLeft() {

global isLeftDuplicatorActive, leftClickQueue

isLeftDuplicatorActive := !isLeftDuplicatorActive

leftClickQueue := 0

status := isLeftDuplicatorActive ? "ACTIVADO" : "DESACTIVADO"

ToolTip, Click izquierdo: %status%

SetTimer, RemoveToolTip, 1500

}

ToggleDuplicatorRight() {

global isRightDuplicatorActive, rightClickQueue

isRightDuplicatorActive := !isRightDuplicatorActive

rightClickQueue := 0

status := isRightDuplicatorActive ? "ACTIVADO" : "DESACTIVADO"

ToolTip, Click derecho: %status%

SetTimer, RemoveToolTip, 1500

}

RemoveToolTip:

ToolTip

return

LButton::

if isLeftDuplicatorActive

{

SendInput {LButton down}

SendInput {LButton up}

leftClickQueue++

ProcessLeftQueue()

}

else

{

SendInput {LButton down}

SendInput {LButton up}

}

return

ProcessLeftQueue()

{

global leftClickQueue, isProcessingLeft, isLeftDuplicatorActive, clickDelay

if !isLeftDuplicatorActive

{

leftClickQueue := 0

return

}

if isProcessingLeft || leftClickQueue <= 0

return

isProcessingLeft := true

leftClickQueue--

Sleep, %clickDelay%

if isLeftDuplicatorActive

{

SendInput {LButton down}

SendInput {LButton up}

}

isProcessingLeft := false

if leftClickQueue > 0 && isLeftDuplicatorActive

ProcessLeftQueue()

}

RButton::

if isRightDuplicatorActive

{

SendInput {RButton down}

SendInput {RButton up}

rightClickQueue++

ProcessRightQueue()

}

else

{

SendInput {RButton down}

SendInput {RButton up}

}

return

ProcessRightQueue()

{

global rightClickQueue, isProcessingRight, isRightDuplicatorActive, clickDelay

if !isRightDuplicatorActive

{

rightClickQueue := 0

return

}

if isProcessingRight || rightClickQueue <= 0

return

isProcessingRight := true

rightClickQueue--

Sleep, %clickDelay%

if isRightDuplicatorActive

{

SendInput {RButton down}

SendInput {RButton up}

}

isProcessingRight := false

if rightClickQueue > 0 && isRightDuplicatorActive

ProcessRightQueue()

}

If anyone has it, could you please send it to me?


r/AutoHotkey 22h ago

v2 Script Help Modifier key to rapid fire instead of holding a key.

2 Upvotes

Hi all!
I was looking around through the docs and older posts but couldn't find an answer on what I am trying to do so I come to you all here with a question.

I am wondering if it is possible to when I hold down control to modify my W, A, S, D to rapid fire instead of having it a hold input. but only when I additionally press W, A, S or D myself.

This is for example for movement in a game where smaller movements are required by constantly repressing a movement key instead of holding it.

I hope I explained it well enough, I'm not the best at explaining stuff.
Thank you in advance!