So I am playing Diablo 2. Typically you cast abilities using the right mouse click. I have used ahk so that I can press keyboard keys and it will cast abilities instead. Also if you hold the key down it will repeatedly cast the ability. What the issue is, is when I hold the key down to repeatedly cast the ability it does an initial ability cast, pauses briefly, then precedes to spam the ability without pause. Is there a reason there is an initial pause.
This is my code.
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
; Press the Q key and click and un-click the right mouse button
Q::
if ( not GetKeyState("RButton" , "P") )
Send {Q}
Sleep, 0
Click down right
Click up right
return
; Press the W key and click and un-click the right mouse button
W::
if ( not GetKeyState("RButton" , "P") )
Send {W}
Sleep, 0
Click down right
Click up right
return
; Press the E key and click and un-click the right mouse button
E::
if ( not GetKeyState("RButton" , "P") )
Send {E}
Sleep, 0
Click down right
Click up right
return
F1::Suspend ; F1 hotkey to toggle hotkeys on and off
return
Trying to fix a slight delay that occurs with key bindings
Re: Trying to fix a slight delay that occurs with key bindings
The initial pause is caused by key repeat.
Go into notepad, hold any key and observe what happens.
You get one key immediately, followed by a slight pause, then it repeats quite quickly
If you want to get rid of the initial pause, you need to completely rewrite the script and use SetTimer instead
Go into notepad, hold any key and observe what happens.
You get one key immediately, followed by a slight pause, then it repeats quite quickly
If you want to get rid of the initial pause, you need to completely rewrite the script and use SetTimer instead
Who is online
Users browsing this forum: Lamron750 and 88 guests