Thread Tools Display Modes
09-07-24, 06:20 PM   #1
Codger
An Aku'mai Servant
AddOn Author - Click to view addons
Join Date: Mar 2021
Posts: 35
Arrow Profession Equuipment API

I want to create a list of profession equipment on my alts but I'm having trouble figuring out which api to even start with. I looked in Professions and Equipment but nothing something seems obvious? Can anyboy point me to the lua api that I can use to query my alts?
  Reply With Quote
09-07-24, 11:54 PM   #2
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 6,006
This page will have the slot IDs you need
https://warcraft.wiki.gg/wiki/InventorySlotID


And this is my code that cycles through the regular inventory slots. You should be able to use this as a start to what you need with some minor changes.
Lua Code:
  1. local inventoryTable = {}    
  2.  
  3.     for i = 0,19,1 do
  4.         inventoryTable[i+1] = {}
  5.         inventoryTable[i+1].index = i
  6.        
  7.         local itemID = GetInventoryItemID("player",i)
  8.         local itemLink = GetInventoryItemLink("player", i)
  9.         local itemIcon = GetInventoryItemTexture("player",i)    
  10.         local itemName = itemID and C_Item.GetItemNameByID(itemID) or nil
  11.  
  12.         if itemID then        
  13.             inventoryTable[i+1].id = itemID        
  14.             inventoryTable[i+1].name = itemName
  15.             inventoryTable[i+1].iconID = itemIcon
  16.             inventoryTable[i+1].invSlot = i
  17.         end
  18.     end

And this event might be useful
https://warcraft.wiki.gg/wiki/UNIT_INVENTORY_CHANGED
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 70 - Resto Druid
Gamaliel - 70 - Disc Priest
Lienae - 70 - Resto Shaman
Velandryn - 70 - Prot Paladin (TR)
+ 5 at 60+
+ 2 at 40+

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818
  Reply With Quote
09-10-24, 10:08 PM   #3
Codger
An Aku'mai Servant
AddOn Author - Click to view addons
Join Date: Mar 2021
Posts: 35
Helps quite a bit but not quite working

Thank you so much for the reply and I apologize for my late reply.
Your reply was very helpful and I'm much closer to solving this mystery than before.
Unfortunately, the additional gear inventory slots don't seem to return an itemId for the profession inventory slots. I'm still looking into it and suppose it could be something I did wrong. I'll get back to this thread in a little bit.
  Reply With Quote
09-11-24, 12:38 AM   #4
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,356
This worked fine for me.
Lua Code:
  1. for i=20,30 do print(i,GetInventoryItemID("player",i)); end

These events also fire when profession equipment changes:
PLAYER_EQUIPMENT_CHANGED
PROFESSION_EQUIPMENT_CHANGED
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote
09-11-24, 07:57 AM   #5
Codger
An Aku'mai Servant
AddOn Author - Click to view addons
Join Date: Mar 2021
Posts: 35
Typo

Thanks for the help Phantom.
As it turns out slotID is a different variable than slotId.
Who knew? 8-)
  Reply With Quote
09-13-24, 12:21 PM   #6
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 6,006
I also stumbled on this while working on a Nomi Cooking addon which might be skill wear slot IDs.

https://warcraft.wiki.gg/wiki/API_C_...rofessionSlots

Or even this ..
https://warcraft.wiki.gg/wiki/API_C_...InventorySlots
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 70 - Resto Druid
Gamaliel - 70 - Disc Priest
Lienae - 70 - Resto Shaman
Velandryn - 70 - Prot Paladin (TR)
+ 5 at 60+
+ 2 at 40+

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Profession Equuipment API


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