From e24481f343acd0a9ade1dda03738a5ced3065aaa Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 10 Dec 2025 19:32:20 +0000 Subject: [PATCH 1/2] Initial plan From fb8ef1e3ec9ef41b23cbfb33e0c92563b8285dd9 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 10 Dec 2025 19:35:39 +0000 Subject: [PATCH 2/2] Fix naming inconsistency: Replace TargetBotCore with TargetCore throughout codebase Co-authored-by: mCodex <5920613+mCodex@users.noreply.github.com> --- README.md | 2 +- ROADMAP.md | 2 +- docs/PERFORMANCE.md | 4 ++-- docs/TARGETBOT.md | 2 +- targetbot/creature_attack.lua | 8 ++++---- targetbot/target.lua | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 41006c8..4dbcbc8 100644 --- a/README.md +++ b/README.md @@ -177,7 +177,7 @@ nExBot/ | **Multi-Factor Scoring** | Tile evaluation for repositioning | | **Intent Voting** | MovementCoordinator confidence-based decisions | | **Behavior Analysis** | Monster pattern recognition | -| **Pure Functions** | TargetBotCore geometry/combat utilities | +| **Pure Functions** | TargetCore geometry/combat utilities | --- diff --git a/ROADMAP.md b/ROADMAP.md index 806db4a..5384925 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -153,7 +153,7 @@ - Confidence voting system (0.0-1.0) - Anti-oscillation tracking - Emergency/wave_avoid/finish_kill/spell_position priorities -- [x] **TargetBotCore** - Pure utility functions +- [x] **TargetCore** - Pure utility functions - Geometry calculations (Manhattan, Chebyshev, Euclidean) - Combat helpers (danger zones, facing direction) - Monster utilities (target scoring, health checks) diff --git a/docs/PERFORMANCE.md b/docs/PERFORMANCE.md index 8f98699..444054f 100644 --- a/docs/PERFORMANCE.md +++ b/docs/PERFORMANCE.md @@ -356,14 +356,14 @@ end -### TargetBotCore Pure Functions +### TargetCore Pure Functions
📊 Reusable Geometry Calculations ```lua -- All geometry functions are pure (no side effects) -TargetBotCore.Geometry = { +TargetCore.Geometry = { manhattan = function(p1, p2) return abs(p1.x - p2.x) + abs(p1.y - p2.y) end, chebyshev = function(p1, p2) return max(abs(p1.x - p2.x), abs(p1.y - p2.y)) end, euclidean = function(p1, p2) return sqrt((p1.x - p2.x)^2 + (p1.y - p2.y)^2) end, diff --git a/docs/TARGETBOT.md b/docs/TARGETBOT.md index 6d7c8ca..71b8f1d 100644 --- a/docs/TARGETBOT.md +++ b/docs/TARGETBOT.md @@ -172,7 +172,7 @@ Moves to tiles with better tactical advantage using multi-factor scoring. - Dynamic thresholds based on monster count - SpellOptimizer integration for AoE considerations - LRU creature config cache (50 entries max) -- Pure function scoring via TargetBotCore +- Pure function scoring via TargetCore - More reactive when surrounded, conservative when safe --- diff --git a/targetbot/creature_attack.lua b/targetbot/creature_attack.lua index 89ac50c..c16e8ee 100644 --- a/targetbot/creature_attack.lua +++ b/targetbot/creature_attack.lua @@ -1,6 +1,6 @@ -------------------------------------------------------------------------------- -- TARGETBOT CREATURE ATTACK v1.0 --- Uses TargetBotCore for shared pure functions (DRY, SRP) +-- Uses TargetCore for shared pure functions (DRY, SRP) -- Dynamic scaling based on monster count for better reactivity -------------------------------------------------------------------------------- @@ -44,7 +44,7 @@ local DIR_VECTORS = Geometry.DIR_VECTORS or { -------------------------------------------------------------------------------- -- IMPROVED WAVE AVOIDANCE SYSTEM -- --- Uses TargetBotCore pure functions and improved scoring algorithm. +-- Uses TargetCore pure functions and improved scoring algorithm. -- Key improvements: -- 1. Dynamic scaling based on monster count (more reactive when surrounded) -- 2. Better front arc detection with configurable width @@ -464,11 +464,11 @@ nExBot.analyzePositionDanger = analyzePositionDanger nExBot.findSafeAdjacentTile = findSafeAdjacentTile -------------------------------------------------------------------------------- --- UTILITY FUNCTIONS (Optimized with TargetBotCore integration) +-- UTILITY FUNCTIONS (Optimized with TargetCore integration) -------------------------------------------------------------------------------- -- Pure function: Count walkable tiles around a position --- Uses TargetBotCore.Geometry if available +-- Uses TargetCore.Geometry if available -- @param position: center position -- @return number local function countWalkableTiles(position) diff --git a/targetbot/target.lua b/targetbot/target.lua index 2c553eb..7d0d644 100644 --- a/targetbot/target.lua +++ b/targetbot/target.lua @@ -10,7 +10,7 @@ local looterStatus = "" TargetBot = TargetBot or {} TargetBot.smartPullActive = false -- When true, CaveBot pauses waypoint walking --- Use TargetBotCore if available (DRY principle) +-- Use TargetCore if available (DRY principle) local Core = TargetCore or {} -- Creature type constants for clarity @@ -143,7 +143,7 @@ local function updateCreatureInCache(creature) local pos = player:getPosition() local cpos = creature:getPosition() - -- Use TargetBotCore distance if available, otherwise calculate + -- Use TargetCore distance if available, otherwise calculate local dist if Core.Geometry and Core.Geometry.chebyshevDistance then dist = Core.Geometry.chebyshevDistance(pos, cpos)