From 7d601dc4e3002d565be3ab62e48f343bb9e5beeb Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 19 Nov 2025 11:38:44 +0000 Subject: [PATCH 1/5] Initial plan From e9ef56da53dc7a66f2e625325e14c501d9fced54 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 19 Nov 2025 11:47:16 +0000 Subject: [PATCH 2/5] Add Codex PvP bot with multibox support and arena detection Co-authored-by: Ewoog <72410352+Ewoog@users.noreply.github.com> --- Bots/Codex_PvP_Bot.py | 328 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 328 insertions(+) create mode 100644 Bots/Codex_PvP_Bot.py diff --git a/Bots/Codex_PvP_Bot.py b/Bots/Codex_PvP_Bot.py new file mode 100644 index 000000000..5d3d9d399 --- /dev/null +++ b/Bots/Codex_PvP_Bot.py @@ -0,0 +1,328 @@ +from Py4GWCoreLib import * +import PyImGui, Py4GW +from typing import Generator, Any + +BOT_NAME = "Codex PvP Bot" + +# Map IDs for Codex Arena +CODEX_ARENA_OUTPOST = 796 + +# Known arena map IDs (these are the actual PvP arena instances) +# Note: These may vary - the bot will detect the actual arena map ID dynamically +KNOWN_ARENA_MAPS = { + # Random Arenas that can be used in Codex + 308: "Ascalon Arena", + 314: "Shiverpeak Arena", + 318: "D'Alessio Arena", + 319: "Amnoon Arena", + 322: "Shiverpeak Arena", + 339: "D'Alessio Arena", + 340: "Amnoon Arena", + 343: "Shiverpeak Arena", + 353: "Petrified Arena", + 354: "Seabed Arena", +} + +# Arena spawn detection - we'll detect team spawn by finding allied players +# Enemy spawn is typically opposite side of the map + +bot = Botting( + BOT_NAME, + upkeep_auto_inventory_management_active=False, + upkeep_auto_combat_active=True, # Enable auto-combat for PvP + upkeep_auto_loot_active=False, +) + +class CodexPvPState: + """Track state of the Codex PvP bot""" + def __init__(self): + self.current_arena_map_id = 0 + self.team_spawn_location = (0.0, 0.0) + self.enemy_spawn_location = (0.0, 0.0) + self.in_arena = False + self.match_count = 0 + +codex_state = CodexPvPState() + + +def detect_arena_and_spawns() -> tuple[int, tuple[float, float], tuple[float, float]]: + """ + Detect which arena we're in and identify team/enemy spawn locations. + Returns: (map_id, team_spawn, enemy_spawn) + """ + map_id = GLOBAL_CACHE.Map.GetMapID() + + # Get player position as initial team spawn reference + player_x, player_y = GLOBAL_CACHE.Player.GetXY() + team_spawn = (player_x, player_y) + + # Find allied players to refine team spawn location + agent_array = GLOBAL_CACHE.AgentArray.GetAgentArray() + ally_positions = [] + enemy_positions = [] + + for agent_id in agent_array: + if not GLOBAL_CACHE.Agent.IsValid(agent_id): + continue + + if not GLOBAL_CACHE.Agent.IsLiving(agent_id): + continue + + _, allegiance = GLOBAL_CACHE.Agent.GetAllegiance(agent_id) + + if allegiance == "Ally": + # This is a teammate + x, y = GLOBAL_CACHE.Agent.GetXY(agent_id) + ally_positions.append((x, y)) + elif allegiance == "Enemy": + # This is an enemy player + x, y = GLOBAL_CACHE.Agent.GetXY(agent_id) + enemy_positions.append((x, y)) + + # Calculate average team spawn from allied positions + if ally_positions: + avg_x = sum(pos[0] for pos in ally_positions) / len(ally_positions) + avg_y = sum(pos[1] for pos in ally_positions) / len(ally_positions) + team_spawn = (avg_x, avg_y) + + # Calculate average enemy spawn if we can see enemies + if enemy_positions: + avg_x = sum(pos[0] for pos in enemy_positions) / len(enemy_positions) + avg_y = sum(pos[1] for pos in enemy_positions) / len(enemy_positions) + enemy_spawn = (avg_x, avg_y) + else: + # If we can't see enemies yet, estimate opposite side of map + # This is a rough estimate - in practice, we'd navigate until we find them + map_bounds = GLOBAL_CACHE.Map.GetMapBoundaries() + if map_bounds != (0.0, 0.0, 0.0, 0.0): + min_x, min_y, max_x, max_y = map_bounds + # Estimate enemy spawn as opposite corner from team spawn + if team_spawn[0] < (min_x + max_x) / 2: + enemy_x = max_x - 500 # Near max boundary + else: + enemy_x = min_x + 500 # Near min boundary + + if team_spawn[1] < (min_y + max_y) / 2: + enemy_y = max_y - 500 + else: + enemy_y = min_y + 500 + enemy_spawn = (enemy_x, enemy_y) + else: + # Fallback if no map boundaries + enemy_spawn = (-team_spawn[0], -team_spawn[1]) + + return map_id, team_spawn, enemy_spawn + + +def wait_for_arena_entry(bot: Botting) -> Generator: + """Wait until we enter an arena (map changes from outpost to explorable PvP)""" + while True: + yield + + if not GLOBAL_CACHE.Map.IsMapReady(): + continue + + current_map_id = GLOBAL_CACHE.Map.GetMapID() + + # Check if we're in an arena (not the outpost) + if current_map_id != CODEX_ARENA_OUTPOST and GLOBAL_CACHE.Map.IsPVP(): + # We're in an arena! + ConsoleLog(BOT_NAME, f"Entered arena: {current_map_id}", Console.MessageType.Info) + break + + Py4GW.Console.Log(BOT_NAME, "Waiting for arena entry...", Console.MessageType.Info) + yield from bot.Wait._coro_for_time(2000) + + +def navigate_to_enemies(bot: Botting, enemy_location: tuple[float, float]) -> Generator: + """Navigate toward enemy spawn location""" + target_x, target_y = enemy_location + + # Use auto-pathing if available, otherwise move directly + try: + yield from bot.Move._coro_get_path_to(target_x, target_y) + yield from bot.Move._coro_follow_path_to() + except: + # Fallback to direct movement + ConsoleLog(BOT_NAME, f"Moving directly to enemies at ({target_x}, {target_y})", Console.MessageType.Info) + yield from bot.Move._coro_xy(target_x, target_y, "Move to enemy spawn") + + +def engage_combat(bot: Botting) -> Generator: + """Engage in combat with enemies - use auto-combat system""" + ConsoleLog(BOT_NAME, "Engaging in combat", Console.MessageType.Info) + + # Combat loop - continue until we win or lose + while True: + yield + + # Check if we're back in outpost (lost/won) + current_map_id = GLOBAL_CACHE.Map.GetMapID() + if current_map_id == CODEX_ARENA_OUTPOST: + ConsoleLog(BOT_NAME, "Match ended - back in outpost", Console.MessageType.Info) + break + + # Check if we're dead + player_id = GLOBAL_CACHE.Player.GetAgentID() + if GLOBAL_CACHE.Agent.IsDead(player_id): + ConsoleLog(BOT_NAME, "Player is dead, waiting for respawn or match end", Console.MessageType.Warning) + yield from bot.Wait._coro_for_time(5000) + continue + + # The auto-combat system will handle targeting and skill usage + # Just need to ensure we're in combat range + + # Find nearest enemy + enemy_id = Routines.Targeting.GetEnemyAttacking(max_distance=Range.Compass.value) + if enemy_id and enemy_id > 0: + # Move toward enemy if too far + enemy_x, enemy_y = GLOBAL_CACHE.Agent.GetXY(enemy_id) + player_x, player_y = GLOBAL_CACHE.Player.GetXY() + + distance = ((enemy_x - player_x)**2 + (enemy_y - player_y)**2)**0.5 + + if distance > Range.Compass.value: + # Too far, move closer + yield from bot.Move._coro_xy(enemy_x, enemy_y, "Approach enemy") + + yield from bot.Wait._coro_for_time(500) + + +def handle_loss_or_victory(bot: Botting) -> Generator: + """Handle returning to outpost after match""" + ConsoleLog(BOT_NAME, "Waiting for return to outpost", Console.MessageType.Info) + + # Wait for map to stabilize + while GLOBAL_CACHE.Map.IsMapLoading(): + yield + + yield from bot.Wait._coro_for_time(2000) + + # Verify we're in outpost + current_map_id = GLOBAL_CACHE.Map.GetMapID() + if current_map_id == CODEX_ARENA_OUTPOST: + codex_state.match_count += 1 + ConsoleLog(BOT_NAME, f"Match {codex_state.match_count} completed. Ready for next match.", Console.MessageType.Success) + else: + ConsoleLog(BOT_NAME, f"Unexpected map after match: {current_map_id}", Console.MessageType.Error) + + +def codex_pvp_match_routine(bot: Botting) -> Generator: + """Main routine for a single Codex PvP match""" + + # Step 1: Wait for arena entry + ConsoleLog(BOT_NAME, "Waiting to enter arena...", Console.MessageType.Info) + yield from wait_for_arena_entry(bot) + + # Step 2: Detect arena and spawn locations + ConsoleLog(BOT_NAME, "Detecting arena and spawn locations...", Console.MessageType.Info) + yield from bot.Wait._coro_for_time(2000) # Wait for map to fully load + + map_id, team_spawn, enemy_spawn = detect_arena_and_spawns() + codex_state.current_arena_map_id = map_id + codex_state.team_spawn_location = team_spawn + codex_state.enemy_spawn_location = enemy_spawn + codex_state.in_arena = True + + arena_name = KNOWN_ARENA_MAPS.get(map_id, f"Unknown Arena {map_id}") + ConsoleLog(BOT_NAME, f"Arena: {arena_name}", Console.MessageType.Info) + ConsoleLog(BOT_NAME, f"Team spawn: {team_spawn}", Console.MessageType.Info) + ConsoleLog(BOT_NAME, f"Enemy spawn: {enemy_spawn}", Console.MessageType.Info) + + # Step 3: Navigate to enemy location + ConsoleLog(BOT_NAME, "Moving toward enemy team...", Console.MessageType.Info) + yield from navigate_to_enemies(bot, enemy_spawn) + + # Step 4: Engage in combat + yield from engage_combat(bot) + + # Step 5: Handle post-match (loss or victory) + codex_state.in_arena = False + yield from handle_loss_or_victory(bot) + + +def multibox_coordination(bot: Botting) -> Generator: + """Coordinate multiple accounts for team play""" + + # Invite all accounts to party if we're the leader + # This assumes accounts are configured in the multibox system + try: + bot.Multibox.InviteAllAccounts() + yield from bot.Wait._coro_for_time(3000) + + ConsoleLog(BOT_NAME, "Multibox accounts invited to party", Console.MessageType.Success) + except Exception as e: + ConsoleLog(BOT_NAME, f"Multibox coordination note: {e}", Console.MessageType.Warning) + + yield + + +def create_bot_routine(bot: Botting) -> None: + """Main bot routine - runs continuously""" + bot.States.AddHeader(f"{BOT_NAME}") + + # Initial setup + bot.States.AddCustomState(lambda: multibox_coordination(bot), "Multibox Setup") + + # Ensure we're in Codex Arena outpost + def check_location(): + current_map = GLOBAL_CACHE.Map.GetMapID() + if current_map != CODEX_ARENA_OUTPOST: + ConsoleLog(BOT_NAME, f"Not in Codex Arena outpost. Please travel there first (Map ID: {CODEX_ARENA_OUTPOST})", Console.MessageType.Error) + # Could add auto-travel here if needed + yield from bot.Wait._coro_for_time(5000) + yield + + bot.States.AddCustomState(lambda: check_location(), "Verify Location") + + # Main match loop - run matches continuously + # Each iteration is one complete match + def match_loop(): + while True: + yield from codex_pvp_match_routine(bot) + # Brief pause between matches + yield from bot.Wait._coro_for_time(3000) + + bot.States.AddCustomState(lambda: match_loop(), "Codex PvP Match Loop") + + +# Set up the bot +bot.SetMainRoutine(create_bot_routine) + + +def configure(): + """Configuration UI""" + global bot + bot.UI.draw_configure_window() + + +def main(): + """Main update function called every frame""" + bot.Update() + + # Draw custom UI + if PyImGui.begin(f"{BOT_NAME} - Status"): + PyImGui.text(f"Matches Played: {codex_state.match_count}") + PyImGui.text(f"In Arena: {'Yes' if codex_state.in_arena else 'No'}") + + if codex_state.in_arena: + PyImGui.text(f"Arena Map ID: {codex_state.current_arena_map_id}") + arena_name = KNOWN_ARENA_MAPS.get(codex_state.current_arena_map_id, "Unknown") + PyImGui.text(f"Arena Name: {arena_name}") + PyImGui.text(f"Team Spawn: ({codex_state.team_spawn_location[0]:.1f}, {codex_state.team_spawn_location[1]:.1f})") + PyImGui.text(f"Enemy Spawn: ({codex_state.enemy_spawn_location[0]:.1f}, {codex_state.enemy_spawn_location[1]:.1f})") + + PyImGui.separator() + PyImGui.text("Instructions:") + PyImGui.text("1. Be in Codex Arena outpost (Map ID 796)") + PyImGui.text("2. Have 4 accounts in party via multibox") + PyImGui.text("3. Enter the arena queue") + PyImGui.text("4. Bot will detect arena and navigate to enemies") + + PyImGui.end() + + bot.UI.draw_window() + + +if __name__ == "__main__": + main() From 3fe7d839dbe0a7b26d2d4d60448c8751cf0f4c97 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 19 Nov 2025 11:48:18 +0000 Subject: [PATCH 3/5] Add comprehensive documentation for Codex PvP bot Co-authored-by: Ewoog <72410352+Ewoog@users.noreply.github.com> --- Bots/Codex_PvP_Bot_README.md | 174 +++++++++++++++++++++++++++++++++++ 1 file changed, 174 insertions(+) create mode 100644 Bots/Codex_PvP_Bot_README.md diff --git a/Bots/Codex_PvP_Bot_README.md b/Bots/Codex_PvP_Bot_README.md new file mode 100644 index 000000000..ba3a1f008 --- /dev/null +++ b/Bots/Codex_PvP_Bot_README.md @@ -0,0 +1,174 @@ +# Codex PvP Bot + +A bot for playing Codex Arena PvP mode in Guild Wars with 4-account multibox support. + +## Features + +- **Arena Detection**: Automatically detects which random arena you're in +- **Team Spawn Detection**: Identifies your team's spawn location by analyzing allied player positions +- **Enemy Location Detection**: Finds enemy spawn by detecting enemy positions or estimating from map boundaries +- **Auto Navigation**: Uses pathfinding to navigate to the enemy team +- **Auto Combat**: Engages in PvP combat using the built-in combat system +- **Loss/Victory Handling**: Automatically handles returning to the Codex Arena outpost after matches +- **Multibox Support**: Coordinates up to 4 accounts in a party for team PvP + +## Requirements + +1. Guild Wars client with Py4GW installed +2. 4 Guild Wars accounts (for full multibox functionality) +3. Characters that can enter Codex Arena (PvP characters or PvE characters with unlocked skills) + +## Setup + +1. Navigate to Codex Arena outpost (Map ID 796) with all 4 accounts +2. Use multibox to party all accounts together +3. Run the `Codex_PvP_Bot.py` script on all accounts +4. Enter the Codex Arena queue + +## How It Works + +### Match Flow + +1. **Wait for Arena Entry**: Bot waits for the party to enter an arena instance +2. **Arena Detection**: Once in an arena, the bot: + - Detects the current arena map ID + - Identifies team spawn location from allied player positions + - Locates enemy spawn (from enemy positions or estimates from map bounds) +3. **Navigation**: Bot navigates toward the enemy spawn location +4. **Combat**: Engages enemies using the auto-combat system +5. **Match End**: Returns to Codex Arena outpost after victory or defeat + +### Arena Detection + +The bot recognizes these Codex arenas: + +- Ascalon Arena (308) +- Shiverpeak Arena (314, 322, 343) +- D'Alessio Arena (318, 339) +- Amnoon Arena (319, 340) +- Petrified Arena (353) +- Seabed Arena (354) + +If an unrecognized arena is encountered, the bot will still function but display "Unknown Arena [Map ID]". + +### Spawn Detection + +**Team Spawn**: Calculated as the average position of all allied players + +**Enemy Spawn**: +- If enemies are visible: average position of enemy players +- If enemies not yet visible: estimated as opposite corner from team spawn based on map boundaries + +## Usage + +### Running the Bot + +Load the script in Py4GW: + +```python +from Bots.Codex_PvP_Bot import main, configure + +# Call main() in your update loop +# Call configure() for configuration UI +``` + +Or run directly: +```bash +python Bots/Codex_PvP_Bot.py +``` + +### UI Information + +The bot displays a status window showing: +- Number of matches played +- Whether currently in an arena +- Current arena map ID and name +- Team and enemy spawn coordinates + +### Multibox Coordination + +The bot includes multibox coordination: +```python +bot.Multibox.InviteAllAccounts() # Invites all configured accounts to party +``` + +Make sure your accounts are configured in the Py4GW multibox system. + +## Configuration + +The bot uses the standard Botting class configuration with: + +- **Auto Combat**: Enabled (for PvP engagement) +- **Auto Loot**: Disabled (not needed in PvP) +- **Auto Inventory Management**: Disabled (not needed in PvP) + +You can customize these settings in the bot configuration UI. + +## Troubleshooting + +### Bot doesn't move toward enemies +- Ensure the arena map has valid pathing data +- Check that enemy spawn detection is working (visible in status UI) +- Verify auto-pathing is enabled in configuration + +### Bot doesn't enter combat +- Ensure auto-combat is enabled in configuration +- Check that your skillbar is loaded with appropriate PvP skills +- Verify the bot can find enemies (check targeting system) + +### Multibox not working +- Ensure all accounts are configured in Py4GW multibox settings +- Verify all accounts are in the same district/region +- Check that party invites are being sent/accepted + +### Bot stuck after match +- The bot should automatically return to outpost after a match +- If stuck, manually return to Codex Arena outpost (Map ID 796) +- Check console logs for error messages + +## Technical Details + +### Code Structure + +- `CodexPvPState`: Tracks current match state (arena, spawns, match count) +- `detect_arena_and_spawns()`: Analyzes map and agents to determine locations +- `wait_for_arena_entry()`: Waits for map transition to arena +- `navigate_to_enemies()`: Pathfinding to enemy location +- `engage_combat()`: Combat loop until match ends +- `handle_loss_or_victory()`: Post-match cleanup +- `codex_pvp_match_routine()`: Main match flow orchestrator + +### Dependencies + +- `Py4GWCoreLib`: Core library with Botting class +- `PyImGui`: UI rendering +- `Py4GW`: Game interaction APIs +- `GLOBAL_CACHE`: Access to game state (Map, Agent, Player) +- `Routines`: Movement, targeting, and combat routines + +## Known Limitations + +1. **Skill Usage**: The bot relies on the auto-combat system for skill usage. You need to configure appropriate PvP builds. +2. **Strategy**: The bot uses a simple "rush enemy spawn" strategy. More complex tactics would require additional logic. +3. **Terrain**: Some arenas may have terrain obstacles that affect pathfinding. +4. **Party Coordination**: While multibox support exists, coordinated team tactics are limited to basic grouping. + +## Future Improvements + +Potential enhancements: + +- Build templates for different professions +- More sophisticated combat strategies +- Terrain and obstacle avoidance +- Party role assignment (tank, healer, damage) +- Skill cooldown optimization +- Target prioritization +- Resurrection handling + +## License + +This bot is part of the Py4GW project. See the main repository for license information. + +## Credits + +Created using the Py4GW framework by the Py4GW community. From 67010c5ecbf665843ea4fbbbc04672515e095957 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 19 Nov 2025 11:49:27 +0000 Subject: [PATCH 4/5] Improve documentation in detect_arena_and_spawns function --- Bots/Codex_PvP_Bot.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Bots/Codex_PvP_Bot.py b/Bots/Codex_PvP_Bot.py index 5d3d9d399..fdcac90b3 100644 --- a/Bots/Codex_PvP_Bot.py +++ b/Bots/Codex_PvP_Bot.py @@ -48,6 +48,12 @@ def __init__(self): def detect_arena_and_spawns() -> tuple[int, tuple[float, float], tuple[float, float]]: """ Detect which arena we're in and identify team/enemy spawn locations. + + Analyzes the current map and agent positions to determine: + - Arena map ID + - Team spawn location (average of allied player positions) + - Enemy spawn location (from enemy positions or estimated from map bounds) + Returns: (map_id, team_spawn, enemy_spawn) """ map_id = GLOBAL_CACHE.Map.GetMapID() From 455f10745778798204eb9b5084ab831b51dfbe39 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 19 Nov 2025 14:39:29 +0000 Subject: [PATCH 5/5] Simplify combat logic to use HeroAI instead of manual targeting Co-authored-by: Ewoog <72410352+Ewoog@users.noreply.github.com> --- Bots/Codex_PvP_Bot.py | 29 +++++++---------------------- Bots/Codex_PvP_Bot_README.md | 36 +++++++++++++++++++----------------- 2 files changed, 26 insertions(+), 39 deletions(-) diff --git a/Bots/Codex_PvP_Bot.py b/Bots/Codex_PvP_Bot.py index fdcac90b3..5d0bdf441 100644 --- a/Bots/Codex_PvP_Bot.py +++ b/Bots/Codex_PvP_Bot.py @@ -29,7 +29,7 @@ bot = Botting( BOT_NAME, upkeep_auto_inventory_management_active=False, - upkeep_auto_combat_active=True, # Enable auto-combat for PvP + upkeep_hero_ai_active=True, # Enable HeroAI for targeting upkeep_auto_loot_active=False, ) @@ -155,10 +155,10 @@ def navigate_to_enemies(bot: Botting, enemy_location: tuple[float, float]) -> Ge def engage_combat(bot: Botting) -> Generator: - """Engage in combat with enemies - use auto-combat system""" - ConsoleLog(BOT_NAME, "Engaging in combat", Console.MessageType.Info) + """Wait in combat area - HeroAI handles targeting and combat""" + ConsoleLog(BOT_NAME, "In combat area - HeroAI active", Console.MessageType.Info) - # Combat loop - continue until we win or lose + # Simple wait loop - HeroAI and multibox will handle targeting and combat while True: yield @@ -175,23 +175,8 @@ def engage_combat(bot: Botting) -> Generator: yield from bot.Wait._coro_for_time(5000) continue - # The auto-combat system will handle targeting and skill usage - # Just need to ensure we're in combat range - - # Find nearest enemy - enemy_id = Routines.Targeting.GetEnemyAttacking(max_distance=Range.Compass.value) - if enemy_id and enemy_id > 0: - # Move toward enemy if too far - enemy_x, enemy_y = GLOBAL_CACHE.Agent.GetXY(enemy_id) - player_x, player_y = GLOBAL_CACHE.Player.GetXY() - - distance = ((enemy_x - player_x)**2 + (enemy_y - player_y)**2)**0.5 - - if distance > Range.Compass.value: - # Too far, move closer - yield from bot.Move._coro_xy(enemy_x, enemy_y, "Approach enemy") - - yield from bot.Wait._coro_for_time(500) + # Just wait - HeroAI handles all targeting and combat + yield from bot.Wait._coro_for_time(1000) def handle_loss_or_victory(bot: Botting) -> Generator: @@ -239,7 +224,7 @@ def codex_pvp_match_routine(bot: Botting) -> Generator: ConsoleLog(BOT_NAME, "Moving toward enemy team...", Console.MessageType.Info) yield from navigate_to_enemies(bot, enemy_spawn) - # Step 4: Engage in combat + # Step 4: Stay in combat area - HeroAI handles targeting and combat yield from engage_combat(bot) # Step 5: Handle post-match (loss or victory) diff --git a/Bots/Codex_PvP_Bot_README.md b/Bots/Codex_PvP_Bot_README.md index ba3a1f008..f4f55f387 100644 --- a/Bots/Codex_PvP_Bot_README.md +++ b/Bots/Codex_PvP_Bot_README.md @@ -8,7 +8,7 @@ A bot for playing Codex Arena PvP mode in Guild Wars with 4-account multibox sup - **Team Spawn Detection**: Identifies your team's spawn location by analyzing allied player positions - **Enemy Location Detection**: Finds enemy spawn by detecting enemy positions or estimating from map boundaries - **Auto Navigation**: Uses pathfinding to navigate to the enemy team -- **Auto Combat**: Engages in PvP combat using the built-in combat system +- **HeroAI Combat**: Uses HeroAI for automatic targeting and combat against enemy players - **Loss/Victory Handling**: Automatically handles returning to the Codex Arena outpost after matches - **Multibox Support**: Coordinates up to 4 accounts in a party for team PvP @@ -35,7 +35,7 @@ A bot for playing Codex Arena PvP mode in Guild Wars with 4-account multibox sup - Identifies team spawn location from allied player positions - Locates enemy spawn (from enemy positions or estimates from map bounds) 3. **Navigation**: Bot navigates toward the enemy spawn location -4. **Combat**: Engages enemies using the auto-combat system +4. **Combat**: HeroAI handles targeting and combat against enemy players 5. **Match End**: Returns to Codex Arena outpost after victory or defeat ### Arena Detection @@ -98,7 +98,7 @@ Make sure your accounts are configured in the Py4GW multibox system. The bot uses the standard Botting class configuration with: -- **Auto Combat**: Enabled (for PvP engagement) +- **HeroAI**: Enabled (for targeting enemy players and henchmen) - **Auto Loot**: Disabled (not needed in PvP) - **Auto Inventory Management**: Disabled (not needed in PvP) @@ -111,10 +111,10 @@ You can customize these settings in the bot configuration UI. - Check that enemy spawn detection is working (visible in status UI) - Verify auto-pathing is enabled in configuration -### Bot doesn't enter combat -- Ensure auto-combat is enabled in configuration -- Check that your skillbar is loaded with appropriate PvP skills -- Verify the bot can find enemies (check targeting system) +### Bot doesn't engage enemies +- Ensure HeroAI is enabled in configuration +- Verify skillbar is loaded with appropriate PvP skills +- Check that HeroAI can detect enemy players (enabled for PvP) ### Multibox not working - Ensure all accounts are configured in Py4GW multibox settings @@ -134,24 +134,26 @@ You can customize these settings in the bot configuration UI. - `detect_arena_and_spawns()`: Analyzes map and agents to determine locations - `wait_for_arena_entry()`: Waits for map transition to arena - `navigate_to_enemies()`: Pathfinding to enemy location -- `engage_combat()`: Combat loop until match ends +- `engage_combat()`: Waits in combat area while HeroAI handles targeting - `handle_loss_or_victory()`: Post-match cleanup - `codex_pvp_match_routine()`: Main match flow orchestrator ### Dependencies -- `Py4GWCoreLib`: Core library with Botting class -- `PyImGui`: UI rendering -- `Py4GW`: Game interaction APIs -- `GLOBAL_CACHE`: Access to game state (Map, Agent, Player) -- `Routines`: Movement, targeting, and combat routines +- Py4GWCoreLib (Botting, GLOBAL_CACHE, Routines, Range, Console) +- PyImGui (UI rendering) +- Py4GW (game interaction) +- Standard library (typing for type hints) + +### Combat System + +The bot uses HeroAI for combat, which now supports targeting enemy players and hostile henchmen in PvP. The bot simply navigates to the enemy spawn area and lets HeroAI handle all targeting and skill usage through the multibox helper system. ## Known Limitations -1. **Skill Usage**: The bot relies on the auto-combat system for skill usage. You need to configure appropriate PvP builds. -2. **Strategy**: The bot uses a simple "rush enemy spawn" strategy. More complex tactics would require additional logic. -3. **Terrain**: Some arenas may have terrain obstacles that affect pathfinding. -4. **Party Coordination**: While multibox support exists, coordinated team tactics are limited to basic grouping. +1. **Navigation**: Auto-pathing may have issues in some PvP arenas with complex terrain. +2. **HeroAI Configuration**: Ensure HeroAI is properly configured for PvP combat in your settings. +3. **Party Coordination**: While multibox support exists, coordinated team tactics are handled by HeroAI. ## Future Improvements