From 7c7edcf9590dffbbadd979c7c1579dfe856a4da8 Mon Sep 17 00:00:00 2001 From: PhatPhuckDave Date: Thu, 9 Jan 2025 12:56:23 +0100 Subject: [PATCH] Add location recognition for combat and death reporters --- Modules/MinimapTagger.lua | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/Modules/MinimapTagger.lua b/Modules/MinimapTagger.lua index 7120d17..99d0f99 100644 --- a/Modules/MinimapTagger.lua +++ b/Modules/MinimapTagger.lua @@ -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")