VESTALua API documentation
Back to productRU

Vesta Lua API 1.0

The Lua API lets local scripts consume Vesta's published game state, add menu controls and overlay graphics, update configuration values, and use the input API. Scripts receive snapshots through the existing runtime and do not need to know CS2 addresses or create additional memory-sampling loops.

Installation

On first launch Vesta creates %TEMP%\vesta\lua:

lua/
  scripts/     -- individual .lua files or packages
  modules/     -- shared Lua source modules
  data/        -- private JSON storage for scripts
  logs/

Scripts are managed in Misc -> Lua API: a list with on/off, settings, reload and delete (to the Recycle Bin), plus Import for a .lua file and Open folder for scripts. Import copies the file atomically and refreshes the runtime at once.

Sandbox

Every script runs in a sandbox and sees only the Vesta API and the safe part of the standard library:

Scripts keep their data with vesta.storage. The one exception is the bundled web radar (lua/scripts/Vesta Web Radar.lua in the repository): Vesta recognises it by the SHA-256 of its text (CRLF normalised to LF) compiled into the build, and only that file gets full access (io, os, starting its PowerShell helper). Any change to the radar file needs a new Vesta build, otherwise it runs sandboxed.

Minimal example

vesta.ui.toggle("enabled", "Player counter", true)

vesta.events.on("frame", function(frame)
    if not vesta.ui.get("enabled") then return end
    vesta.draw.text(30, 90, "Players: " .. #frame.players, 255, 255, 255, 255)
end)

Continue with runtime and lifecycle, game snapshots, events, configuration, UI and drawing, input, storage and modules, runtime testing, the Web Radar example, and the complete API reference.