# Funscript Check Tools (show infomation/stats and overspeed)

**URL:** <https://discuss.eroscripts.com/t/funscript-check-tools-show-infomation-stats-and-overspeed/323396>\
**Category:** Software\
**Tags:** scriptor-tools\
**Created:** [July 5, 2026, 11:29pm UTC](https://discuss.eroscripts.com/t/funscript-check-tools-show-infomation-stats-and-overspeed/323396 "2026-07-05T23:29:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nullptr\_cast](https://discuss.eroscripts.com/user_avatar/discuss.eroscripts.com/nullptr_cast/32/432188_2.png) [@nullptr\_cast](https://discuss.eroscripts.com/u/nullptr_cast)\
**Post date:** [July 5, 2026, 11:29pm UTC](https://discuss.eroscripts.com/t/funscript-check-tools-show-infomation-stats-and-overspeed/323396/1 "2026-07-05T23:29:08Z")

</div>

### Resource

> **Click me – check\_stats.py**
>
> Copy the text and save it as `check_stats.py`.
> 
> ```python
> import json
> import sys
> 
> def stats(file):
> with open(file, encoding='utf-8') as f:
> data = json.load(f)
> acts = data['actions']
> n = len(acts)
> durations = [acts[i+1]['at'] - acts[i]['at'] for i in range(n-1)]
> speeds = []
> for i, d in enumerate(durations):
> if d > 0:
> diff = abs(acts[i+1]['pos'] - acts[i]['pos'])
> speeds.append(diff / (d / 1000.0))
> max_speed = max(speeds) if speeds else 0
> avg_speed = sum(speeds) / len(speeds) if speeds else 0
> duration = data['metadata']['duration'] # 单位：秒
> return n, max_speed, avg_speed, duration
> 
> if __name__ == ' __main__':
> if len(sys.argv) != 2:
> print("用法: python check_stats.py <json文件>")
> sys.exit(1)
> n, max_s, avg_s, dur = stats(sys.argv[1])
> print(f"动作数: {n}")
> print(f"最大速度: {max_s:.2f}")
> print(f"平均速度: {avg_s:.2f}")
> # 格式化显示持续时间（转为分:秒）
> mins = int(dur // 60)
> secs = int(dur % 60)
> print(f"持续时间: {mins}分{secs}秒")
> 
> ```

> **Click me – check\_overspeed.py**
>
> Copy the text and save it as `check_overspeed.py`.
> 
> ```python
> import json
> import sys
> 
> def find_overspeed(file):
> with open(file, encoding='utf-8') as f:
> data = json.load(f)
> acts = data['actions']
> for i in range(len(acts)-1):
> dt = acts[i+1]['at'] - acts[i]['at']
> if dt == 0:
> continue
> dp = abs(acts[i+1]['pos'] - acts[i]['pos'])
> speed = dp / (dt / 1000.0)
> if speed > 600:
> print(f"索引 {i}->{i+1}: 速度 {speed:.2f}, 位置差 {dp}, 时间差 {dt}ms")
> 
> if __name__ == ' __main__':
> if len(sys.argv) != 2:
> print("用法: python check_overspeed.py <json文件>")
> sys.exit(1)
> find_overspeed(sys.argv[1])
> 
> ```

## Introduce

**Funscript Check Tools** are two tiny Python scripts that quickly inspect a single‑track `.funscript` (or JSON) file.

- **`check_stats.py`** prints total actions, maximum / average speed, and duration.
- **`check_overspeed.py`** lists every adjacent pair where the speed exceeds **600 units/second**.

> _They are designed for simple quality checks before or after processing other tools. They do **not** work with multi‑axis (merged) files – only one `actions` array is allowed._

## Usage

(Python 3.6+ required.)

```bash
# Basic statistics
python check_stats.py <file.funscript>

# Find overspeed points
python check_overspeed.py <file.funscript>

```

> **Key Features and How It Works**
>
> ### Key Features
> 
> - **Instant statistics** – `check_stats.py` counts actions, computes peak and mean speed, and reads the `duration` from metadata (if present).
> - **Overspeed scanner** – `check_overspeed.py` walks through every consecutive pair, calculates instantaneous speed, and outputs any pair that exceeds 600 units/s.
> - **Single‑track only** – both scripts assume the JSON contains a plain `"actions"` array at the top level. If you feed them a merged file with `"axes"`, they will fail or give wrong results.
> 
> ### How It Works
> 
> 1. Load the JSON file and access the `"actions"` list.
> 2. Iterate over indices:
> - `check_stats.py` computes `Δpos/Δtime` for each step, then aggregates min/max/average.
> - `check_overspeed.py` checks every step and prints diagnostic info when speed \> 600.
> 
> 3. Output results directly to the console.

## Example output

**`check_stats.py`**

```auto
动作数: 2847
最大速度: 598.21
平均速度: 187.45
持续时间: 10分42秒

```

**`check_overspeed.py`**

```auto
索引 155->156: 速度 845.67, 位置差 20, 时间差 23ms
索引 427->428: 速度 701.34, 位置差 12, 时间差 17ms
...

```

_If no lines are printed by `check_overspeed.py`, the file is fully within the safe limit._

* * *

**Important** – These tools only examine the main `"actions"` array. For merged multi‑axis files, extract the individual tracks first.

---

<div class="post-metadata">

**Author:** ![Rriik](https://discuss.eroscripts.com/user_avatar/discuss.eroscripts.com/rriik/32/113492_2.png) [@Rriik](https://discuss.eroscripts.com/u/Rriik)\
**Post date:** [July 7, 2026, 9:10pm UTC](https://discuss.eroscripts.com/t/funscript-check-tools-show-infomation-stats-and-overspeed/323396/2 "2026-07-07T21:10:07Z")

</div>

![image](https://eroscripts-discourse.eroscripts.com/original/4X/6/4/e/64e4533250d2a0e25d4957fcbc888ea76125ee68.jpeg)
