AutoHotkey Migration: Runtime, Timers, And State

Mapping AutoHotkey Sleep, SetTimer, and variables to EyeAuras script runtime and state APIs.

AutoHotkey Migration: Runtime, Timers, And State

Use this page for Sleep, SetTimer, ordinary variables, globals, built-in variables, and shared state.

Quick Map

AutoHotkey NeedAHK APIsEyeAuras RouteFirst C# ShapeJudgmentNotes
Sleep or repeat laterSleep, SetTimerScript Sleep(...), loops, services, observablesSleep(250); or run a cancellation-aware loopSleep is good; SetTimer needs redesign.EyeAuras script Sleep(...) is cancellation-aware and can finish early when the script stops. Aura Tree timer actions/triggers are configurable components, not lightweight script API equivalents.
Store script stateVariables, built-in variables, globalsC# locals, fields, objects; ScriptVariable<T> only for shared/persistent statevar count = 0; or int Count { get; set; }Better for normal in-script state; use script variables only when sharing is needed.ScriptVariable<T> / IVariablesScriptingApi are for state shared across launches, between scripts, or with EyeAuras infrastructure outside the script.

Sleep

AutoHotkey v2:

Sleep 250

EyeAuras script:

Sleep(250);

Recommendation: Good shape. EyeAuras Sleep(...) is cancellation-aware, which is usually better for scripts that may be stopped by the user.

Ordinary State

AutoHotkey v2:

ahk
count := 0
count += 1

EyeAuras script:

csharp
var count = 0;
count += 1;

Use normal C# locals, fields, and objects for ordinary in-script state. Use ScriptVariable<T> / IVariablesScriptingApi only when the value must be shared across launches, between scripts, or with EyeAuras infrastructure outside the script.

Recommendation: Better than AHK for normal in-script state because it is typed and explicit. Shared/persistent variables need separate examples.