Skip to main content

$getVar

Parameters

FieldTypeDescriptionRequired
nameVarstringThe name of the variable to retrieve.true
tablestringThe name of the table (optional). Default is "main".false

Usage

This function allows you to retrieve the value of a variable from a specified table. If the table parameter is not provided, the default table "main" is used. If the specified variable or table does not exist, an error will be raised.

Example

<AoiClient>.addCommand({
name: "getVar",
code: `
$getVar[userCount;stats]
`,
});

In this example, the function is used to retrieve a variable named "userCount" from the "stats" table. If the table or variable doesn't exist, appropriate error handling is required.