[Lua] 纯文本查看 复制代码 local FailedTime = BeeGetVariable("FailedTime") --"获取临时变量传入"
if FailedTime == nil then
FailedTime = 0
end
local Failed = time() - FailedTime >= 2
if Failed then --"这里需要和施法共同判断,否则一直为true"
F = F or CreateFrame("frame")
-- "注册战斗记录事件"
F:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
F:SetScript("OnEvent", function(_,_,_,a,_,b,_,_,_,_,_,_,_,c)
if a=="SPELL_CAST_FAILED" and b==UnitName("player") and c=="目标不在视野中" then
-- "储存临时变量"
BeeSetVariable("FailedTime", time())
F:UnregisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
end
end)
-- "如果目标不在视野中大于2秒,执行下面语句"
print(Failed)
end
|