Skip to content

Commit

Permalink
Decrease sleep time when trying to reconnect
Browse files Browse the repository at this point in the history
  • Loading branch information
anthony5301 authored Jan 16, 2024
1 parent 5991c53 commit 9aca88d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 2 additions & 0 deletions auto_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ def reconnect(client_info: tuple) -> None:
def queue() -> None:
"""Function that handles getting into a game"""
client_info: tuple = get_client()
while check_game_status(client_info) == "InProgress":
sleep(1)
if check_game_status(client_info) == "Reconnect":
print(" Reconnecting")
reconnect(client_info)
Expand Down
3 changes: 1 addition & 2 deletions game.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,8 @@ def check_failed_to_connect_window(self) -> bool:
print(" Found \"Failed to Connect\" window, trying to exit and reconnect")
if reconnect_button := win32gui.FindWindowEx(hwnd, 0, "Button", None):
if cancel_button := win32gui.FindWindowEx(hwnd, reconnect_button, "Button", None):
print(f" {win32gui.GetWindowText(cancel_button)} button found.")
print(f"{win32gui.GetWindowText(cancel_button)} button found.")
win32gui.SendMessage(cancel_button, BM_CLICK, 0, 0)
sleep(5)
return True
print(" Cancel button not found.")
else:
Expand Down

0 comments on commit 9aca88d

Please sign in to comment.