Skip to content

Commit facb389

Browse files
committed
fix(executor): touch 参数顺序 (x,y,contact,pressure) 不是 (contact,x,y,pressure)
post_touch_down/move 参数是 (x, y, contact, pressure),之前写反导致 contact=y 坐标→out of range。 PC: contact=0(左键) 模拟器: contact=1(右键)。
1 parent a06ff5c commit facb389

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

custom/maa/action/executor.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -290,16 +290,16 @@ def _deploy(self, context: Context, ctrl: Controller, action: Action, is_pc: boo
290290

291291
if is_pc:
292292
# PC: 左键拖拽
293-
ctrl.post_touch_down(0, avatar_x, avatar_y, 1).wait()
293+
ctrl.post_touch_down(avatar_x, avatar_y, 0, 1).wait()
294294
time.sleep(0.05)
295-
ctrl.post_touch_move(0, deploy_x, deploy_y, 1).wait()
295+
ctrl.post_touch_move(deploy_x, deploy_y, 0, 1).wait()
296296
time.sleep(0.05)
297297
ctrl.post_touch_up(0).wait()
298298
else:
299299
# 模拟器: 右键拖拽(contact=1)
300-
ctrl.post_touch_down(1, avatar_x, avatar_y, 1).wait()
300+
ctrl.post_touch_down(avatar_x, avatar_y, 1, 1).wait()
301301
time.sleep(0.1)
302-
ctrl.post_touch_move(1, deploy_x, deploy_y, 1).wait()
302+
ctrl.post_touch_move(deploy_x, deploy_y, 1, 1).wait()
303303
time.sleep(0.1)
304304
ctrl.post_touch_up(1).wait()
305305

@@ -333,9 +333,9 @@ def _set_direction(self, ctrl: Controller, action: Action, is_pc: bool) -> None:
333333
x2 = int(max(0, min(1, x + dx)) * 1280)
334334
y2 = int(max(0, min(1, y + dy)) * 720)
335335

336-
ctrl.post_touch_down(0, x1, y1, 1).wait()
336+
ctrl.post_touch_down(x1, y1, 0, 1).wait()
337337
time.sleep(0.05)
338-
ctrl.post_touch_move(0, x2, y2, 1).wait()
338+
ctrl.post_touch_move(x2, y2, 0, 1).wait()
339339
time.sleep(0.05)
340340
ctrl.post_touch_up(0).wait()
341341
time.sleep(config.GENERAL_WAIT_MS / 1000)

0 commit comments

Comments
 (0)