Skip to main content

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

FieldValue
DisplayScroll UI Widget
Categoryui
AccessUserCheat
ScopeB1Standalone
TagsExperimental
Aliases—

Parameters

NameTypeRequiredDefaultDescription
refstringno—Scroll box or list view ref from ui.get_tree.
tostringnooffsetScroll destination. offset uses --offset or --delta; index uses --index (list views only).
offsetfloatno—Absolute target offset for to=offset.
deltafloatno—Relative offset change for to=offset; with wheel=true this is the wheel tick count (positive scrolls up).
indexintno—Item index to bring into view for to=index.
wheelboolnofalseSynthesize 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
});