Async & Timers #
Non-blocking macros, frame delays, and keyboard lock for background threads.
delayTimer #
delayTimer(dwMilliseconds)
Suspends the current thread for the given duration (milliseconds).
- Parameters:
dwMilliseconds(number) — Duration in ms.
Demo:
-- use in draw/message callback only
delayTimer(500) -- sleep 500 ms on worker thread
1
2
2
asyncExecuteMacro #
asyncExecuteMacro(directionKey, comboKey, frames, keyType)
Runs a macro asynchronously in the background.
- Parameters:
directionKey— Direction inputcomboKey— Attack/button inputframes— Frame countkeyType— Key type (press, release, hold)
Demo:
local sdk2 = require("_SDK.sdk2")
local enums = sdk2.enums
asyncExecuteMacro(
enums.Input.FORWARD,
enums.Input.R_HAND,
3,
enums.InputType.KEY_PRESS
)
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
asyncDelayFrames #
asyncDelayFrames(frames)
Delays asynchronously by frame count (tied to game frame rate).
Demo:
asyncDelayFrames(10) -- non-blocking, 10 frames
1
asyncDisableKeyboardInput #
asyncDisableKeyboardInput()
Disable or re-enable keyboard input processing asynchronously.
Demo:
asyncDisableKeyboardInput()
-- ... background macro ...
asyncEnableKeyboardInput()
1
2
3
2
3
asyncEnableKeyboardInput #
asyncEnableKeyboardInput()
Re-enable keyboard input on async worker thread.
Demo:
asyncEnableKeyboardInput()
1