@@ -274,8 +274,8 @@ bool MoneyFarmerRoute210::battle(SingleSwitchProgramEnvironment& env, ProControl
274274}
275275
276276void MoneyFarmerRoute210::move_to_trainer (SingleSwitchProgramEnvironment& env, ProControllerContext& context, const std::vector<ImagePixelBox>& bubbles
277- ){
278-
277+ ){
278+
279279 const ImagePixelBox* closest = nullptr ;
280280 double best_dist_sq = std::numeric_limits<double >::max ();
281281
@@ -295,32 +295,37 @@ void MoneyFarmerRoute210::move_to_trainer(SingleSwitchProgramEnvironment& env, P
295295
296296 if (closest->min_x < 350 ) {
297297 // The trainer who wants to battle is to the far-left, behind the other trainer
298- pbf_press_dpad (context, DPAD_UP, 300ms , 0ms);
298+ pbf_press_dpad (context, DPAD_UP, 400ms , 0ms);
299299 pbf_press_dpad (context, DPAD_LEFT, 500ms, 0ms);
300300 pbf_mash_button (context, BUTTON_A, 1000ms);
301- pbf_press_dpad (context, DPAD_DOWN, 300ms, 0ms);
301+ context.wait_for_all_requests ();
302+ pbf_press_dpad (context, DPAD_DOWN, 400ms, 0ms);
302303 pbf_mash_button (context, BUTTON_A, 1000ms);
304+ context.wait_for_all_requests ();
303305 } else if (closest->min_x < 450 ) {
304306 // The trainer who wants to battle is on the character's left
305307 if (closest->min_y < 110 ) {
306308 // The trainer who wants to battle is one step above us
307- pbf_press_dpad (context, DPAD_UP, 300ms, 0ms);
308- pbf_press_dpad (context, DPAD_LEFT, 300ms, 0ms);
309+ pbf_press_dpad (context, DPAD_UP, 400ms, 0ms);
310+ pbf_press_dpad (context, DPAD_LEFT, 400ms, 0ms);
311+ context.wait_for_all_requests ();
309312 } else {
310313 // The trainer who wants to battle is on our left, right next to us
311- pbf_press_dpad (context, DPAD_LEFT, 300ms , 0ms);
314+ pbf_press_dpad (context, DPAD_LEFT, 400ms , 0ms);
312315 }
313316 } else if (closest->min_x < 560 ) {
314317 // The trainer who wants to battle is right above us
315- pbf_press_dpad (context, DPAD_UP, 300ms , 0ms);
318+ pbf_press_dpad (context, DPAD_UP, 400ms , 0ms);
316319 } else {
317320 // The trainer who wants to battle is above us, one step to our right
318- pbf_press_dpad (context, DPAD_RIGHT, 300ms, 0ms);
319- pbf_press_dpad (context, DPAD_UP, 300ms, 0ms);
321+ pbf_press_dpad (context, DPAD_RIGHT, 400ms, 0ms);
322+ pbf_press_dpad (context, DPAD_UP, 400ms, 0ms);
323+ context.wait_for_all_requests ();
320324 }
321325
322326 pbf_mash_button (context, BUTTON_A, 1000ms);
323-
327+ context.wait_for_all_requests ();
328+ }
324329
325330void MoneyFarmerRoute210::check_pickup_items (
326331 ProControllerContext& context, const bool pickup_slots[6 ]
0 commit comments