Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
caf37e6c99 | ||
|
|
5af41d3b72 |
BIN
AUTO_MAA.exe
12
README.md
@@ -36,24 +36,20 @@ MAA下载地址 [GitHub下载](https://github.com/MaaAssistantArknights/MaaAs
|
||||
|
||||
### 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)
|
||||
|
||||
GitHub下载地址 [GitHub下载](https://github.com/DLmaster361/AUTO_MAA/releases)
|
||||
|
||||
BIN
manage.exe
3
requirements.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
termcolor
|
||||
pycryptodome
|
||||
pyinstaller
|
||||
|
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(
|
||||
# filevers and prodvers should be always a tuple with four items: (1, 2, 3, 4)
|
||||
# Set not needed items to zero 0.
|
||||
filevers=(2, 1, 3, 0),
|
||||
filevers=(2, 1, 4, 0),
|
||||
prodvers=(0, 0, 0, 0),
|
||||
# Contains a bitmask that specifies the valid bits 'flags'r
|
||||
mask=0x3f,
|
||||
@@ -31,13 +31,13 @@ VSVersionInfo(
|
||||
[StringStruct('Comments', 'https://github.com/DLmaster361/AUTO_MAA/'),
|
||||
StringStruct('CompanyName', 'AUTO_MAA Team'),
|
||||
StringStruct('FileDescription', 'AUTO_MAA Component'),
|
||||
StringStruct('FileVersion', '2.1.3'),
|
||||
StringStruct('FileVersion', '2.1.4'),
|
||||
StringStruct('InternalName', 'AUTO_MAA'),
|
||||
StringStruct('LegalCopyright', 'Copyright © 2024 DLmaster361'),
|
||||
StringStruct('OriginalFilename', 'AUTO_MAA'),
|
||||
StringStruct('ProductName', 'AUTO_MAA'),
|
||||
StringStruct('ProductVersion', 'v2.1.3'),
|
||||
StringStruct('Assembly Version', '2.1.3.0')])
|
||||
StringStruct('ProductVersion', 'v2.1.4'),
|
||||
StringStruct('Assembly Version', '2.1.4.0')])
|
||||
])
|
||||
]
|
||||
)
|
||||
25
res/set.txt
Normal file
@@ -0,0 +1,25 @@
|
||||
#主界面
|
||||
"MainFunction.ActionAfterCompleted": "ExitEmulatorAndSelf" #完成后
|
||||
"TaskQueue.WakeUp.IsChecked": "True" #开始唤醒
|
||||
"TaskQueue.Recruiting.IsChecked": "True" #自动公招
|
||||
"TaskQueue.Base.IsChecked": "True" #基建换班
|
||||
"TaskQueue.Combat.IsChecked": "True" #刷理智
|
||||
"TaskQueue.Mission.IsChecked": "True" #领取奖励
|
||||
"TaskQueue.Mall.IsChecked": "True" #获取信用及购物
|
||||
#刷理智
|
||||
"MainFunction.Stage1": "" #主关卡
|
||||
"MainFunction.Stage2": "" #备选关卡1
|
||||
"MainFunction.Stage3": "" #备选关卡2
|
||||
"Fight.RemainingSanityStage": "Annihilation" #剩余理智关卡
|
||||
"Penguin.IsDrGrandet": "True" #博朗台模式
|
||||
"GUI.CustomStageCode": "False" #手动输入关卡名
|
||||
"GUI.UseAlternateStage": "False" #使用备选关卡
|
||||
"Fight.UseRemainingSanityStage": "True" #使用剩余理智
|
||||
"Fight.UseExpiringMedicine": "False" #无限吃48小时内过期的理智药
|
||||
"GUI.HideUnavailableStage": "False" #隐藏当日不开放关卡
|
||||
"Infrast.CustomInfrastPlanShowInFightSettings": "False" #显示基建计划
|
||||
"Penguin.EnablePenguin": "True" #上报企鹅物流
|
||||
"Yituliu.EnableYituliu": "True" #上报一图流
|
||||
#设置
|
||||
"Start.RunDirectly": "True" #启动MAA后直接运行
|
||||
"Start.StartEmulator": "True" #启动MAA后自动开启模拟器
|
||||
153
run.py
@@ -28,64 +28,123 @@ import time
|
||||
import json
|
||||
from termcolor import colored
|
||||
|
||||
#执行MAA任务
|
||||
def runmaa(id,tel,game,num=3):
|
||||
#配置MAA运行参数
|
||||
#配置MAA运行参数
|
||||
def setmaa(s,tel,game):
|
||||
with open(setpath,"r",encoding="utf-8") as f:
|
||||
data=json.load(f)
|
||||
data["Configurations"]["Default"]["Start.AccountName"]=tel[:3]+"****"+tel[7:]
|
||||
data["Configurations"]["Default"]["MainFunction.Stage1"]="Annihilation"
|
||||
data["Configurations"]["Default"]["Fight.RemainingSanityStage"]=game
|
||||
data["Configurations"]["Default"]["Fight.UseRemainingSanityStage"]="True"
|
||||
data["Configurations"]["Default"]["GUI.CustomStageCode"]="True"
|
||||
if s==0:
|
||||
data["Configurations"]["Default"]["MainFunction.ActionAfterCompleted"]="ExitEmulatorAndSelf" #完成后退出MAA和模拟器
|
||||
data["Configurations"]["Default"]["Start.RunDirectly"]="True" #启动MAA后直接运行
|
||||
data["Configurations"]["Default"]["Start.StartEmulator"]="True" #启动MAA后自动开启模拟器
|
||||
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:
|
||||
json.dump(data,f)
|
||||
return True
|
||||
|
||||
#执行MAA任务
|
||||
def runmaa(id,tel,game,num=3):
|
||||
#开始运行
|
||||
for i in range(num):
|
||||
global idnew,idold,idfail,idall,logx,logi
|
||||
#创建MAA任务
|
||||
time.sleep(10)
|
||||
maa=subprocess.Popen([maapath])
|
||||
maapid=maa.pid
|
||||
#等待MAA启动
|
||||
idsuccess=idnew+idold
|
||||
idwait=[idx for idx in idall if not idx in idsuccess+idfail+[id]]
|
||||
os.system('cls')
|
||||
if i==0:
|
||||
print(colored("正在代理:",'white')+colored(id,'blue'))
|
||||
else:
|
||||
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')+colored("等待MAA初始化",'light_green'))
|
||||
time.sleep(60)
|
||||
#监测MAA运行状态
|
||||
while True:
|
||||
#打印基本信息
|
||||
runbook=[False for i in range(2)]
|
||||
for j in range(2):
|
||||
#配置MAA
|
||||
setmaa(j+1,tel,game)
|
||||
#创建MAA任务
|
||||
print(colored("等待中~",'yellow'))
|
||||
time.sleep(10)
|
||||
maa=subprocess.Popen([maapath])
|
||||
maapid=maa.pid
|
||||
#等待MAA启动
|
||||
idsuccess=idnew+idold
|
||||
idwait=[idx for idx in idall if not idx in idsuccess+idfail+[id]]
|
||||
os.system('cls')
|
||||
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:
|
||||
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(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):
|
||||
return True
|
||||
elif ("请检查连接设置或尝试重启模拟器与 ADB 或重启电脑" in log) or ("已停止" in log) or ("MaaAssistantArknights GUI exited" in log) or timeout():
|
||||
os.system('taskkill /F /T /PID '+str(maapid))
|
||||
break
|
||||
time.sleep(10)
|
||||
print(colored("运行日志:",'white')+colored("等待MAA初始化",'light_green'))
|
||||
time.sleep(60)
|
||||
#监测MAA运行状态
|
||||
while True:
|
||||
#打印基本信息
|
||||
os.system('cls')
|
||||
if i==0:
|
||||
if j==0:
|
||||
print(colored("正在代理:",'white')+colored(id+"-剿灭",'blue'))
|
||||
elif j==1:
|
||||
print(colored("正在代理:",'white')+colored(id+"-日常",'blue'))
|
||||
else:
|
||||
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(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
|
||||
|
||||
#检查是否超时
|
||||
@@ -149,6 +208,9 @@ idall=[data[i][0] for i in range(len(data))]
|
||||
LOGXLEN=60
|
||||
logx=['' for i in range(LOGXLEN)]
|
||||
logi=0
|
||||
#MAA预配置
|
||||
setmaa(0,0,0)
|
||||
#优先代理今日未完成的用户
|
||||
for i in range(len(data)):
|
||||
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])
|
||||
@@ -157,6 +219,7 @@ for i in range(len(data)):
|
||||
idnew.append(data[i][0])
|
||||
else:
|
||||
idfail.append(data[i][0])
|
||||
#次优先重复代理
|
||||
for i in range(len(data)):
|
||||
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])
|
||||
|
||||