Merge remote-tracking branch 'origin/main'

# Conflicts:
#	.idea/workspace.xml
This commit is contained in:
2025-09-16 21:34:27 +08:00
5 changed files with 79 additions and 64 deletions

View File

@@ -211,22 +211,8 @@ class ControlUtils(object):
# 点击一个随机范围
@classmethod
def tap_mini_cluster(cls, center_x: int, center_y: int, session, points=5, duration_ms=60):
"""
以 (center_x, center_y) 为中心,在 3×3 像素范围内摆 `points` 个邻近坐标,
一次性同时按下,持续 `duration_ms` 后抬起。
"""
# 1. 生成邻像素坐标±1 像素内)
cluster = []
for i in range(points):
dx = random.randint(-1, 1)
dy = random.randint(-1, 1)
cluster.append((center_x + dx, center_y + dy))
pass
# 2. 随机持续时间 50100 ms
duration_s = random.randint(50, 100) / 1000.0
# 3. 下发多点触控
session.tap_hold_coords(cluster, duration=duration_s)
# 检测五分钟前和当前的状态是否相同
# @classmethod
# def compareCurrentWithPreviousState(cls,xml):