Quantcast Export eventtrace content? - WoWInterface
Thread Tools Display Modes
12-22-18, 12:12 PM   #1
LudiusMaximus
An Aku'mai Servant
 
LudiusMaximus's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2018
Posts: 38
Export eventtrace content?

Is there an addon (or any other way) to export the content of the /eventtrace window or to copy it to the clipboard?

I want to compare the order of events of different situations, which I could only reasonably do with an external text editor.
  Reply With Quote
12-22-18, 12:43 PM   #2
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 982
I don't know an elegent way to do it so something like:

Lua Code:
  1. local tracing, hooked
  2. local function DoTrace()
  3.     if tracing then
  4.         print(EventTraceFrameButton1.event:GetText())
  5.     end
  6. end
  7. SLASH_MYTRACE1 = "/tt"
  8. SlashCmdList["MYTRACE"] = function(msg)
  9.     if not EventTraceFrame then print("ETRACE NOT OPEN") return end
  10.     if not hooked then
  11.         EventTraceFrame:HookScript("OnEvent", DoTrace)
  12.         hooked = true
  13.     end
  14.     tracing = not tracing
  15. end

Replace the print with a SavedVariable store or save to an EditBox. The slash command lets you stop/start the collection.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 12-22-18 at 12:48 PM.
  Reply With Quote
12-22-18, 01:07 PM   #3
LudiusMaximus
An Aku'mai Servant
 
LudiusMaximus's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2018
Posts: 38
Thanks a lot for the quick reply!

Your suggested code definitely does something. But something's not right.

Any time an event is triggered, your code prints the *previous* event. When there are several events at the same time (like while mounting/dismounting), your code prints the previous event once for each of these events...

Furthermore, it would also be important for me to get that timing information printed in the eventtrace window.

Any further ideas how to achieve this?

Thanks again!
  Reply With Quote
12-22-18, 01:20 PM   #4
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 982
Code:
/run for i=1, #EventTraceFrame.events do print(i, EventTraceFrame.events[i]) end
I don't know how long the table can get and if you haven't guessed, I'm making this up as I go along .
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote
12-22-18, 01:30 PM   #5
LudiusMaximus
An Aku'mai Servant
 
LudiusMaximus's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2018
Posts: 38
Thanks, this works great.

But this leads into my next question regading your previous post:

How do I get this into an EditBox as you suggested?

Or how does you other suggestion involving a "SavedVariable" work?
  Reply With Quote
12-22-18, 01:50 PM   #6
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 982
Use /tt or /xyz to open the editbox again if you close it. Press R to refresh the list. Use CTRL-A/CTRL-C to select/copy.
Lua Code:
  1. local TFrame
  2. SLASH_MYTRACE1 = "/tt"
  3. SLASH_MYTRACE2 = "/xyz"
  4. SlashCmdList["MYTRACE"] = function(msg)
  5.     if not EventTraceFrame then print("ETRACE NOT OPEN") return end
  6.     if not TFrame then
  7.         TFrame = CreateFrame("Button", "FizzleEventList", UIParent)
  8.         TFrame:SetBackdrop({bgFile = "Interface/Tooltips/UI-Tooltip-Background", edgeFile="Interface/Tooltips/UI-Tooltip-Border", tile = true, tileSize = 8, insets = {left = 8, right = 8, top = 8, bottom = 8},})
  9.         TFrame:SetBackdropColor(0, 0, 0)
  10.         TFrame:SetPoint("RIGHT", -12)
  11.         TFrame:SetSize(400, 400)
  12.         TFrame.SF = CreateFrame("ScrollFrame", "$parent_SF", TFrame, "UIPanelScrollFrameTemplate")
  13.         TFrame.SF:SetPoint("TOPLEFT", TFrame, 12, -30)
  14.         TFrame.SF:SetPoint("BOTTOMRIGHT", TFrame, -30, 10)
  15.         TFrame.Text = CreateFrame("EditBox", nil, TFrame)
  16.         TFrame.Text:SetMultiLine(true)
  17.         TFrame.Text:SetSize(180, 170)
  18.         TFrame.Text:SetPoint("TOPLEFT", TFrame.SF)
  19.         TFrame.Text:SetPoint("BOTTOMRIGHT", TFrame.SF)
  20.         TFrame.Text:SetMaxLetters(99999)
  21.         TFrame.Text:SetFontObject(GameFontNormal)
  22.         TFrame.Text:SetAutoFocus(false)
  23.         TFrame.Text:SetScript("OnEscapePressed", function(self)self:ClearFocus() end)
  24.         TFrame.SF:SetScrollChild(TFrame.Text)
  25.         TFrame.Close = CreateFrame("Button", nil, TFrame, "UIPanelButtonTemplate")
  26.         TFrame.Close:SetSize(24, 24)
  27.         TFrame.Close:SetPoint("TOPRIGHT", -8, -8)
  28.         TFrame.Close:SetText("X")
  29.         TFrame.Close:SetScript("OnClick", function(self) self:GetParent():Hide() end)
  30.         TFrame.Refresh = CreateFrame("Button", nil, TFrame, "UIPanelButtonTemplate")
  31.         TFrame.Refresh:SetSize(24, 24)
  32.         TFrame.Refresh:SetPoint("RIGHT", TFrame.Close, "LEFT", -1)
  33.         TFrame.Refresh:SetText("R")
  34.         TFrame.Refresh:SetScript("OnClick", function(self)
  35.             local t = self:GetParent().Text
  36.             local text = ""
  37.             for i=1, #EventTraceFrame.events do
  38.                 text = text.."\n"..EventTraceFrame.events[i]
  39.             end
  40.             t:SetText("")
  41.             t:SetText(text)
  42.             t:ClearFocus()
  43.         end)
  44.         TFrame:RegisterForClicks("LeftButtonDown", "LeftButtonUp", "RightButtonUp")
  45.         TFrame:RegisterForDrag("LeftButton")
  46.         TFrame:SetMovable(true)
  47.         TFrame:SetScript("OnDragStart", function(self) self:StartMoving() end)
  48.         TFrame:SetScript("OnDragStop", function(self) self:StopMovingOrSizing() ValidateFramePosition(self) end)
  49.     else
  50.         TFrame:SetShown(not TFrame:IsShown())
  51.     end
  52. end
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 12-23-18 at 01:35 AM.
  Reply With Quote
12-22-18, 01:57 PM   #7
LudiusMaximus
An Aku'mai Servant
 
LudiusMaximus's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2018
Posts: 38
Ingenious!!

You should consider turning this into a developer add-on of its own. :-D

Thanks a lot again!
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Search/Requests » Export eventtrace content?

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off