> For the complete documentation index, see [llms.txt](https://docs.gamesense.biz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gamesense.biz/api-reference/menu-paths.md).

# Menu Paths

Read and update existing menu settings.

Menu path functions access settings that already exist in the main interface.

## menu.paths

`menu.paths([prefix: string]): table`

Returns available setting paths. The optional `prefix` filters the results.

```lua
local all_paths = menu.paths()
local misc_paths = menu.paths("Misc")
```

Available paths depend on the current interface. Use `menu.paths()` to discover valid paths.

## menu.exists

`menu.exists(path: string): boolean`

Checks whether the specified setting exists.

## menu.get

`menu.get(path: string): any`

Returns a setting's current value. The return type depends on the setting.

```lua
local path = menu.paths()[1]
if path and menu.exists(path) then
    local current_value = menu.get(path)
end
```

## menu.set

`menu.set(path: string, value: any)`

Updates a writable setting. Values are type-specific: `boolean` for checkboxes, `number` for numeric settings, and `{r, g, b, a}` for colors.

## menu.rescan / menu.ready

`menu.rescan()` requests an updated path list. `menu.ready(): boolean` indicates when scanning has finished.

```lua
local status = menu.label("Menu paths: scanning")
local updated = false

menu.rescan()

register_callback("on_update", function()
    if updated or not menu.ready() then return end
    status:set("Menu paths: " .. #menu.paths())
    updated = true
end)
```

## menu.targets

`menu.targets(): table`

Returns the available menu sections where script controls may be placed.

## menu.target

`menu.target([scope: string])`

Selects the section for **subsequently created** controls. Calling without an argument restores the default target.

```lua
local targets = menu.targets()
if targets[1] then
    menu.target(targets[1])
    menu.checkbox("Extra option", false)
    menu.target()
end
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.gamesense.biz/api-reference/menu-paths.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
