> For the complete documentation index, see [llms.txt](https://docs.intrepidcs.com/vspy-3-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.intrepidcs.com/vspy-3-documentation/3.9.22/vehicle-spy-main-menus/main-menu-scripting-and-automation/function-blocks/function-blocks-types/script-type-function-block-commands/script-type-function-block-command-clear-stats.md).

# Script Type Function Block Command: Clear Stats

### Command Description

This command resets the current statistical information for received messages.

It has no effect on transmit message statistics.

### Value Field Parameters

Double-click the **Value** field for the command to open a dialog box that will allow you to select which stats you wish to clear (Figure 1). The three choices are:

* **Clear All Stats:** Clear statistics for all messages.
* **Clear Stats for One Message:** Clear statistics for a single message, which should be selected from the **Message** drop-down box just below. (This option is illustrated in Figure 1.)
* **Clear Stats for One Network:** Clear statistics for a network, selected from the adjacent **Network** drop-down box.

![Figure 1: Dialog box for Clear Stats command.](/files/xxpmAivbX8LijTpoUrvv)

### Example

One possible use for the **Clear Stats** command is to [reset the **Present** flag on a message](/vspy-3-documentation/3.9.22/vehicle-spy-main-menus/main-menu-scripting-and-automation/function-blocks/function-blocks-types/script-type-function-block-resetting-the-present-flag.md) to ensure that actions dependent on receipt of a message trigger only once each time the message arrives. In the example in Figure 2, the script waits until **Receive Message 1** arrives before taking any further action (Step 1). Once it is received, **Clear Stats** is used to clear the **Present** flag (Step 2). Then an outgoing message, **Transmit Message A**, is sent (Step 3) and the function block automatically resumes back at Step 1. Without clearing the **Present** flag, it would still have the value **True** and **Transmit Message A** would be sent on the next iteration, the process repeating indefinitely.

**Important Note:** Using **Clear Stats** in this manner resets not only the **Present** flag, but all other information related to the message, including its data. If you will need to work with other properties or data in the message, it is recommended that you instead use the more precise [Set Value option](/vspy-3-documentation/3.9.22/vehicle-spy-main-menus/main-menu-scripting-and-automation/function-blocks/function-blocks-types/script-type-function-block-resetting-the-present-flag.md) for clearing the flag.

![Figure 2: Example function block script using Clear Stats to clear the Present flag of a receive message. This also clears the other data for the message.](/files/ipR6lmUUiZ1p5WvWUtkQ)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.intrepidcs.com/vspy-3-documentation/3.9.22/vehicle-spy-main-menus/main-menu-scripting-and-automation/function-blocks/function-blocks-types/script-type-function-block-commands/script-type-function-block-command-clear-stats.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
