-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmain.py
More file actions
49 lines (38 loc) · 1.26 KB
/
Copy pathmain.py
File metadata and controls
49 lines (38 loc) · 1.26 KB
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
import sys
import os
import easyocr
from loguru import logger
# Ensure root is in path
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
from games.xianyu.main import xianyu
from common.ocr import OCRReader
def main():
print("Game Helper")
print("1. 咸鱼之王")
choice = input("Select game (default 1): ")
if choice == '1' or choice == '':
logger.info("Initializing Xianyu King...")
try:
# Initialize OCR
reader = OCRReader(gpu=True)
game = xianyu(reader)
print("\nSelect task:")
print("1. Auto Pass (推图)")
print("2. Auto Tower (推塔)")
print("3. Auto Answer (答题)")
print("4. Auto Fish (钓鱼)")
task = input("Select task: ")
if task == '1':
game.task_auto_pass()
elif task == '2':
game.task_auto_tower()
elif task == '3':
game.task_auto_answer()
elif task == '4':
game.task_auto_fish()
else:
print("Invalid task")
except Exception as e:
logger.error(f"Error: {e}")
if __name__ == "__main__":
main()