From 2de5448c2790a0e5fb2e992077844c406e2bf16d Mon Sep 17 00:00:00 2001 From: dayfine Date: Thu, 22 Oct 2026 21:05:24 -0700 Subject: [PATCH 1/2] BBQ Farmer: look around for another target when Kleavor is absent The glide to Kleavor lands in the right place, but Kleavor was absent in about 40% of attempts (R4-R8), and the attempt then gave up. Any wild Pokemon counts for the quest and Scyther roam the area, so turn the camera about a quarter at a time, up to three times, and send out the lead again. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E --- .../Farming/PokemonSV_BlueberryQuests.cpp | 35 ++++++++++++------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/SerialPrograms/Source/VideoGames/PokemonSV/Programs/Farming/PokemonSV_BlueberryQuests.cpp b/SerialPrograms/Source/VideoGames/PokemonSV/Programs/Farming/PokemonSV_BlueberryQuests.cpp index 8e65e03c2c..b0245729c2 100644 --- a/SerialPrograms/Source/VideoGames/PokemonSV/Programs/Farming/PokemonSV_BlueberryQuests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonSV/Programs/Farming/PokemonSV_BlueberryQuests.cpp @@ -680,22 +680,31 @@ void quest_tera_self_defeat( jump_glide_fly(console, context, BBQ_OPTIONS.INVERTED_FLIGHT, 8000ms, 12800ms, 2400ms); } - ssf_press_button(context, BUTTON_ZR, 0ms, 1600ms); - ssf_press_button(context, BUTTON_ZL, 800ms, 400ms); - ssf_press_button(context, BUTTON_ZL, 1200ms, 400ms); + //Send out the lead at whatever is in front and wait for a battle. + auto try_battle = [&](std::chrono::seconds timeout){ + ssf_press_button(context, BUTTON_ZR, 0ms, 1600ms); + ssf_press_button(context, BUTTON_ZL, 800ms, 400ms); + ssf_press_button(context, BUTTON_ZL, 1200ms, 400ms); - pbf_wait(context, 2400ms); - context.wait_for_all_requests(); + pbf_wait(context, 2400ms); + context.wait_for_all_requests(); - NormalBattleMenuWatcher battle_menu(COLOR_YELLOW); - int ret2 = wait_until( - console, context, - std::chrono::seconds(15), - { battle_menu } - ); - battle_menu_detected = ret2 == 0; + NormalBattleMenuWatcher battle_menu(COLOR_YELLOW); + return wait_until(console, context, timeout, { battle_menu }) == 0; + }; + + battle_menu_detected = try_battle(std::chrono::seconds(15)); + + //The glide lands in the right place, but Kleavor is absent ~40% of the time. + //Any wild Pokemon counts, and Scyther roam the area, so turn the camera + //about a quarter at a time and try again. + for (int turn = 1; turn <= 3 && !battle_menu_detected; turn++){ + console.log("Did not enter battle. Did Kleavor spawn? Looking around (" + std::to_string(turn) + "/3)."); + pbf_move_right_joystick(context, {+1, 0}, 480ms, 320ms); + battle_menu_detected = try_battle(std::chrono::seconds(6)); + } if (!battle_menu_detected){ - console.log("Did not enter battle. Did Kleavor spawn?"); + console.log("Did not enter battle after looking around."); } }, { From 285034d465af5980a3785eeece34be3fd9144c4e Mon Sep 17 00:00:00 2001 From: dayfine Date: Thu, 22 Oct 2026 21:08:46 -0700 Subject: [PATCH 2/2] BBQ Farmer: share the look-around as send_out_and_look_around() Catch-any and sneak-up can use it too. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E --- .../Farming/PokemonSV_BlueberryQuests.cpp | 57 +++++++++++-------- .../Farming/PokemonSV_BlueberryQuests.h | 10 ++++ 2 files changed, 42 insertions(+), 25 deletions(-) diff --git a/SerialPrograms/Source/VideoGames/PokemonSV/Programs/Farming/PokemonSV_BlueberryQuests.cpp b/SerialPrograms/Source/VideoGames/PokemonSV/Programs/Farming/PokemonSV_BlueberryQuests.cpp index b0245729c2..504befe9b1 100644 --- a/SerialPrograms/Source/VideoGames/PokemonSV/Programs/Farming/PokemonSV_BlueberryQuests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonSV/Programs/Farming/PokemonSV_BlueberryQuests.cpp @@ -656,6 +656,36 @@ TeraEncounterAction tera_encounter_action( return TeraEncounterAction::Recover; } +bool send_out_and_look_around( + ConsoleHandle& console, ProControllerContext& context, + std::chrono::seconds first_wait, const std::string& target +){ + auto try_battle = [&](std::chrono::seconds timeout){ + ssf_press_button(context, BUTTON_ZR, 0ms, 1600ms); + ssf_press_button(context, BUTTON_ZL, 800ms, 400ms); + ssf_press_button(context, BUTTON_ZL, 1200ms, 400ms); + + pbf_wait(context, 2400ms); + context.wait_for_all_requests(); + + NormalBattleMenuWatcher battle_menu(COLOR_YELLOW); + return wait_until(console, context, timeout, { battle_menu }) == 0; + }; + + if (try_battle(first_wait)){ + return true; + } + for (int turn = 1; turn <= 3; turn++){ + console.log("Did not enter battle. Did " + target + " spawn? Looking around (" + std::to_string(turn) + "/3)."); + pbf_move_right_joystick(context, {+1, 0}, 480ms, 320ms); + if (try_battle(std::chrono::seconds(6))){ + return true; + } + } + console.log("Did not enter battle after looking around."); + return false; +} + void quest_tera_self_defeat( const ProgramInfo& info, ConsoleHandle& console, ProControllerContext& context, @@ -680,32 +710,9 @@ void quest_tera_self_defeat( jump_glide_fly(console, context, BBQ_OPTIONS.INVERTED_FLIGHT, 8000ms, 12800ms, 2400ms); } - //Send out the lead at whatever is in front and wait for a battle. - auto try_battle = [&](std::chrono::seconds timeout){ - ssf_press_button(context, BUTTON_ZR, 0ms, 1600ms); - ssf_press_button(context, BUTTON_ZL, 800ms, 400ms); - ssf_press_button(context, BUTTON_ZL, 1200ms, 400ms); - - pbf_wait(context, 2400ms); - context.wait_for_all_requests(); - - NormalBattleMenuWatcher battle_menu(COLOR_YELLOW); - return wait_until(console, context, timeout, { battle_menu }) == 0; - }; - - battle_menu_detected = try_battle(std::chrono::seconds(15)); - //The glide lands in the right place, but Kleavor is absent ~40% of the time. - //Any wild Pokemon counts, and Scyther roam the area, so turn the camera - //about a quarter at a time and try again. - for (int turn = 1; turn <= 3 && !battle_menu_detected; turn++){ - console.log("Did not enter battle. Did Kleavor spawn? Looking around (" + std::to_string(turn) + "/3)."); - pbf_move_right_joystick(context, {+1, 0}, 480ms, 320ms); - battle_menu_detected = try_battle(std::chrono::seconds(6)); - } - if (!battle_menu_detected){ - console.log("Did not enter battle after looking around."); - } + //Any wild Pokemon counts, and Scyther roam the area. + battle_menu_detected = send_out_and_look_around(console, context, std::chrono::seconds(15), "Kleavor"); }, { static_cast(encounter_watcher), diff --git a/SerialPrograms/Source/VideoGames/PokemonSV/Programs/Farming/PokemonSV_BlueberryQuests.h b/SerialPrograms/Source/VideoGames/PokemonSV/Programs/Farming/PokemonSV_BlueberryQuests.h index 16593da3ac..a6b36e982c 100644 --- a/SerialPrograms/Source/VideoGames/PokemonSV/Programs/Farming/PokemonSV_BlueberryQuests.h +++ b/SerialPrograms/Source/VideoGames/PokemonSV/Programs/Farming/PokemonSV_BlueberryQuests.h @@ -7,6 +7,8 @@ #ifndef PokemonAutomation_PokemonSV_BlueberryQuests_H #define PokemonAutomation_PokemonSV_BlueberryQuests_H +#include +#include #include #include "NintendoSwitch/Controllers/Procon/NintendoSwitch_ProController.h" #include "NintendoSwitch/NintendoSwitch_ConsoleHandle.h" @@ -97,6 +99,14 @@ void quest_travel_500( ); //Run around until you encounter a pokemon. Tera, then defeat it by spamming your first move. +// Send out the lead at whatever is in front and wait for a battle. If none starts, +// turn the camera about a quarter at a time, up to three times, and try again. +// Returns true once the battle menu shows. +bool send_out_and_look_around( + ConsoleHandle& console, ProControllerContext& context, + std::chrono::seconds first_wait, const std::string& target +); + void quest_tera_self_defeat( const ProgramInfo& info, ConsoleHandle& console, ProControllerContext& context,