While loop breaking ESO
I'm slowly working on an addon that includes auto refining and I'm having an issue with the while loop locking up ESO completely. Has anyone seen this type of issue or can someone smarter than me think of a way around the issue? Everything in this code works until I uncomment the (while do end) and I get the expected array count on the testing output.
NOTE-- I added the table remove to find a way around this issue thinking the array wasn't empty. Lua Code:
|
It's not possible to tell what is going wrong with only the piece of code you are showing us. It doesn't even include how you define the RefineList. If you want help, upload the whole addon somewhere so I can take a look. ;)
|
Uploaded to ESOUI downloads/info2488-AllCraft.html I appreciate any eyes and input.
|
Check the code of DoItAll maybe. It builds a slot class which gets the inventory list slot to extract/refine and then adds it to the extraction slot.
There were some problems I had to track down as well like endless loops as slots were not added to a list as they could not be extracted (less than 10 items, or protected by FCOItemSaver e. G.). The list tried to add this item again and again as it stayed inside the normal inventory list for "extraction". So I had to add an "already tried to add to extract" list for it, in order to skip those already tried ones. This fixed the endless loops. |
Baertram is right. You never check if the items are actually refined successfully, so you keep readding the same items again and again without ever exiting your while loop.
|
Are you... I feel like an idiot, all I had to do was add little if then before rerolling?
Lua Code:
That fixes the bomb, now I just need to have a way to tell when refine is complete instead. Thanks for all the assistance |
Refine complete = Use event_craft_started -> check if in refine mode (API functiosn exists somewhere in esoui/ingame/crafting) -> event_craft_complete it's done or event_craft_failed / event_craft_aborted it was not finished correctly
Works for all other craftings as well. Helpfull functions in here: https://github.com/esoui/esoui/blob/...ftingutils.lua There exists the function ZO_SmithingExtractionSlot:IsInRefineMode() ZO_SmithingExtractionSlot should relate to the global variable SMITHING.refinementPanel I'm using it like this within DoItAll: Lua Code:
And for the extraction then: Lua Code:
Lua Code:
And at the end check if only 1 or multiple items are added to the slot and extract them: Lua Code:
I'm registering a callback function at EVENT_CRAFT_STARTED for EVENT_CRAFT_COMPLETE and EVENT_CRAFT_FALIED. If one of them gets called it will be unregistering the 2 callback functions again. Same if next EVENT_CRAFT_STARTED is called. Hope this helps. |
All times are GMT -6. The time now is 02:40 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI