Просмотр исходного кода

Merge pull request #93 from runhey/dev

Dev
huangrunheng 3 лет назад
Родитель
Сommit
0476db8be8

+ 2 - 1
module/config/config_model.py

@@ -274,6 +274,7 @@ if __name__ == "__main__":
         c = ConfigModel()
 
     # c.save()
-    print(c.deep_get(c, 'area_boss.scheduler.success_interval'))
+    print(c.gui_args('Script'))
+    # print(c.deep_get(c, 'area_boss.scheduler.success_interval'))
 
 

+ 3 - 1
module/device/method/window.py

@@ -148,7 +148,9 @@ class Window(Handle):
         if emulator_type == 2:  # mumu模拟器
             SendMessage(self.control_handle_list[0], WM_ACTIVATE, WA_ACTIVE, 0)  # 激活窗口
             # SendMessage(self.control_handle_list[1], WM_ACTIVATE, WA_ACTIVE, 0)  # 激活窗口
-            SendMessage(self.control_handle_list[0], WM_LBUTTONDOWN, 0, MAKELONG(x, y+self.mumu_head_height))  # 模拟鼠标按下 先是父窗口 上面的框高度是57
+            # SendMessage(self.control_handle_list[0], WM_LBUTTONDOWN, 0, MAKELONG(x, y+self.mumu_head_height))  # 模拟鼠标按下 先是父窗口 上面的框高度是57
+            # mumu12模拟器 V3.5.16 之后后可以用下面的方式
+            SendMessage(self.control_handle_list[1], WM_LBUTTONDOWN, 0, MAKELONG(x, y))
             time.sleep((random.randint(100, 200)) / 1000.0)  # 点击弹起改为随机,时间100ms-200ms
             SendMessage(self.control_handle_list[1], WM_LBUTTONUP, 0, MAKELONG(x, y))  # 模拟鼠标弹起 后是子窗口
         elif emulator_type > 2:  # 夜神模拟器

+ 1 - 1
module/gui/context/utils.py

@@ -26,7 +26,7 @@ class Utils(QObject):
     def test_notify(self, _config: str, title: str, content: str) -> bool:
         from module.notify.notify import Notifier
         try:
-            notifier = Notifier(_config)
+            notifier = Notifier(_config, True)
             if notifier.push(title=title, content=content):
                 return "true"
             else:

+ 3 - 5
tasks/BondlingFairyland/script_task.py

@@ -161,6 +161,7 @@ class ScriptTask(GameUi, BondlingBattle, SwitchSoul, BondlingFairylandAssets):
         (2) 超过时间限制了,(探查页面)返回False
         (3) 打满五只球了,(探查界面)返回True
         """
+        self.lock_team()
         while 1:
             # 检查是不是在探查界面,
             if not self.in_search_ui(screenshot=True):
@@ -541,10 +542,7 @@ if __name__ == '__main__':
     device = Device(config)
     task = ScriptTask(config, device)
     image = task.screenshot()
-    # print(task.roi_appear_ball(task.I_BF_LOCAL_3_LITTLE_KURO.roi_back, image))
-    # print(task.ball_number())
+
     con = config.bondling_fairyland
-    # task.run_catch(con.bondling_config, con.bondling_switch_soul, con.battle_config)
-    # task.run_stone(True, con.bondling_config.bondling_stone_class)
-    # task.run_search(con.bondling_config)
+    # task.lock_team()
     task.run()

+ 2 - 1
tasks/Component/GeneralBattle/general_battle.py

@@ -356,7 +356,8 @@ class GeneralBattle(GeneralBuff, GeneralBattleAssets):
                     self.swipe(self.S_BATTLE_RANDOM_RIGHT, interval=20)
             # 重新设置为长战斗
             self.device.stuck_record_add('BATTLE_STATUS_S')
-        time.sleep(0.4)  # 这样的好像不对
+        else:
+            time.sleep(0.4)  # 这样的好像不对
 
     # 判断是否在战斗中
     def is_in_battle(self, is_screenshot: bool = True) -> bool:

+ 1 - 1
tasks/KekkaiUtilize/script_task.py

@@ -270,7 +270,7 @@ class ScriptTask(GameUi, ReplaceShikigami, KekkaiUtilizeAssets):
 
             if self.appear(self.I_U_ENTER_REALM):
                 break
-            if self.appear_then_click(self.I_UTILIZE_ADD, interval=1.5):
+            if self.appear_then_click(self.I_UTILIZE_ADD, interval=2):
                 continue
         logger.info('Enter utilize')
         return True

+ 2 - 2
tasks/MysteryShop/script_task.py

@@ -230,6 +230,6 @@ if __name__ == '__main__':
     t = ScriptTask(c, d)
     t.screenshot()
 
-    # t.run_shop(t.config.mystery_shop.shop_config)
-    t.shop_reward()
+    t.run_shop(t.config.mystery_shop.shop_config)
+    # t.shop_reward()
 

+ 3 - 3
tasks/RichMan/mall/special.py

@@ -161,13 +161,13 @@ class Special(Buy, MallNavbar):
         # logger.info(f'上中点是:{upper_midpoint}')
         # logger.info(f'数字的ROI是: {self.O_SP_RES_NUMBER.roi}')
         result = self.O_SP_RES_NUMBER.ocr(self.device.image)
-        result = result.replace('?', '2').replace('?', '2')
+        result = result.replace('?', '2').replace('?', '2').replace(':', ';')
         try:
-            result = re.findall(r'\d+', result)[0]
+            result = re.findall(r'剩余购买次数:(\d+)', result)[0]
             result = int(result)
         except:
             result = 0
-        logger.info(f'Remain {result}')
+        logger.info(f'Remain [{result}]')
         return result