Athavar / Athavar.FFXIV.Plugin

GNU Affero General Public License v3.0
11 stars 3 forks source link

CraftQueue attempting to use potion while having already started a craft #20

Closed GingerbreadJ closed 9 months ago

GingerbreadJ commented 1 year ago

Hi - first off, I want to say how much of a godsend this utility is when crafting, especially for collectibles.

One problem I've run into (I don't know if it's new since the patch): My Cunning Craftsman's Draught ran out after finishing a craft, and the queuer attempted to apply a new potion after it had started the next craft, which both stalled the crafting queue and resulted in that particular craft failing. Would it be possible to check the order of operations?

Also, a request: would it be possible for us to set a threshold at which the queuer will auto-repair gear? I noticed some of my crafts failed and/or weren't HQ even though the sim said they would be, and I suspect it was due to gear breaking in the middle of a craft.

Thank you for your time!

Athavar commented 1 year ago

Gear will only break after finishing a craft. Non-HQ can also happen because of a bad timing of excellent/poor-condition. The simulation is only testing the craft in a linear way and don't contains condition. And skills that have a probability of success have in the simulation a 100% success chance.

For each craft different steps are processed before the crafting begins:

One thing that is not included in all simulation tests are crafting effecting FC-buffs .

GingerbreadJ commented 1 year ago

Thank you for the reply!

Upon checking, what actually seems to be happening (at least with my current round of crafting) is that it is failing to use the potion Cunning Craftsman's Draught HQ. It runs fine if I manually drink it beforehand, but for some reason if CraftQueue tries to apply the potion, it gives me the error '[Athavar's Toolbox]Fail to use potion. Is perhaps on CD.' despite both having the potion and it not being on cooldown.

(I still have no idea why it started a craft and then tried to apply the potion that one time, but Code Is Weird and there was probably a once-off bug or lag delay or something.)

The items that turned out NQ rather than HQ were Grade 5 Vitality Alkahests, and I wasn't using any food or potions for those. While I'd not think it unusual if just a few batches turned out NQ, all 60 of the crafts turned out NQ when both the simulator and Teamcraft expected them to turn out HQ with the selected macro, which is just... odd. Could 100% be user error and I selected the wrong macro after looking at the right one and switching between crafts though.

Athavar commented 1 year ago

The error '[Athavar's Toolbox]Fail to use potion. Is perhaps on CD.' only occurs if the plugin fails to use the potion (source, souce2). It could be a timing problem that the character was in the animation of exiting the crafting mode while try to use the potion. Or before this food was applied and because of server latency this action was delayed. The only solution I can think of would be to increase the wait duration between these actions in CraftQueue. But it's not guaranteed that this is the root cause.

Athavar commented 1 year ago

After a few tests and releases, I have removed the check if an item was successfully used. It will now work like a retry and a job should only go to the next step after applying the buffs.

GingerbreadJ commented 1 year ago

Thank you so much, it is executing correctly now.

EDIT: Ok, never mind. It does it correctly before I start crafting, but if it attempts to drink it while pausing between crafts, it once again runs into what I think is an animation lock problem, as it again is starting the next craft while simultaneously attempting to drink the potion. The window to the new craft opens, but luckily none of the actions go off, so I can quit out without losing any materials. At that point, it will drink the potion, and open the craft window again and continue crafting as normal.

Maybe a slightly larger delay between executing the drink potion action and opening the crafting window?

colgeee commented 10 months ago

I have the same issue. Initial potion is correctly applied, it would fail to apply potion if it runs out before the craft job has finished and attempted to drink another potion. The craft job would be paused at this point. Seemed a bit inconsistent though. Sometimes it would work fine. Perhaps an even longer delay?

colgeee commented 10 months ago

I think the problem is failing to exit crafting.

Athavar commented 10 months ago

Do you mean with "failing to exit crafting" that the craft is not finished?

I could not reproduce the issue. For my test I have used:

If this happens again, can you please take screenshots from it.

colgeee commented 10 months ago

I can get it to fail quite easily. It fails once about every 2nd or 3rd potion. What I've observed is after finishing the current craft, instead of standing up and drinking potion, it immediately goes to craft the next craft. So my assumption was there needs some more delay to make sure standing up is executed.

However, there seem to be some checks in place to not craft without the assigned potion so it stays crafting without using any action. I was able to temporarily mitigate the issue by just quitting the stalled craft (items gets refunded since no action was performed) and it'll drink potion and continue crafting.

and yes, i can provide a screenshot if you need it.

Athavar commented 10 months ago

Ok, in the method WaitSynthesis the queue will re-check, if all stats are correct for the craft and will force a rerun of all previous steps. I need to add closing of the Synthesis Addon, because the previous steps only containing checks for closing of "RecipeNote". https://github.com/Athavar/Athavar.FFXIV.Plugin/blob/6b5d83322813e3f9efde0879c10afcad7c0f6d15/src/Athavar.FFXIV.Plugin.CraftQueue/CraftingJob.cs#L457-L473

Athavar commented 10 months ago

v2.0.29 is released.

colgeee commented 10 months ago

You’re the best. I’ll give it a try.

On Mon, Aug 28, 2023 at 2:21 PM Athavar @.***> wrote:

v2.0.29 is released.

— Reply to this email directly, view it on GitHub https://github.com/Athavar/Athavar.FFXIV.Plugin/issues/20#issuecomment-1696430108, or unsubscribe https://github.com/notifications/unsubscribe-auth/AVCQW73SJK3SECKXZUQSVBLXXUDXPANCNFSM6AAAAAAYSACMRI . You are receiving this because you commented.Message ID: <Athavar/Athavar. @.***>