Feature/Add favorite-pack boot and selection flow - #95
Open
lucaredaelli wants to merge 1 commit into
Open
Conversation
Implement favorite pack support using the ptcgpb helper so injected accounts can preselect an expansion before app launch. The bot now passes the rolled pack into `loadAccount`, sets `packFavoriteSet`, adds pack-to-expansion and coordinate helpers, and updates Home/Points navigation (including a new `FavouriteBooster` needle) to skip normal expansion switching when favorites are active while preserving fallback behavior.
lucaredaelli
force-pushed
the
feature/Pack-Favorite-Helper-Clean
branch
from
August 15, 2026 20:19
24aa9bd to
1bc30ac
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pack Favorite Feature
Summary
Adds support for setting a "favorite pack" expansion via the
ptcgpb-helper-androidbinary's--packcommand. When enabled, the game boots directly into the correct expansion's pack screen, bypassing the manual expansion selection UI. This speeds up pack opening by eliminating navigation steps.How it works
Pack name to expansion ID mapping (
PTCGPHelper.ahk): A lookup table maps bot pack names (e.g.Mewtwo,MegaAltaria) to expansion IDs (e.g.A1,B1).SetPackFavorite(packName)(PTCGPHelper.ahk): Called while the game is closed. Runsptcgpb --pack <expansionId>via adb shell. Returns true on success.loadAccount(favoritePackName)(AccountManager.ahk): After closing the game and before restarting it, callsSetPackFavoritewith the rolledopenPack. SetspackFavoriteSet = 1on success,0on failure or whenopenPackis empty.getPackCoordXInHome()(Crinity_UnofficialPatch.ahk): WhenpackFavoriteSetis true, setsisSkipSelectExpansion = 1and returns the favourite home coordinate.startPreProcesspreservesisSkipSelectExpansioninstead of resetting it.SelectPack()(1.ahk):HG = "First"): The game boots directly into the Points screen. The "Waiting for Points" loop does not click in Home. AfterFindPackStats, a single extra click selects the correct pack within the expansion if it is not the centre one.HG != "First", e.g. extra pack): Switches to the favourites view in Home (click265, 236+FavouriteBoosterneedle), then clicks the pack at the correct Home X coordinate. Skips the favourites switch for packs already stable in the Home screen (mainScreenPackList).isSkipSelectExpansion = 1, skipsmoveSeriesScreen/expansionScreenDrag/additionalAction.EnterFavouritePackFromHome()(1.ahk): Used in Inject Wonderpick 96P+ afterAddFriends. Switches to favourites view, clicks the pack once to enter the Points screen, then waits forPack_PackPointButtonwithout clicking again (clicking the pack in favourites enters Open Pack directly if clicked again).Stable Home packs: For packs listed in
mainScreenPackList(e.g.ParadoxDrive,RulerOfTheSkies,EveryDayWonders), the bot uses the Home position (Left=60, Middle=140, Right=215) instead ofGetPackFavoriteHomeX, since these packs have their own fixed slots in the Home screen.Coordinate helpers (
PTCGPHelper.ahk)GetPackFavoriteHomeX(packName): Returns the X coordinate for a pack in the Home favourites view (Y=203). 3 packs use Left=60, Centre=140, Right=215. 2 packs use Left=90, Right=190. 1 pack uses Centre=140.GetPackFavoritePointsX(packName): Returns the X coordinate for a pack in the Points screen (Y=320). Same layout as Home.Files modified
Scripts/1.ahk:loadAccountcall;loadAccountnow called inside the loop afteropenPackis rolled.restartGameInstancefor injection methods.favEnteredFromHomeflag to skip extra pack-selection click when entering from Home favourites.EnterFavouritePackFromHome()function.SelectPack()to handle favourite pack flow for cold boot and Home entry.Scripts/Include/AccountManager.ahk:loadAccountnow acceptsfavoritePackNameparameter.SetPackFavoriteand setspackFavoriteSetaccordingly.Scripts/Include/PTCGPHelper.ahk:SetPackFavorite(),GetPackFavoriteHomeX(),GetPackFavoritePointsX().Scripts/Include/Crinity_UnofficialPatch.ahk:getPackCoordXInHome()returns early withisSkipSelectExpansion = 1whenpackFavoriteSetis true.startPreProcesspreservesisSkipSelectExpansionwhenpackFavoriteSetis true.Scripts/Needles/FavouriteBooster.png: New needle for detecting the favourites view in Home.Fallback
If
SetPackFavoritefails (helper not installed, unknown pack name, emptyopenPack),packFavoriteSetstays 0 and the bot uses the normal UI navigation flow (moveSeriesScreen+expansionScreenDrag).