View Single Post
06-13-17, 01:47 AM   #2
lightspark
A Rage Talon Dragon Guard
 
lightspark's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2012
Posts: 341
Originally Posted by loff93 View Post
I guess I have to do something like
name, link, quality, iLevel, reqLevel, class, subclass, maxStack, equipSlot, texture, vendorPrice = GetItemInfo(itemID) or GetItemInfo("itemName") or GetItemInfo("itemLink")

To actually store what I need.
You guessed it right.

GetItemInfo returns raw values, they aren't packed, it's not a table. So obv there's no itemTexture member of name, name is just a string.

-- edit #1

Lua Code:
  1. local function normal_loop()
  2.     -- guess numMaterials and craftingMaterials are defined elsewhere :p
  3.     for index = 1, numMaterials do
  4.         local itemID = craftingMaterials[index]
  5.         local name, _, _, _, _, _, _, _, _, texture = GetItemInfo(itemID)
  6.         if name then
  7.             print(texture)
  8.         else
  9.             -- you don't write anything to wait[itemID] table
  10.             -- simple true should be enough
  11.             wait[itemID] = true
  12.         end
  13.     end
  14. end
__________________

Last edited by lightspark : 06-13-17 at 01:58 AM.
  Reply With Quote