Skip to content

util ​

Logging, notifications, key input, and game hashes.

Utility reference ​

util.joaat ​

Case-insensitive game hash; validates the normal text limit.

text
util.joaat(text)

Returns: Unsigned 32-bit integer

util.time_ms ​

Monotonic Windows uptime in milliseconds, not a Unix timestamp.

text
util.time_ms()

Returns: Integer

util.clamp ​

Requires finite values and minimum <= maximum.

text
util.clamp(value, minimum, maximum)

Returns: Number

util.key_down ​

Compatibility alias for input.is_key_down; focused game window, VK 1..254.

text
util.key_down(vk)

Returns: Boolean

util.notify ​

Information notification titled with the script filename.

text
util.notify(text)

Returns: Nothing

util.log ​

File-log entry prefixed with [Lua: filename].

text
util.log(text)

Returns: Nothing

print ​

Alias for util.log; accepts one string, unlike ordinary variadic Lua print.

text
print(text)

Returns: Nothing

Convert values before logging: util.log(tostring(value)) or util.log(string.format(...)). Use a notification for an occasional user-facing event and the log for diagnostics; avoid sending either on every frame.

Held-key polling remains available through input.is_key_down and its util.key_down alias. Use the event subscription API for press/release actions. Vectors now live in math, with the legacy global vec3 alias retained.