Skip to content

Add dual display scale support#37

Draft
Bemirror99 wants to merge 10 commits into
kevnITG:mainfrom
Bemirror99:feature/scale-125-support
Draft

Add dual display scale support#37
Bemirror99 wants to merge 10 commits into
kevnITG:mainfrom
Bemirror99:feature/scale-125-support

Conversation

@Bemirror99

@Bemirror99 Bemirror99 commented May 15, 2026

Copy link
Copy Markdown

Summary

Add dual display scale support for Windows display scale 100% and 125% in the same codebase.

The goal is to keep the main flow aligned with the current Crinity/Kevin-based structure while using shared needles by default, scale-specific coordinates/profiles/helpers where needed, and only minimal verified Scale125 fallback assets.

Latest checkpoint commit:
d5f312e Update pack data and add blocked request opt-in

Main Changes

  • Added Display Scale support: Auto / 100 / 125.
  • Added scale-aware coordinates, needle path resolution, ADB click scaling, screenshot/card crop handling, MuMu window sizing, and card/rarity detection handling.
  • Restored Scale 125 coverage for Create Bots, Inject Wonderpick, GP test cleanup, friend navigation, and card detection.
  • Reduced Scale125 image dependency:
    • Shared Scripts/Needles assets are now the default.
    • Removed duplicate/unused Scripts/Scale125 PNGs.
    • Scripts/Scale125 fallback is limited to documented pixel-sensitive exceptions and rarity/card detection needles.
  • Updated pack metadata/dictionaries for the current pack layout, including ParadoxDrive.
  • Improved group reroll recovery:
    • Persists loaded account and friend cleanup state.
    • If an instance gets stuck after friending, it can resume cleanup after restart instead of immediately loading a new account.
    • Recovery cleanup now clears recovery metadata without marking the account as used unless the normal XML/pack state was actually updated.
    • Valid GP detection/restarts now clear pending friend-cleanup state so found GP accounts are not removed during notification or on next startup.
  • Hardened Scale 125 long-run issues:
    • Anchors the hamburger-menu Misc route to the visible inventory icon so 125-scale menu drift cannot tap Trade / Share.
    • Extends the Points startup wait path to use the same 90-second tolerance as Country/Social startup screens.
    • Guards friend-request retry clicks against already-pending/accepted states to reduce request/cancel/request risk.
  • Hardened friend entry and friend request handling under load:
    • Retries friend ID search submission when only part of the code is entered or the search dialog does not advance.
    • Skips the current ID instead of repeatedly clicking when ADD errors, already-friended states, cannot-request states, or friend/request limits are detected.
    • Adds a hidden opt-in workaround for a blocked incoming request edge case:
      • Default is off: blockedFriendRequestHotfix=0.
      • When enabled, the existing approve-tab FriendLimit path waits for the current gray toast to clear, denies the top request, and waits for the post-deny gray toast to clear.
      • This is intended only for the rare full-friend sender case where one incoming request blocks the approve queue.
  • Preserves repository placeholder files during Balance XML cleanup:
    • Balance XML now uses a per-run Accounts/Saved/tmp/balance_* folder.
    • Accounts/Saved/<instance>/readme.md is restored after balancing so repo placeholder files are not deleted by the tool.
  • Added stuck screenshots, log rotation, and more useful stuck recovery logs.
  • Improved monitor/restart handling:
    • Instance scripts now use #SingleInstance, Force.
    • Monitor cleanup handles AHK dialog windows such as previous-instance prompts.
    • Keeps the common SafeReload path on AutoHotkey's built-in Reload while adding lightweight Reload.txt diagnostics.
    • Experimental delayed/VBS reload workarounds are intentionally not included.
  • Reduced runtime focus/z-order disruption:
    • Removes repeated external-window capture/restore from status message updates.
    • Keeps console initialization focus restoration for automatic reload/console-hide moments by restoring the previous foreground window.
    • Leaves user-triggered Arrange / Launch All MuMu activation behavior unchanged.
  • Hardened Discord webhook delivery:
    • Checks Discord HTTP status, retries failed sends, logs failures to Logs/Discord.txt, redacts webhook tokens, and adds trace IDs.
    • Suppresses successful heartbeat delivery logs while keeping success logs for GP/S4T/tradeable alerts.

Tested

  • Scale 100 Create Bots
  • Scale 125 Create Bots
  • Scale 100 Inject Wonderpick 96P+
  • Scale 125 Inject Wonderpick 96P+
  • Scale 125 GP test cleanup / Send2 rate-limit cases
  • Scale 125 card detection across all card positions in recent long-run tests
  • Stuck recovery and friend cleanup recovery through long-run testing
  • Latest blocked incoming friend request opt-in validation:
    • Compared the old MainStuck.png hotfix needle with existing Scripts/Needles/FriendLimit.png; colors match within image-search tolerance and the existing smaller crop fits the current 100/125 coordinate profiles.
    • Keeps the default FriendLimit -> done/break behavior unchanged unless blockedFriendRequestHotfix=1 is set manually.
    • Ahk2Exe compile validation for Scripts\Main.ahk.
    • git diff --check.
  • Previous Ahk2Exe syntax checks:
    • PTCGPB.ahk
    • Scripts\1.ahk
    • Scripts\Main.ahk
    • Scripts\Include\Monitor.ahk
    • Scripts\Include\MonitorOnce.ahk
    • Scripts\Include\LaunchAllMumu.ahk

Notes

  • Most UI needles are intended to be shared between 100% and 125%.
  • Scale-specific behavior should live in coordinates, RarityBorder/card detection profiles, Gdip/search wrappers, window sizing, ADB click mapping, and crop utilities.
  • Remaining Scale125-only assets should be treated as verified exceptions, not a second full image set.
  • blockedFriendRequestHotfix=1 is a hidden, opt-in workaround for a rare approve-queue blocking case. It should not be enabled for normal users, especially if the local friend list may be 99/99.
  • Old Logs/Discord.txt files from previous builds may contain raw webhook URLs because the old code logged the full curl command. Please delete or sanitize old Discord logs before sharing them.
  • New heartbeat success messages are intentionally quiet in Discord.txt; GP/S4T success logs and all Discord failure/retry logs remain available for debugging.
  • High-load MuMu RAM pressure reports appear more related to emulator/app configuration than this AHK branch. Please compare AutoHotkeyU64.exe and MuMuVMMHeadless.exe separately when investigating memory usage.
  • Runtime focus/z-order handling now separates focus recovery from window-order restoration: status messages do not restore covering windows, while console initialization only restores the previous foreground window.

Extra Testing Wanted

  • Long group reroll sessions on unstable/high-instance setups
  • Friend add/delete cleanup after app/MuMu crashes
  • Incoming friend request approve-tab cases, especially full-friend/blocked sender requests with blockedFriendRequestHotfix=1
  • Social / Send / Send2 stuck cases
  • Wonder Pick recognition on both 100% and 125%
  • Dual monitor setups, especially mixed display scales
  • Runtime focus/z-order cases:
    • Automatic reload/stuck recovery while another app is active on the main monitor.
    • Long runs with Explorer or another window covering MuMu on a secondary monitor.
    • Browser file-upload popups while the bot is running.
  • Discord alert misses:
    • If GP is saved/found but no Discord alert appears, please provide GPlog.txt, Discord.txt, the instance Log_N.txt around that time, and any stuck screenshot.

@Bemirror99

Copy link
Copy Markdown
Author

superseded by smaller PRs against Leanny/main

@Bemirror99 Bemirror99 force-pushed the feature/scale-125-support branch from d66c830 to d5f312e Compare May 28, 2026 15:05
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