From 966985411f01b799fa71f4823da7a8cd6d9cc47b Mon Sep 17 00:00:00 2001 From: Bryan Bishop Date: Mon, 11 Nov 2013 00:55:54 -0600 Subject: detect the "mandatory switch" menu This requires a slightly slower text_wait function. There is probably a way to refactor that function in a way that doesn't cause cancer. --- pokemontools/vba/battle.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'pokemontools/vba/battle.py') diff --git a/pokemontools/vba/battle.py b/pokemontools/vba/battle.py index 824f27a..87cd7b1 100644 --- a/pokemontools/vba/battle.py +++ b/pokemontools/vba/battle.py @@ -67,8 +67,10 @@ class Battle(EmulatorController): # 1) current pokemon hp is 0 # 2) game is polling for input - # TODO: detect the mandatory switch menu - return False + if "CANCEL Which ?" in self.emulator.get_text(): + return True + else: + return False def skip_start_text(self, max_loops=20): """ -- cgit v1.2.3