Add location recognition for combat and death reporters

This commit is contained in:
2025-01-09 12:56:23 +01:00
parent dee5053345
commit 7c7edcf959

View File

@@ -246,6 +246,30 @@ function shared.MinimapTagger.Init()
PlantTag(tonumber(x), tonumber(y), 2)
end
end
if string.find(msg, "^I am in combat with") then
if Heimdall_Data.config.minimapTagger.debug then
print(string.format("[%s] Found combat alert in message: %s", ModuleName, msg))
end
local x, y = string.match(msg, "%((%d+%.%d+)%s*,%s*(%d+%.%d+)%)")
if Heimdall_Data.config.minimapTagger.debug then
print(string.format("[%s] Found combat position: %s, %s", ModuleName, tostring(x), tostring(y)))
end
if x and y then
PlantBattle(tonumber(x), tonumber(y), 2)
end
end
if string.find(msg, " killed ") then
if Heimdall_Data.config.minimapTagger.debug then
print(string.format("[%s] Found death alert in message: %s", ModuleName, msg))
end
local x, y = string.match(msg, "%((%d+%.%d+)%s*,%s*(%d+%.%d+)%)")
if Heimdall_Data.config.minimapTagger.debug then
print(string.format("[%s] Found death position: %s, %s", ModuleName, tostring(x), tostring(y)))
end
if x and y then
PlantAlert(tonumber(x), tonumber(y), 2)
end
end
end)
print("[Heimdall] MinimapTagger loaded")