1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-03-19 07:13:34 +08:00

Fix: use appear_on for ROLE_SELECT_ENTER

This commit is contained in:
sui-feng-cb
2026-01-19 02:21:21 +08:00
parent db70207ad3
commit 1eb4d01d88
3 changed files with 8 additions and 5 deletions

View File

@@ -5,6 +5,7 @@ import numpy as np
from scipy import signal
import module.config.server as server
from module.base.button import Button, ButtonGrid
from module.base.timer import Timer
from module.base.utils import color_similarity_2d, crop, random_rectangle_vector, rgb2gray
@@ -16,6 +17,7 @@ from module.logger import logger
from module.map.map_grids import SelectedGrids
from module.ocr.ocr import Duration, Ocr
class ProjectNameOcr(Ocr):
def after_process(self, result):
result = super().after_process(result)
@@ -69,9 +71,9 @@ class IslandProject:
return
# name
dx = {'cn':326, 'en':137}[server.server]
dy = {'cn':0, 'en':2}[server.server]
area = (self.x1 - 446, self.y1, self.x1 - dx, self.y2+dy)
dx = {'cn': 326, 'en': 137}[server.server]
dy = {'cn': 0, 'en': 2}[server.server]
area = (self.x1 - 446, self.y1, self.x1 - dx, self.y2 + dy)
button = Button(area=area, color=(), button=area, name='PROJECT_NAME')
ocr = ProjectNameOcr(button, lang='cnocr')
self.name = ocr.ocr(self.image)
@@ -372,7 +374,7 @@ class IslandProjectRun(IslandUI):
click_timer.reset()
continue
if enter and self.appear_then_click(ROLE_SELECT_ENTER, offset=(5, 5), interval=2):
if enter and self.appear_then_click(ROLE_SELECT_ENTER, threshold=10, interval=2):
success = True
self.interval_clear(GET_ITEMS_ISLAND)
click_timer.reset()