perryhuynh / azurlane-auto

ALAuto - Azur Lane Automation Tool
Do What The F*ck You Want To Public License
22 stars 8 forks source link

ADB commands used doesn't support Android 5 or below #11

Closed ryuuzake closed 5 years ago

ryuuzake commented 5 years ago

Environment details

Issue variability

Consistent

Issue

There are some adb command that doesn't support older device e.g. Android 5 or below. This cause the logic to take screenshot in emulator/device returning error thus creating error on opencv.imdecode. I'm using Nox emulator to create this bug. Nox emulator use Android 4.

Log

[2019-01-27 08:48:26] Initializing config module
[2019-01-27 08:48:26] Validating config
[2019-01-27 08:48:26] Starting azurlane-auto!
already connected to 127.0.0.1:62001
[2019-01-27 08:48:26] Navigating to map.
error: closed
Traceback (most recent call last):
  File "azurlane-auto.py", line 96, in <module>
    script.run_combat_cycle()
  File "azurlane-auto.py", line 41, in run_combat_cycle
    if self.modules['combat'].combat_logic_wrapper():
  File "D:\Downloads\azurlane-auto\azurlane-auto-master\modules\combat.py", line 57, in combat_logic_wrapper
    Utils.wait_and_touch('map_{}'.format(self.sortie_map), 5, 0.85)
  File "D:\Downloads\azurlane-auto\azurlane-auto-master\util\utils.py", line 196, in wait_and_touch
    if cls.find_and_touch(image, similarity):
  File "D:\Downloads\azurlane-auto\azurlane-auto-master\util\utils.py", line 173, in find_and_touch
    region = cls.find(image, similarity)
  File "D:\Downloads\azurlane-auto\azurlane-auto-master\util\utils.py", line 92, in find
    screen = cls.update_screen()
  File "D:\Downloads\azurlane-auto\azurlane-auto-master\util\utils.py", line 77, in update_screen
    Adb.exec_out('screencap -p'), dtype=numpy.uint8), 0)
cv2.error: OpenCV(3.4.4) C:\projects\opencv-python\opencv\modules\imgcodecs\src\loadsave.cpp:750: error: (-215:Assertion failed) !buf.empty() && buf.isContinuous() in function 'cv::imdecode_'
perryhuynh commented 5 years ago

I'd suggest using a more updated version of Android via Nox or using another emulator such as Android Studio's official emulator

ryuuzake commented 5 years ago

Okay, I'll do it. But you should put in on the README.MD tho, so other people know what android version to use.

Can I communicate with you personally? I think I can help you with this project

perryhuynh commented 5 years ago

Sure I've kind of been inactive due to interviewing for a new job but I'll be able to start working on it again soon, you can contact me on discord at Perry#9205