Files
wow-weakauras/AttackSpeedTest.lua

55 lines
1.5 KiB
Lua

--Guess attack speed by taking entire data set and comparing 2 - 4 intervals then storing the n into seperate array and incrementing it
--Attack speed with most counts in latter array is the best guess by m%
--Correct this by repeating step on exit combat maybe?
--Look at tolerances as well
local dataSet2s = {
[1]=540390408.9506,
[2]=540392394.9163,
[3]=540394398.5326,
[4]=540396409.5288,
[5]=540398396.6414,
[6]=540400397.0754,
[7]=540402384.8113,
[8]=540404385.3304,
[9]=540406398.99,
[10]=540408386.472,
[11]=540410386.9851,
[12]=540412374.8497,
[13]=540414375.1427,
[14]=540416373.0995,
[15]=540418376.9931,
[16]=540420390.6971
}
local dataSet1p5s = {
[1]=541651364.1916,
[2]=541652857.9058,
[3]=541654365.8491,
[4]=541655858.3292,
[5]=541657352.4962,
[6]=541658846.2963,
[7]=541660354.015,
[8]=541661847.0112,
[9]=541663340.6759,
[10]=541664861.3772,
[11]=541666354.9449,
[12]=541667848.8308,
[13]=541669343.2332,
[14]=541670849.9777,
[15]=541672344.0613,
[16]=541673851.2346
}
local tolerance = 50
local tempAverages = {}
-- rounds .5 to 0 or 1; want to round to .5 or .2 or alike
for k,v in ipairs(dataSet1p5s) do
if k > 1 then
local tempAvg = (dataSet1p5s[k] - dataSet1p5s[k - 1])
print(((math.floor(tempAvg / 1000) - (tempAvg / 1000)) * 1000), (math.ceil(tempAvg / 1000) - (tempAvg / 1000)) * 1000)
if not tempAverages[tempAvg] then tempAverages[tempAvg] = 0 end
tempAverages[tempAvg] = tempAverages[tempAvg] + 1
end
end
for k,v in pairs(tempAverages) do
print(k,v)
end