优化剿灭逻辑
BIN
AUTO_MAA.exe
12
README.md
@@ -36,24 +36,20 @@ MAA下载地址 [GitHub下载](https://github.com/MaaAssistantArknights/MaaAs
|
|||||||
|
|
||||||
### MAA配置
|
### MAA配置
|
||||||
|
|
||||||
1.完成MAA的adb配置等基本配置
|
1. 完成MAA的adb配置等基本配置
|
||||||
|
|
||||||
2.在“完成后”菜单,选择“退出MAA和模拟器”。勾选“手动输入关卡名”和“无限吃48小时内过期的理智药”
|
2. 确保当前配置名为“Default”,取消所有“定时执行”
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
3.确保当前配置名为“Default”,取消所有“定时执行”
|
3. 取消勾选“开机自启动MAA”,勾选“启动MAA后直接运行”和“启动MAA后自动开启模拟器”。配置自己模拟器所在的位置并根据实际情况填写“等待模拟器启动时间”(建议预留10s以防意外)。如果是多开用户,需要填写“附加命令”,具体填写值参见多开模拟器对应快捷方式路径(如“-v 1”)。
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
4.取消勾选“开机自启动MAA”,勾选“启动MAA后直接运行”和“启动MAA后自动开启模拟器”。配置自己模拟器所在的位置并根据实际情况填写“等待模拟器启动时间”(建议预留10s以防意外)。如果是多开用户,需要填写“附加命令”,具体填写值参见多开模拟器对应快捷方式路径(如“-v 1”)。
|
4. 勾选“定时检查更新”、“自动下载更新包”和“自动安装更新包”
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
5.勾选“定时检查更新”、“自动下载更新包”和“自动安装更新包”
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
## 下载AUTO_MAA软件包 [](https://github.com/DLmaster361/AUTO_MAA/releases)
|
## 下载AUTO_MAA软件包 [](https://github.com/DLmaster361/AUTO_MAA/releases)
|
||||||
|
|
||||||
GitHub下载地址 [GitHub下载](https://github.com/DLmaster361/AUTO_MAA/releases)
|
GitHub下载地址 [GitHub下载](https://github.com/DLmaster361/AUTO_MAA/releases)
|
||||||
|
|||||||
BIN
manage.exe
|
Before Width: | Height: | Size: 59 KiB After Width: | Height: | Size: 44 KiB |
|
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 60 KiB |
|
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 52 KiB |
|
Before Width: | Height: | Size: 52 KiB |
@@ -4,7 +4,7 @@ VSVersionInfo(
|
|||||||
ffi=FixedFileInfo(
|
ffi=FixedFileInfo(
|
||||||
# filevers and prodvers should be always a tuple with four items: (1, 2, 3, 4)
|
# filevers and prodvers should be always a tuple with four items: (1, 2, 3, 4)
|
||||||
# Set not needed items to zero 0.
|
# Set not needed items to zero 0.
|
||||||
filevers=(2, 1, 3, 0),
|
filevers=(2, 1, 4, 0),
|
||||||
prodvers=(0, 0, 0, 0),
|
prodvers=(0, 0, 0, 0),
|
||||||
# Contains a bitmask that specifies the valid bits 'flags'r
|
# Contains a bitmask that specifies the valid bits 'flags'r
|
||||||
mask=0x3f,
|
mask=0x3f,
|
||||||
@@ -31,13 +31,13 @@ VSVersionInfo(
|
|||||||
[StringStruct('Comments', 'https://github.com/DLmaster361/AUTO_MAA/'),
|
[StringStruct('Comments', 'https://github.com/DLmaster361/AUTO_MAA/'),
|
||||||
StringStruct('CompanyName', 'AUTO_MAA Team'),
|
StringStruct('CompanyName', 'AUTO_MAA Team'),
|
||||||
StringStruct('FileDescription', 'AUTO_MAA Component'),
|
StringStruct('FileDescription', 'AUTO_MAA Component'),
|
||||||
StringStruct('FileVersion', '2.1.3'),
|
StringStruct('FileVersion', '2.1.4'),
|
||||||
StringStruct('InternalName', 'AUTO_MAA'),
|
StringStruct('InternalName', 'AUTO_MAA'),
|
||||||
StringStruct('LegalCopyright', 'Copyright © 2024 DLmaster361'),
|
StringStruct('LegalCopyright', 'Copyright © 2024 DLmaster361'),
|
||||||
StringStruct('OriginalFilename', 'AUTO_MAA'),
|
StringStruct('OriginalFilename', 'AUTO_MAA'),
|
||||||
StringStruct('ProductName', 'AUTO_MAA'),
|
StringStruct('ProductName', 'AUTO_MAA'),
|
||||||
StringStruct('ProductVersion', 'v2.1.3'),
|
StringStruct('ProductVersion', 'v2.1.4'),
|
||||||
StringStruct('Assembly Version', '2.1.3.0')])
|
StringStruct('Assembly Version', '2.1.4.0')])
|
||||||
])
|
])
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
153
run.py
@@ -28,64 +28,123 @@ import time
|
|||||||
import json
|
import json
|
||||||
from termcolor import colored
|
from termcolor import colored
|
||||||
|
|
||||||
#执行MAA任务
|
#配置MAA运行参数
|
||||||
def runmaa(id,tel,game,num=3):
|
def setmaa(s,tel,game):
|
||||||
#配置MAA运行参数
|
|
||||||
with open(setpath,"r",encoding="utf-8") as f:
|
with open(setpath,"r",encoding="utf-8") as f:
|
||||||
data=json.load(f)
|
data=json.load(f)
|
||||||
data["Configurations"]["Default"]["Start.AccountName"]=tel[:3]+"****"+tel[7:]
|
if s==0:
|
||||||
data["Configurations"]["Default"]["MainFunction.Stage1"]="Annihilation"
|
data["Configurations"]["Default"]["MainFunction.ActionAfterCompleted"]="ExitEmulatorAndSelf" #完成后退出MAA和模拟器
|
||||||
data["Configurations"]["Default"]["Fight.RemainingSanityStage"]=game
|
data["Configurations"]["Default"]["Start.RunDirectly"]="True" #启动MAA后直接运行
|
||||||
data["Configurations"]["Default"]["Fight.UseRemainingSanityStage"]="True"
|
data["Configurations"]["Default"]["Start.StartEmulator"]="True" #启动MAA后自动开启模拟器
|
||||||
data["Configurations"]["Default"]["GUI.CustomStageCode"]="True"
|
elif s==1:
|
||||||
|
data["Configurations"]["Default"]["Start.AccountName"]=tel[:3]+"****"+tel[7:] #账号切换
|
||||||
|
data["Configurations"]["Default"]["TaskQueue.WakeUp.IsChecked"]="True" #开始唤醒
|
||||||
|
data["Configurations"]["Default"]["TaskQueue.Recruiting.IsChecked"]="False" #自动公招
|
||||||
|
data["Configurations"]["Default"]["TaskQueue.Base.IsChecked"]="False" #基建换班
|
||||||
|
data["Configurations"]["Default"]["TaskQueue.Combat.IsChecked"]="True" #刷理智
|
||||||
|
data["Configurations"]["Default"]["TaskQueue.Mission.IsChecked"]="False" #领取奖励
|
||||||
|
data["Configurations"]["Default"]["TaskQueue.Mall.IsChecked"]="False" #获取信用及购物
|
||||||
|
data["Configurations"]["Default"]["MainFunction.Stage1"]="Annihilation" #主关卡
|
||||||
|
data["Configurations"]["Default"]["MainFunction.Stage2"]="" #备选关卡1
|
||||||
|
data["Configurations"]["Default"]["MainFunction.Stage3"]="" #备选关卡2
|
||||||
|
data["Configurations"]["Default"]["Fight.RemainingSanityStage"]="" #剩余理智关卡
|
||||||
|
data["Configurations"]["Default"]["Penguin.IsDrGrandet"]="False" #博朗台模式
|
||||||
|
data["Configurations"]["Default"]["GUI.CustomStageCode"]="True" #手动输入关卡名
|
||||||
|
data["Configurations"]["Default"]["GUI.UseAlternateStage"]="False" #使用备选关卡
|
||||||
|
data["Configurations"]["Default"]["Fight.UseRemainingSanityStage"]="False" #使用剩余理智
|
||||||
|
data["Configurations"]["Default"]["Fight.UseExpiringMedicine"]="True" #无限吃48小时内过期的理智药
|
||||||
|
elif s==2:
|
||||||
|
data["Configurations"]["Default"]["Start.AccountName"]=tel[:3]+"****"+tel[7:] #账号切换
|
||||||
|
data["Configurations"]["Default"]["TaskQueue.WakeUp.IsChecked"]="True" #开始唤醒
|
||||||
|
data["Configurations"]["Default"]["TaskQueue.Recruiting.IsChecked"]="True" #自动公招
|
||||||
|
data["Configurations"]["Default"]["TaskQueue.Base.IsChecked"]="True" #基建换班
|
||||||
|
data["Configurations"]["Default"]["TaskQueue.Combat.IsChecked"]="True" #刷理智
|
||||||
|
data["Configurations"]["Default"]["TaskQueue.Mission.IsChecked"]="True" #领取奖励
|
||||||
|
data["Configurations"]["Default"]["TaskQueue.Mall.IsChecked"]="True" #获取信用及购物
|
||||||
|
data["Configurations"]["Default"]["MainFunction.Stage1"]=game #主关卡
|
||||||
|
data["Configurations"]["Default"]["MainFunction.Stage2"]="" #备选关卡1
|
||||||
|
data["Configurations"]["Default"]["MainFunction.Stage3"]="" #备选关卡2
|
||||||
|
data["Configurations"]["Default"]["Fight.RemainingSanityStage"]="" #剩余理智关卡
|
||||||
|
data["Configurations"]["Default"]["Penguin.IsDrGrandet"]="False" #博朗台模式
|
||||||
|
data["Configurations"]["Default"]["GUI.CustomStageCode"]="True" #手动输入关卡名
|
||||||
|
data["Configurations"]["Default"]["GUI.UseAlternateStage"]="False" #使用备选关卡
|
||||||
|
data["Configurations"]["Default"]["Fight.UseRemainingSanityStage"]="False" #使用剩余理智
|
||||||
|
data["Configurations"]["Default"]["Fight.UseExpiringMedicine"]="True" #无限吃48小时内过期的理智药
|
||||||
with open(setpath,"w",encoding="utf-8") as f:
|
with open(setpath,"w",encoding="utf-8") as f:
|
||||||
json.dump(data,f)
|
json.dump(data,f)
|
||||||
|
return True
|
||||||
|
|
||||||
|
#执行MAA任务
|
||||||
|
def runmaa(id,tel,game,num=3):
|
||||||
#开始运行
|
#开始运行
|
||||||
for i in range(num):
|
for i in range(num):
|
||||||
global idnew,idold,idfail,idall,logx,logi
|
global idnew,idold,idfail,idall,logx,logi
|
||||||
#创建MAA任务
|
runbook=[False for i in range(2)]
|
||||||
time.sleep(10)
|
for j in range(2):
|
||||||
maa=subprocess.Popen([maapath])
|
#配置MAA
|
||||||
maapid=maa.pid
|
setmaa(j+1,tel,game)
|
||||||
#等待MAA启动
|
#创建MAA任务
|
||||||
idsuccess=idnew+idold
|
print(colored("等待中~",'yellow'))
|
||||||
idwait=[idx for idx in idall if not idx in idsuccess+idfail+[id]]
|
time.sleep(10)
|
||||||
os.system('cls')
|
maa=subprocess.Popen([maapath])
|
||||||
if i==0:
|
maapid=maa.pid
|
||||||
print(colored("正在代理:",'white')+colored(id,'blue'))
|
#等待MAA启动
|
||||||
else:
|
idsuccess=idnew+idold
|
||||||
print(colored("正在代理:",'white')+colored(id,'light_blue'))
|
idwait=[idx for idx in idall if not idx in idsuccess+idfail+[id]]
|
||||||
print(colored("等待代理:",'white')+colored(','.join(idwait),'yellow'))
|
|
||||||
print(colored("代理成功:",'white')+colored(','.join(idsuccess),'green'))
|
|
||||||
print(colored("代理失败:",'white')+colored(','.join(idfail),'red'))
|
|
||||||
print(colored("运行日志:",'white')+colored("等待MAA初始化",'light_green'))
|
|
||||||
time.sleep(60)
|
|
||||||
#监测MAA运行状态
|
|
||||||
while True:
|
|
||||||
#打印基本信息
|
|
||||||
os.system('cls')
|
os.system('cls')
|
||||||
if i==0:
|
if i==0:
|
||||||
print(colored("正在代理:",'white')+colored(id,'blue'))
|
if j==0:
|
||||||
|
print(colored("正在代理:",'white')+colored(id+"-剿灭",'blue'))
|
||||||
|
elif j==1:
|
||||||
|
print(colored("正在代理:",'white')+colored(id+"-日常",'blue'))
|
||||||
else:
|
else:
|
||||||
print(colored("正在代理:",'white')+colored(id,'light_blue'))
|
if j==0:
|
||||||
|
print(colored("正在代理:",'white')+colored(id+"-剿灭",'light_blue'))
|
||||||
|
elif j==1:
|
||||||
|
print(colored("正在代理:",'white')+colored(id+"-日常",'light_blue'))
|
||||||
print(colored("等待代理:",'white')+colored(','.join(idwait),'yellow'))
|
print(colored("等待代理:",'white')+colored(','.join(idwait),'yellow'))
|
||||||
print(colored("代理成功:",'white')+colored(','.join(idsuccess),'green'))
|
print(colored("代理成功:",'white')+colored(','.join(idsuccess),'green'))
|
||||||
print(colored("代理失败:",'white')+colored(','.join(idfail),'red'))
|
print(colored("代理失败:",'white')+colored(','.join(idfail),'red'))
|
||||||
print(colored("运行日志:",'white'))
|
print(colored("运行日志:",'white')+colored("等待MAA初始化",'light_green'))
|
||||||
#读取并保存MAA日志
|
time.sleep(60)
|
||||||
with open(logpath,'r',encoding='utf-8') as f:
|
#监测MAA运行状态
|
||||||
logs=f.readlines()[-1:-11:-1]
|
while True:
|
||||||
print(colored(''.join(logs[::-1]),'light_green'),end='')
|
#打印基本信息
|
||||||
log=''.join(logs)
|
os.system('cls')
|
||||||
logx[logi]=log
|
if i==0:
|
||||||
logi=(logi+1) % len(logx)
|
if j==0:
|
||||||
#判断MAA程序运行状态
|
print(colored("正在代理:",'white')+colored(id+"-剿灭",'blue'))
|
||||||
if ("任务已全部完成!" in log):
|
elif j==1:
|
||||||
return True
|
print(colored("正在代理:",'white')+colored(id+"-日常",'blue'))
|
||||||
elif ("请检查连接设置或尝试重启模拟器与 ADB 或重启电脑" in log) or ("已停止" in log) or ("MaaAssistantArknights GUI exited" in log) or timeout():
|
else:
|
||||||
os.system('taskkill /F /T /PID '+str(maapid))
|
if j==0:
|
||||||
break
|
print(colored("正在代理:",'white')+colored(id+"-剿灭",'light_blue'))
|
||||||
time.sleep(10)
|
elif j==1:
|
||||||
|
print(colored("正在代理:",'white')+colored(id+"-日常",'light_blue'))
|
||||||
|
print(colored("等待代理:",'white')+colored(','.join(idwait),'yellow'))
|
||||||
|
print(colored("代理成功:",'white')+colored(','.join(idsuccess),'green'))
|
||||||
|
print(colored("代理失败:",'white')+colored(','.join(idfail),'red'))
|
||||||
|
print(colored("运行日志:",'white'))
|
||||||
|
#读取并保存MAA日志
|
||||||
|
with open(logpath,'r',encoding='utf-8') as f:
|
||||||
|
logs=f.readlines()[-1:-11:-1]
|
||||||
|
print(colored(''.join(logs[::-1]),'light_green'),end='')
|
||||||
|
log=''.join(logs)
|
||||||
|
logx[logi]=log
|
||||||
|
logi=(logi+1) % len(logx)
|
||||||
|
#判断MAA程序运行状态
|
||||||
|
if ("任务已全部完成!" in log):
|
||||||
|
runbook[j]=True
|
||||||
|
break
|
||||||
|
elif ("请检查连接设置或尝试重启模拟器与 ADB 或重启电脑" in log) or ("已停止" in log) or ("MaaAssistantArknights GUI exited" in log) or timeout():
|
||||||
|
os.system('taskkill /F /T /PID '+str(maapid))
|
||||||
|
break
|
||||||
|
if j==0:
|
||||||
|
time.sleep(40)
|
||||||
|
elif j==1:
|
||||||
|
time.sleep(10)
|
||||||
|
if runbook[0] and runbook[1]:
|
||||||
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
#检查是否超时
|
#检查是否超时
|
||||||
@@ -149,6 +208,9 @@ idall=[data[i][0] for i in range(len(data))]
|
|||||||
LOGXLEN=60
|
LOGXLEN=60
|
||||||
logx=['' for i in range(LOGXLEN)]
|
logx=['' for i in range(LOGXLEN)]
|
||||||
logi=0
|
logi=0
|
||||||
|
#MAA预配置
|
||||||
|
setmaa(0,0,0)
|
||||||
|
#优先代理今日未完成的用户
|
||||||
for i in range(len(data)):
|
for i in range(len(data)):
|
||||||
if data[i][3]=='y' and data[i][4]!=curdate and data[i][2]>0:
|
if data[i][3]=='y' and data[i][4]!=curdate and data[i][2]>0:
|
||||||
book=runmaa(data[i][0],data[i][1],data[i][5])
|
book=runmaa(data[i][0],data[i][1],data[i][5])
|
||||||
@@ -157,6 +219,7 @@ for i in range(len(data)):
|
|||||||
idnew.append(data[i][0])
|
idnew.append(data[i][0])
|
||||||
else:
|
else:
|
||||||
idfail.append(data[i][0])
|
idfail.append(data[i][0])
|
||||||
|
#次优先重复代理
|
||||||
for i in range(len(data)):
|
for i in range(len(data)):
|
||||||
if data[i][3]=='y' and data[i][4]==curdate and data[i][2]>0:
|
if data[i][3]=='y' and data[i][4]==curdate and data[i][2]>0:
|
||||||
book=runmaa(data[i][0],data[i][1],data[i][5])
|
book=runmaa(data[i][0],data[i][1],data[i][5])
|
||||||
|
|||||||