Egoistically / ALAuto

Azur Lane bot based on azurlane-auto. Discord: https://discord.gg/vCFxDen.
Do What The F*ck You Want To Public License
106 stars 43 forks source link

Running multiple instances of this bot doesn't seem to work #135

Open observeroftime02 opened 4 years ago

observeroftime02 commented 4 years ago

I'd like to run several instances of this bot at the same time. I created multiple folders all with their own copy of the scripts in this repository and configure them to connect to the proper android device. Starting up a second instance of the script crashes the first one. Am I doing something wrong? Here's the error it spits out.

Traceback (most recent call last): File "ALAuto.py", line 234, in Utils.update_screen() File "C:\Users\USERNAME\ALAuto-master-note5\util\utils.py", line 154, in update_screen screen = cv2.imdecode(numpy.fromstring(Adb.execout('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'

As it stands I have to use a separate virtual machine per instance of the script I'd like to run which isn't exactly ideal, anyone got any ideas?

hjk22 commented 4 years ago

Each time the script is launched, the adb server get killed and then restarted: this is what it's preventing you from running multiple instances of the bot, I think. Try commenting this line. https://github.com/Egoistically/ALAuto/blob/fefeaa51089803eaa04d7b7f3e37a7d80083a51d/util/adb.py#L14