Brues f296425c94 Cut per-call allocations in the event and publish paths; merge SPELL_CAST_EVENT
Chasing high memory churn (~188 kb/s with pfUI). Four allocation sources and one
correctness bug found along the way.

The recurring cause: in 1.12's Lua 5.0 a function declared `function(...)` builds
a fresh `arg` table on every call. Three handlers were declared that way and none
of them read the vararg.

- Compatibility/pfUI.lua: the registered action handler. This was the dominant
  one. UpdateAllManagedCooldowns fans ACTIONBAR_UPDATE_COOLDOWN across every
  managed slot (up to 120) on each SPELL_UPDATE_COOLDOWN, so every GCD and
  cooldown tick allocated ~120 tables that the handler then discarded, because
  its whole body only ever applied to ACTIONBAR_SLOT_CHANGED. Dropped the vararg
  and added an early return before any work. Bongos' and UltimaMacros' handlers
  were already vararg-free.

- Core.lua SendEventForAction: dropped the vararg (every caller passes exactly
  one extra value) and replaced the inline "arg" .. i concatenations -- 30 per
  call across three loops -- with a prebuilt name table. The eight-branch arg.n
  fan-out collapses to one loop.

- Core.lua Frame OnEvent dispatcher: dropped the vararg. It fires for all ~48
  registered events, including the UNIT_HEALTH / UNIT_AURA / UNIT_*_GUID streams.

PublishDisplay now skips no-op publishes. Publishing is not free: the client
repaints holders of the macro through its own notifier, which returns as
ACTIONBAR_SLOT_CHANGED -> ClearAction + IndexActionSlot -> TestForActiveAction ->
publish. Publishing an unchanged value therefore tore down and re-resolved slots
for nothing and fed itself, since GetAction and IndexActionSlot both publish on
paths that fire constantly. This was the C_Macro.SetMacroDisplay regression.

Also merges the two same-named SPELL_CAST_EVENT handlers. Lua assigns in file
order, so the later definition silently replaced the earlier one and its half
never ran: channel-start detection, spell_tracking cleanup, and cast-sequence
advancement. AdvanceSequence has only two callers and the other is inside
UNIT_CASTEVENT, which is registered only under SuperWoW -- so /castsequence had
no way to advance on a successful cast for Nampower-only users.
2026-09-10 14:40:16 -05:00
2026-06-21 03:38:50 -05:00
2026-09-09 12:46:48 -05:00
2026-09-09 12:46:48 -05:00
2025-08-18 16:15:25 -04:00

SuperCleveRoid Macros

Enhanced macro addon for World of Warcraft 1.12.1 (Vanilla/Turtle WoW) with dynamic tooltips, conditional execution, and extended syntax.

Full Documentation on the Wiki

Requirements

Mod Required Purpose
Nampower (v3.0.0+) Spell queueing, DBC data, auto-attack events
UnitXP_SP3 Distance checks, [multiscan] enemy scanning
ClassicAPI Modern C_* API: dispel-type conditionals ([magic], [curse], …), [moving] speed

Installation

  1. Download and extract to Interface/AddOns/SuperCleveRoidMacros
  2. Recommended pfUI: Use brues-code/pfUI for full compatibility with macro spell scanning and action bar features

Quick Start

#showtooltip
/cast [mod:alt] Frostbolt; [mod:ctrl] Fire Blast; Blink
  • Conditionals in [] brackets, space or comma separated
  • Arguments use colon: [mod:alt], [hp:>50]
  • Negation with no prefix: [nobuff], [nomod:alt]
  • Target with @: [@mouseover,help], [@party1,hp:<50]
  • Spell names with spaces: "Mark of the Wild" or Mark_of_the_Wild

Multi-value logic:

Syntax Logic Example
[buff:X/Y] OR Has X or Y
[buff:X&Y] AND Has X and Y
[nobuff:X/Y] NOR Missing both
[nobuff:X&Y] NAND Missing at least one

Comparisons: [hp:>50], [hp:>20&<50], [buff:"Name"<5] (time), [debuff:"Name">#3] (stacks)

Wiki

See the Wiki for complete documentation:

  • Quick Start — Syntax, multi-value logic, comparisons, special prefixes
  • Slash Commands — All 35+ commands, priority macros, UnitXP scanning
  • Conditionals — 150+ conditionals (player & target), short aliases, extended unit tokens, multiscan
  • Reference Tables — CC types, damage schools, stat types, swing types
  • Features — Debuff timers, combo tracking, talent modifiers, TWoW mechanics
  • Overflow Buff Frame — Hidden buff display for 32+ buffs
  • Immunity Tracking — Auto-learned NPC immunities
  • Settings — Configuration and console commands
  • Supported Addons — Compatible addons and integrations

Known Issues

  • Action-bar macros are identified by slot, so blank or duplicate macro names are fine. Only macros referenced by name ({MacroName} nesting, /runmacro "Name") still need a unique name to disambiguate.
  • Reactive abilities must be on action bars for detection
  • Debuff time-left conditionals only work on own debuffs unless pfUI libdebuff or Cursive has data
  • Macro line length: 261 characters max (MacroLengthWarn extension prevents crashes)

Supported Addons

Unit Frames: pfUI, LunaUnitFrames, XPerl, Grid, CT_UnitFrames, agUnitFrames, and more

Action Bars: Blizzard, pfUI, Bongos, Discord Action Bars

Integrations: SP_SwingTimer, TWThreat, TimeToKill, QuickHeal, Cursive, ClassicFocus, SuperMacro

Note: For pfUI users, the brues-code/pfUI fork includes native SuperCleveRoidMacros integration for proper cooldown, icon, and tooltip display on conditional macros.

Credits

Based on CleverMacro and Roid-Macros.

MIT License

S
Description
Requires ClassicAPI
Readme MIT 8.9 MiB
Languages
Lua 100%