Quantcast
Convert ItemID's to Item Details - WoWInterface
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
07-09-19, 02:58 AM   #1
Walkerbo
A Wyrmkin Dreamwalker
 
Walkerbo's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2010
Posts: 51
Convert ItemID's to Item Details

Hi all

I am building a small addon that converts an itemID into an extended itemDetails table.
I have a function that loops through a list of itemID's and gets the full item details which I then insert as a table into another table.

When I check the results in the saved variables file I get a list with only the hearthstone details, all the other entries display only the itemID.

My convert function, (links to my full code are at the bottom of this post)
Lua Code:
  1. -- convert function
  2. local function convertList()
  3. print('convert start')
  4. for k, v inpairs(AAA_FROM_LIST)do
  5. local itemName,
  6. itemLink,
  7. itemRarity,
  8. itemLevel,
  9. itemMinLevel,
  10. itemType,
  11. itemSubType,
  12. itemStackCount,
  13. itemEquipLoc,
  14. iconFileDataID,
  15. itemSellPrice,
  16. itemClassID,
  17. itemSubClassID,
  18. bindType,
  19. expacID,
  20. itemSetID,
  21. isCraftingReagent = GetItemInfo(v)
  22.  
  23. tempItemList = {
  24. itemID = v,
  25. itemName = itemName,
  26. itemLink = itemLink,
  27. itemRarity = itemRarity,
  28. itemLevel = itemLevel,
  29. itemMinLevel = itemMinLevel,
  30. itemType = itemType,
  31. itemSubType = itemSubType,
  32. itemStackCount = itemStackCount,
  33. itemEquipLoc = itemEquipLoc,
  34. iconFileDataID = iconFileDataID,
  35. itemSellPrice = itemSellPrice,
  36. itemClassID = itemClassID,
  37. itemSubClassID = itemSubClassID,
  38. bindType = bindType,
  39. expacID = expacID,
  40. itemSetID = itemSetID,
  41. isCraftingReagent = isCraftingReagent
  42. }
  43. table.insert(AAA_CONVERTED_LIST,1, tempItemList)
  44. end
  45. print('convert end')
  46. end
My results
Lua Code:
  1. AAA_CONVERTED_LIST = {
  2.     {
  3.         ["itemID"] = 52025,
  4.     }, -- [1]
  5.     {
  6.         ["itemID"] = 50717,
  7.     }, -- [2]
  8.     {
  9.         ["itemID"] = 50606,
  10.     }, -- [3]
  11.     {
  12.         ["itemID"] = 50688,
  13.     }, -- [4]
  14.     {
  15.         ["itemID"] = 50639,
  16.     }, -- [5]
  17.     {
  18.         ["itemID"] = 50687,
  19.     }, -- [6]
  20.     {
  21.         ["itemID"] = 50703,
  22.     }, -- [7]
  23.     {
  24.         ["itemID"] = 50650,
  25.     }, -- [8]
  26.     {
  27.         ["itemID"] = 52028,
  28.     }, -- [9]
  29.     {
  30.         ["itemID"] = 52029,
  31.     }, -- [10]
  32.     {
  33.         ["itemID"] = 52026,
  34.     }, -- [11]
  35.     {
  36.         ["itemID"] = 50685,
  37.     }, -- [12]
  38.     {
  39.         ["itemID"] = 50730,
  40.     }, -- [13]
  41.     {
  42.         ["itemID"] = 147561,
  43.     }, -- [14]
  44.     {
  45.         ["itemID"] = 114131,
  46.     }, -- [15]
  47.     {
  48.         ["itemID"] = 114081,
  49.     }, -- [16]
  50.     {
  51.         ["itemID"] = 119229,
  52.     }, -- [17]
  53.     {
  54.         ["itemID"] = 119226,
  55.     }, -- [18]
  56.     {
  57.         ["itemID"] = 139802,
  58.     }, -- [19]
  59.     {
  60.         ["itemID"] = 32240,
  61.     }, -- [20]
  62.     {
  63.         ["itemID"] = 32258,
  64.     }, -- [21]
  65.     {
  66.         ["itemID"] = 32254,
  67.     }, -- [22]
  68.     {
  69.         ["itemID"] = 805,
  70.     }, -- [23]
  71.     {
  72.         ["itemID"] = 9763,
  73.     }, -- [24]
  74.     {
  75.         ["itemID"] = 4496,
  76.     }, -- [25]
  77.     {
  78.         ["itemID"] = 109119,
  79.     }, -- [26]
  80.     {
  81.         ["itemID"] = 109253,
  82.     }, -- [27]
  83.     {
  84.         ["itemID"] = 128650,
  85.     }, -- [28]
  86.     {
  87.         ["itemName"] = "Hearthstone",
  88.         ["iconFileDataID"] = 134414,
  89.         ["bindType"] = 1,
  90.         ["itemSellPrice"] = 0,
  91.         ["itemLink"] = "|cffffffff|Hitem:6948::::::::19:265::::::|h[Hearthstone]|h|r",
  92.         ["itemClassID"] = 15,
  93.         ["itemLevel"] = 1,
  94.         ["itemStackCount"] = 1,
  95.         ["isCraftingReagent"] = false,
  96.         ["expacID"] = 0,
  97.         ["itemRarity"] = 1,
  98.         ["itemMinLevel"] = 0,
  99.         ["itemID"] = 6948,
  100.         ["itemSubClassID"] = 0,
  101.         ["itemEquipLoc"] = "",
  102.         ["itemSubType"] = "Junk",
  103.         ["itemType"] = "Miscellaneous",
  104.     }, -- [29]
  105.     {
  106.         ["itemID"] = 15017,
  107.     }, -- [30]
  108.     {
  109.         ["itemID"] = 6268,
  110.     }, -- [31]
  111.     {
  112.         ["itemID"] = 90555,
  113.     }, -- [32]
  114.     {
  115.         ["itemID"] = 109118,
  116.     }, -- [33]
  117.     {
  118.         ["itemID"] = 828,
  119.     }, -- [34]
  120.     {
  121.         ["itemID"] = 2657,
  122.     }, -- [35]
  123. }
Here is my lua
Here is my toc
Here is my saved variables results

Any help solving this would be great.
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » Convert ItemID's to Item Details

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