Addon: [1.9.16] - Fix combat lockdown, queue init, and array requirement support#796
Merged
Addon: [1.9.16] - Fix combat lockdown, queue init, and array requirement support#796
Conversation
- GoapAgent: Exclude targets in ToPull list from targettargetsus check to prevent premature combat goal switching during pull phase - PullTargetGoal: Add melee range guard to stop-attack logic and use stopMoving.Stop() with wait.Until() for more reliable pre-pull stops - StuckDetector: Refactor to escalating unstuck strategy (jump → nudge → aggressive turn+move), use IsMoving property backed by AddonBits, reduce MIN_RANGE_DIFF to 1f, add LoggerMessage source generation - CursorScan: Simplify cursor matching with Array.Contains() - ConfigurableInput: Remove unused methods Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When a player logs in and immediately enters combat (e.g., logged out in
a hostile area), AutoSetupBindingsIfNeeded() previously returned silently
due to InCombatLockdown() with no retry mechanism. This left essential
keybindings (targeting, interaction, pet control) never configured,
requiring a manual /reload to fix.
Now uses BindPad's existing WaitForEvent("PLAYER_REGEN_ENABLED", ...)
to automatically retry binding setup once combat ends. Prints a chat
message so the user knows bindings were deferred.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When /dcflush is triggered during bot operation, the C# side calls FullReset() which clears all reader data. Previously, the GOAP agent continued running immediately with empty readers, causing Spell: requirements to fail silently — the bot would never attempt abilities like Charge until a second flush or /reload. Root cause: the C# side had no reliable way to know when queue-based readers (SpellBook, KeyBindings, ActionBarTextures) were fully repopulated after a reset. Solution: Each queue now embeds an expected item count as the first item in the data stream using a count marker (QUEUE_COUNT_MARKER = 16,777,000). The C# readers extract this count and track received items. IsInitialized is true only when receivedCount >= expectedCount. AddonReader now withholds DataReady.Set() after FullReset until all three queue-based readers report IsInitialized, naturally pausing the GOAP agent until data is fully repopulated. Lua changes: - DataToColor.lua: Add QUEUE_COUNT_MARKER constant, push count header in InitSpellBookQueue() - SetupDefaultBindings.lua: Push count header in InitBindingQueue() - ActionBarTextures.lua: Push count header in InitActionBarTextureQueue() C# changes: - AddonTicks.cs: Add QUEUE_COUNT_MARKER constant - SpellBookReader/KeyBindingsReader/ActionBarTextureReader: Detect count headers, track expectedCount/receivedCount, expose public properties - AddonReader: Gate DataReady on reader initialization after FullReset, add logging for pause/resume timing Frontend changes: - BotHeader.razor: Display reader initialization progress with color-coded status (gray=waiting, orange=loading, green=complete), add Textures column Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…arrays Previously, Spell:, BagItem:, and npcID: requirements could only resolve IntVariables to a single int value. For non-aura array variables (e.g. multiple healthstone item IDs), only the first element was used. Now these requirements check the intArrayVariables dictionary first. When the variable maps to an array with multiple values: - Spell:VARIABLE — returns true if ANY spell ID in the array is known in the spellbook (useful for spell rank ranges) - BagItem:VARIABLE:COUNT — sums item counts across ALL IDs in the array (useful for items with multiple ranks like Healthstones) - npcID:VARIABLE — returns true if target matches ANY NPC ID in the array (useful for NPC variant groups) Add Warlock_32.json example config demonstrating Item_Healthstone_All array variable with 15 healthstone item IDs across all ranks. Update README.md to document array support for all three requirements. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… count headers Lua changes in this release: - AutoSetupBindingsIfNeeded defers to PLAYER_REGEN_ENABLED when in combat - InitSpellBookQueue/InitBindingQueue/InitActionBarTextureQueue now push QUEUE_COUNT_MARKER + expectedCount as the first queue item for reliable C# reader initialization tracking Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR addresses two bugs discovered during testing and adds a new feature to the requirement DSL.
Bug Fixes
1. Keybinding setup silently fails when login enters combat
AutoSetupBindingsIfNeeded()silently returned due toInCombatLockdown()with no retry/reloadWaitForEvent("PLAYER_REGEN_ENABLED", ...)to automatically retry once combat ends2. Bot uses abilities with empty readers after /dcflush
/dcflushis triggered during bot operation,FullReset()clears all reader data (spell book, bindings, textures). The GOAP agent continued running immediately with empty readersSpell:SPELL_CHARGErequirements returned false becauseSpellBookReaderwas empty — the bot never attempted ChargeQUEUE_COUNT_MARKER = 16,777,000). C# readers extract this count and track received items.AddonReaderwithholdsDataReady.Set()until all three queue readers reportreceivedCount >= expectedCount, naturally pausing the GOAP agentFeature: IntVariable Array Support for Requirements
Expanded
Spell:,BagItem:, andnpcID:requirements to support IntVariable arrays (matching the existing aura array pattern):Spell:VARIABLEwith array[100, 6178, 11578]→ true if ANY spell ID is knownBagItem:VARIABLE:COUNTwith array[5512, 5511, 5509]→ sums item counts across all IDsnpcID:VARIABLEwith array[6195, 6196]→ true if target matches ANY NPC IDExample (Warlock healthstones):
Other Improvements
stopMoving.Stop()withwait.Until()for reliable pre-pull stopsLoggerMessagesource generationToPulltargets fromtargettargetsuscheckArray.Contains()TimeSpanformat string crashSpell:,BagItem:, andnpcID:requirementsTest plan
BagItem:Item_Healthstone_Alldetects any healthstone variant/dcflush(no second flush needed)🤖 Generated with Claude Code