> For the complete documentation index, see [llms.txt](https://fehdead.gitbook.io/npc-kit/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/aaske.md).

# npc.aaske

```lua
npc.aaske(slot, text)
```

|                         |                                                                         |
| ----------------------- | ----------------------------------------------------------------------- |
| id                      | `0x014A`                                                                |
| arguments               | 2: Int, Int                                                             |
| in NPC Kit              | yes                                                                     |
| measured from a kit NPC | returns                                                                 |
| waits                   | it has a wait handler: it can hold the script, and in `talk` the player |
| vanilla scripts         | 3007 calls in 369 of 1114 scripts                                       |

## What it does

The game's own question in the conversation window: shows line `text` of the script's text section with its choices in window `slot`, waits for the player's pick, and returns it.

## Arguments

### `slot` (Int)

The message window slot, 0 to 7. Vanilla: `0` and `1`.

### `text` (Int)

`0x01000000 + n`, line `n` of the running script's text section, a line written with its choices.

## Result

The choice the player picked.

## Timing

Waits for the player's pick.

## In NPC Kit

**Use the Lua Loader's `dialog.aaske` instead.** NPC Kit's script has no text section, so this call has no question of yours to show. `dialog.aaske` takes the speaker, the text and the choices as Lua strings, and its `onClose(index, reason)` gives the pick (`references/dialog.md`, A choice).

## Used with

In vanilla: [askpos](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/askpos.md) (cursor and Cancel rows) before it, a `switch` on its result after. In the kit: `dialog.aaske` in `npc.lua` with `cursor` and `cancel` fields.

## Example

The kit form of a vanilla `askpos(0, 0, 1)` + `aaske(0, line)`: the NPC asks, the hand starts on the first choice and Cancel lands on the second.

```lua
local offer = [[
Care for a potion? Only 50 gil, and fresh today.
It might just save your life out in the sands.
]]

local offerChoices = { "Buy one", "No, thanks" }

talk = function()
    talkOpen();
    npc.lua(function(handle)
        if not dialog.aaske.open {
                speaker = "NPCKit 0020",
                body = offer,
                choice = offerChoices,
                cursor = 0,
                cancel = 1,
                queue = true,
                onClose = function(index, reason)
                    if reason == "dismissed" and index == 0 then
                        handle.run("sell", function() handle.finish() end)
                    else
                        handle.finish()
                    end
                end,
                onError = function() handle.finish() end
            } then
            handle.finish()
        end
    end);
    talkClose();
end,

sell = function()
    npc.subgill(50);
    npc.additemmes(0x0000, 1);   -- Potion
end,
```

## Pitfalls

* A pick counts only with `reason == "dismissed"`: a window closed by the game reports `"gameClosed"` with no choice.
