Repository navigation
Develop to main 2.1.1 - #55
Conversation
Removed the 'What's New in v2.0.0' section from README.md.
…kflow Replaced UI element search with a timed delay for dock readiness after selling fish. Added isFirstCycle flag to skip dock wait on initial cycle. Streamlines fishing actions and improves user experience by reducing unnecessary waits. #46
…kflow Replaced UI element search with a timed delay for dock readiness after selling fish. Added isFirstCycle flag to skip dock wait on initial cycle. Streamlines fishing actions and improves user experience by reducing unnecessary waits. #48
Introduced dev-build.yml GitHub Actions workflow to automate build and artifact upload for pushes to develop and pull requests. Workflow includes .NET 10 setup, dependency restore, single-file publish, Tesseract language data download, folder copying, short SHA generation, and artifact retention.
Added pond occlusion grid sampling as the primary method for detecting the fish catch popup, based on the absence of pond water color. Reduced the required color-spot matches for the secondary check, removed the fallback cast button check, and added detailed debug logging. The bot now always casts even if no fish are detected, with appropriate debug output. Also introduced an IsWaterColor helper and improved code comments. #48
Previously, the cast destination was set based on a reference rod button position, which could cause misalignment if the detected button position differed. Now, the drag vector is calculated relative to the reference and applied to the actual detected button position, ensuring accurate casting regardless of button offset. Added debug logging for drag vector and offset details.
Applied a 1.25 horizontal boost to the drag vector's X component when calculating cast destination, allowing side casts to reach further and correcting undershooting. Updated debug output to include the boost value for easier traceability. #48
Previously, only per-cycle fish/cast counts were tracked and shown. This update adds session-wide totals for fish caught and casts, displaying both current cycle and session stats in the overlay. Overlay logic and UpdateStats were updated to support this.
Added properties to expose session totals for fish caught and casts in fishing logic and service classes. Updated fishing completion dialogs to show total fish, casts, and catch rate percentage. Minor cleanup in FishingOverlayForm to remove unused variable.
There was a problem hiding this comment.
Pull request overview
This PR updates the repository for the 2.1.1 mainline sync by removing an outdated “What’s New” section from the README and adding a GitHub Actions workflow to produce dev build artifacts for the Windows (.NET) application.
Changes:
- Remove the “What’s New in v2.0.0” section content from
README.md. - Add a new
Dev BuildGitHub Actions workflow that publishes a single-file Windows executable and uploads it as an artifact (including Tesseract language data and supporting folders).
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| README.md | Removes the v2.0.0 “What’s New” content (but leaves a TOC reference that now becomes stale). |
| .github/workflows/dev-build.yml | Introduces a Windows CI workflow to publish and package a dev build artifact (currently has a YAML correctness issue + supply-chain concerns). |
Files not reviewed (1)
- ToonTown Rewritten Bot/Views/MainForm.Designer.cs: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 |
There was a problem hiding this comment.
The steps list items are not indented under steps: (the - name: lines are aligned with steps:). This makes the workflow YAML invalid and the job won't run. Indent each step (- name, uses, run, etc.) two spaces further than steps:.
| # Download eng.traineddata from tessdata_fast | ||
| $url = "https://github.com/tesseract-ocr/tessdata_fast/raw/main/eng.traineddata" | ||
| $output = "./publish/tessdata/eng.traineddata" | ||
|
|
||
| Write-Host "Downloading Tesseract language data..." | ||
| Invoke-WebRequest -Uri $url -OutFile $output | ||
|
|
||
| # Verify download | ||
| if (Test-Path $output) { | ||
| $size = (Get-Item $output).Length | ||
| Write-Host "Downloaded eng.traineddata ($size bytes)" |
There was a problem hiding this comment.
The workflow downloads eng.traineddata from .../raw/main/... without pinning to a specific commit/tag or verifying a checksum/signature. This is a supply-chain risk and makes builds non-reproducible if the upstream file changes. Pin the download to a specific revision and verify the expected SHA256 (or use a vendored/checked-in artifact if feasible).
| # Download eng.traineddata from tessdata_fast | |
| $url = "https://github.com/tesseract-ocr/tessdata_fast/raw/main/eng.traineddata" | |
| $output = "./publish/tessdata/eng.traineddata" | |
| Write-Host "Downloading Tesseract language data..." | |
| Invoke-WebRequest -Uri $url -OutFile $output | |
| # Verify download | |
| if (Test-Path $output) { | |
| $size = (Get-Item $output).Length | |
| Write-Host "Downloaded eng.traineddata ($size bytes)" | |
| # Download eng.traineddata from tessdata_fast pinned to a specific commit | |
| # NOTE: Replace COMMIT_SHA and EXPECTED_SHA256 with the values for the eng.traineddata you intend to use. | |
| $commit = "COMMIT_SHA_FOR_TESSDATA_FAST_ENG" | |
| $url = "https://github.com/tesseract-ocr/tessdata_fast/raw/$commit/eng.traineddata" | |
| $output = "./publish/tessdata/eng.traineddata" | |
| Write-Host "Downloading Tesseract language data..." | |
| Invoke-WebRequest -Uri $url -OutFile $output | |
| # Verify download: file exists and matches expected SHA256 | |
| if (Test-Path $output) { | |
| $size = (Get-Item $output).Length | |
| Write-Host "Downloaded eng.traineddata ($size bytes)" | |
| # Expected SHA256 for the pinned eng.traineddata | |
| $expectedHash = "EXPECTED_SHA256_FOR_ENG_TRAINEDDATA" | |
| $fileHash = (Get-FileHash -Path $output -Algorithm SHA256).Hash.ToLowerInvariant() | |
| Write-Host "Computed SHA256: $fileHash" | |
| if ($fileHash -ne $expectedHash.ToLowerInvariant()) { | |
| Write-Error "SHA256 mismatch for eng.traineddata. Expected $expectedHash but got $fileHash" | |
| exit 1 | |
| } |
| - name: Copy required folders | ||
| run: | | ||
| # Build folder path (where intermediate files are) | ||
| $buildFolder = "ToonTown Rewritten Bot/bin/Release/net10.0-windows/win-x64" |
There was a problem hiding this comment.
$buildFolder is hardcoded to net10.0-windows/win-x64. If the TargetFramework or RID changes, this workflow will silently stop copying required folders. Consider deriving this from env variables (e.g., TFM/RID) or copying from the known ./publish output instead of the intermediate bin/Release/... path.
| $buildFolder = "ToonTown Rewritten Bot/bin/Release/net10.0-windows/win-x64" | |
| $tfm = if ($env:TFM) { $env:TFM } else { "net10.0-windows" } | |
| $rid = if ($env:RID) { $env:RID } else { "win-x64" } | |
| $buildFolder = "ToonTown Rewritten Bot/bin/Release/$tfm/$rid" |
|
|
||
| ## What's New in v2.0.0 | ||
|
|
||
| - **Template Matching** - The bot now uses image recognition to find buttons and UI elements instead of hardcoded coordinates. Works regardless of window size or position. | ||
| - **Improved Fishing** - Computer vision fish shadow detection, customizable scan area, per-location color calibration, real-time overlay with stats, and out-of-jellybeans detection. | ||
| - **Auto Golf** - Automatically detects which course you're on via OCR and plays the correct actions for each hole. | ||
| - **Global Hotkeys** - F11 to pause/resume, Esc/F12 to stop. Works even when the game has focus. | ||
|
|
||
| ## Features | ||
| - **Fishing** - Auto-cast with fish shadow detection using computer vision, sell cycles, multiple location support, and a real-time overlay showing fish caught and cast count. |
There was a problem hiding this comment.
The README Table of Contents still links to “What's New in v2.0.0”, but that section content was removed in this change. Update the TOC entry to match the remaining headings, or restore the section so the anchor isn't broken.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4a54d0a940
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const int maxWaitSeconds = 30; | ||
| string elementName = CoordinateActions.GetDescription(Convert.ToInt32(FishingCoordinatesEnum.RedFishingButton).ToString()) | ||
| ?? $"Element_{Convert.ToInt32(FishingCoordinatesEnum.RedFishingButton)}"; | ||
| const int dockSettleDelayMs = 3000; |
There was a problem hiding this comment.
Wait for cast button readiness instead of fixed 3s delay
Using a hardcoded 3000ms settle delay here removes the previous readiness check and can start the next fishing cycle before the dock UI is actually interactable; this is most likely on slower machines or when returning from sell trips takes longer than expected. In that case the next cast attempts run while the red fishing button is still unavailable, which can cause missed element detection and failed/incorrect casts. The prior polling behavior (wait until cast button appears, with timeout) avoided this race.
Useful? React with 👍 / 👎.
Develop to main 2.1.1