so I have this function:
but I'm unsure how to go about stripping the spell ID + power name from the return, for example I just want to be able toCode:local CostTip = CreateFrame('GameTooltip') local CostText = CostTip:CreateFontString() CostTip:AddFontStrings(CostTip:CreateFontString(), CostTip:CreateFontString()) CostTip:AddFontStrings(CostText, CostTip:CreateFontString()) -- the next function is what will be called to find the cost of a spell function GetPowerCost(spellId) -- returns the value of the second line of the tooltip -- bail if we don't have a spellId if spellId == nil then return nil else CostTip:SetOwner(WorldFrame, 'ANCHOR_NONE') CostTip:SetSpellByID(spellId) print(spellId .. ' = ' .. CostText:GetText()) return CostText:GetText() end end
/dump GetPowerCost(53209)
and get a return of:
35
right now I get:
"35 Focus"
thank you for any help