浏览代码

!2 fix multi account

pcacc 3 月之前
父节点
当前提交
05d73f52d2
共有 3 个文件被更改,包括 36 次插入8 次删除
  1. 33 4
      app_dongri.py
  2. 二进制
      dongri_img/place/title.png
  3. 3 4
      dongri_task.py

+ 33 - 4
app_dongri.py

@@ -26,6 +26,7 @@ autoTask = None
 isReset = False
 g_times = 0
 g_cureNum = 500
+g_switch = False
 
 @app.after_request
 def add_no_cache_header(response):
@@ -55,7 +56,14 @@ def thread_runTask():
             myTimeSleep_big()
         if isReset:
             isReset = False
-            restart_game()
+            cfg = read_cfg()
+            if cfg['switch']:
+                config = read_Dailycfg()
+                type = update_rungame_type(config)
+                print(f'启动游戏{type}')
+                restart_game(type)
+            else:
+                restart_game(0)
 
 
 @app.route('/')
@@ -271,6 +279,7 @@ def add_auto_task(isMaxCollect, isJina, isSimple = False, isAddStrengh = False,
 
         send_status(f"isLoginTask:{isLoginTask}, fight_big_monster_times:{fight_big_monster_times}")
 
+
         if not isLoginTask:
             task_queue.appendleft(task_checkMaster())
             set_login_task(config, True)
@@ -281,6 +290,8 @@ def add_auto_task(isMaxCollect, isJina, isSimple = False, isAddStrengh = False,
             if isSuccess:
                 set_fight_big_monster_times(config, fight_big_monster_times + 1)
                 write_Dailycfg(config)
+
+
         
         if activity == 'lianmeng':
             task_queue.appendleft(task_activity_lianmeng())
@@ -336,6 +347,7 @@ def add_auto_task(isMaxCollect, isJina, isSimple = False, isAddStrengh = False,
         g_times += 1
         if g_times % 3 == 0:
             task_queue.appendleft(task_checkDonata())
+            task_queue.appendleft(task_checkMaster())
             task_queue.appendleft(task_checkAdventure())
             task_queue.appendleft(task_train(train_type))
             task_queue.appendleft(task_useAnnimalSkill())
@@ -350,8 +362,10 @@ def add_auto_task(isMaxCollect, isJina, isSimple = False, isAddStrengh = False,
         
         task_queue.appendleft(task_gotoTree())
         #task_queue.appendleft(task_get_redPackage())
-
-        if g_times == 7:
+        restart_times = 7
+        if g_switch:
+            restart_times = 4
+        if g_times == restart_times:
             handle_end_game()
             if always:
                 myTimeSleep(random.randint(350, 400), send_status)
@@ -392,7 +406,20 @@ def check_daily_config(config):
         print(f"Today's config found: {today}")  # 调试信息
         return True
 
-    
+def update_rungame_type(config):
+    runTypeStr = 'runType'
+    if runTypeStr not in config:
+        config[runTypeStr] = 1
+        write_Dailycfg(config)
+        print(f"更新下次启动{config[runTypeStr]}")
+        return 0
+    else:
+        value = config[runTypeStr]
+        config[runTypeStr] = (value + 1) % 2
+        write_Dailycfg(config)
+        print(f"更新下次启动{config[runTypeStr]}")
+        return value
+
 # 修改或添加 "login_task" 的值
 def set_login_task(config, value):
     today = datetime.now().strftime('%Y-%m-%d')  # 获取当前日期
@@ -485,6 +512,7 @@ def auto_task(data):
         lineCheck = False
         switch = False
         
+        
     else:
         isMaxCollect = data['maxCollect']
         isSimple = data['simple']
@@ -500,6 +528,7 @@ def auto_task(data):
         switch = data['switch']
 
     g_cureNum = cureNumber
+    g_switch = switch
     set_lineCheck(lineCheck)
     send_status(f'开始自动模式')
     executor.submit(add_auto_task, isMaxCollect, isJina, isSimple, isAddStrengh, activity, participateJijie, auto_daily, train_type, always)

二进制
dongri_img/place/title.png


+ 3 - 4
dongri_task.py

@@ -226,8 +226,7 @@ def task_start_game(type=0):
         if waitClickImg_withBool(gameStart_img.ico, 100, 0) == False:
             return False
     else:
-        if waitClickImg_withBool(gameStart_img.second_game, 100, 0) == False:
-            return False
+        waitClickImg_withBool(gameStart_img.second_game, 100, 0)
         if waitClickImg_withBool(gameStart_img.ico, 5, 0) == False:
             return False
     
@@ -1291,8 +1290,8 @@ if __name__ == '__main__':
     #task_fightMonster(False, False,False).run()
     #task_checkHelp().run()
     #task_checkStoreRoom().run()
-    task_start_game(0)
-    #task_activity_lianmeng().run()
+    #task_start_game(0)
+    task_activity_lianmeng().run()
     #task_fight_yongbing(True).run()
     #task_collect([4,3,2,1]).run()
     #task_train("upgrade").run()