Skip to content

refactor: optimise exceptions thrown; feat: implement MatchResult; fix: compass accuracy#59

Merged
StaticSweep merged 1 commit into
mainfrom
development
Feb 27, 2026
Merged

refactor: optimise exceptions thrown; feat: implement MatchResult; fix: compass accuracy#59
StaticSweep merged 1 commit into
mainfrom
development

Conversation

@StaticSweep

Copy link
Copy Markdown
Owner

This PR improves developer experience (DX) across the board.

  • Exceptions have been optimised
    • Ocr throws a RuntimeException/UncheckedIOExeption -> to fail fast -> if the project files aren't valid then the project shouldn't run.
    • The VirtualMouseUtils.moveTo()'s InterruptedException was a remnant from a previous version, my fault, safely removed.
    • TemplateMatching.match() no longer throws Exception and does not automatically log failure.
      • It was very annoying to see this when performing competitive selection.
  • There are 3 new Exceptions:
    • DaxException: for a generalised, unaccounted for error, and the parent of the next two.
    • DaxAuthException: if the service is down/the API key is invalid.
    • DaxRateLimitException: for when the service hits its maximum load, meaning the user has to wait.
  • TemplateMatching.match() has been reworked and optimised for the user in mind.
    • It now returns a MatchResult object which includes:
      • Rectangle bounds: the zone local location and size of the template image found within the base.
      • double score: The minVal/threshold/confidence at which the image correlated to the base (lower = better).
      • boolean success: Whether the template was successfully found within the base image.
      • String message: In case there is no match, this will contain further information.
    • It's the user's responsibility to react to the state of the coming MatchResult object so it provides a lot of granularity rather than a catch all Exception, utilising the success() boolean has been very useful whilst testing.
  • The Walker has been refactored:
    • Template images for the compass are no longer required, you can safely delete previous compass images.
      • CVTemplates.bat has been changed to reflect this.
      • The resulting process is a lot faster and memory efficient.
    • It uses the cardinal markers in red, on the compass itself to derive bearing, heavily inspired by SRL.
  • ItemDropper changes:
    • Changed to accept the BaseScript rather than the Controller, for consistency across utilities.
    • The method signature has changed to accept an int[] exclude array.
      • This array should contain slots that you don't want items dropped in -> it will skip those slots.
  • The DemoScripts have been updated across the board to stick to best practices and reflect the above changes.

@StaticSweep StaticSweep merged commit 5ea2a16 into main Feb 27, 2026
1 check passed
@StaticSweep StaticSweep deleted the development branch February 28, 2026 21:25
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