Check if itemString or itemLink
Hey, I would like to know if there’s a way to check if I have an itemLink or an itemString.
I’m using Lua Code:
Lua Code:
So, as I want to have an itemLink, is there a way to check if it returns an itemLink or an itemString, like that I can wait for ITEM_INFO_RECEIVED to add the itemLink in my table. |
What is the main goal you're trying to accomplish?
I would use GetInventoryItemID to get the ID of the item and then pass it through GetItemInfo to get the itemLink or itemString. |
I'm trying to have a table of itemLinks of all items that are equipped. My addon check if an item looted is better than an item equipped, but because of items are not cached, when I do GetInventoryItemLink it adds an itemString into my table, and when I do a GetItemInfo on this item to compare the looted one with the equipped one, I got a an error "Usage: GetItemInfo(itemID | "name" | "itemlink")"
|
I would recommend downloading Personal Loot Helper and see how it retrieves the information it uses to determine upgrades for you and/or party/raid members.
|
I will try this. Thank you for your help
|
Quote:
|
Quote:
|
Hey,
I have a new question. Is it possible to convert an itemString into an itemLink without using GetItemInfo() to avoid the possible nil due to item not in cache |
Quote:
Just store item ID of an item that isn't cached in some table, then compare it to an item ID that comes w/ "GET_ITEM_INFO_RECEIVED", then re-request item's info and save it. And, IMHO, it's better to use item strings for storing item's info in SVs. Lua Code:
-- edit #1 Something like this Lua Code:
equippedItems is a table where indices are slot IDs, I organised them in a way that resembles their placement on char info panel. |
All times are GMT -6. The time now is 04:33 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI