Skip to content

Feat/bot core module - #2

Merged
mCodex merged 5 commits into
mainfrom
feat/bot_core_module
Dec 10, 2025
Merged

mCodex merged 5 commits into
mainfrom
feat/bot_core_module

Conversation

@mCodex

@mCodex mCodex commented Dec 10, 2025

Copy link
Copy Markdown
Owner

No description provided.

Added new TargetBot AI modules: core utilities, monster behavior analysis, spell optimizer, and movement coordinator. Updated documentation and code comments to reflect new features, dynamic scaling, and improved naming (SmartHunt → Hunt Analyzer, Smart Pull → Pull System, etc). Refactored imports and descriptions for clarity and consistency across modules.
Copilot AI review requested due to automatic review settings December 10, 2025 14:23
Refactored the equipment manager to use a centralized EquipState and cached rules for improved performance. UI rule list refresh now avoids widget flicker and unnecessary recreation. Equipment macro now iterates over cached rules instead of UI children, reducing overhead and improving responsiveness. Added cache invalidation logic when rules change or priorities are updated.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a sophisticated bot core module system for TargetBot, featuring dynamic movement coordination, monster behavior analysis, and spell optimization. The changes aim to make the bot more reactive when surrounded by many monsters while remaining conservative in safer situations.

Key changes:

  • New TargetCore module with pure utility functions for geometry and combat calculations
  • MonsterAI module for behavior pattern recognition and attack prediction
  • SpellOptimizer for calculating optimal AoE spell positions
  • MovementCoordinator with dynamic confidence thresholds that scale based on monster count
  • LRU caching implementation for creature data (50 entry limit)
  • Documentation updates renaming "SmartHunt" to "Hunt Analyzer"

Reviewed changes

Copilot reviewed 28 out of 28 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
targetbot/core.lua New pure utility functions module with geometry, distance, and combat helpers
targetbot/monster_ai.lua Monster behavior tracking and attack prediction system
targetbot/spell_optimizer.lua AoE spell position optimization with pattern matching
targetbot/movement_coordinator.lua Unified movement system with dynamic scaling and intent voting
targetbot/target.lua Added LRU eviction to creature cache with 50 entry limit
targetbot/creature_priority.lua Updated to use TargetCore constants where available
targetbot/creature_attack.lua Integrated MovementCoordinator with dynamic scaling based on monster count
targetbot/creature_editor.lua Minor UI text changes (Smart Pull → Pull System)
docs/*.md Updated documentation with new module descriptions and renamed Hunt Analyzer
core/smart_hunt.lua Renamed from SmartHunt to HuntAnalyzer throughout
core/cavebot.lua Added loading of new TargetBot modules
core/Equipper.lua Optimized with rules caching to reduce UI iteration overhead

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread targetbot/target.lua Outdated
Comment thread targetbot/target.lua Outdated
Comment thread targetbot/creature_attack.lua Outdated
Comment thread targetbot/monster_ai.lua

-- Check if monster is facing a position (pure function)
function MonsterAI.Predictor.isFacingPosition(monsterPos, monsterDir, targetPos)
local dirVec = TargetCore and TargetCore.CONSTANTS.DIR_VECTORS[monsterDir]

Copilot AI Dec 10, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment references TargetCore.CONSTANTS.DIR_VECTORS but the actual check is for a non-existent TargetCore module. The fallback direction vectors will always be used since the check will fail.

Copilot uses AI. Check for mistakes.
local WEIGHT_MEDIUM = 2 -- Distance <= 5
local WEIGHT_CHASE_LOW = 10 -- Chase mode + low HP
-- Use TargetCore constants if available, otherwise define locally
local PRIO = (TargetCore and TargetCore.CONSTANTS and TargetCore.CONSTANTS.PRIORITY) or {

Copilot AI Dec 10, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable name TargetBotCore is inconsistent with the actual module name TargetCore. This pattern appears multiple times in the PR. All references should use TargetCore consistently.

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot open a new pull request to apply changes based on this feedback

addCheckBox("smartPull", "Smart Pull", false, [[When enabled, uses CaveBot to walk and pull more monsters if the current pack is too small.
Configure with: Smart Pull Range (how far to check), Min Monsters (threshold), and Shape (accuracy).
addCheckBox("smartPull", "Pull System", false, [[When enabled, uses CaveBot to walk and pull more monsters if the current pack is too small.
Configure with: Pull Range (how far to check), Min Monsters (threshold), and Shape (accuracy).

Copilot AI Dec 10, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in comment: "accurracy" should be "accuracy".

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot open a new pull request to apply changes based on this feedback

mCodex and others added 3 commits December 10, 2025 16:31
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Copilot AI commented Dec 10, 2025

Copy link
Copy Markdown
Contributor

@mCodex I've opened a new pull request, #3, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI commented Dec 10, 2025

Copy link
Copy Markdown
Contributor

@mCodex I've opened a new pull request, #4, to work on those changes. Once the pull request is ready, I'll request review from you.

@mCodex
mCodex merged commit c51e19d into main Dec 10, 2025
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.

3 participants