---卡复仇---
function BST(unit)
unit = unit or "target";
local speed=UnitAttackSpeed(unit)
local _, _, _, lag = GetNetStats()
lag = lag / 1000
if not Fbst then Fbst=CreateFrame("Frame") end
Fbst:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
Fbst:SetScript("OnEvent",FbstOnEvent)
function FbstOnEvent(self,event,...)
if event=="COMBAT_LOG_EVENT_UNFILTERED" then
local _, subEvent, _, sourceGUID, sourceName, _, _, destGUID, _, _, _, _, _, _, spellFailed = ...
if sourceGUID == "0x0000000000000000" or sourceGUID == nil or sourceName == nil then return end
if (subEvent == "SWING_DAMAGE" or subEvent == "SWING_MISSED") and destGUID == UnitGUID("player") and sourceGUID== UnitGUID("target") then
lst=GetTime()
end
end
end
if lst~=nil then
if (lst+speed-lag)-GetTime()>=0.05 and (lst+speed-lag)-GetTime()<=0.1 then
return true
end
end
end |