> 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/askpos.md).

# npc.askpos

```lua
npc.askpos(slot, cursor, cancel)
```

|                         |                                   |
| ----------------------- | --------------------------------- |
| id                      | `0x0013`                          |
| arguments               | 3: Int, Int, Int                  |
| in NPC Kit              | yes                               |
| measured from a kit NPC | returns                           |
| vanilla scripts         | 4716 calls in 385 of 1114 scripts |

## What it does

Sets, for window `slot`'s next choice list, the row the cursor starts on and the row Cancel goes to.

## Arguments

### `slot` (Int)

The window slot, 0 to 7.

### `cursor` (Int)

The row the hand starts on, from 0.

### `cancel` (Int)

The row Cancel moves to: `-1` none, `127` (the most common value) the last row.

Vanilla: `(1, 0, 127)` 1,290 times, `(0, 0, 1)` 791, `(0, 0, 127)` 719.

## Timing

Returns at once.

## In NPC Kit

**Use the `cursor` and `cancel` fields of `dialog.aaske` / `dialog.aask` instead**, both 0-based (`references/dialog.md`, The fields a talk uses). This call sets up the VM's own windows, which have no text of yours in the kit.

## Used with

* [aaske](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/aaske.md), [aask](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/aask.md) after it in vanilla.

## Example

The kit form of vanilla's most common `askpos(1, 0, 127)`: hand on the first choice, Cancel on the last.

```lua
local hunt = [[
Heard about the hunt? A mark was posted today,
and the reward is the biggest one in many months.
]]

npc.lua(function(handle)
    local choices = { "Tell me more", "Not now" }
    if not dialog.aaske.open {
            speaker = "NPCKit 0020",
            body = hunt,
            choice = choices,
            cursor = 0,
            cancel = #choices - 1,
            queue = true,
            onClose = function() handle.finish() end,
            onError = function() handle.finish() end
        } then
        handle.finish()
    end
end);
```
