1. I'm trying to get the names of the professions that the player has. Here's my code:

    prof1, prof2, archaeology, fishing, cooking, firstAid = GetProfessions("player");
    name, icon, skillLevel, maxSkillLevel, numAbilities, spelloffset, skillLine, skillModifier = GetProfessionInfo(prof1)
    print(name)
    name, icon, skillLevel, maxSkillLevel, numAbilities, spelloffset, skillLine, skillModifier = GetProfessionInfo(prof2)
    print(name)
    

    The result is an error:

    Message: 
    `Interface\AddOns\PimpMyToon\PimpMyToon.lua:2: Usage: GetProfessionSkillLine(index)
    Time: 09/13/11 14:08:11
    Count: 1
    Stack: [C]: in function `GetProfessionInfo
    Locals: (*temporary) = nil'
    

    HOWEVER, if I type /reload ui then the addon works. Here's a sample output from my character that has tailoring/enchanting:

    Enchanting
    Tailoring
    

    Additionaly, if I log out and back in on the same character, I get the same Lua error message as mentioned above. What is causing this? Why do I have to type /reload ui before it works?

    Thanks for the help!

  2. That information is not available immediately when the addon is being loaded. You should wait for an event that occurs that is relevant to the profession information being loaded. This is why it works on a reload but not when the cache is cold.

  3. Open/close a profession window perhaps? Is there a function that does this?

  4. That's unnecessary. Glancing at the spellbook frame, you can use the SKILL_LINES_CHANGED event.