Skip to main content
Utility functions.

GetScreenSize

Returns two numbers, the game’s resolution.

GetCursorPos

Returns two numbers, in the same screen pixels the renderer draws in. Only moves while the menu is open; in game the cursor is locked.

GetDpiScale

Returns the user’s menu scale. Renderer sizes are raw pixels, so multiply them by this value when matching the menu scale.

IsInGame

IsMenuOpen

GetMapName

Returns the short map name (de_dust2), or nil when not in a game.

FindPattern

? is a wildcard byte. Returns the address as a number, or nil if not found.

FindExport

Returns the address as a number, or nil if the module or export is missing.

GetModule

Returns the module’s base address as a number, or nil if it is not loaded.

Interface

Accepts either "module::name" or separate module and name strings. Returns the interface address, or nil if it is unavailable. The name is prefix-matched, so a versionless "Source2EngineToClient00" still resolves.

SchemaOffset

Returns a schema field’s runtime offset, or nil if unresolved.

FNV1A

32-bit FNV1A hash of the string.

Murmur2

Returns a 32-bit MurmurHash2. The optional seed defaults to 0x31415926.

GetClipboard

Returns clipboard text, or nil if none is available.

SetClipboard

GetUsername

The user’s forum username.

Log output

LogChat writes to chat. LogScreen shows an on-screen log.
Addresses from this page are plain numbers. Wrap one with entity.Cast for typed access.