Why does it start working inaccurately if I set sleep below 57?

Ask gaming related questions (AHK v1.1 and older)
zerox
Posts: 80
Joined: 15 Apr 2021, 13:01

Why does it start working inaccurately if I set sleep below 57?

Post by zerox » 29 Feb 2024, 16:49

Hello, so there is the code. The problem if i set sleep under 57, sometimes it hit with weapon 2 or with weapon 6.
Maybe I should start autohotkey v2, because v1 is too slow to make this code faster? Any idea, or any solution? I will greatly appreciate any help!

Code: Select all

*space::

    Send 6
    Send {Esc}
    Send {LButton Down}
    Sleep, 57
    Send 2
    Send {LButton Up}
    Sleep, 100

    Loop {
        GetKeyState, iskeydown, space, p
        if (iskeydown == "D") {
            Send 6
            Send {LButton Down}
            Sleep, 57
            Send 2
            Send {LButton Up}
            Sleep, 100

        } else {
            Break
        }
    }

return
User avatar
mikeyww
Posts: 28871
Joined: 09 Sep 2014, 18:38

Re: Why does it start working inaccurately if I set sleep below 57?

Post by mikeyww » 29 Feb 2024, 19:42

Hello,

I know nothing about weapons, but the nuances of sleep are explained below.

:arrow: Sleep

SetBatchLinesSendInput
Last edited by mikeyww on 29 Feb 2024, 19:49, edited 1 time in total.
zerox
Posts: 80
Joined: 15 Apr 2021, 13:01

Re: Why does it start working inaccurately if I set sleep below 57?

Post by zerox » 29 Feb 2024, 19:45

mikeyww wrote:
29 Feb 2024, 19:42
Hello,

I know nothing about weapons, but the nuances of sleep are explained below.

:arrow: Sleep
Hello, thank you, well its just ingame weapons :)
User avatar
mikeyww
Posts: 28871
Joined: 09 Sep 2014, 18:38

Re: Why does it start working inaccurately if I set sleep below 57?

Post by mikeyww » 29 Feb 2024, 19:50

Sleep is typically approximate, as-- beyond what is explained in the documentation-- your CPU is not dedicated to your conquests but has other work to do, too. SetBatchLines can help you dodge the sleep between commands. SendInput can help you dodge the key delays. Some games actually require minimum key delays, so you can experiment and see what works.

KeyHistory will help you see what is happening with the keys and delays.
Post Reply

Return to “Gaming Help (v1)”