修复死循环,日志读取优化,运行流程优化
This commit is contained in:
BIN
AUTO_MAA.exe
BIN
AUTO_MAA.exe
Binary file not shown.
@@ -60,15 +60,17 @@ while True:
|
|||||||
print(colored(linex,'light_green'))
|
print(colored(linex,'light_green'))
|
||||||
else:
|
else:
|
||||||
print(colored("暂无",'light_green'))
|
print(colored("暂无",'light_green'))
|
||||||
|
#定时执行
|
||||||
if (curtime in timeset) and not os.path.exists("state/running"):
|
if (curtime in timeset) and not os.path.exists("state/running"):
|
||||||
with open("state/BEGIN","w",encoding="utf-8") as f:
|
with open("state/BEGIN","w",encoding="utf-8") as f:
|
||||||
print("BEGIN",file=f)
|
print("BEGIN",file=f)
|
||||||
maa=subprocess.Popen(["run.exe"])
|
run=subprocess.Popen(["run.exe"])
|
||||||
maapid=maa.pid
|
runpid=run.pid
|
||||||
while True:
|
while True:
|
||||||
if os.path.exists("state/END"):
|
if os.path.exists("state/END"):
|
||||||
os.system('taskkill /F /T /PID '+str(maapid))
|
os.system('taskkill /F /T /PID '+str(runpid))
|
||||||
os.remove("state/END")
|
os.remove("state/END")
|
||||||
break
|
break
|
||||||
|
time.sleep(1)
|
||||||
os.remove("state/BEGIN")
|
os.remove("state/BEGIN")
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
BIN
manage.exe
BIN
manage.exe
Binary file not shown.
@@ -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, 2, 0),
|
filevers=(2, 1, 3, 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.2'),
|
StringStruct('FileVersion', '2.1.3'),
|
||||||
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.2'),
|
StringStruct('ProductVersion', 'v2.1.3'),
|
||||||
StringStruct('Assembly Version', '2.1.2.0')])
|
StringStruct('Assembly Version', '2.1.3.0')])
|
||||||
])
|
])
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
5
run.py
5
run.py
@@ -44,6 +44,7 @@ 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任务
|
#创建MAA任务
|
||||||
|
time.sleep(10)
|
||||||
maa=subprocess.Popen([maapath])
|
maa=subprocess.Popen([maapath])
|
||||||
maapid=maa.pid
|
maapid=maa.pid
|
||||||
#等待MAA启动
|
#等待MAA启动
|
||||||
@@ -73,8 +74,8 @@ def runmaa(id,tel,game,num=3):
|
|||||||
print(colored("运行日志:",'white'))
|
print(colored("运行日志:",'white'))
|
||||||
#读取并保存MAA日志
|
#读取并保存MAA日志
|
||||||
with open(logpath,'r',encoding='utf-8') as f:
|
with open(logpath,'r',encoding='utf-8') as f:
|
||||||
logs=f.readlines()[-1:-10:-1]
|
logs=f.readlines()[-1:-11:-1]
|
||||||
print(colored(''.join(logs[::-1]),'light_green'))
|
print(colored(''.join(logs[::-1]),'light_green'),end='')
|
||||||
log=''.join(logs)
|
log=''.join(logs)
|
||||||
logx[logi]=log
|
logx[logi]=log
|
||||||
logi=(logi+1) % len(logx)
|
logi=(logi+1) % len(logx)
|
||||||
|
|||||||
1
state/说明.txt
Normal file
1
state/说明.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
此文件夹内文件用于AUTO_MAA组件间的信息传递,如果遇到run.exe闪退或AUTO_MAA.exe一直显示“正在运行代理”,请尝试删除本文件夹下的所有文件。
|
||||||
Reference in New Issue
Block a user