Skip to content

BBQ Farmer: check which quest a reroll pays for, and that it was replaced - #1659

Closed
dayfine wants to merge 3 commits into
PokemonAutomation:mainfrom
dayfine:bbq/verified-reroll
Closed

dayfine wants to merge 3 commits into
PokemonAutomation:mainfrom
dayfine:bbq/verified-reroll

Conversation

@dayfine

@dayfine dayfine commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Depends on: #1640. Merge that first. Until then this PR also shows #1640's commits; the change here is the last commit only.

Rerolling a quest costs BP, but the farmer did not check which quest it paid for, or whether anything was rerolled at all.

  • Wrong quest. reroll_slot() opened the quest panel and pressed DOWN once per slot, assuming the cursor started on the top quest. On a Switch the panel often opens with the cursor where it was left. In one run, 3 of 10 rerolls opened the menu on a different quest than planned.
  • Nothing checked. It then pressed A twice and closed the panel. When out of BP, nothing was rerolled, the same quest came back, and it was rerolled again every round.

Change

reroll_quest() does one reroll through an injectable BBQRerollActions:

  1. Open the panel and press A wherever the cursor is.
  2. See which quest the reroll menu opened next to, from the position of its arrow. If it isn't the planned quest, close the menu, move the cursor by the difference, and try again (up to 3 times).
  3. Confirm only once the menu is open next to the planned quest.
  4. Read the panel again, up to 3 times since OCR can miss a read, to check the quest was replaced.

reroll_slot() runs it on the console and stops the program if it fails:

Result BP spent Stops with
Panel did not open no error report
Reroll menu not found no error report
Quest not replaced maybe no error report; usually means out of BP

Reroll-all is unchanged.

Limits

  • The arrow boxes for the top three quests were checked on a Switch. The fourth uses the same spacing but hasn't been seen live.
  • A reroll that gives back the same quest looks the same as running out of BP, so it also stops.

Tests

9 PokemonSV::BBQReroll cases run reroll_quest() against a simulated panel with a cursor. Each checks the result, which slots were paid for, the updated quests, and that the panel was closed. They cover the cursor left below the quest, the fourth quest, panel or menu not found, out of BP, missed reads, and a same-quest replacement. All pass, along with the existing PokemonSV::BBQuestPlan cases.

🤖 Generated with Claude Code

https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E

dayfine and others added 3 commits October 20, 2026 22:39
… out

process_quest_list() decided what to do with each quest and pressed
the buttons for it in the same loop, so the decisions could only be
checked on a Switch.

plan_quests() now makes the decisions from the options alone: which
quests to do, which panel slots to reroll, and whether to reroll all.
process_quest_list() carries out the plan, and opening the panel is a
shared helper instead of three copies.

All rerolls now move the cursor to the quest's slot. The out-of-eggs
reroll used to reroll the top slot; the egg quest is a red quest and
red quests are listed at the top, so this is the same in practice.
OOEggs::Stop reaching the planner is now an InternalProgramError,
since the farmer stops before that can happen.

Unit tests cover the plan for exclusions, duplicate rows, quests that
are not possible, and eggs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Move the out-of-eggs choice, the exclusions table rows, a single-slot
reroll and the reroll of every slot into file-local helpers, so
plan_quests() and process_quest_list() read as one level of steps.
Explain why the language-selection error is commented out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
reroll_slot() opened the quest panel, pressed DOWN once per slot from where
it assumed the cursor was, and pressed A twice. The panel does not always
open with the cursor on the top quest: on a Switch it opened where the
cursor was left, so the reroll paid for a different quest than planned.
Nothing checked the menu opened or the quest changed, so running out of
BP went unnoticed and the same quest was rerolled every round.

reroll_quest() now does a reroll through injectable BBQRerollActions:
open the reroll menu wherever the cursor is, see which quest the menu
opened next to from its arrow, move to the planned quest, and only then
confirm. Afterwards it reads the panel (up to 3 times, as OCR can miss a
read) to check the quest was replaced. Panel or menu not found stops
before spending BP; a quest not replaced stops without an error report,
as it usually means out of BP.

The arrow boxes for the top three slots were checked on a Switch; the
fourth uses the same spacing. Reroll-all is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
@dayfine

dayfine commented Oct 22, 2026

Copy link
Copy Markdown
Contributor Author

Closing for now to keep the upstream queue to PRs that are ready: this one waits on unmerged parent PRs. It continues on my fork as dayfine#8, and I'll reopen it here once its parents merge.

@dayfine dayfine closed this Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant