Page 1 of 1

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

Posted: 29 Feb 2024, 16:49
by zerox
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

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

Posted: 29 Feb 2024, 19:42
by mikeyww
Hello,

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

:arrow: Sleep

SetBatchLinesSendInput

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

Posted: 29 Feb 2024, 19:45
by zerox
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 :)

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

Posted: 29 Feb 2024, 19:50
by mikeyww
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.

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

Posted: 17 Mar 2024, 15:50
by Banaanae