Skip to content

Commit fecd04d

Browse files
authored
fix(FishNew): 在钓鱼的while循环中更新green_bar和cursor以避免误判 (#283)
1 parent ac068e0 commit fecd04d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

agent/custom/action/AutoFish/auto_fish_withoutCV.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ def run(
5858
):
5959
time.sleep(0.5)
6060
image = context.tasker.controller.post_screencap().wait().get()
61-
6261
click_blank = context.run_recognition("SceneClickBlankToExit", image)
6362
if click_blank and click_blank.hit:
6463
PrintT(context, "autofish.fish_caught")
@@ -76,7 +75,8 @@ def run(
7675
context, "钓鱼异常结束(可能是鱼溜走),继续钓鱼"
7776
) # 通常不会执行这一步
7877
return CustomAction.RunResult(success=True)
79-
continue
78+
green_bar = context.run_recognition("FishGreenBar", image)
79+
cursor = context.run_recognition("FishCursor", image)
8080

8181
green_bar_x, green_bar_y, green_bar_w, green_bar_h = green_bar.box
8282
cursor_x, cursor_y, cursor_w, cursor_h = cursor.box

0 commit comments

Comments
 (0)