-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathmain.py
55 lines (47 loc) · 1.39 KB
/
main.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
# -*- coding: utf-8 -*-
# Author: Amove
# vision 1.1 zero 修改支持高分辨
from window_operate import *
from gaming_func import *
from notice_func import *
import sys,time,os
import threading
if __name__ == '__main__':
# 初始化
hwnd = get_window_handle(title="咸鱼之王")
#获取窗口 大小w,h
rect = win32gui.GetWindowRect(hwnd)
x,y=rect[0],rect[1]
w,h=rect[2] - x,rect[3] - y
if hwnd == 0:
print("游戏未启动,退出...")
time.sleep(3)
os._exit(1)
print_help()
print("Start...tap help for more details.")
# 领取离线奖励的线程
thread1 = threading.Thread(target=shoucai_rountin_long, args=(hwnd,))
thread1.start()
# 爬塔的线程
thread2 = threading.Thread(target=fuben_tower_rountin, args=(hwnd,))
thread2.start()
time.sleep(1)
# 主函数
while True:
print_notice()
cmd_input = input()
if cmd_input == "1":
show_window(hwnd)
elif cmd_input == "2":
hide_window(hwnd)
elif cmd_input == "help":
print_help()
elif cmd_input == "shoucai":
shoucai(hwnd,h,w)
elif cmd_input == "tower":
fuben_tower(hwnd,h,w)
elif cmd_input == "daily":
daily_test(hwnd,h,w)
elif cmd_input == "exit":
print("Bye!")
os._exit(1)