This article covers the following platforms
MSFS 2024
MSFS 2020
ATS
FSX
Prepar3D
Use the Command API to open Otto and inspect its on-screen location and visibility.
open_search()
Open Otto’s search bar, optionally prefilled with a query.
SignatureTypeScript contract
open_search(query?: string): voidParameters
| Name | Type | Required | Description |
|---|---|---|---|
query | string | No | Text with which to prefill the search bar. |
ExampleJavaScript
this.$api.command.open_search("weather");Returns
voidNo direct return value is documented.get_otto_location()
Get Otto’s on-screen position in pixels.
SignatureTypeScript contract
get_otto_location(): [number, number]ExampleJavaScript
const [x, y] = this.$api.command.get_otto_location();
console.log({ x, y });Returns
[number, number]Otto’s x and y position in pixels.get_otto_state()
Check whether Otto is visible.
SignatureTypeScript contract
get_otto_state(): booleanExampleJavaScript
const isVisible = this.$api.command.get_otto_state();
console.log(isVisible);Returns
booleanWhether Otto is currently visible.