Scanning
EnumerateFrames() can be very taxing on the system considering the default UI alone creates hundreds of frames. Trying to "hack" your way to get access to a local frame is customized to that specific frame. One way I can think of that would be much easier on the system is to use
GetFramesRegisteredForEvent("CANCEL_LOOT_ROLL") and cross-check the taint record of any existing index.
Lua Code:
local function GetTeksRollFrame()
local list={GetFramesRegisteredForEvent("CANCEL_LOOT_ROLL")};
for i,j in ipairs(list) do
if j.button and select(2,issecurevariable(j,"button"))=="teksLoot" then
return j;
end
end
end
Hacking these frames isn't always going to be easy and it takes a lot of understanding with the environment they exist in. Not only the function creating a frame, but every function that takes the frame in as an argument is a possible point of entry to capture it. Scanning methods like the ones posted here are a last resort if you can't find a viable point of entry to get direct access.