修复死循环,日志读取优化,运行流程优化

This commit is contained in:
DLmaster
2024-04-03 20:06:48 +08:00
parent 63ed257a5f
commit ebd3273251
8 changed files with 16 additions and 9 deletions

Binary file not shown.

View File

@@ -60,15 +60,17 @@ while True:
print(colored(linex,'light_green'))
else:
print(colored("暂无",'light_green'))
#定时执行
if (curtime in timeset) and not os.path.exists("state/running"):
with open("state/BEGIN","w",encoding="utf-8") as f:
print("BEGIN",file=f)
maa=subprocess.Popen(["run.exe"])
maapid=maa.pid
run=subprocess.Popen(["run.exe"])
runpid=run.pid
while True:
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")
break
time.sleep(1)
os.remove("state/BEGIN")
time.sleep(1)

Binary file not shown.

View File

@@ -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, 2, 0),
filevers=(2, 1, 3, 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.2'),
StringStruct('FileVersion', '2.1.3'),
StringStruct('InternalName', 'AUTO_MAA'),
StringStruct('LegalCopyright', 'Copyright © 2024 DLmaster361'),
StringStruct('OriginalFilename', 'AUTO_MAA'),
StringStruct('ProductName', 'AUTO_MAA'),
StringStruct('ProductVersion', 'v2.1.2'),
StringStruct('Assembly Version', '2.1.2.0')])
StringStruct('ProductVersion', 'v2.1.3'),
StringStruct('Assembly Version', '2.1.3.0')])
])
]
)

BIN
run.exe

Binary file not shown.

5
run.py
View File

@@ -44,6 +44,7 @@ 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启动
@@ -73,8 +74,8 @@ def runmaa(id,tel,game,num=3):
print(colored("运行日志:",'white'))
#读取并保存MAA日志
with open(logpath,'r',encoding='utf-8') as f:
logs=f.readlines()[-1:-10:-1]
print(colored(''.join(logs[::-1]),'light_green'))
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)

1
state/说明.txt Normal file
View File

@@ -0,0 +1 @@
此文件夹内文件用于AUTO_MAA组件间的信息传递如果遇到run.exe闪退或AUTO_MAA.exe一直显示“正在运行代理”请尝试删除本文件夹下的所有文件。

3
更新说明.txt Normal file
View File

@@ -0,0 +1,3 @@
项目初始阶段,不会提供专门的版本更新程序,您需要手动更新程序。
v2.1.2版本的使用者将旧版本data文件夹移动至新版本软件根目录下覆盖掉预置文件即可完成更新。其它文件不需要动
新用户请忽略本说明。