Skip to content
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌾 Hayday-Bot-Pro (Project Wheat)

CI Build Check Language Platform Security License

Hayday-Bot-Pro is a lightweight, zero-CPU overhead C++20 automation engine and ImGui control panel designed to manage multi-account Hay Day operations seamlessly across Android emulators. By combining Tesseract OCR, hardware-backed Windows DPAPI encryption (.Ahjie), and ADB background multi-instance routing, it eliminates high CPU usage, fragile pixel scripts, and insecure plain-text credentials.


📸 Demo & Interface

+-----------------------------------------------------------------------+
|  [Hayday-Bot-Pro v2.0 - ImGui Engine]                                 |
|  Active Instance: MEmu_1 (640x480 DirectX)                             |
|  Status: Running | OCR State: Harvesting Wheat | Accounts: 8 Active  |
|  [ Start Engine ]   [ Stop Engine ]   [ Account Manager (.Ahjie) ]   |
+-----------------------------------------------------------------------+

⚡ One-Command Quickstart

Get up and running in under 60 seconds:

:: Clone repository and launch quickstart helper
git clone https://github.com/YourUsername/Hayday-Bot-Pro.git
cd Hayday-Bot-Pro
quickstart.bat

quickstart.bat automatically detects your local build tools, verifies ADB installation, compiles Release|x64, and launches the ImGui GUI interface.


🏗️ System Architecture

flowchart TD
    subgraph GUI ["ImGui Control Panel (C++20 / DirectX)"]
        UI["User Interface & Slot Manager"]
        CFG["Config & State Machine"]
    end

    subgraph Security ["Cryptographic Engine"]
        DPAPI["Windows DPAPI"]
        AES["AES-256-GCM (.Ahjie Files)"]
    end

    subgraph Core ["Bot Engine & Recognition"]
        WINAPI["WinAPI GDI Capture (CaptureWindowGDI)"]
        MINITOUCH["Minitouch Stealth Touch Agent"]
        OCR["Tesseract OCR Engine"]
        COLOR["Direct HSV Color Matcher"]
    end

    subgraph Emulator ["Android Emulator Pool"]
        E1["MEmu Instance 1"]
        E2["LDPlayer Instance 2"]
    end

    UI --> CFG
    CFG <--> DPAPI
    DPAPI <--> AES
    CFG --> Core
    Core --> WINAPI
    Core --> OCR
    Core --> COLOR
    Core --> MINITOUCH
    MINITOUCH <--> E1
    MINITOUCH <--> E2
Loading

🌾 Streamlined Core Workflow

flowchart TD
    Start["Start Bot Instance"] --> SelectSlot["1. Select Active Account Slot"]

    SelectSlot --> CheckStuck{"Shop Blocked?"}
    CheckStuck -- Yes --> ClearAd["Clear Shop Ad Cooldown"]
    CheckStuck -- No --> AutoTom["2. Run Auto Tom Helper"]
    ClearAd --> AutoTom

    AutoTom --> Harvest["3. Harvest Crops"]
    Harvest --> SiloCheck{"Silo 100% Full?"}

    SiloCheck -- Yes --> EmergencySale["Run Emergency Sales Pass"]
    EmergencySale --> SpaceCheck{"Silo Space Freed?"}
    SpaceCheck -- No --> SiloCooldown["Set Silo-Full Cooldown & Skip Slot"]
    SpaceCheck -- Yes --> Plant["4. Plant Empty Fields"]
    SiloCheck -- No --> Plant

    Plant --> SalesTrigger{"Run Sales?"}
    SalesTrigger -- No --> NextSlot
    SalesTrigger -- Yes --> OpenShop["5. Open Roadside Shop"]

    OpenShop --> CollectCoins["Collect Gold & Free Crates"]
    CollectCoins --> CrateCheck{"Empty Crate Available?"}

    CrateCheck -- Yes --> ListCrop["List Crop at Configured Price"]
    CrateCheck -- No --> AdCheck{"Ad Available?"}

    AdCheck -- Yes --> PublishAd["Publish Newspaper Ad"]
    AdCheck -- No --> ShopCooldown["Set Shop-Full Cooldown & Skip Slot"]

    ListCrop --> NextSlot["6. Advance to Next Account Slot"]
    PublishAd --> NextSlot
    SiloCooldown --> NextSlot
    ShopCooldown --> NextSlot
Loading

👦 Auto Tom Helper Workflow

flowchart TD
    Start["Account Slot Start"] --> CheckEnabled{"Auto Tom Enabled?"}
    CheckEnabled -- No --> SkipTom["Proceed to Harvest & Plant"]
    CheckEnabled -- Yes --> CheckCooldown{"Tom Awake? (nextTomTime <= now)"}

    CheckCooldown -- Sleeping --> SkipTom
    CheckCooldown -- Awake --> OpenTom["Tap Tom Crate on Farm"]

    OpenTom --> SelectCategory["Select Barn or Silo Tab"]
    SelectCategory --> InputItem["Type Item Name via ADB"]
    InputItem --> ConfirmSearch["Confirm Search"]

    ConfirmSearch --> WaitReturn["Wait 30s for Tom Search"]
    WaitReturn --> ChooseStack["Select Max Quantity Crate"]
    ChooseStack --> CoinCheck{"Coins Sufficient?"}

    CoinCheck -- Low Coins --> FallbackStack["Fallback to Mid / Min Stack"]
    CoinCheck -- Ok --> ConfirmPurchase["Confirm Purchase"]
    FallbackStack --> ConfirmPurchase

    ConfirmPurchase --> WaitDelivery["Wait 30s for Tom Delivery"]
    WaitDelivery --> CollectItems["Tap Balloons to Collect to Barn/Silo"]
    CollectItems --> SetCooldown["Set 2-Hour Cooldown"]
    SetCooldown --> SkipTom
Loading

🚀 Key Features

  • ⚡ Zero-Disk-Write WinAPI Engine: Captures host emulator window framebuffers directly via Windows GDI (CaptureWindowGDI) without slow disk PNG writes or ADB delays.
  • 🔐 Hardware-Protected Credentials (.Ahjie): Stores account profiles in AES-256-GCM encrypted format tied to machine identity via Windows DPAPI.
  • 👁️ Precision OCR & HSV Color Detection: Uses fast HSV color segmentation for crops (Cyan/Blue/Pink/Mint/Purple) and empty soil (Magenta), combined with Tesseract OCR for coin, diamond, and storage level tracking.
  • 🔄 Anti-Deadlock Multi-Instance Rotation: Features non-blocking Silo-Full recovery, shop ad cooldown management, and automated background account slot rotation.

⚙️ Emulator Configuration Checklist

For optimal OCR accuracy and pixel state matching, ensure your emulator matches these parameters:

Parameter Recommended Setting Note
Resolution 640 x 480 Strictly required for coordinate & OCR alignment
DPI 100 DPI Required for coordinate mapping
Graphics Engine DirectX Prevents frame buffer tearing
Permissions Root Enabled Allows background touch routing via Minitouch
In-Game Language English Required for Tesseract traineddata

🤝 Open for Contributors

We welcome contributions of all kinds! Whether you want to polish the ImGui interface, optimize ADB packet routing, or improve OCR dataset alignment:

  • Read our CONTRIBUTING.md guide.
  • Check out open issues tagged good first issue or help wanted.
  • Submit Pull Requests using feature branches (feature/xyz or fix/abc).

📣 Strategic Visibility & Community Roadmap

Want to learn how we designed this engine or submit Hayday-Bot-Pro to curated list ecosystems? Check out docs/COMMUNITY_OUTREACH.md for our promotion guide and awesome-* PR submission templates.


🛑 Important Notices

Warning

Automated interaction with third-party game clients may violate terms of service. Use responsibly on secondary or testing accounts.

About

You'd be suprised how good this open source project is.

Resources

Contributing

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages