# DataType:switch

Data related to switches (levers, buttons, etc) in the zone

## Members

| **Type**                                                                                       | **Member**         | **Description**                                        |
| ---------------------------------------------------------------------------------------------- | ------------------ | ------------------------------------------------------ |
| [*float*](/macroquest/data-types-and-top-level-objects/data-types/datatype-float.md)           | **D**              | D coordinate (Upward-positive)                         |
| [*heading*](/macroquest/data-types-and-top-level-objects/data-types/datatype-heading.md)       | **DefaultHeading** | Heading of "closed" switch                             |
| [*float*](/macroquest/data-types-and-top-level-objects/data-types/datatype-float.md)           | **DefaultN**       | Y coordinate of "closed" switch (Northward-positive)   |
| [*float*](/macroquest/data-types-and-top-level-objects/data-types/datatype-float.md)           | **DefaultU**       | Z coordinate of "closed" switch (Upward-positive)      |
| [*float*](/macroquest/data-types-and-top-level-objects/data-types/datatype-float.md)           | **DefaultW**       | X coordinate of "closed" switch (Westward-positive)    |
| [*float*](/macroquest/data-types-and-top-level-objects/data-types/datatype-float.md)           | **DefaultX**       | X coordinate of "closed" switch                        |
| [*float*](/macroquest/data-types-and-top-level-objects/data-types/datatype-float.md)           | **DefaultY**       | Y coordinate of "closed" switch                        |
| [*float*](/macroquest/data-types-and-top-level-objects/data-types/datatype-float.md)           | **DefaultZ**       | Z coordinate of "closed" switch                        |
| [*float*](/macroquest/data-types-and-top-level-objects/data-types/datatype-float.md)           | **Distance**       | Distance from player to switch in (x,y)                |
| [*heading*](/macroquest/data-types-and-top-level-objects/data-types/datatype-heading.md)       | **Heading**        | Switch is facing this heading                          |
| [*heading*](/macroquest/data-types-and-top-level-objects/data-types/datatype-heading.md)       | **HeadingTo**      | Direction player must move to meet this switch         |
| [*int*](/macroquest/data-types-and-top-level-objects/data-types/datatype-int.md)               | **ID**             | Switch ID                                              |
| [*bool*](/macroquest/data-types-and-top-level-objects/data-types/datatype-bool.md)             | **LineOfSight**    | Returns TRUE if the switch is in LoS                   |
| [*float*](/macroquest/data-types-and-top-level-objects/data-types/datatype-float.md)           | **N**              | Y coordinate (Northward-positive)                      |
| [*string*](/macroquest/data-types-and-top-level-objects/data-types/datatype-string.md)         | **Name**           | Name                                                   |
| [*bool*](/macroquest/data-types-and-top-level-objects/data-types/datatype-bool.md)             | **Open**           | True if the switch is in the "open" state (State == 1) |
| \_\_[*int*](/macroquest/data-types-and-top-level-objects/data-types/datatype-int.md)\_\_       | **State**          | The "state" of the switch.                             |
| [*float*](/macroquest/data-types-and-top-level-objects/data-types/datatype-float.md)           | **W**              | X coordinate (Westward-positive)                       |
| [*float*](/macroquest/data-types-and-top-level-objects/data-types/datatype-float.md)           | **X**              | X coordinate                                           |
| [*float*](/macroquest/data-types-and-top-level-objects/data-types/datatype-float.md)           | **Y**              | Y coordinate                                           |
| [*float*](/macroquest/data-types-and-top-level-objects/data-types/datatype-float.md)           | **Z**              | Z coordinate                                           |
| \_\_[*string*](/macroquest/data-types-and-top-level-objects/data-types/datatype-string.md)\_\_ | **ToString**       | Same as **ID**                                         |


---

# 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://macroquest.gitbook.io/macroquest/data-types-and-top-level-objects/data-types/datatype-switch.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.
