Skip to content

Conversation

@jw098
Copy link
Collaborator

@jw098 jw098 commented Nov 12, 2025

Uses a newly created CloseGameDetector.

@jw098 jw098 requested a review from Mysticial November 12, 2025 07:28
}

// fail-safe against button drops and unexpected error messages.
pbf_mash_button(context, BUTTON_X, 50);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we're now using visual inference, mashing X and B are no longer necessary, right? Should we remove them?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yes. Commented below without seeing this one on top (on the otherwise identical code).


// this sequence will close the game from the home screen,
// regardless of whether the game is initially open or closed.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're actually gonna want to split this function into to, a blind one with the old behavior and the new feedback one. Since some of the older SwSh programs are able to run without feedback.

So give this the same treatment as start_game_from_home(). Rename the current one to start_game_from_home_blind(), then add the new feedback one.

context.wait_for_all_requests();
if (is_close_game_menu_visible(console)){ // game was initially open.
console.log("Detected close game menu.");
pbf_mash_button(context, BUTTON_A, 400ms);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to state machine this?

close game menu:
Press A

main menu:
if (close game seen) return;
if (main menu seen twice before) return;
if (main menu seen once before)
move joysticks, press Home.
else
mash X


}
// fail-safe against button drops and unexpected error messages.
pbf_mash_button(context, BUTTON_X, 400ms);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we can state machine the above, we can get rid of these two and save 2+ seconds from the reset sequence.

@Mysticial Mysticial merged commit fb47f34 into PokemonAutomation:main Nov 14, 2025
11 of 12 checks passed
@jw098 jw098 deleted the closegame branch November 14, 2025 05:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants