From 91e83271a46766eae5acceec14d929e428d005e4 Mon Sep 17 00:00:00 2001 From: LmeSzinc Date: Tue, 14 Apr 2020 12:26:57 +0800 Subject: [PATCH] =?UTF-8?q?Add:=20=E5=A2=9E=E5=8A=A0=E4=BA=86=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E4=B8=80=E9=94=AE=E9=80=80=E5=BD=B9=E7=9A=84=E6=94=AF?= =?UTF-8?q?=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 增加了根据设置选择切换函数的装饰器 - 增加了ADB截图和点击的设置, 默认使用ADB截图, uiautomator2点击 - 更新了assets.py文件, 上次commit忘记了 --- assets/retire/ONE_CLICK_RETIREMENT.png | Bin 0 -> 12910 bytes .../{SORTNG_CLICK.png => SORTING_CLICK.png} | Bin config/template.ini | 3 + module/base/decorator.py | 68 ++++++++++++++++++ module/config/argparser.py | 9 ++- module/config/config.py | 6 +- module/config/dictionary.py | 3 + module/daemon/assets.py | 4 +- module/device/control.py | 8 +-- module/device/device.py | 4 +- module/exercise/assets.py | 4 ++ module/handler/assets.py | 1 + module/retire/assets.py | 1 + module/retire/retirement.py | 37 +++++++++- module/reward/assets.py | 1 + module/reward/reward.py | 2 +- 16 files changed, 138 insertions(+), 13 deletions(-) create mode 100644 assets/retire/ONE_CLICK_RETIREMENT.png rename assets/retire/{SORTNG_CLICK.png => SORTING_CLICK.png} (100%) create mode 100644 module/base/decorator.py diff --git a/assets/retire/ONE_CLICK_RETIREMENT.png b/assets/retire/ONE_CLICK_RETIREMENT.png new file mode 100644 index 0000000000000000000000000000000000000000..7b9dcb8186c5e763215ace88ee6def83b5824936 GIT binary patch literal 12910 zcmeHMXEfVy*p4o3X;n*Ut(KOerKAy35kv%$c+ffC+8%;bMEJQ?)$p0>wexpHPAYD_Uc&x0B}x6TO9-d zoMe1G_WSfP#_~Wwmx-~Q@zyr?0{~bq{rxZjzNB*l0B7}G9zTBi^re@-m)}b-?`t}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6J7vJRfQYe1@ zX~p8VIhRy}kH0UwAXI7JLcLx= amount: + break + + logger.info(f'Total retired round: {total // 10}') + return total + + @Config.when(USE_ONE_CLICK_RETIREMENT=False) def retire_ships(self, amount=None, rarity=None): """ Args: diff --git a/module/reward/assets.py b/module/reward/assets.py index b42fefffa..6833544fc 100644 --- a/module/reward/assets.py +++ b/module/reward/assets.py @@ -10,6 +10,7 @@ COMMISSION_DAILY = Button(area=(35, 132, 67, 186), color=(208, 172, 118), button COMMISSION_HAS_PENDING = Button(area=(357, 300, 359, 330), color=(86, 201, 173), button=(357, 300, 359, 330), file='./assets/reward/COMMISSION_HAS_PENDING.png') COMMISSION_NOTICE_AT_CAMPAIGN = Button(area=(1054, 647, 1061, 654), color=(197, 89, 64), button=(1054, 647, 1061, 654), file='./assets/reward/COMMISSION_NOTICE_AT_CAMPAIGN.png') COMMISSION_START = Button(area=(1028, 322, 1156, 383), color=(229, 175, 113), button=(1028, 322, 1156, 383), file='./assets/reward/COMMISSION_START.png') +COMMISSION_STOP_SCROLLING = Button(area=(115, 236, 179, 487), color=(50, 55, 74), button=(115, 236, 179, 487), file='./assets/reward/COMMISSION_STOP_SCROLLING.png') COMMISSION_URGENT = Button(area=(35, 231, 68, 281), color=(215, 188, 124), button=(35, 231, 68, 281), file='./assets/reward/COMMISSION_URGENT.png') EXP_INFO_S_REWARD = Button(area=(498, 140, 557, 154), color=(233, 241, 127), button=(498, 140, 557, 154), file='./assets/reward/EXP_INFO_S_REWARD.png') MISSION_MULTI = Button(area=(1041, 8, 1101, 39), color=(226, 192, 142), button=(1041, 8, 1101, 39), file='./assets/reward/MISSION_MULTI.png') diff --git a/module/reward/reward.py b/module/reward/reward.py index 108c84449..ca8320ee6 100644 --- a/module/reward/reward.py +++ b/module/reward/reward.py @@ -85,7 +85,7 @@ class Reward(RewardCommission): reward = True continue - if not self.appear(page_reward.check_button): + if not self.appear(page_reward.check_button) or self.info_bar_count(): exit_timer.reset() continue