Skip to main content

Core API

Essential functions for controlling script execution.


hexis.running()

Returns true if script should continue running. Use in main loop.

while hexis.running() do
-- Script logic
hexis.sleep(100)
end

hexis.sleep(ms)

Pauses script execution for specified milliseconds.

hexis.sleep(1000)  -- Wait 1 second
hexis.sleep(500) -- Wait 500ms

hexis.yield()

Yields execution briefly. Use in tight loops to prevent freezing.

for i = 1, 1000 do
-- Processing
if i % 100 == 0 then hexis.yield() end
end

hexis.wait(seconds)

Alternative to sleep() using seconds instead of milliseconds.

hexis.wait(0.5)  -- Wait 500ms
hexis.wait(2) -- Wait 2 seconds