Quantcast
WoWInterface - View Single Post - HookScript mystery??
View Single Post
10-31-20, 04:35 AM   #3
LudiusMaximus
A Frostmaul Preserver
 
LudiusMaximus's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2018
Posts: 283
OK, I think my working example was not the best way to demonstrate it.
Let me put it this way:

Code:
GameTooltip:HookScript("OnTooltipSetItem", function() print(GetTime(), "SetItem") end)
GameTooltip:HookScript("OnTooltipCleared", function() print(GetTime(), "Cleared") end)
leads to:

Code:
1225.517 SetItem
1225.517 Cleared
1225.689 Cleared
1225.689 SetItem
1225.689 Cleared
1225.89 Cleared
1225.89 SetItem
1225.89 Cleared
1226.093 Cleared
1226.093 SetItem
1226.093 Cleared
1226.297 Cleared
1226.297 SetItem
1226.297 Cleared
1226.502 Cleared
1226.502 SetItem
1226.502 Cleared
1226.705 Cleared
1226.705 SetItem
1226.705 Cleared
...

Whereas,

Code:
C_Timer.After(1, function()

  GameTooltip:HookScript("OnTooltipSetItem", function() print(GetTime(), "SetItem") end)
  GameTooltip:HookScript("OnTooltipCleared", function() print(GetTime(), "Cleared") end)

end)
leads to

Code:
1340.647 Cleared
1340.647 SetItem
1340.743 Cleared
1340.743 Cleared
1340.743 SetItem
1340.946 Cleared
1340.946 Cleared
1340.946 SetItem
1341.15 Cleared
1341.15 Cleared
1341.15 SetItem
1341.353 Cleared
1341.353 Cleared
1341.353 SetItem
1341.555 Cleared
1341.555 Cleared
1341.555 SetItem
...
__________________
~ Be the change you want to see in the world... of warcraft interface! ~
  Reply With Quote