diff --git a/Core.lua b/Core.lua index 948de8a..b4fb8e4 100644 --- a/Core.lua +++ b/Core.lua @@ -1933,6 +1933,9 @@ function CleveRoids.ParseMsg(msg) -- e.g., distance:30:facing>1 → condition="distance", args="30:facing>1") local conditionGroup = CleveRoids.splitStringIgnoringQuotes(conditionGroups, ":") local condition = conditionGroup[1] + -- Rewrite deprecated names (e.g. mouseuse -> cursor) so old macros + -- keep working and only the current keyword exists downstream. + condition = CleveRoids.conditionalAliases[condition] or condition local args = conditionGroup[2] for _cgi = 3, table.getn(conditionGroup) do args = (args or "") .. ":" .. conditionGroup[_cgi] @@ -2586,22 +2589,6 @@ function CleveRoids.DoWithConditionals(msg, hook, fixEmptyTargetFunc, targetBefo end end - -- [mouseuse] modifier: auto-click the AOE targeting circle at cursor position - if conditionals.mouseuse and SpellIsTargeting() then - local wasAttacking = CleveRoids.CurrentSpell.autoAttack - CameraOrSelectOrMoveStart() - CameraOrSelectOrMoveStop() - -- CameraOrSelectOrMoveStart can start auto-attack as a side effect. - -- Stop it immediately if it wasn't active before. - if not wasAttacking then - local slot = CleveRoids.GetProxyActionSlot(CleveRoids.Localized.Attack) - if slot and CleveRoids.Hooks.IsCurrentAction(slot) then - AttackTarget() - CleveRoids.CurrentSpell.autoAttack = false - end - end - end - if needRetarget then TargetLastTarget() end diff --git a/Init.lua b/Init.lua index e254c6b..0cdd1bd 100644 --- a/Init.lua +++ b/Init.lua @@ -187,11 +187,19 @@ CleveRoids.ignoreKeywords = { _operators = true, -- Metadata for AND/OR operator tracking _groups = true, -- Grouped conditional values for AND/OR evaluation multiscan = true, -- Processed before Keywords loop (target resolution) - mouseuse = true, -- Post-cast modifier: auto-click AOE targeting circle at cursor cursor = true, -- Modifier: place ground-target spell/item at cursor (CastAtCursor) stopattack = true, -- Post-cast modifier: stop autoattack after cast (CheapShot pattern) } +-- Deprecated conditional names, rewritten to their current keyword in ParseMsg +-- before anything downstream (evaluation, _groups) sees them. This is the path +-- for renamed *modifiers* -- ignoreKeywords entries, which have no Keywords +-- predicate that an alias could just point at the way [stl] does for [stealth]. +-- MacroErrorChecker also reads this table, so the old names stay valid syntax. +CleveRoids.conditionalAliases = { + mouseuse = "cursor", -- pre-ClassicAPI name, back when it clicked the AoE reticle +} + -- TODO: Localize? CleveRoids.countedItemTypes = { ["Consumable"] = true, diff --git a/MacroErrorChecker.lua b/MacroErrorChecker.lua index e39797d..4074ebb 100644 --- a/MacroErrorChecker.lua +++ b/MacroErrorChecker.lua @@ -35,6 +35,14 @@ if CleveRoids.ignoreKeywords then end end +-- Deprecated names still valid in macros; ParseMsg rewrites them to the current +-- keyword, so they never reach Keywords/ignoreKeywords under their old name. +if CleveRoids.conditionalAliases then + for alias, _ in pairs(CleveRoids.conditionalAliases) do + VALID_CONDITIONALS[alias] = true + end +end + -- Known valid commands local VALID_COMMANDS = { -- Core commands NOT registered via SlashCmdList (so not auto-discoverable):