# Training Area

## set\_training\_position(region, x, y, z)

Sets the coordinates for the active training area. If no training area is active, this function does nothing.

#### Usage

`set_training_position(0, 6400.0, 800.0, 0.0)`

* The region will be calculated by the bot if it's set to `0`. This can only be done for non-cave areas. For cave areas, you will need to set the region yourself, or take it from `get_character_data()`.
* The X, Y, Z coordinates are floats.

#### Returns

`True` or `False` depending on if the training position has been set.

## set\_training\_script(path)

Sets the script path for the current training area.

#### **Usage**

`set_training_script('C:\path\to\script.txt')`

#### **Returns**

`True` if changed otherwise `None`

If the path is `''` (empty) it will reset the training area.

## set\_training\_radius(radius)

Changes the radius for the current training area.

#### **Usage**

`set_training_radius(50.0)`

#### **Returns**

`True` or `False` depending on if the training radius has been set.

## get\_training\_area()

Returns the training area info for the enabled training area.

#### **Usage**

`get_training_area()`

#### **Returns**

`None` or a dictionary containing the training area info.

```
{
	'x': 6428.2373046875,
	'y': 1086.672607421875,
	'z': -32.60887908935547,
	'region': 25000,
	'path': '',
	'radius': 50.0,
	'pick_radius': 50.0
}
```

## set\_training\_area(name)

Changes the training area based on its name.

#### **Usage**

`set_training_area('name')`

#### **Returns**

`True` if the training area was changed or `False` if it was not.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://plugins.phbot.org/phbot-api/training-area.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
