-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.py
62 lines (52 loc) · 1.98 KB
/
run.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import time
from task.douji import DouJi
from task.juexing import JueXing
from task.liaotupo import LiaoTuPo
from task.liaoyan import LiaoYan
from task.summon import Summon
from task.yaoqi import YaoQi
from task.yuhun import Yuhun
from task.jiejie import Jiejie
from util.HwndList import get
def main():
# 获取所有阴阳师句柄
hd_list = get()
hd_len = len(hd_list)
if hd_len == 0:
print("未发现阴阳师窗口!")
raise SystemExit
elif hd_len == 1:
target_hd = hd_list[0]
else:
for inx, hd in enumerate(hd_list):
print(f'窗口{inx + 1}: {hd}')
num = int(input(f'当前有{hd_len}个阴阳师窗口,请选择要运行的窗口:') or 1) - 1
if not hd_list[num]:
print('窗口选择失败,请重新运行')
time.sleep(3000)
raise SystemExit
target_hd = hd_list[num]
print('当前运行的阴阳师窗口:', target_hd)
print('选择运行脚本类型:')
task_list = [
{'name': "自动御魂", 'cls': Yuhun, "tpl_dir": "yuhun"},
{"name": "自动斗技", 'cls': DouJi, "tpl_dir": "douji"},
{"name": "自动觉醒", "cls": JueXing, "tpl_dir": "juexing"},
{"name": "结界突破", 'cls': Jiejie, "tpl_dir": "jiejie"},
{"name": "妖气封印", 'cls': YaoQi, "tpl_dir": "yaoqi"},
{"name": "自动寮破", 'cls': LiaoTuPo, "tpl_dir": "liaotupo"},
{"name": "自动寮宴", 'cls': LiaoYan, "tpl_dir": "liaoyan"},
{"name": "厕纸召唤", 'cls': Summon, "tpl_dir": "summon"},
]
for inx, task in enumerate(task_list):
print(f"{inx + 1}、{task.get('name')}")
try:
task_num = int(input("输入任务类型:") or 1) - 1
except ValueError:
task_num = 0
task = task_list[task_num]
task_cls = task.get("cls")
func = task_cls(hwnd=target_hd, task_name=task.get("name"), tpl_dir=task.get("tpl_dir"))
func.start()
if __name__ == "__main__":
main()