1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-03-26 04:45:03 +08:00

Merge pull request #1220 from LmeSzinc/dev

Bug fix
This commit is contained in:
LmeSzinc
2022-06-14 01:31:43 +08:00
committed by GitHub
3 changed files with 8 additions and 3 deletions

View File

@@ -480,7 +480,7 @@ def get_server_next_update(daily_trigger):
trigger = [] trigger = []
for t in daily_trigger: for t in daily_trigger:
h, m = [int(x) for x in t.split(':')] h, m = [int(x) for x in t.split(':')]
future = local_now.replace(hour=h, minute=m, second=0, microsecond=0) - diff future = local_now.replace(hour=h, minute=m, second=0, microsecond=0) + diff
future = future + timedelta(days=1) if future < local_now else future future = future + timedelta(days=1) if future < local_now else future
future = future + timedelta(days=1) if future < local_now else future future = future + timedelta(days=1) if future < local_now else future
trigger.append(future) trigger.append(future)

View File

@@ -168,12 +168,12 @@ def get_research_series_jp(image):
series (string): series (string):
""" """
# Set 'prominence = 50' to ignore possible noise. # Set 'prominence = 50' to ignore possible noise.
parameters = {'height': 200, 'prominence': 50} parameters = {'height': 160, 'prominence': 50, 'width': 1}
area = SERIES_DETAIL.area area = SERIES_DETAIL.area
# Resize is not needed because only one area will be checked in JP server. # Resize is not needed because only one area will be checked in JP server.
im = color_similarity_2d(crop(image, area), color=(255, 255, 255)) im = color_similarity_2d(crop(image, area), color=(255, 255, 255))
peaks = [len(signal.find_peaks(row, **parameters)[0]) for row in im[2:-2]] peaks = [len(signal.find_peaks(row, **parameters)[0]) for row in im[5:-5]]
upper, lower = max(peaks), min(peaks) upper, lower = max(peaks), min(peaks)
# print(upper, lower) # print(upper, lower)
if upper == lower and 1 <= upper <= 3: if upper == lower and 1 <= upper <= 3:

View File

@@ -159,6 +159,10 @@ class UI(InfoHandler):
if self.config.Emulator_ControlMethod == "uiautomator2": if self.config.Emulator_ControlMethod == "uiautomator2":
self.device.uninstall_minicap() self.device.uninstall_minicap()
@run_once
def rotation_check():
self.device.get_orientation()
timeout = Timer(5, count=10).start() timeout = Timer(5, count=10).start()
while 1: while 1:
if skip_first_screenshot: if skip_first_screenshot:
@@ -189,6 +193,7 @@ class UI(InfoHandler):
app_check() app_check()
minicap_check() minicap_check()
rotation_check()
# Unknown page, need manual switching # Unknown page, need manual switching
logger.warning("Unknown ui page") logger.warning("Unknown ui page")