I get this error message , C_TradeSkillUI (a nil value), when I issue this call:
> local skillLineIDs = C_TradeSkillUI.GetAllProfessionTradeSkillLines()
I’ve also tried to use GetProfessions(), but it fails with a similar message,
> attempt to call GetProfessions() a nil value
So, I’m trying to find the functions necessary to get 3 items of the player’s skill information:
Profession name (e.g., Alchemy)
current skill level
max skill level in that bracket (e.g., 75, 150, 225, etc.)
Any help would be greatly appreciated.
Cheers
========== EDIT ===========
I forgot to mention that I’m using the WotLK Classic client.
this is cutdown from the functions and data that i have/use for getting profession data across the different clients.
edit: made it simpler
local function ClassicGetProfessions( ... )
local good = false
local skills = { }
local skillnum = 0
local header1 = string.lower( TRADE_SKILLS )
local header2 = string.lower( SECONDARY_SKILLS )
for k = 1, GetNumSkillLines( ) do
local name, header = GetSkillLineInfo( k )
if header ~= nil then
name = string.lower( name )
if string.match( header1, name ) or string.match( header2, name ) then
good = true
if string.match( header2, name ) and skillnum < 2 then
skillnum = 2
end
else
good = false
end
else
if good then
skillnum = skillnum + 1
skills[skillnum] = k
end
end
end
return skills[1], skills[2], skills[3], skills[4], skills[5]
end
for _, v in ipairs( { ClassicGetProfessions( ) } ) do
if v then
local name, texture, rank, maxRank, numSpells, spelloffset, skillLine, rankModifier = GetSkillLineInfo( v )
print(name)
print(rank)
print(maxRank)
end
end
Thanks. I’ll give this a try.