Giter Site home page Giter Site logo

egoistically / alauto Goto Github PK

View Code? Open in Web Editor NEW
104.0 20.0 42.0 3.58 MB

Azur Lane bot based on azurlane-auto. Discord: https://discord.gg/vCFxDen.

License: Do What The F*ck You Want To Public License

Python 100.00%
azurlane azur-lane azur-lane-automation bot

alauto's Introduction

ALAuto

Updated and semi-rewritten version of azurlane-auto.
Automates Combat, Commissions, Missions, Enhancement, Retiring, Skill Levelling, Dorm Refilling and Dorm Cleaning.

This bot was made for EN server. However, it's now possible to use it on JP thanks to @phantasmalmira (#59). Other servers won't work with current assets.

Requirements on Windows

  • Python 3.7.X installed and added to PATH.
  • Latest ADB added to PATH.
  • ADB debugging enabled emulator with 1920x1080 resolution and Android 5 or newer.

Tested on Windows 10 with BlueStacks and Nox, don't use Nox though.

Installation and Usage

  1. Clone or download this repository.
  2. Install the required packages via pip3 with the command pip3 install -r requirements.txt.
  3. Enable adb debugging on your emulator, on Nox you might also need to enable root.
  4. Change config.ini's IP:PORT to 127.0.0.1 and your emulator's adb port, then change the rest to your likings. If you are using your own phone/device for the bot, enable debbuging on your device and change IP:PORT to your device's name (obtainable through this adb command adb devices -l).
  5. Run ALAuto using the command python ALAuto.py from the bot main directory.

Check the Wiki for more information. It's my first time making one, don't mind me.

Relevant information

  • CPU usage might spike a bit when searching for enemies and boss.
  • If you'd like to disable oil limit or retreat after set them to 0.
  • If you wish to view a changelog, check the commit history.
  • If you'd like to help us during events to release an update faster you can check this guide.

This was made for my own usage, it is far from good and I'm very aware of it. I am posting this because it might be useful to someone, that's all.
If you'd like to contribute in any way make sure to open a pull request or an issue. If you'd like to contact us you can do so through our Discord.

alauto's People

Contributors

asd111333 avatar egoistically avatar fongchinghinunsw avatar gvalls27 avatar hjk22 avatar jmangs avatar kurutsukaren avatar lixtem avatar metaldevops avatar phantasmalmira avatar wiseasswolfofyoitsu avatar zumochi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

alauto's Issues

Out of memory?

I've encountered this error twice now. I forgot to keep the logs when it first happened but seems to happen if I keep it running for ~2 hours

traceback.txt

  File "ALAuto.py", line 218, in <module>
    script.run_sortie_cycle()
  File "ALAuto.py", line 79, in run_sortie_cycle
    self.run_combat_cycle()
  File "ALAuto.py", line 87, in run_combat_cycle
    result = self.modules['combat'].combat_logic_wrapper()
  File "E:\ALAuto\modules\combat.py", line 100, in combat_logic_wrapper
    if not self.clear_map():
  File "E:\ALAuto\modules\combat.py", line 393, in clear_map
    target_info = self.get_closest_target(self.blacklist)
  File "E:\ALAuto\modules\combat.py", line 553, in get_closest_target
    enemies = self.get_enemies(blacklist)
  File "E:\ALAuto\modules\combat.py", line 479, in get_enemies
    l5 = filter(lambda x:x[1] > 80 and x[1] < 977 and x[0] > 180, map(lambda x:[x[0] + 75, x[1] + 110], Utils.find_all('enemy/fleet_3_down', sim - 0.06, self.chapter_map)))
  File "E:\ALAuto\util\utils.py", line 217, in find_all
    match = cv2.matchTemplate(screen, template, cv2.TM_CCOEFF_NORMED)
cv2.error: OpenCV(3.4.4) C:\projects\opencv-python\opencv\modules\core\src\alloc.cpp:55: error: (-4:Insufficient memory) Failed to allocate 16612808 bytes in function 'cv::OutOfMemoryError'

I have 2x4GB DDR3 installed in my system. Here's the full operation log: https://pastebin.com/QrCQXcjE

How to speed up sorties.

Takes me 12 mins to do one sortie on 3-4 and I'm wondering if that's normal. How long does it take you to do a sortie there and how would I be able to speed up the process? Any way to allocate more ram?
Running an i7-7500 cpu with 8 gigs of ram.

Btw, thanks for the bot :)

Stuck upon failing combat

If the player's fleet were to fail, script would interpret the "No remaining fleet" as a commission info message and accept it, after which the game sends you back to the world map, effectively freezing the script (doesn't do any more attempts).

Re-entering the specified map manually seems to resume normal operation as seen by this log

[2019-12-21 16:19:31] Boss fleet was found.
[2019-12-21 16:19:34] Moving towards objective.
[2019-12-21 16:19:37] Starting combat.
[2019-12-21 16:21:31] Found commission info message. ///No remaining fleet message received
[2019-12-21 16:25:24] Current location is: [1510, 551]     ///After manual fix
[2019-12-21 16:25:24] Enemies found at: [[1002, 258], [1188, 492]]
[2019-12-21 16:25:24] Closest enemy is at [1188, 492]
[2019-12-21 16:25:27] Moving towards objective.
[2019-12-21 16:25:39] Starting combat.
[2019-12-21 16:26:43] Combat ended.

Slow operation, no retry after failing to find specified map

Hi I've managed to get the bot working and noticed that it's operating speed is painfully slow (specifically scanning mob ships which takes roughly 5s), is this a hardware-based problem or is this intended speed?
I'm running i5-3550, 8GB DDR3, RX 580 4GB, Windows 10 (version 1903).

Edit 1: I noticed after 2 runs, the bot somehow goes searching for the map I specified (3-4) after having already started map clear, this is really confusing and when returning to the world map, the bot doesn't seem to try looking for the map again.
https://imgur.com/krEuBce

Edit 2: Would it be possible to make this work on smaller resolutions? This would reduce the chances of misclicks and disrupting the bot's operation, I highly doubt this is the culprit of said issue in Edit 1.

Other than that the bot works flawlessly, thank you very much for making this.

Stuck if a ship sinks and the fleet cannot be formed any more

If one of the ships sinks in the 1:1 composition, a message will popup saying that the fleet cannot be formed anymore and user will be force to retreat from the map. The bot will then stuck at the popup.
I took a quick look at the bot code and found out that it didn't handle the above case.
Hopefully, you can update the code to handle it.

Anyways, thanks a lot for making the bot.

cv2 error

Hello again, I've updated to the latest ALAuto version with SED removed. When trying to run the script with the latest ADB platform-tools 1.0.41 version 29.0.4. I get this output.

[2019-09-29 17:26:21] Initializing config module
[2019-09-29 17:26:21] Validating config
[2019-09-29 17:26:21] Starting ALAuto!
* daemon not running; starting now at tcp:5037
* daemon started successfully
[2019-09-29 17:26:36] Sucessfully connected to the service.
error: more than one device/emulator
Traceback (most recent call last):
  File "ALAuto.py", line 143, in <module>
    Utils.update_screen()
  File "G:\AzurLane\ALAuto-master\util\utils.py", line 79, in update_screen
    screen = cv2.imdecode(numpy.fromstring(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_'```

Any insights on what I may have setup incorrectly?

mac os x/linux

Got a version of this working in mac os x, however using subprocess shell=True will fork a subshell causing the call to adb to fail. Simply removing this flag is enough to make the rest of the script work, i can give you a pull request but i'm not sure if it'd fail windows.

Tactical Class stuck in loop if someone's skill is maxed lv 10

Basically the script continue tapping on the confirm button of skill lesson ended when the prompt is actually about the skill being maxed, no idea if this issue is present in EN since I don't know how the prompt looks, I imagine it's the same though.

Prompt showing Noshiro finished enhancing, skill level 9 -> 10
hqskill

? node collection

I would like to suggest adding the option to acquire all ? nodes before approaching the boss. Many of the farm locations are popular because of their high ? node density.

How can we support fighting Sirens?

For most of events, there are some sirens spawn to the map.

  • Code doesn't recognize and not try to calculate them yet.
  • The sirens graphic is quite big target which conceal other normal enemy fleet then the code cannot get target enemy location

So I try to add support them at below code in combat.py:

ALAuto/modules/combat.py

Lines 442 to 460 in 70f52a5

while self.l == []:
Utils.update_screen()
l1 = filter(lambda x:x[1] > 80 and x[1] < 977 and x[0] > 180, map(lambda x:[x[0] - 3, x[1] - 45], Utils.find_all('enemy/fleet_level', sim - 0.15, self.chapter_map)))
l1 = [x for x in l1 if (not self.filter_blacklist(x, blacklist))]
l2 = filter(lambda x:x[1] > 80 and x[1] < 977 and x[0] > 180, map(lambda x:[x[0] + 75, x[1] + 110], Utils.find_all('enemy/fleet_1_down', sim, self.chapter_map)))
l2 = [x for x in l2 if (not self.filter_blacklist(x, blacklist))]
l3 = filter(lambda x:x[1] > 80 and x[1] < 977 and x[0] > 180, map(lambda x:[x[0] + 75, x[1] + 110], Utils.find_all('enemy/fleet_2_down', sim - 0.02, self.chapter_map)))
l3 = [x for x in l3 if (not self.filter_blacklist(x, blacklist))]
l4 = filter(lambda x:x[1] > 80 and x[1] < 977 and x[0] > 180, map(lambda x:[x[0] + 75, x[1] + 130], Utils.find_all('enemy/fleet_3_up', sim - 0.06, self.chapter_map)))
l4 = [x for x in l4 if (not self.filter_blacklist(x, blacklist))]
l5 = filter(lambda x:x[1] > 80 and x[1] < 977 and x[0] > 180, map(lambda x:[x[0] + 75, x[1] + 110], Utils.find_all('enemy/fleet_3_down', sim - 0.06, self.chapter_map)))
l5 = [x for x in l5 if (not self.filter_blacklist(x, blacklist))]
self.l = l1 + l2 + l3 + l4 + l5
sim -= 0.005
self.l = Utils.filter_similar_coords(self.l)
return self.l

I added new l6, l7, l8 by trying to calculate from graphic from enemy sirens of each type (DD, CL, CA) but couldn't make it.

I'm quite new in python so please shade me some light so I can open PR later :)

connected but do nothing usefull

Hello i try to use the script but it not work
Nox rooted + Debug enabled
i start ADB :

> adb connect 127.0.0.1:62001
connected to 127.0.0.1:62001

i have this on config :

[Network]
Service: 127.0.0.1:62001

and i start the script :

PS C:\Users\Miaou\ALAuto> python .\ALAuto.py
[2019-10-17 18:49:35] Initializing config module
[2019-10-17 18:49:35] Validating config
[2019-10-17 18:49:35] Starting ALAuto!
* daemon not running; starting now at tcp:5037
* daemon started successfully
[2019-10-17 18:49:41] Sucessfully connected to the service.

aaaaand... he no thing but spam the top left corner.

i missed something ?

Will this event be added?

Will this event be made available for the bot?

When i put E-A1 in the config file it doesn't work.

Unable to Reach Target and others

There are instances when the bot cant proceed because no enemy is within the range of the Fleet. Will the bot automatically move my fleet? I waited for a while but my fleet is not moving.

Also, is there a guide to install this bot in a phone?

Event comparison using wrong operator

if self.events['name'] is not 'Crosswave' or ',' not in self.events['levels']:

The comparison if self.events['name'] is not 'Crosswave' should be self.events['name'] != 'Crosswave'.

The former comparison checks it they reference the same object, whereas the latter compares whether they're equal.

Merge pull request #47 - Script gets stuck on E-D3 in certain cases

Issue occurs when the available targets are the sirens and the remaining fleets are tucked away in the top and bottom left corners.
The triangles that the script scans for aren't visible,
One is tucked away behind the list of ships in your active fleet, and the other is just tucked under the timer as such:

Bluestacks_Yn172HG2qg

Another interesting situation where my fleet finds itself trapped behind a siren that is blocking the triangle leading to blacklisting and no progress

Bluestacks_9XvxlHlVFW

As such there are no targets available and the script will just cycle between blacklisting points and do nothing.
This happens most commonly early on when there are few targets aside from the sirens available.

cmd_KaXD0tTFdn

Is it possible to integrate #48 in the event that the script is unable to find another target?
Or given that is an issue, make the script retreat and re-attempt the map (with the option to limit attempts so that it doesn't eat our oil if there is a recurring issue)
To clarify, this is on the latest build post merge

Results when closing with ^C

It might be nice to see the combat results you get normally after a cycle is done also when you stop the script with for example Ctrl+C.

I don't think a handler is implemented right now?

Error: Wrong resolution.

Script won't run, citing that the resolution is not 1920x1080, even though within Bluestacks it is set to 1920x1080. I've tried setting a custom resolution to 1920x1080 as well, with the same results, and none of the 3 DPI settings below worked either. Fullscreen mode on Bluestacks did not work.

image

Just a question, speed of auto farm.

the auto farming work well (but no kaga TT__TT ), thank again for this !

i juste have a little question, for each action it's take realy a long time, for exemple in 30min the script to only 4 complet run.

i am cursions to know, it's because a limitation (it's take time to reconize the image maybe) or a choice for avoid an ban ?

Stuck on level requirement commisions

Hello, I've noticed that the bot gets stuck when trying to start high-level requirement commissions.

I have 2+ โ‰ฅ ship level requirement.
They are not in any sortie.
They are unlinked from a formation.
Bluestacks_7FhltyBonk
Bluestacks_PbixIZqptS

The bot repeatedly attempts to click recommend on the lowest commission which is a level 100 (I have a level 100, but it won't show up when recommend is clicked)
Bluestacks_g6fhNMq2Kt

The same happens on level 70 commissions despite having 2+ ships that are 70+
Bluestacks_Qdq1REdLOs

I think it should either check to see:
If the dialog popping up saying it can't do the commission comes up
Or if it's previously pressed the bottom one and it didn't work to try the next one in line (By way of blacklist or something)

Works great on Windows 7 64bit with LDPlayer

First of all thank you for sharing and updating this amazing script. I've got it running on Windows 7 64bit with LDPlayer 1920x1080 resolution, 30fps, Android 5.1.1, Python 3.4.7 and the ADB and SED links provided.

I did have to take one extra step after installing the requirements.txt. For some reason the opencv module threw an error until I ran pip3 install opencv-contrib-python. Now it's working great, maybe its a Windows 7 thing.

Also noticed the script would hang on the Auto Combat Alert popup which I thought I had turned off. Maybe something to add to the Readme to make sure it's turned off.

Thank you for this huge improvement in grinding 3-4 and I'm sure many more. I got Akagi but still need to get that Kaga!

Get's stuck when unable to reach enemy

When the bot selects an enemy that the fleet can't reach, it seems to be stuck there. This seems to only happen if the enemy is not a boss. I had to manually select an enemy.
bot error log

Can't scan em at top location.

if em spawn at top location. cv2 or picture in assets folder can't match it.

can add code to swipe up or something for small map ?

image

Bot won't start

I tried to start the bot but i wont work
I have bluestacks installed ADB Enabled and resolution on 1920x1080
My config.ini

[Network]
Service: 127.0.0.1:5555

[Updates]
Enabled: True
Channel: Development

[Combat]
Enabled: True
Map: 3-4
OilLimit: 1000
RetireCycle: 2

[Modules]
Commissions: True
Enhancement: False
Missions: False
Retirement: False

[Events]
Enabled: False
Event: Crosswave
Levels: EX,H,N,E

when I start the script

[2019-12-08 19:30:19] Initializing config module
[2019-12-08 19:30:19] Validating config
[2019-12-08 19:30:19] Starting ALAuto!
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
[2019-12-08 19:30:24] Successfully connected to the service.

after this nothing happens

No module named modules.combat

i am getting the following error.

Traceback (most recent call last):
File "ALAuto.py", line 3, in
from modules.combat import CombatModule
ImportError: No module named modules.combat
PS D:\User\Downloads\Tools\ALAuto-master>

Stuck on 7-1 boss

The bot refuses to click on the boss fleet in 7-1. It keeps clicking on the area outside the map zone. The console doesn't detect the boss fleet it seems.
Edit: Just tested it on world 8-1. Seems like the small map is the problem, I guess.
Untitled

Retreat after X fights

Just a thought. Because you have only 1 fleet so when you farm, sometimes you don't want your fleet to attack boss .

in event map B2 B4 has problem

B4

it's large map and CV2 fail or miss location scan. and fail to go boss node.

image

B2

location [1141, 969] is button Retreat and scripts auto click at thst point.

image

Suck at result screen

When I run this script, the script would be stuck at the second result screen. First one is result screen shows you got S and 3 stars, second is the one that shows the exp and mvp of the shipgirls. The script would click once and stop there. I let it hang for 20 mins just in case. If I manually click pass the result screen, the script would keep going with "combat ended". Below is the feedback when I ctrl+c.

`Traceback (most recent call last):

File "ALAuto.py", line 191, in
script.run_sortie_cycle()
File "ALAuto.py", line 72, in run_sortie_cycle
self.run_combat_cycle()
File "ALAuto.py", line 80, in run_combat_cycle
result = self.modules['combat'].combat_logic_wrapper()
File "E:\Downloads\ALAuto-master\modules\combat.py", line 76, in combat_logic_wrapper
if not self.clear_map():
File "E:\Downloads\ALAuto-master\modules\combat.py", line 364, in clear_map
self.battle_handler()
File "E:\Downloads\ALAuto-master\modules\combat.py", line 170, in battle_handler
if Utils.find("menu/drop_ssr"):
File "E:\Downloads\ALAuto-master\util\utils.py", line 189, in find
match = cv2.matchTemplate(screen, template, cv2.TM_CCOEFF_NORMED)`

PS Thanks for the hard work

error: more than one emulator

Hello, trying to use this amazing script again and running into error: more than one emulator again.
I also tried the -l legacy parameter to see if SED would work. Any ideas what I might have wrong?

Without -l:

[2019-12-15 02:16:34] Initializing config module
[2019-12-15 02:16:34] Validating config
[2019-12-15 02:16:34] Starting ALAuto!
* daemon not running; starting now at tcp:5037
* daemon started successfully
[2019-12-15 02:16:40] Successfully connected to the service.
[2019-12-15 02:16:59] Found specified map.
[2019-12-15 02:17:11] Started map clear.
error: more than one emulator
Traceback (most recent call last):
  File "ALAuto.py", line 197, in <module>
    script.run_sortie_cycle()
  File "ALAuto.py", line 72, in run_sortie_cycle
    self.run_combat_cycle()
  File "ALAuto.py", line 80, in run_combat_cycle
    result = self.modules['combat'].combat_logic_wrapper()
  File "C:\Users\Games\Desktop\ALAuto-master\modules\combat.py", line 86, in combat_logic_wrapper
    if not self.clear_map():
  File "C:\Users\Games\Desktop\ALAuto-master\modules\combat.py", line 357, in clear_map
    target_info = self.get_closest_target(self.blacklist)
  File "C:\Users\Games\Desktop\ALAuto-master\modules\combat.py", line 510, in get_closest_target
    fleet_location = self.get_fleet_location()
  File "C:\Users\Games\Desktop\ALAuto-master\modules\combat.py", line 470, in get_fleet_location
    Utils.update_screen()
  File "C:\Users\Games\Desktop\ALAuto-master\util\utils.py", line 84, in update_screen
    screen = cv2.imdecode(numpy.fromstring(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_'

With -l:

[2019-12-15 02:17:35] Initializing config module
[2019-12-15 02:17:35] Validating config
[2019-12-15 02:17:35] Starting ALAuto!
[2019-12-15 02:17:35] Enabled sed usage.
* daemon not running; starting now at tcp:5037
* daemon started successfully
[2019-12-15 02:17:41] Successfully connected to the service.
error: more than one emulator
Traceback (most recent call last):
  File "ALAuto.py", line 184, in <module>
    Utils.update_screen()
  File "C:\Users\Games\Desktop\ALAuto-master\util\utils.py", line 82, in update_screen
    screen = cv2.imdecode(numpy.fromstring(Adb.exec_out(r"screencap -p | sed s/\r\n/\n/"),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_'

Merge pull request #47 - Checking HQ, "Cat Lodge Alert"

HQ_alert

Just a small thing to point out, the alert in my case was for the Academy, not cat lodge (so the script failed to correctly identify the alert) Not sure whether this may cause an issue for others based on their config file.

[Headquarters]
Dorm: True
Academy: False
SkillBookTier: 2

[Modules]
Commissions: True
Enhancement: False
Missions: False
Retirement: False

In my case i am not automating any Skill training so the check doesn't matter, and to clarify i am using the latest build as of this time.

i have question.

Commissions: True
in Commission screen. you can set script disable or don't click a mission lost 1200 oil ?

or disable it's in config.ini

Commissions: False

i like auto commisions but sometime it's click

Self Training III (lost 1200 oil but i don't click it)

KeyError: 'oil_limit'

[2019-10-31 13:42:06] Initializing config module
[2019-10-31 13:42:06] Validating config
[2019-10-31 13:42:06] Starting ALAuto!
* daemon not running; starting now at tcp:5037
* daemon started successfully
[2019-10-31 13:42:12] Successfully connected to the service.
Traceback (most recent call last):
  File "ALAuto.py", line 188, in <module>
    if script.should_sortie():
  File "ALAuto.py", line 64, in should_sortie
    Utils.check_oil(self.config.combat['oil_limit'])
KeyError: 'oil_limit'1

KeyError is logic error means the oil_limit key doesn't exist. I already use Nox, 1920x1080 resolution, and ADB connection is fine.

My config.ini

[Network]
Service: 127.0.0.1:62001

[Updates]
Enabled: True
Channel: Development

[Combat]
Enabled: False
Map: 3-4
OilLimit: 1000
RetireCycle: 2

[Modules]
Commissions: False
Enhancement: False
Missions: False
Retirement: False

[Events]
Enabled: False
Event: Crosswave
Levels: EX,H,N,E

Random crashes on new fight

It randomly crashes, sometimes it shows insufficent memory from OpenCV but it doesnt even use more than 500mbs of ram.
Config:
AMD Fx 8350 4.2GHz
16GB Ram
RX 480 8GB
memory

crash

Adb exec-out not working properly

Adb exec-out screencap is buggy for those who didn't have a proper Android SDK installation. Testing the command adb exec-out screencap -p | sed s/\r\n/\n/ produces corrupted image.

I also tried many different of sed'ed and perl'ed flavor of this command and still gets corrupted file (tested on multiple machines with other users)

Suggestion: Offering a slower alternative for update_screen:

  • Using native adb shell screencap to save a screenshot on emulator
  • Use adb pull to pull the screenshot -> proper screenshot

Example:

adb.py, add to last:

    @staticmethod
    def pull(args):
        """Executes the command via adb shell

        Args:
            args (string): Command to execute.
        """
        cmd = ['adb', 'pull'] + args.split(' ')
        #Logger.log_debug(str(cmd))
        subprocess.call(cmd, shell=False, stderr=subprocess.DEVNULL)

utils.py, line 79, replace / add slower alternative method for screencap:

            Adb.shell("screencap /sdcard/screenshot.png")
            Adb.pull("/sdcard/screenshot.png")
            screen = cv2.imdecode(numpy.fromstring(open("screenshot.png","rb").read(),dtype=numpy.uint8),0)

While this method of updating screen will definitely be slower, the reliability is 100%

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.