Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raid finder fixes #207

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions src-tauri/backend/bot/game_modes/raid.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,10 @@ def _join_raid():

# Get ready to make the user-selected raid active.
Game.find_and_click_button("raid_filter_1", x_offset = 100)
tab_pos, grid_pos, list_pos = Raid._list_of_raids[Settings.mission_name].split(",")
tab_pos, grid_pos, list_pos = [int(value) for value in Raid._list_of_raids[Settings.mission_name].split(",")]

# Select the difficulty tab.
if int(tab_pos) == 1:
if tab_pos == 1:
MessageLog.print_message("[RAID] Selecting Standard difficulty tab.")
Game.find_and_click_button("raid_difficulty_standard", suppress_error = True)
else:
Expand All @@ -214,13 +214,20 @@ def _join_raid():
anchor_pos = ImageUtils.find_button("raid_select_difficulty")

for index, grid in enumerate(Raid._GRID_SECTIONS):
if int(grid_pos) in grid:
MouseUtils.move_and_click_point(anchor_pos[0] - 125 + anchor_x_offset * (int(grid_pos) - 1), anchor_pos[1] + 195 + anchor_y_offset * (index - 1), "template_raid_category")
if grid_pos in grid:
# Determine the position in the grid via modulo.
if grid_pos % 3 == 1:
grid_modulo_pos = 2
elif grid_pos % 3 == 2:
grid_modulo_pos = 1
else:
grid_modulo_pos = 0
MouseUtils.move_and_click_point(anchor_pos[0] + 125 - (anchor_x_offset * grid_modulo_pos), anchor_pos[1] + 195 + anchor_y_offset * (index - 1), "template_raid_category")
break

# A list of raids is now shown. Now make that raid filter active and then close out the popup.
checkboxes = ImageUtils.find_all("raid_filter_checkbox")
MouseUtils.move_and_click_point(checkboxes[int(list_pos) - 1][0], checkboxes[int(list_pos) - 1][1], "raid_filter_checkbox")
MouseUtils.move_and_click_point(checkboxes[list_pos - 1][0], checkboxes[list_pos - 1][1], "raid_filter_checkbox")
Game.wait(0.25)
Game.find_and_click_button("ok")
Game.wait(0.50)
Expand Down