This commit is contained in:
@@ -7,7 +7,7 @@ local ModuleName = "StinkyTracker"
|
||||
shared.StinkyTracker = {}
|
||||
function shared.StinkyTracker.Init()
|
||||
shared.stinkyTracker = {
|
||||
stinkies = ReactiveValue.new({})
|
||||
stinkies = ReactiveValue.new({}),
|
||||
}
|
||||
|
||||
local whoRegex = "([^ -/]+)-?%w*/(%w+)"
|
||||
@@ -23,11 +23,18 @@ function shared.StinkyTracker.Init()
|
||||
name = name,
|
||||
class = class,
|
||||
seenAt = GetTime(),
|
||||
hostile = true
|
||||
hostile = true,
|
||||
}
|
||||
if Heimdall_Data.config.stinkyTracker.debug then
|
||||
print(string.format("[%s] Found hostile player: %s (%s) at %s", ModuleName, name, class,
|
||||
date("%H:%M:%S", time())))
|
||||
print(
|
||||
string.format(
|
||||
"[%s] Found hostile player: %s (%s) at %s",
|
||||
ModuleName,
|
||||
name,
|
||||
class,
|
||||
date("%H:%M:%S", time())
|
||||
)
|
||||
)
|
||||
shared.dumpTable(stinkies)
|
||||
end
|
||||
end
|
||||
@@ -53,12 +60,20 @@ function shared.StinkyTracker.Init()
|
||||
name = name,
|
||||
class = class,
|
||||
seenAt = GetTime(),
|
||||
hostile = aggression == "hostile"
|
||||
hostile = aggression == "hostile",
|
||||
}
|
||||
stinkies[name] = stinky
|
||||
if Heimdall_Data.config.stinkyTracker.debug then
|
||||
print(string.format("[%s] Found stinky in SEE: %s (%s) - %s at %s", ModuleName, name, class, aggression,
|
||||
date("%H:%M:%S", time())))
|
||||
print(
|
||||
string.format(
|
||||
"[%s] Found stinky in SEE: %s (%s) - %s at %s",
|
||||
ModuleName,
|
||||
name,
|
||||
class,
|
||||
aggression,
|
||||
date("%H:%M:%S", time())
|
||||
)
|
||||
)
|
||||
shared.dumpTable(stinkies)
|
||||
end
|
||||
return stinkies
|
||||
@@ -87,7 +102,7 @@ function shared.StinkyTracker.Init()
|
||||
name = name,
|
||||
class = class,
|
||||
seenAt = GetTime(),
|
||||
hostile = true
|
||||
hostile = true,
|
||||
}
|
||||
stinkies[name] = stinky
|
||||
if Heimdall_Data.config.stinkyTracker.debug then
|
||||
@@ -141,8 +156,9 @@ function shared.StinkyTracker.Init()
|
||||
if stinky.hostile then
|
||||
shared.stinkyTracker.stinkies[name] = stinky
|
||||
if Heimdall_Data.config.stinkyTracker.debug then
|
||||
print(string.format("[%s] Added hostile stinky from WHO: %s (%s)", ModuleName, name, stinky
|
||||
.class))
|
||||
print(
|
||||
string.format("[%s] Added hostile stinky from WHO: %s (%s)", ModuleName, name, stinky.class)
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -159,8 +175,9 @@ function shared.StinkyTracker.Init()
|
||||
if stinky.hostile then
|
||||
shared.stinkyTracker.stinkies[name] = stinky
|
||||
if Heimdall_Data.config.stinkyTracker.debug then
|
||||
print(string.format("[%s] Added hostile stinky from SEE: %s (%s)", ModuleName, name, stinky
|
||||
.class))
|
||||
print(
|
||||
string.format("[%s] Added hostile stinky from SEE: %s (%s)", ModuleName, name, stinky.class)
|
||||
)
|
||||
end
|
||||
end
|
||||
if not stinky.hostile then
|
||||
@@ -190,7 +207,9 @@ function shared.StinkyTracker.Init()
|
||||
-- Log total stinky count after processing
|
||||
if Heimdall_Data.config.stinkyTracker.debug then
|
||||
local count = 0
|
||||
for _ in pairs(shared.stinkyTracker.stinkies:get()) do count = count + 1 end
|
||||
for _ in pairs(shared.stinkyTracker.stinkies:get()) do
|
||||
count = count + 1
|
||||
end
|
||||
print(string.format("[%s] Current total stinkies tracked: %d", ModuleName, count))
|
||||
end
|
||||
|
||||
@@ -236,7 +255,7 @@ function shared.StinkyTracker.Init()
|
||||
name = name,
|
||||
class = UnitClass(unit),
|
||||
seenAt = GetTime(),
|
||||
hostile = true
|
||||
hostile = true,
|
||||
}
|
||||
return
|
||||
end
|
||||
@@ -254,8 +273,6 @@ function shared.StinkyTracker.Init()
|
||||
shared.stinkyTracker.stinkies[name] = nil
|
||||
end)
|
||||
|
||||
if Heimdall_Data.config.stinkyTracker.debug then
|
||||
print(string.format("[%s] Module initialized", ModuleName))
|
||||
end
|
||||
if Heimdall_Data.config.stinkyTracker.debug then print(string.format("[%s] Module initialized", ModuleName)) end
|
||||
print("[Heimdall] StinkyTracker loaded")
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user