Scan a tooltip

This piece of code lets you scan a tooltip.

Snippet

-- make sure it has a name
local f = CreateFrame('GameTooltip', 'MyTooltip', UIParent, 'GameTooltipTemplate')

-- call this every time you want to scan
f:SetOwner(UIParent, 'ANCHOR_NONE')

-- do something with the tooltip, for example set it to a player buff   
f:SetUnitBuff('player', 1)

-- get information from the tooltip, for example the buff description
print(MyTooltipTextLeft2:GetText())

-- finally hide it again
f:Hide()
Posted by Industrial at Sun, 05 Jul 2009 17:58:08 +0000