View Single Post
Unread 01-11-13, 08:33 PM   #6
Bullarky
Zombie
 
Bullarky's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2013
Posts: 2
I think what you are looking for is the following event:

Event.Tooltip
this will trigger every time the tooltip is changed.

Once fired, you will need to use

Inspect.Tooltip
This will get the entire tooltip object. In this object there is a type property that will hold "item" or "itemtype" for you to key off of... others tooltip types are "unit", "buff", and "ability"

Then use the code posted to pass the item...

Example:

Code:
function scrapeTooltip()
	local ttType = ""
	local ttItem = nil
	
	ttType, ttItem = Inspect.Tooltip()
	
	if ttType == "item" then
		TTGetItem(ttItem)
	elseif ttType then
		print(string.format("Type: %s", ttType))
	end
end

function TTGetItem(itm)
	local itemDetail = Inspect.Item.Detail(itm)
	local itemStrength = itemDetail and itemDetail.stats and itemDetail.stats.strength or 0
	if itemStrength then print(string.format("Strength: %s", itemStrength)) end
end

table.insert(Event.Tooltip, {scrapeTooltip, "Tester", "Tester_Init"})

Last edited by Bullarky : 01-11-13 at 08:36 PM.
Bullarky is offline   Reply With Quote