diff --git a/Heimdall.toc b/Heimdall.toc index 1608a75..7314b24 100644 --- a/Heimdall.toc +++ b/Heimdall.toc @@ -1,6 +1,6 @@ ## Interface: 70300 ## Title: Heimdall -## Version: 3.3.1 +## Version: 3.4.0 ## Notes: Watches over areas and alerts when hostiles spotted ## Author: Cyka ## SavedVariables: Heimdall_Data diff --git a/Heimdall.zip b/Heimdall.zip index 32cc7f6..5d5d16b 100644 --- a/Heimdall.zip +++ b/Heimdall.zip @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5a0f7799637747403dfd6694c6e2a72393639bbc50dfabcb91010a27d527e304 -size 985696 +oid sha256:ce715cbaf623dd9f54ad71e11a5dc514a468ee7bbe14764505dbe2b5c276b62a +size 985963 diff --git a/Modules/Commander.lua b/Modules/Commander.lua index 3a9056f..4c2ab03 100644 --- a/Modules/Commander.lua +++ b/Modules/Commander.lua @@ -202,6 +202,41 @@ function shared.Commander.Init() return {} end + ---@param args string[] + local function MacroTarget(args) + if Heimdall_Data.config.commander.debug then + print(string.format("[%s] Macroing: %s", ModuleName, + strjoin(" ", unpack(args)))) + end + if #args < 2 or #args % 2 ~= 0 then + if #args < 2 or #args % 2 ~= 0 then + if Heimdall_Data.config.commander.debug then + print(string.format( + "[%s] Invalid number of arguments for MacroTarget", ModuleName)) + end + return {} + end + end + table.remove(args, 1) + + for i = 1, #args do + local stinky = strtrim(args[i]) + local name = stinky:match("([^/]+)") + local class = stinky:match("/([^ $]+)") + if Heimdall_Data.config.commander.debug then + print(string.format("[%s] Adding stinky: %s/%s", ModuleName, name, tostring(class))) + end + shared.stinkyTracker.stinkies[name] = { + name = name, + class = class or "unknown", + seenAt = GetTime(), + hostile = true + } + shared.dumpTable(shared.stinkyTracker.stinkies) + end + return {} + end + ---@class Command ---@field keywordRe string ---@field commanderOnly boolean @@ -216,6 +251,7 @@ function shared.Commander.Init() { keywordRe = "^joingroup$", commanderOnly = false, callback = JoinGroup }, { keywordRe = "^leavegroup$", commanderOnly = false, callback = LeaveGroup }, { keywordRe = "^follow$", commanderOnly = false, callback = FollowTarget }, + { keywordRe = "^macro", commanderOnly = false, callback = MacroTarget }, } local commanderChannelFrame = CreateFrame("Frame")