Skip to content

Commit

Permalink
docs: Small fixes in lua-api
Browse files Browse the repository at this point in the history
  • Loading branch information
MeSoftHorny committed Dec 29, 2024
1 parent a179db3 commit f6dad41
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 22 deletions.
2 changes: 1 addition & 1 deletion docs/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
## Features
- **Cross-platform**: Windows, Linux and macOS.
- **VR support** (SteamVR only). See [VR section](features.md/#vr).
- **Graphical indicators**. [PRO version](https://patreon.com/wtrti).
- More than 30 types of indicators (Climb, AoA, Turning time, Fuel consumption, WEP timer, Booster remain, Critical Speed, Critical AoA etc.).
**Note:** **Weapon** or **Ammo** information **is not** available (or very limited) in the web-map, so it cannot be added to the app.
- Two types of OSD (On-screen display):
- **WTRTI** - Built-in OSD. See [OSD Setup](features.md#wtrti-built-in).
- **RTSS** - using "RivaTuner Statistics Server" OSD functionality. See [RTSS OSD Setup](features.md#rtss-osd-setup).
- **Vehicle Information** window, provides additional information (Speed Limits, Critical Overload, Critical AoA, etc).
- **Custom indicators**, allows you to make a new indicators with a specific reading properties from the game.
- **Graphical indicators**. [PRO version](https://patreon.com/wtrti).
- **Customizable "Alert" conditions**, with a sound playback. See how-to: [Alert](features.md#alert).
- **Lua** scripts, for custom processing of indicator values.
- **Plot** window that provides real-time visualization of telemetry data on a graph.
Expand Down
39 changes: 18 additions & 21 deletions docs/docs/lua-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,13 @@ The pipeline looks like this:
**"State value"** -> **value_proc** -> **value_str_proc**

The script file runs in a **sandboxed environment**, that includes a few standard libs:
**
```
math
string
table
```
**

With some functions from the `base` library:
**
```
assert
error
Expand All @@ -60,8 +57,7 @@ tostring
type
pcall
xpcall
```
**
```

Each script can contain the following callback functions:

Expand Down Expand Up @@ -184,6 +180,23 @@ __OPTIONS = {
| combo | integer, index of the `options`, begins from 0 |
| hotkey | none |

### Functions
#### getOptionValue(key_str [, default_value])
Returns the option value.
__Usage:__
`local opt1 = getOptionValue("option_key")`

or with default value:

`local opt1 = getOptionValue("option_key", "Default String")`

#### setOptionValue(key_str, value)
Allows to set a value for the option.
__Usage:__
`setOptionValue("option_key", "New String")`

**Note:** Only initial type of the value is allowed to set.

### Groups
You can make a group of the options, simply add a name key to the table right before the options.

Expand Down Expand Up @@ -214,19 +227,3 @@ __OPTIONS = {
}
```
Maximum level of group depth is 2.

#### getOptionValue(key_str [, default_value])
Returns the option value.
__Usage:__
`local opt1 = getOptionValue("option_key")`

or with default value:

`local opt1 = getOptionValue("option_key", "Default String")`

#### setOptionValue(key_str, value)
Allows to set a value for the option.
__Usage:__
`setOptionValue("option_key", "New String")`

**Note:** Only initial type of the value is allowed to set.

0 comments on commit f6dad41

Please sign in to comment.