ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   Lua/XML Help (https://www.esoui.com/forums/forumdisplay.php?f=175)
-   -   Itemlink crashes (https://www.esoui.com/forums/showthread.php?t=6512)

dorrino 09/11/16 04:45 PM

Itemlink crashes
 
EDIT: i'm at the lack of words. The game didn't crash because of invalid itemlinks. The game crashed because for some reason the 100000 values in the "for" loop were too many. When i split the loop in 5 separate loops for 20000 iterations each and introduced a delay of 50ms between the loops it stopped crashing.

Looks like now my question is what is happening and what's the best way to prevent it from happening?


-----------------------------------------------------------------------------------------------------------------------------------
Hi there.

I have a problem.

I'm trying to get a table of itemlinks of all the set items in the game:)

So i'm using a for loop going from 0 to 99999 and using this value as an itemId.

Lua Code:
  1. for itemId = 0, 99999 do
  2.        local link = "|H1:item:" .. itemId .. ":4:66:0:0:0:0:0:0:0:0:0:0:0:0:0:1:0:10000:0|h|h"
  3.        local hasSet, setName, numBonuses, numEquipped, maxEquipped = GetItemLinkSetInfo(link)
  4.        if hasSet then
  5.              --do somthing
  6.        end
  7. end


My problem is that for some values of itemId the game crashes on GetItemLinkSetInfo(link). Since it's REALLY hard to even find those itemId's when you need to restart the game each time, i'm asking for an advice.

I understand that it should be the game bug and, probabely if i knew the exact itemId that trigger it i could've just excluded them, but it's a pain to do it.

Is there any way to check the validity of the itemlink before using GetItemLinkSetInfo()? GetItemLinkName() does NOT crash for any itemId and i tried to use it to check if the name for the item link existed, but even after this check the client still kept crashing.

Any advice would be greatly appreciated.

Thank you.

calia1120 09/11/16 06:18 PM

UESP has a lot of this data already - http://esoitem.uesp.net/viewlog.php - you may be able to get a lot of it from there.

Hope that helps.

dorrino 09/11/16 06:28 PM

Quote:

Originally Posted by calia1120 (Post 28328)
UESP has a lot of this data already - http://esoitem.uesp.net/viewlog.php - you may be able to get a lot of it from there.

Hope that helps.

Thanks. I'm using uesp.net constantly. Best site it is there with api related stuff for eso.

My goal is much more complicated than just to know what sets are there.

I need to have itemlinks for each single set in the game.

Solved that problem though.

Rhyono 11/21/16 04:07 PM

I've been having this same problem, except it isn't consistent at all. Sometimes it can handle it all without a problem and the next time I load the game, it fails in one second. I only have very light addons (MM aside), but I recently reduced my MM data immensely so even MM+what I'm doing should not be such a big deal (and as stated, it works sometimes). What method of delay did you use?


All times are GMT -6. The time now is 05:29 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI