44 lines
1.3 KiB
Python
44 lines
1.3 KiB
Python
# -*- coding: utf-8 -*-
|
|
"""UI step9: python策略(y=385, current boot) -> row1 -> right-click -> 运行.
|
|
Then screenshot + objective formula-log runonce check."""
|
|
import datetime
|
|
import io
|
|
import os
|
|
import time
|
|
|
|
import pyautogui
|
|
|
|
pyautogui.FAILSAFE = False
|
|
|
|
time.sleep(1.5)
|
|
pyautogui.click(75, 385) # python策略 (verified on THIS boot's screenshot)
|
|
time.sleep(0.8)
|
|
pyautogui.press("enter")
|
|
time.sleep(2.5)
|
|
pyautogui.click(500, 178) # select instance row 1
|
|
time.sleep(0.8)
|
|
pyautogui.click(500, 178, button="right")
|
|
time.sleep(1.2)
|
|
pyautogui.click(520, 213) # 运行
|
|
time.sleep(4)
|
|
pyautogui.screenshot(r"C:\sanguo_bigqmt\shot.png")
|
|
|
|
d = open(r"C:\sanguo_bigqmt\qmt_install_dir.txt", encoding="utf-8").read().strip()
|
|
logp = os.path.join(os.path.dirname(d), "userdata", "log",
|
|
"XtClient_Formula_20260909.log")
|
|
n = 0
|
|
try:
|
|
now = datetime.datetime.now()
|
|
for ln in io.open(logp, "r", encoding="gbk", errors="replace"):
|
|
try:
|
|
ts = datetime.datetime.strptime(ln[:19], "%Y-%m-%d %H:%M:%S")
|
|
except ValueError:
|
|
continue
|
|
if (now - ts).total_seconds() < 120 and (
|
|
"runonce" in ln or "PythonFormula" in ln):
|
|
n += 1
|
|
except OSError:
|
|
pass
|
|
print("RUNONCE_LINES_120S=", n)
|
|
print("DONE click run")
|