|
@@ -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)
|