View Single Post
05-20-16, 06:10 PM   #1
Rainrider
A Firelord
AddOn Author - Click to view addons
Join Date: Nov 2008
Posts: 454
Getting artifact perks data

I would like to get info about which artifact perks are currently active. So far I have the following code:

lua Code:
  1. local powers = C_ArtifactUI.GetPowers()
  2.  
  3. for i = 1, #powers do
  4.     local spellID, _, currentRank = C_ArtifactUI.GetPowerInfo(powers[i])
  5.  
  6.     if currentRank > 0 then
  7.         local name = GetSpellInfo(spellID)
  8.         -- do stuff
  9.     end
  10. end

However this only works when the ArtifactUI is open and I can't figure out how to open it programmatically. Would appreciate some help on that.