mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-09 18:39:04 +08:00
commit
e630e550eb
@ -170,7 +170,9 @@ class AScreenCap(Connection):
|
|||||||
# ValueError: cannot reshape array of size 0 into shape (720,1280,4)
|
# ValueError: cannot reshape array of size 0 into shape (720,1280,4)
|
||||||
raise ImageTruncated(str(e))
|
raise ImageTruncated(str(e))
|
||||||
|
|
||||||
cv2.flip(image, 0, dst=image)
|
# flip without `dst=image`
|
||||||
|
# np.frombuffer creates a read-only memory view, we need to create a writable copy here
|
||||||
|
image = cv2.flip(image, 0)
|
||||||
if image is None:
|
if image is None:
|
||||||
raise ImageTruncated('Empty image after cv2.flip')
|
raise ImageTruncated('Empty image after cv2.flip')
|
||||||
|
|
||||||
|
|||||||
@ -101,7 +101,8 @@ class Scrcpy(ScrcpyCore, Uiautomator2):
|
|||||||
if thread is None or not thread.is_alive():
|
if thread is None or not thread.is_alive():
|
||||||
raise ScrcpyError('_scrcpy_stream_loop_thread died')
|
raise ScrcpyError('_scrcpy_stream_loop_thread died')
|
||||||
if self._scrcpy_last_frame_time > now:
|
if self._scrcpy_last_frame_time > now:
|
||||||
screenshot = self._scrcpy_last_frame.copy()
|
# no copy
|
||||||
|
screenshot = self._scrcpy_last_frame
|
||||||
return screenshot
|
return screenshot
|
||||||
|
|
||||||
@retry
|
@retry
|
||||||
|
|||||||
@ -48,6 +48,13 @@ class AshCombat(Combat):
|
|||||||
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
def handle_exp_info(self):
|
||||||
|
"""
|
||||||
|
META combats don't drop EXP so no handle_exp_info
|
||||||
|
Random background of BATTLE_STATUS may trigger EXP_INFO_B
|
||||||
|
"""
|
||||||
|
return False
|
||||||
|
|
||||||
def handle_battle_preparation(self):
|
def handle_battle_preparation(self):
|
||||||
if super().handle_battle_preparation():
|
if super().handle_battle_preparation():
|
||||||
return True
|
return True
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user