Skip to content

Buff reader: canBlend OCR, cross-system border tolerance, glow support#47

Open
Techpure2013 wants to merge 1 commit into
skillbert:masterfrom
Techpure2013:buff-reader-pr
Open

Buff reader: canBlend OCR, cross-system border tolerance, glow support#47
Techpure2013 wants to merge 1 commit into
skillbert:masterfrom
Techpure2013:buff-reader-pr

Conversation

@Techpure2013
Copy link
Copy Markdown

Summary

  • Rewrote readArg to use readLine/readChar with canBlend instead of custom pixel-level detection
  • Replaced pixel_8px_digits font with anti-aliased aa_8px_new and secondary aa_8px_buff2 fonts
  • Added buffborder_alt, debuffborder_alt, and buffborder_dim border templates for cross-system color variations and glow animation support
  • Three-tier border matching in read() with consecutive-miss scanning to handle glowing buffs mid-bar
  • countMatch/isolateBuffer use luminance/saturation instead of exact RGB for text pixel detection
  • Tested against 142 test cases covering: standard timers, bright icons (1-10), debuff decimals (X.Y), stacked buff parens, familiar timers, Linux/Windows captures, glowing/dimmed borders

Key changes

  • OCR: canBlend-based with trailing-1 recovery, decimal detection, stacked parens via font2 dp2 pattern, "m"/"%" suffix detection
  • Border detection: Tolerant matching (max=50/60 per-pixel) handles RuneScape's buff glow animation and cross-platform color differences
  • Text position: buffery + 25 (was 23) for current game UI, with oy-2 fallback for old UI

Test plan

  • Verify buff/debuff reading in Alt1 live with RuneScape
  • Check cross-platform (Windows/Linux) border detection
  • Verify glowing buff timers remain stable during animation cycles
  • Test stacked buffs with parens notation (e.g. "16(2)")
  • Confirm debuff decimal timers read correctly (e.g. "2.8", "3.5")

- Replaced pixel_8px_digits font with aa_8px_new (anti-aliased) and aa_8px_buff2 (secondary)
- readArg rewritten to use Skillbert's readLine/readChar with canBlend
- Added buffborder_alt, debuffborder_alt, buffborder_dim templates for border variants
- Three-tier border matching: standard/alt (max=50), dim glow (max=60)
- Consecutive-miss scanning to handle glowing buffs mid-bar
- getCaptRect pads left by one gridsize to catch dim buffs before grid origin
- countMatch/isolateBuffer use lum/sat instead of exact RGB for text pixel detection
- Trailing-1 recovery with canBlend fallback for narrow "1" character
- Decimal detection (X.Y debuff timers) with proper ordering vs trailing-1
- Stacked buff parens detection via font2 dp2 pattern and canBlend
- "m" suffix via stroke groups with bright icon guard
- "%" suffix via bright pixel density
- oy-2 fallback for old UI text position
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.

2 participants