From ac9cac4078e976698a0a87d109a92cbce99344aa Mon Sep 17 00:00:00 2001 From: jw098 Date: Thu, 6 Mar 2025 16:36:08 -0800 Subject: [PATCH 1/2] fix flying trial farmer for esp32 --- .../Farming/PokemonSV_FlyingTrialFarmer.cpp | 31 +++++++++++++------ 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/SerialPrograms/Source/PokemonSV/Programs/Farming/PokemonSV_FlyingTrialFarmer.cpp b/SerialPrograms/Source/PokemonSV/Programs/Farming/PokemonSV_FlyingTrialFarmer.cpp index 1331b4662c..dd8dc40042 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/Farming/PokemonSV_FlyingTrialFarmer.cpp +++ b/SerialPrograms/Source/PokemonSV/Programs/Farming/PokemonSV_FlyingTrialFarmer.cpp @@ -216,15 +216,28 @@ void FlyingTrialFarmer::program(SingleSwitchProgramEnvironment& env, ProControll pbf_wait(context, 9 * TICKS_PER_SECOND); break; case FlightPath::BACK_ENTRY_SOFT_TURN: - pbf_wait(context, 3 * TICKS_PER_SECOND); - pbf_move_left_joystick(context, 180, get_final_y_axis(-108), 1 * TICKS_PER_SECOND, 0); - pbf_wait(context, 2 * TICKS_PER_SECOND); - pbf_move_left_joystick(context, 40, get_final_y_axis( -78), 240, 0); - pbf_wait(context, 1 * TICKS_PER_SECOND); - pbf_move_left_joystick(context, 110, get_final_y_axis( -78), 2 * TICKS_PER_SECOND, 0); - pbf_wait(context, 14 * TICKS_PER_SECOND); - pbf_move_left_joystick(context, 205, get_final_y_axis( 37), 160, 0); - pbf_wait(context, 9 * TICKS_PER_SECOND); + if (env.console.controller().controller_type() == ControllerType::NintendoSwitch_WirelessProController){ + pbf_wait(context, Milliseconds(3000)); + pbf_move_left_joystick(context, 180, get_final_y_axis(-108), Milliseconds(1005), Milliseconds(0)); + pbf_wait(context, Milliseconds(1995)); + pbf_move_left_joystick(context, 40, get_final_y_axis( -78), Milliseconds(1605), Milliseconds(0)); + pbf_wait(context, Milliseconds(1005)); + pbf_move_left_joystick(context, 110, get_final_y_axis( -78), Milliseconds(1995), Milliseconds(0)); + pbf_wait(context, Milliseconds(14040)); + pbf_move_left_joystick(context, 205, get_final_y_axis( 30), Milliseconds(750), Milliseconds(0)); + pbf_wait(context, Milliseconds(9000)); + }else{ + pbf_wait(context, 3 * TICKS_PER_SECOND); + pbf_move_left_joystick(context, 180, get_final_y_axis(-108), 1 * TICKS_PER_SECOND, 0); + pbf_wait(context, 2 * TICKS_PER_SECOND); + pbf_move_left_joystick(context, 40, get_final_y_axis( -78), 240, 0); + pbf_wait(context, 1 * TICKS_PER_SECOND); + pbf_move_left_joystick(context, 110, get_final_y_axis( -78), 2 * TICKS_PER_SECOND, 0); + pbf_wait(context, 14 * TICKS_PER_SECOND); + pbf_move_left_joystick(context, 205, get_final_y_axis( 37), 160, 0); + pbf_wait(context, 9 * TICKS_PER_SECOND); + } + break; case FlightPath::BACK_ENTRY_HARD_TURN: pbf_wait(context, 3 * TICKS_PER_SECOND); From 26ca32bab7bfca2ad37c44dd2a398a4f47873fdf Mon Sep 17 00:00:00 2001 From: jw098 Date: Fri, 7 Mar 2025 07:58:46 -0800 Subject: [PATCH 2/2] minor tweak to FlyingTrialFarmer --- .../PokemonSV/Programs/Farming/PokemonSV_FlyingTrialFarmer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SerialPrograms/Source/PokemonSV/Programs/Farming/PokemonSV_FlyingTrialFarmer.cpp b/SerialPrograms/Source/PokemonSV/Programs/Farming/PokemonSV_FlyingTrialFarmer.cpp index dd8dc40042..5513c763c7 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/Farming/PokemonSV_FlyingTrialFarmer.cpp +++ b/SerialPrograms/Source/PokemonSV/Programs/Farming/PokemonSV_FlyingTrialFarmer.cpp @@ -224,7 +224,7 @@ void FlyingTrialFarmer::program(SingleSwitchProgramEnvironment& env, ProControll pbf_wait(context, Milliseconds(1005)); pbf_move_left_joystick(context, 110, get_final_y_axis( -78), Milliseconds(1995), Milliseconds(0)); pbf_wait(context, Milliseconds(14040)); - pbf_move_left_joystick(context, 205, get_final_y_axis( 30), Milliseconds(750), Milliseconds(0)); + pbf_move_left_joystick(context, 205, get_final_y_axis( 30), Milliseconds(735), Milliseconds(0)); pbf_wait(context, Milliseconds(9000)); }else{ pbf_wait(context, 3 * TICKS_PER_SECOND);