72 lines
1.6 KiB
Lua
72 lines
1.6 KiB
Lua
-- COMBAT_LOG_EVENT_UNFILTERED TICKER_1000
|
|
---@param allstates allstates
|
|
---@param e string
|
|
function(allstates, e, ...)
|
|
if e == "TICKER_1000" then
|
|
local ttl = 120
|
|
for _, state in pairs(allstates) do
|
|
if state.progress then
|
|
local elapsedTime = GetTime() - state.index
|
|
if elapsedTime > ttl then
|
|
state.show = false
|
|
state.changed = true
|
|
else
|
|
local prettyTime = ""
|
|
|
|
local minutes = 0
|
|
while elapsedTime > 60 do
|
|
elapsedTime = elapsedTime - 60
|
|
minutes = minutes + 1
|
|
end
|
|
if minutes > 0 then
|
|
prettyTime = string.format("%s%dm", prettyTime, minutes)
|
|
end
|
|
if elapsedTime > 0 then
|
|
prettyTime = string.format("%s %ds", prettyTime, elapsedTime)
|
|
end
|
|
|
|
state.progress = string.format("%20s", prettyTime)
|
|
state.changed = true
|
|
end
|
|
end
|
|
end
|
|
return true
|
|
end
|
|
|
|
|
|
local detected = false
|
|
local stinky = ""
|
|
|
|
local source, err = CLEUParser.GetSourceName(...)
|
|
if not err then
|
|
if aura_env.stinkies[source] then
|
|
stinky = source
|
|
detected = true
|
|
end
|
|
end
|
|
if not detected then
|
|
local destination, err = CLEUParser.GetDestName(...)
|
|
if not err then
|
|
if aura_env.stinkies[destination] then
|
|
stinky = destination
|
|
detected = true
|
|
end
|
|
end
|
|
end
|
|
|
|
if detected then
|
|
aura_env.StinkyDetected(stinky)
|
|
allstates[stinky] = {
|
|
show = true,
|
|
changed = true,
|
|
name = string.format("%-30s", stinky),
|
|
progressType = "timed",
|
|
duration = 60,
|
|
expirationTime = GetTime() + 60,
|
|
autohide = true,
|
|
index = GetTime(),
|
|
progress = string.format("%20s", "0s"),
|
|
}
|
|
end
|
|
return true
|
|
end |