Some more navigation changes and a couple readme updates

This commit is contained in:
J-Doiron
2024-12-13 15:30:17 -08:00
parent 27f7dfc50c
commit 86650655b8
3 changed files with 11 additions and 11 deletions

View File

@@ -207,6 +207,9 @@ If Keras is taking images on the wrong monitor, the primary display can be modif
For keyboard and mouse input, we employ two distinct methods. The first method involves using Virtual Key Codes (VKs) with the deprecated Win32 functions mouse_event() and keybd_event(). The second method utilizes Send Input. Specifically, [PyAutoGui](https://pyautogui.readthedocs.io/en/latest/) implements the first approach, while [PyDirectInput](https://pypi.org/project/PyDirectInput/) implements the second.
### Gamepad Input
For gamepad input, we utilize [Vgamepad](https://pypi.org/project/vgamepad/) in order to navigate some stubborn menus or games with scaling issues.
<p align="right">(<a href="#readme-top">back to top</a>)</p>

View File

@@ -7,6 +7,7 @@ This script navigates the menus of the Black Myth Wukong Benchmark tool and runs
- Python 3.10+
- Black Myth Wukong Benchmark Tool installed
- Keras OCR service
- Vgamepad
## Options

View File

@@ -69,24 +69,21 @@ def run_benchmark():
setup_start_time = time.time()
start_game()
time.sleep(30) # wait for game to load into main menu
if kerasService.wait_for_word(word="failed", timeout=15, interval=1):
#Looking for Syncing Failed message
if kerasService.wait_for_word(word="failed", timeout=5, interval=1):
user.press("enter")
#Looking for press start
if kerasService.wait_for_word(word="press", timeout=30, interval=1) is None:
logging.error("Game didn't start in time. Check settings and try again.")
sys.exit(1)
user.press("enter")
is_close_present = kerasService.look_for_word("close", interval=1, attempts=5)
if is_close_present:
gui.moveTo(is_close_present[0], is_close_present[1])
time.sleep(0.2)
gui.mouseDown()
time.sleep(0.2)
gui.mouseUp()
time.sleep(1)
#Looking for news menu close button
if kerasService.wait_for_word(word="close", timeout=5, interval=1):
gamepad.single_press(button=vg.XUSB_BUTTON.XUSB_GAMEPAD_B)
time.sleep(3)
@@ -134,7 +131,6 @@ def run_benchmark():
logging.error("Didn't navigate to the replays. Check menu options for any anomalies.")
sys.exit(1)
#Entering the replay screen and starting the replay:
user.press("down")
time.sleep(0.2)
user.press("enter")