Quantcast
Check if itemString or itemLink - WoWInterface
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
12-30-17, 05:29 PM   #1
Marsgames
An Aku'mai Servant
 
Marsgames's Avatar
Join Date: Jul 2016
Posts: 33
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:
  1. GetInventoryItemLink("player", GetInventorySlotInfo("HeadSlot"))
to get all my equipped items, but because of the item is not always cached, sometimes I get something like this : "[Tome de la raison déclinante]" that is an itemLink, but sometimes I only get "[]". At first I thought it was nothing but after some research, I found that it was an itemString, and if I try to parse it with
Lua Code:
  1. local aze = GetInventoryItemLink("player",GetInventorySlotInfo("Trinket0Slot"))
  2. local itemString = select(3, strfind(aze, "|H(.+)|h"))
  3. print(itemString)
It returns "item:147019::::::::110:265::3:3:3561:1492:3528:::[]"

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.
  Reply With Quote
 

WoWInterface » Developer Discussions » General Authoring Discussion » Check if itemString or itemLink

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off