Pretty much yes. I want it to tally all attacks, crits, non crits and display the current % value of crits done. I know it can be done in scrut, but like you said, doing it all by hand it tedious and time consuming. I would rather not have to do it that way. Besides I think being able to see a real time value for crit % might be useful.So what im understanding is you want an addon that catches every hit you do while ur online (or until you reset it), counts total number, counts non crit, and counts crit, then displays what % were crits, and what % of the total were non crits?
Technically scrut can do that you just have to do the math by hand, you want an addon that does the math for you. I dont belive one like that exists, atleast not on curse.
If you want to go the scrut route, you do (total number of crit hits)/(total number of hits) * 100. You have to add it all up by hand though which is annoying.
Pretty much yes. I want it to tally all attacks, crits, non crits and display the current % value of crits done. I know it can be done in scrut, but like you said, doing it all by hand it tedious and time consuming. I would rather not have to do it that way. Besides I think being able to see a real time value for crit % might be useful.So what im understanding is you want an addon that catches every hit you do while ur online (or until you reset it), counts total number, counts non crit, and counts crit, then displays what % were crits, and what % of the total were non crits?
Technically scrut can do that you just have to do the math by hand, you want an addon that does the math for you. I dont belive one like that exists, atleast not on curse.
If you want to go the scrut route, you do (total number of crit hits)/(total number of hits) * 100. You have to add it all up by hand though which is annoying.
I wouldn't think it would be that hard to write, I lack programming skills or I would attempt it. I would assume it's just a matter of monitoring your combat log, logging crit vs non crit and simple math after that from the total attacks.
Pretty much yes. I want it to tally all attacks, crits, non crits and display the current % value of crits done. I know it can be done in scrut, but like you said, doing it all by hand it tedious and time consuming. I would rather not have to do it that way. Besides I think being able to see a real time value for crit % might be useful.So what im understanding is you want an addon that catches every hit you do while ur online (or until you reset it), counts total number, counts non crit, and counts crit, then displays what % were crits, and what % of the total were non crits?
Technically scrut can do that you just have to do the math by hand, you want an addon that does the math for you. I dont belive one like that exists, atleast not on curse.
If you want to go the scrut route, you do (total number of crit hits)/(total number of hits) * 100. You have to add it all up by hand though which is annoying.
I wouldn't think it would be that hard to write, I lack programming skills or I would attempt it. I would assume it's just a matter of monitoring your combat log, logging crit vs non crit and simple math after that from the total attacks.
Its doable. Ill give it a shot.
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
local playerName
local hitCount, critCount = 0, 0
local someLabel = CreateUIComponent("Label", "CritCounter_Label", "UIParent") -- create the ui label
someLabel:SetScripts("OnEvent", [[ this.UpdateCritRate(_source, _type) ]]) -- set event handler
someLabel:SetFont("Fonts/DFHEIMDU.TTF", 14, "NORMAL", "NORMAL") -- set font
someLabel:SetJustifyHType("CENTER") -- horizontal alignment
someLabel:SetText("Crit: -,--%") -- initial text
someLabel:ClearAllAnchors() -- clear anchors
someLabel:SetAnchor("TOP", "TOP", 0, 150) -- set anchor
someLabel:SetSize(250, 16) -- set size
someLabel:SetLayers(3, UIParent) -- set as layer of UIParent
someLabel:RegisterEvent("COMBATMETER_DAMAGE") -- register event
someLabel:RegisterEvent("COMBATMETER_HEAL") -- register event
function someLabel.UpdateCritRate(source, hitType)
playerName = playerName or UnitName("player)
if source == playerName then
if hitType == "CRITIAL" then -- eventhough there is a typo is is the correct value
critCount = critCount + 1
end
hitCount = hitCount + 1
someLabel:SetText(string.format("Crit: %.2d%%", (critCount * 100)/(hitCount or 0)))
end
end
|
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
local playerName
local hitCount, critCount = 0, 0
local someFrame = CreateUIComponent("Frame", "CritCounter_Frame", "UIParent") -- create the ui frame
someFrame:SetScripts("OnEvent", [[ this.UpdateCritRate(_source, _type) ]]) -- set event handler
someFrame:RegisterEvent("COMBATMETER_DAMAGE") -- register event
someFrame:RegisterEvent("COMBATMETER_HEAL") -- register event
local someLabel = CreateUIComponent("FontString", "CritCounter_Label", "UIParent") -- create the ui label
someLabel:ClearAllAnchors() -- clear anchors
someLabel:SetAnchor("TOP", "TOP", "UIParent", 0, 150) -- set anchor: anchor point, relative point, relative to, x offset, y offset
someLabel:SetSize(250, 16) -- set size
UIParent:SetLayers(1, someLabel) -- set as layer of UIParent
someLabel:SetFont("Fonts/DFHEIMDU.TTF", 14, "NORMAL", "NORMAL") -- set font
someLabel:SetJustifyHType("CENTER") -- horizontal alignment
someLabel:SetText("Crit: -,--%") -- initial text
someLabel:Show()
function someFrame.UpdateCritRate(source, hitType)
playerName = playerName or UnitName("player")
if source == playerName then
if hitType == "CRITIAL" then -- eventhough there is a typo is is the correct value
critCount = critCount + 1
end
hitCount = hitCount + 1
someLabel:SetText(string.format("Crit: %03.2f%%", (critCount * 100)/(hitCount or 0)))
end
end
|
THANK YOU! Exactly what I was looking for!You would just need to put the code into a .lua file, create a matching .toc for that. (the content is the .lua file's name) A minimal gui is already created in the lua code, eventhough there is no configuration.
Todays maintenance fixed my login issues. I was able to test the code and fixed some minor stuff about the frames. To move the frame you would need to edit the lua file at line 12, where i wrote in a comment "set anchor ...". That also gives a quick description what the parameters do.
That's the fixed variant:
![]()
Source code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31local playerName local hitCount, critCount = 0, 0 local someFrame = CreateUIComponent("Frame", "CritCounter_Frame", "UIParent") -- create the ui frame someFrame:SetScripts("OnEvent", [[ this.UpdateCritRate(_source, _type) ]]) -- set event handler someFrame:RegisterEvent("COMBATMETER_DAMAGE") -- register event someFrame:RegisterEvent("COMBATMETER_HEAL") -- register event local someLabel = CreateUIComponent("FontString", "CritCounter_Label", "UIParent") -- create the ui label someLabel:ClearAllAnchors() -- clear anchors someLabel:SetAnchor("TOP", "TOP", "UIParent", 0, 150) -- set anchor: anchor point, relative point, relative to, x offset, y offset someLabel:SetSize(250, 16) -- set size UIParent:SetLayers(1, someLabel) -- set as layer of UIParent someLabel:SetFont("Fonts/DFHEIMDU.TTF", 14, "NORMAL", "NORMAL") -- set font someLabel:SetJustifyHType("CENTER") -- horizontal alignment someLabel:SetText("Crit: -,--%") -- initial text someLabel:Show() function someFrame.UpdateCritRate(source, hitType) playerName = playerName or UnitName("player") if source == playerName then if hitType == "CRITIAL" then -- eventhough there is a typo is is the correct value critCount = critCount + 1 end hitCount = hitCount + 1 someLabel:SetText(string.format("Crit: %03.2f%%", (critCount * 100)/(hitCount or 0))) end end
Here's a complete addon package:
You would just need to put the code into a .lua file, create a matching .toc for that. (the content is the .lua file's name) A minimal gui is already created in the lua code, eventhough there is no configuration.

.This post has been edited 1 times, last edit by "ArkanaROM" (Sep 18th 2013, 4:51pm)