ui.scroll
Overview
- Scrolls a scroll box or list view identified by a ref from ui.get_tree. By default it calls the scroll API directly, which lands on the target in one step and makes the result easy to verify; the response carries the resulting offset/max/pos/at_end so you do not have to re-query. Pass wheel=true with --delta to synthesize a real mouse wheel instead, which is what you want when the thing under test is wheel handling itself (nested scroll boxes, scroll propagation) - that path is animated, so the reported offset may still be settling. to=index only works on list views and is the reliable way to bring a virtualized item on screen: items outside the displayed range have no widget at all, so you must scroll them into view before ui.get_tree can see them or ui.click can touch them. For a scroll box the offset is in slate units; for a list view it is in items. Fails when there is no world or the ref is not scrollable.
Metadata
| Field | Value |
|---|---|
| Display | Scroll UI Widget |
| Category | ui |
| Access | UserCheat |
| Scope | B1Standalone |
| Tags | Experimental |
| Aliases | — |
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| ref | string | no | — | Scroll box or list view ref from ui.get_tree. |
| to | string | no | offset | Scroll destination. offset uses --offset or --delta; index uses --index (list views only). |
| offset | float | no | — | Absolute target offset for to=offset. |
| delta | float | no | — | Relative offset change for to=offset; with wheel=true this is the wheel tick count (positive scrolls up). |
| index | int | no | — | Item index to bring into view for to=index. |
| wheel | bool | no | false | Synthesize a mouse wheel event instead of calling the scroll API. |
Usage
await inzoi.cli.execute('ui.scroll', {
ref: '', // optional
to: 'offset', // optional
offset: 0.0, // optional
delta: 0.0, // optional
index: 0, // optional
wheel: false, // optional
});