> 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/pt-br/api-reference/caminhos-do-menu.md).

# Caminhos do Menu

Acesso e atualização de configurações do menu.

As funções de caminhos do menu permitem acessar configurações já existentes na interface principal.

## menu.paths

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

Retorna os caminhos disponíveis. O argumento opcional `prefix` filtra os resultados.

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

Os caminhos dependem dos elementos presentes na interface. `menu.paths()` fornece a lista de caminhos válidos.

## menu.exists

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

Verifica se uma configuração com o caminho especificado existe.

## menu.get

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

Retorna o valor atual da configuração. O tipo retornado depende do elemento.

```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)`

Altera uma configuração que permite escrita. O tipo varia conforme o elemento: `boolean` para caixas de seleção, `number` para números e `{r, g, b, a}` para cores.

## menu.rescan / menu.ready

`menu.rescan()` solicita uma nova leitura dos caminhos. `menu.ready(): boolean` informa se a verificação foi concluída.

```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`

Retorna as seções nas quais os controles do script podem ser inseridos.

## menu.target

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

Define a seção para os **próximos controles criados**. Uma chamada sem argumentos restaura a seção padrão.

```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/pt-br/api-reference/caminhos-do-menu.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.
