Xian55 / WowClassicGrindBot

Highly configurable and responsive World of Warcraft Classic pixel Grind Bot - No DLL injection or memory tampering, just screen capture and input simulation.
177 stars 121 forks source link

Not stopping to use bandage will move during channeling #565

Closed adamssullivan closed 1 month ago

adamssullivan commented 8 months ago

Description

Using after the bot will still just start running directly after using "AfterCastWaitCastbar": true, "AfterCastDelay": 3000, "AfterCastWaitGCD": true, "HasCastBar": true,

Addon Version

1.7.50

World of Warcraft Client

Season of Mastery

Reproduction Steps

"Adhoc": { "Sequence": [ { "Name": "Bandage", "Key": "F1", "AfterCastWaitCastbar": true, "AfterCastDelay": 3000, "AfterCastWaitGCD": true, "HasCastBar": true, "Requirement": "Health% < 30" } ] },

Bot will just start moving directly after casting bandage

Last Good Version

No response

Screenshots

No response

Logs

[21:33:51:008 I] [GoapAgent ] New Plan= Adhoc [21:33:51:404 I] [Bandage ] ... casting: True | count:1 | usable: True->True | SPELL_FAILED_NOT_READY->CAST_SUCCESS [21:33:51:434 I] [BagChangeTracker] 12 -> 11 Linen Bandage [21:33:51:558 I] [Bandage ] ... casting: True | count:1 | usable: True->True | CAST_SUCCESS->SPELL_FAILED_ITEM_NOT_READY [21:33:51:574 I] [GoapAgent ] New Plan= Follow Route [21:33:51:575 I] [Navigation ] [LocalPathingApi] distance is close 19.145397. Keep RouteToWaypoint. [21:33:51:715 I] [BagChangeTracker] 8 -> 9 Clam Meat [21:33:51:745 I] [NpcNameFinder] type = None | mode = Fuzzy [21:33:51:778 I] [BagChangeTracker] - 1 Small Barnacled Clam [21:33:56:743 I] [FollowRouteGoal] Random jump [21:34:01:443 I] [NpcNameFinder] type = None | mode = Fuzzy

adamssullivan commented 8 months ago

out20240116_002.log

Xian55 commented 8 months ago

Hello there,

Thanks for brining it to my attention. In the past i was really struggling with instant cast items in general like on use trinkets.

I will take a look at it, once the PTR servers are coming back online.

Xian55 commented 8 months ago

Gooday,

Since yesterday the PTR servers come back online. I did some tests regarding Bandages. It seems to be working as intended, the castbar is being detected and in isolated case the castbar is fully awaited. The mentioned problem comes from compounded side effect.

It's probably worth mentioning that currently the CastingHandler, presses the hotkey twice in a row really quickly. This actually was not intended from my part, however it seemed stable enough to keep it as it is. There's one downside, spells like Arcane Missle(instant cast, channelling) is most of the time failed to detect properly.

Channelling spells are more trickery to detect. I did not wanted to add a special case for it like "HasChannelCastbar": true, maybe over time its worth to explore the idea to separate casting from channelling or use different strategy to handle edge cases.

Bandages does not belong to the previously mentioned category, since you cannot interrupt a Bandage cast by casting a new one but rather yields an error message of SPELL_FAILED_ITEM_NOT_READY because of the debuff you receive for X seconds.

In order to avoid this issue, i have to cover the case, when the castbar is active while the getting a notification of SPELL_FAILED_ITEM_NOT_READY and yet the cast is not getting interrupted. Sadly the error event source is not tracked, and currently the backend cannot make a reliable decision about the cast is truly interrupted so it assumes the worst case scenario.

As of now, i do not plan to delve into the CastingHandler component as it is really fragile, not my proudest code. Last time i spent a great deal amount of time to improve the reliability meanwhile breaking perfectly working stuffs.

Over the past years the casting rules have been changed Classic Vanilla -> TBC -> Wotlk as Blizzard keep adding QoL changes from Retail, which makes the code hard to maintain.

Xian55 commented 1 month ago

Hello i've been added some extra consideration regarding channelling spells, i was primarily tested mage abilities.

Such as

I assume bandages works the same.

To ensure that the cast is being fully awaited i can recommend using the "AfterCastWaitCastbar": true flag.

Let me know if the issue comes up again!

Be sure to use #617 addon version!