GetItemInfo hanging?
I'm looping through a SavedVariable storing loot history. Printing line by line with a link to the item within the line. However, when create a SavedVariable with a 100 item history, when I load the game it will do one of them and then error out saying that the variable is nil, expecting value. But it's only once. So basically every time I reload the UI, it'll add one more item successfully to the list until I have the entire list printed out. Then it will no longer error out. Almost as if GetItemInfo is not able to keep up with the loop.
Lua Code:
error received: Interface\AddOns\DKP\ConfigMenuTabs.lua:546: attempt to concatenate local 'itemToLink' (a nil value) Just seems really strange that once all items have been loaded, it's fine until the game is restarted. Is there a way to delay the loop on each iteration? |
https://wow.gamepedia.com/API_GetItemInfo#Details
Quote:
To get some information about an item immediately, you can use GetItemInfoInstant Lua Code:
Quote:
|
My goal was to minimize the footprint of the SavedVariable file. But if storing the string is the best method I'll go ahead and do that. Thank you
|
Word of advice for add-on files, either SavedVariables or the add-on itself: Do not worry about how much space or memory you use. There is no difference between storing 100 item IDs and storing 100 item strings. In fact, it's a waste of CPU having to look up those item IDs. Always consider CPU, space/memory is never an issue. Better to save data than look it up.
|
All times are GMT -6. The time now is 10:38 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI