Skip to content

Fix: [CN] core monthly shop never scrolls, items on later pages can never be bought - #5855

Open
wanwan-doudou wants to merge 2 commits into
LmeSzinc:devfrom
wanwan-doudou:fix/core-shop-scroll
Open

Fix: [CN] core monthly shop never scrolls, items on later pages can never be bought#5855
wanwan-doudou wants to merge 2 commits into
LmeSzinc:devfrom
wanwan-doudou:fix/core-shop-scroll

Conversation

@wanwan-doudou

@wanwan-doudou wanwan-doudou commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #5853 — the core monthly shop (核心月度商店) never scrolls, so only the first 2 rows out of about 20 are ever seen. Items placed on later pages can never be found or bought, including the torpedo / AP shell / heavy shell templates added in #5837.

CoreShop_250814.run() called shop_buy() once and returned, unlike medal shop which walks the list page by page.

The visible first page is not a reliable assumption: scroll position and exchange state can differ between accounts and runs. The three templates were on the first page on the test account, while #5853 reported them later in the list, so the shop must reset to the top and scan the full list.

Changes

  • Locate item rows by the core icon in the price bar (assets/shop/cost/Core_4.png, origin_y = icon_y - 129), the same approach medal shop uses. The static grid origin=(265, 238) only matches when the list is at top; once scrolled, predict() returns an empty list because every item fails predict_valid, so the log only shows No shop items found with no visible error.
  • Scroll by dragging the item list, and detect the end of the list by comparing the item area before and after the drag. The scrollbar is not usable here: its lower half overlaps a dark character illustration and loses contrast (grey fades from 99 to 56 over the slider), so scroll position cannot be read near the bottom.
  • Use device.drag() with a shake at the end rather than swipe_vector(). Plain swipes keep sliding from inertia, moving about 4 rows per page while only 2 rows are detected, silently skipping half of the items.
  • Call device.click_record_remove() after each drag, otherwise walking the whole list trips GameTooManyClickError (the guard fires at 12 clicks on the same button).
  • Use the same 20-swipe guard when resetting the list to the top, and stop the shop run if the top boundary cannot be confirmed. The live CN list needs 11 successful upward drags from the bottom; the previous 10-swipe guard stopped one row short.

Testing

Tested against a live CN client (about 20 rows / 99 items):

  • Traverses the full list with 11 successful downward drags; the 12th probe confirms the bottom boundary. Prices go 800 → 500 → 300 / 100 / 25 → 1500 → 1200 → 1000 with no gap.
  • Type93PureOxygenTorpedo / Type1ArmorPiercingShell / SuperHeavyShell are recognized with the correct names and groups.
  • Real purchase verified with filter Chip: item clicked, AMOUNT_MAX selected 10, purchase confirmed, core 17416 → 17066.
  • End-to-end purchase verified with the exact target filter: Type93PureOxygenTorpedo / Type1ArmorPiercingShell / SuperHeavyShell were each recognized, clicked, confirmed, and marked sold out in one run; core 17066 → 15566 → 14766 → 13966. No other item was purchased.
  • After purchases mark items sold out and change the set of detectable items, scrolling still reaches the bottom correctly.
  • Reset regression from the actual bottom: 11 successful upward drags, the 12th drag confirms the top boundary, the top-frame mean difference is 1.730, and all three target templates are recognized again before scanning.

Only tested on CN. Scrolling and row detection use fixed geometry and a text-free core icon rather than localized text, so they are expected to work on other servers, but this remains unverified.

CoreShop_250814.run() called shop_buy() once and returned, so only the
first 2 rows out of about 20 were ever seen. Items placed on later pages
could never be found, including the templates added in LmeSzinc#5837.

Locate item rows by the core icon in price bar, the static grid only
matches when the list is at top. Scroll by dragging the item list instead
of the scrollbar, whose lower half overlaps a dark illustration and loses
contrast near the bottom.
Allow the top reset to use the same swipe guard as page scanning, and stop the shop run if the top boundary cannot be confirmed.
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