ui_click
Safely click a DayZ UI widget by path, verifying it still matches expected name/class. Choose script delivery for open menus or cursor for real clicks, with clear reporting of handler results.
Instructions
Press a widget, by path, having checked it is still the one meant.
expect_name and expect_class are how a path stops being a loaded gun. A
tree walked a minute ago is not the tree in front of the mouse now, and
pressing "whatever is at 0.3.1 today" is how an automated run presses the
wrong button and reports success. Both are optional -- sometimes the caller
genuinely means "whatever is there" -- but then that is the caller's own
decision, taken in the open.
TWO TRACTS, and the answer always says which one was used:
via="script"delivers the click to the open menu's own handler. Works with the client in the background, no focus taken. Reaches ONLY the open scripted menu:Widgethas noGetHandler, so a HUD widget's own handler is not reachable from script at all.via="cursor"puts the real mouse on the widget's rectangle and clicks. Reaches anything the player could click -- and TAKES THE FOREGROUND, likeclient_type, because a real click goes wherever the real cursor is.
A handler that returns false is reported as what it is: the click was delivered and the menu did not act on it. That is a fact about the mod, not a failure of this tool, and the answer says so rather than inventing a verdict.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| via | No | script | |
| path | Yes | ||
| root | No | menu | |
| button | No | ||
| timeout | No | ||
| expect_name | No | ||
| expect_class | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| data | No | ||
| hint | No | ||
| error | No |