@@ -40,12 +40,15 @@ void release_one_pokemon(
4040 );
4141 }
4242
43+ // The advance dialog is ambiguous against 2 other states. Therefore,
44+ // if we see it, we do not decide that is the state unless it holds for
45+ // 1 second without any of the other states firing.
4346 SomethingInBoxSlotDetector exists (COLOR_BLUE);
4447// GradientArrowDetector change_marks(COLOR_MAGENTA, GradientArrowType::DOWN, {0.28, 0.38, 0.30, 0.10});
4548 BoxWatcher box_detector (COLOR_RED);
4649 BoxSelectWatcher selected (COLOR_YELLOW, std::chrono::milliseconds (100 ));
4750 PromptDialogWatcher confirm (COLOR_CYAN, std::chrono::milliseconds (100 ));
48- AdvanceDialogWatcher advance_dialog (COLOR_GREEN, DialogType::DIALOG_ALL, std::chrono::milliseconds (250 ));
51+ AdvanceDialogWatcher advance_dialog (COLOR_GREEN, DialogType::DIALOG_ALL, std::chrono::milliseconds (1000 ));
4952
5053 context.wait_for_all_requests ();
5154 int ret = wait_until (
@@ -58,7 +61,8 @@ void release_one_pokemon(
5861 advance_dialog
5962 }
6063 );
61- context.wait_for (std::chrono::milliseconds (50 ));
64+ // cout << "ret0 = " << ret << endl;
65+ context.wait_for (std::chrono::milliseconds (100 ));
6266 if (ret == 3 ){
6367 // Make sure we're not mistakening this for the other dialogs.
6468 auto screenshot = stream.video ().snapshot ();
@@ -68,6 +72,7 @@ void release_one_pokemon(
6872 ret = 2 ;
6973 }
7074 }
75+ // cout << "ret1 = " << ret << endl;
7176// cout << "consecutive_box_neutrals = " << consecutive_box_neutrals << endl;
7277
7378 switch (ret){
@@ -101,6 +106,7 @@ void release_one_pokemon(
101106
102107 if (exists.detect (screenshot)){
103108 if (release_attempted && release_completed){
109+ // cout << "return 0" << endl;
104110 return ;
105111 }
106112 release_attempted = false ;
@@ -110,6 +116,7 @@ void release_one_pokemon(
110116 continue ;
111117 }else {
112118 stream.log (" Slot is empty." );
119+ // cout << "return 1" << endl;
113120 return ;
114121 }
115122 }
@@ -148,6 +155,7 @@ void release_one_pokemon(
148155 stream.log (" Detected advance dialog. (unexpected)" , COLOR_RED);
149156 errors++;
150157 }
158+ pbf_press_dpad (context, DPAD_UP, 10 , 10 );
151159 pbf_press_button (context, BUTTON_A, 20 , 20 );
152160 release_completed = true ;
153161 expected = 0 ;
0 commit comments