Basically I only want to know whether a tradeskill (Imperial Silk, Sha Crystal for example) is ready for a player.
What I tried so far is
local start, duration, enable = [URL="http://wowprogramming.com/docs/api/GetSpellCooldown"]GetSpellCooldown[/URL]([URL="http://www.wowhead.com/spell=125557"]125557[/URL])
-- returns 0,0,1 if I have the spell and it is not on cooldown
-- returns 2091844.252, 19966.7, 1 if I have the spell and it is on cooldown
-- returns also 0,0,1 if the player does not have the skill
So the Problem seems to be the players without the skill.
-- Imperial Silk (Tailoring)
[URL="http://wowprogramming.com/docs/api/IsSpellKnown"]IsSpellKnown[/URL]([URL="http://www.wowhead.com/spell=125557"]125557[/URL]) -- false on my tailor
[URL="http://wowprogramming.com/docs/api/IsPlayerSpell"]IsPlayerSpell[/URL]([URL="http://www.wowhead.com/spell=125557"]125557[/URL]) -- true on my tailor
-- Sha Crystal (Enchanting)
[URL="http://wowprogramming.com/docs/api/IsSpellKnown"]IsSpellKnown[/URL]([URL="http://www.wowhead.com/spell=116499"]116499[/URL]) -- false on my non-enchanter
[URL="http://wowprogramming.com/docs/api/IsPlayerSpell"]IsPlayerSpell[/URL]([URL="http://www.wowhead.com/spell=116499"]116499[/URL]) -- false on my non-enchanter
What I have seen so far seems pretty complicated.
(http://www.wowace.com/addons/broker-tradecooldowns/) for example.
Basically I only want to know whether a tradeskill (Imperial Silk, Sha Crystal for example) is ready for a player.
What I tried so far is
So the Problem seems to be the players without the skill.
Any good ideas?
tl;dr: IsSpellKnown does not work for tradeskills, IsPlayerSpell does
Thank you very much Phanx.