PIManager.zip
What's new
Changelog
All notable changes to PI Manager are documented here.
[1.16.1]
Fixed
- Duplicate macros, including one with a different potion. Regression from
1.13.0. When macro editing switched to writing by name, the existence check
became
GetMacroIndexByName. That is the exact function banned in 1.6.2: it returns 0 during early load even when the macro already exists, and a false "doesn't exist" creates a duplicate. Existence is once again decided by the authoritative duplicate-aware scan, andGetMacroIndexByNameis not called anywhere. - The potion line was unstable while the item cache warmed.
GetItemInfois asynchronous and returns nil for an item whose data hasn't arrived yet, so the same lookup gave different answers moments apart — first nothing, then whichever default had resolved. Every different answer changed the macro body, and every body change drove another write attempt through the faulty existence check. That is why the duplicates differed by potion. The addon now prefers the stored custom potion name (no lookup needed) and reuses the last successfully resolved name while the cache is cold, so the body stops flip-flopping. - Tightened the macro-cache readiness guard. Its nonzero-count safety net
could be satisfied by a partial count during the earliest load window, which
looks populated but lets the scan miss an existing macro. That path now also
requires the world to have loaded;
UPDATE_MACROSremains the primary signal.
Note for affected players
The addon never deletes macros. Open /macro, delete the extras so exactly one
PIManager macro remains, then /reload.
[1.16.0]
Removed
- The "Twins of the Sun Priestess detected" confirmation. Having the talent is the expected state, so announcing it every login was just noise. The warning when the talent is missing is unchanged — that one is actionable.
Added
- Macro status on login. The addon now reports what actually happened to the
macro:
Macro 'PIManager' created (slot N). Open /macro and drag it to an action bar.Macro 'PIManager' ready (slot N).— confirmed to already exist- the existing duplicate warning, when more than one was found
- a clear message if creation failed, e.g. at the macro limit
- The status prints at most once per session.
PLAYER_ENTERING_WORLDfires on every zone change, so reporting unconditionally would print a line on every loading screen. - If the first attempt is blocked (in combat, macro window open, or the macro cache still loading), nothing is printed then — the status is reported by whichever later attempt actually resolves, so a deferred creation is still confirmed rather than going silent.
[1.15.1]
Fixed
- The macro often failed to be created, appearing only later. Regression
introduced in 1.14.0. Every path that creates the macro was gated behind the
macroPendingflag, and that flag starts out false — so on a fresh session nothing created the macro at all. Assigning a target then only set the flag and waited, so the macro appeared later when some unrelated event (zoning, leaving combat) happened to notice. Two fixes:- The macro is now created unconditionally when you enter the world, instead
of only when the flag happens to be set.
EnsureMacrois idempotent — it creates exactly one macro when none exists, edits the existing one when present, and refuses to add more when duplicates are found — so calling it every time is safe. - Assigning a target when no macro exists now creates it immediately rather than deferring. Assignment is a direct user action and must take effect at once.
- The macro is now created unconditionally when you enter the world, instead
of only when the flag happens to be set.
- 1.14.0 removed the
UpdateMacro()call fromPLAYER_ENTERING_WORLDas part of dropping event-driven rebuilds, without noticing that this call was what primedmacroPendingand thereby triggered creation.
[1.15.0]
Twins of the Sun Priestess is the mechanic this addon exists to manage, so its state is now treated as first-class rather than as a footnote.
Fixed
- The Twins indicator was hidden whenever someone was assigned. The status
line only showed it in the unassigned case. But Twins governs every fallback
— assigned target dead, out of range, or gone — so its absence matters most
exactly when you do have someone assigned. A red
[no Twins]marker now shows alongside the target at all times when the talent is missing.
Added
- The addon now says in chat when Twins is not talented, explaining that Power Infusion will cast on you instead of a damage dealer whenever the assigned target isn't castable. It confirms when the talent is present again. This fires at login and on any talent change, and only when the state actually changes, so a respec never leaves you guessing.
Changed
- The README now leads with the talent requirement instead of burying it, and the addon list description names the talent directly.
[1.14.0]
Dropped event-driven macro rebuilding. The macro is now written only when you do something that changes it, or when you press Rescan — much less machinery, and far fewer ways to fail.
Fixed
- The potion line used a positional bag/slot reference.
/use <bag> <slot>is a position: looting, consuming or sorting moves the potion, and the baked coordinates then point at a different item — firing the wrong thing. The macro now emits/use <PotionName>, which is stable. The name is read from the game, so it is also correct on non-English clients.
Changed
- The macro is no longer rebuilt on
BAG_UPDATE_DELAYED(which fires constantly while raiding) or onPLAYER_EQUIPMENT_CHANGED. Neither can invalidate the macro any more, now that the target, the trinket slots, and the potion are all referenced by stable identifiers rather than positions. BAG_UPDATE_DELAYEDis no longer registered at all.PLAYER_REGEN_ENABLEDnow only finishes work that combat actually blocked, instead of rebuilding unconditionally.
What still updates the macro immediately
Assigning or clearing a target, toggling a trinket, changing the potion setting,
pressing Rescan, and /pi macro. A change made during combat is applied the
moment combat ends, so nothing is silently lost.
Removed
- The bag/slot lookup helper and the two container API wrappers it needed are gone, along with the last of the index/position-based macro logic.
[1.13.0]
Simplified the macro plumbing after studying PIMacroGenerator by Slothpala, which does the same job in 63 lines. Several of its techniques are better than what we had.
Fixed
- The macro used a hardcoded English spell name.
/cast Power Infusionis a silent no-op on any non-English client — the macro would appear to do nothing. The name is now resolved from the game viaC_Spell.GetSpellInfo(10060).nameand cached, so the macro works on every locale. - Macros are now edited by NAME instead of by index.
EditMacroaccepts "index or name" as its first argument. Using the name means there is no cached index that can go stale when the user adds or deletes other macros, which removes that entire class of bug (and the index-verification code added in 1.12.1) rather than guarding against it. - The addon no longer tries to edit macros while the Macro window is open. Doing so can clobber what the user is editing. It now says so and retries.
- Creating a macro when the account macro list is full now reports the problem instead of failing silently.
Changed
- The macro is no longer rebuilt on every roster change. Since 1.12.0 the
macro targets the assigned player by name, so people joining, leaving, or being
reshuffled cannot invalidate it. Rebuilding on
GROUP_ROSTER_UPDATEwas pure overhead and a frequent source of combat-lockdown deferrals — a likely cause of the inconsistent behaviour reported in 12.1. - All macro-write preconditions (combat, macro window open, cold cache) are now checked in one place instead of being scattered.
[1.12.1]
Full audit of the targeting and macro-management systems. Three real bugs found.
Fixed
- Editing the macro could hijack an unrelated macro. The cached macro index
was used without ever being re-verified. Macro indices are positional and the
book is packed, so deleting any macro shifts everything above it down one
slot. The cached index then pointed at a different macro, and writing to it
renamed that macro to "PIManager" and overwrote its body — destroying the
user's macro and producing a second macro named "PIManager". This is a
direct cause of duplicate-macro reports. The index is now re-verified against
GetMacroInfobefore every write, and re-checked wheneverUPDATE_MACROSfires; if it no longer holds our macro it is discarded and a fresh authoritative scan runs instead. - Load-breaking ordering bug introduced in 1.12.0. The new
UnitFullNameandShortNamehelpers were defined afterFindCastTargetandUpdateMacro, which call them. In Lua alocal functionis only visible after its definition, so those calls resolved to nil and would error on every target resolution. The helpers are now defined before first use. - The per-character macro index base is now read from
Constants.MacroConsts.MAX_ACCOUNT_MACROSinstead of a hardcoded 120. If Blizzard ever changes the account-macro cap, a hardcoded base would scan the wrong range, miss an existing per-character macro, and create a duplicate.
Changed
- The cast confirmation line now matches on the realm-qualified name first, so a same-named player from another realm is no longer mislabelled "(assigned)".
Verified
- Realm-qualified names are space-free (
UnitName's realm return is normalized), so[@Name-Realm]is macro-safe — including hyphenated realms like Azjol-Nerub. This matches Blizzard's ownname.."-"..serverpattern. - Parse clean, blocks balanced, 18 events registered and handled 1:1, no unused functions, no used-before-defined references.
[1.12.0]
Fixed
- Power Infusion could land on the wrong player. The macro baked in a
positional unit token (
party3,raid12). Unit tokens shift whenever the roster changes — if someone at a lower index leaves or disconnects, everyone below shifts up and the baked-in token silently points at a different player. BecauseEditMacrois protected and cannot run in combat, the macro could not be corrected mid-fight, so the wrong person kept getting PI for the rest of the pull. - The macro now targets the assigned player by name
(
/cast [@Name,help,nodead] Power Infusion). A name never shifts, so the macro stays correct through any roster change, in or out of combat. - Same-named players from different realms no longer collide. Assignments are
now stored realm-qualified (
Name-Realm) and matched that way, so PI can't go to the wrong "Solsonic" in a cross-realm raid. Names are still displayed short. Assignments saved by older versions (bare names) still resolve via a short-name fallback. CheckAutoClearAssignmentnow uses the same resolver as the macro, so a cross-realm assignment is no longer wrongly cleared as "left the group."
Note
Worst-case macro body is 118 of the 255-character limit, even with a long realm-qualified name.
[1.11.2]
Fixed
- Duplicate "PIManager" macros could be created on login. The macro-system
readiness guard only checked that
GetNumMacros()returned numbers. During early load it returns0, 0— two perfectly valid numbers — while the macro cache is still empty. The duplicate scan then iterated zero slots, concluded no PIManager macro existed, and created another one. Each time the race hit, another duplicate appeared. - The addon now waits for positive confirmation that the macro cache is live
before creating anything: either the
UPDATE_MACROSevent has fired (the signal Blizzard's own macro UI uses), orGetNumMacros()reports a nonzero total. A brand-new character with genuinely zero macros simply waits forUPDATE_MACROS, which fires shortly after login. - Running
/pi macrobefore the cache is ready now says so instead of appearing to do nothing. /pi diagnow reportsmacroCacheReady,macroPending, and the rawGetNumMacros()values to make this diagnosable in the field.
Note for affected players
The addon never deletes macros. If you already have duplicates, open /macro,
delete the extras so exactly one PIManager macro remains, then /reload.
The addon will keep that one updated and will not create more.
[1.11.1]
Changed
- Iron-Clad rules (in the code header and
IRONCLAD_RULES.md) now target both WoW 12.0.7 and 12.1, matching the TOC. - Coding disclosure updated to credit both Claude Opus 4.8 and Claude Opus 5.
[1.11.0]
Added
- Press ESC to close the window. The main frame is now registered with
UISpecialFrames, so it closes on ESC like a standard Blizzard panel. The registration is guarded against double-insertion.
Fixed
- Removed a stale layout comment that cited window and inset dimensions from an earlier version and no longer matched the code.
[1.10.3]
Added
- 12.1 (Curse of Ula'tek) support. The TOC now declares both versions —
## Interface: 120007, 120100— so the addon loads on 12.0.7 today and on 12.1 when that patch ships, with no further change needed. - Every API the addon uses was verified against the 12.1 PTR source: all
C_*functions, the spellcast event payloads, the macro globals, all 17 registered events, and all six frame templates are unchanged. None of the 14 functions deprecated across the 12.x manifests are used. - Also checked against 12.1's other addon-facing changes: the addon does not use
UIParentLoadAddOn,CanAccessObject, orgetglobal/setglobal, and it reads no aura data at all, so 12.1's aura restrictions don't affect it.
[1.10.2]
Removed
- Trimmed the README down to Install, How it works, Features, Slash commands, and the coding disclosure. The Raid-safety design, Files, and Notes sections were removed as unnecessary detail for users.
- Removed the legacy
PIManagerSendWhisperno-op global. It existed as a safety net for macros generated before 1.6.0 that contained a/runline; the addon has regenerated the macro body on every update since, so it no longer serves a purpose. - Cleared out comments referencing systems that no longer exist (the whisper feature, the secure cast button, the fallback DPS pool and its scratch tables, and the Power Infusion cooldown display).
Fixed
- The README's feature list still described the status line as showing the Power Infusion cooldown, which was removed in 1.10.0. It now correctly describes the target / Twins fallback indicator.
[1.10.1]
Changed
- Dropped 12.0.5 from the TOC now that 12.0.7 is the live client. The interface is
now
## Interface: 120007only, and the compatibility wording in the code header and README reads "12.0.7." (Earlier changelog entries that mention 12.0.5 are left intact as a historical record.)
[1.10.0]
Removed
- The Power Infusion cooldown timer (the "Ready" / "CD Xs" indicator) has been removed from the status line. The cooldown read and its secret-value guard are gone along with it.
Changed
- The status line's unassigned-fallback text now reads "Fallback: Twins of the Sun Priestess" instead of "Twins: random DPS".
- Added a talent check: if the player does not have the Twins of the Sun
Priestess talent, the status line shows "Fallback: Not talented" (in red),
so it's clear the smart-distribution fallback won't work. Uses the modern
C_SpellBook.IsSpellKnownAPI; if the talent state can't be determined, it defaults to showing the talent name rather than falsely reporting "not talented". - The status line now refreshes on
PLAYER_TALENT_UPDATE, so the fallback indicator updates immediately when you change talents or spec.
[1.9.2]
Fixed
- Addon showed as "Incompatible" on the live 12.0.5 client. 1.9.1 set the TOC
interface to
120007only, which is higher than the current live client, so WoW flagged it out of date / incompatible until 12.0.7 ships. The TOC now declares both versions —## Interface: 120005, 120007— so it loads on 12.0.5 today and on 12.0.7 when that patch goes live, with no further change needed. - Compatibility wording in the code header and README updated to read "12.0.5 and 12.0.7."
[1.9.1]
Changed
- Updated for WoW 12.0.7 ("Revelations"). Bumped the TOC interface to
120007and updated all compatibility references (code header, README, Iron-Clad rules) to 12.0.7. - Every API the addon uses was verified against the live 12.0.7 PTR source
(Gethe/wow-ui-source
ptr2branch, build 67808):C_Spell.GetSpellCooldown,C_Spell.IsSpellInRange, theUNIT_SPELLCAST_SENT/SUCCEEDED/FAILED/INTERRUPTEDevent payloads,C_Container.*,C_Item.*, and the macro globals (CreateMacro/EditMacro/GetNumMacros/GetMacroInfo). No breaking changes were found — this release is a compatibility/version bump only, no logic changes.
Notes
- 12.0.7 adds a
SecretWhenUnitSpellCastRestrictedflag to the spellcast events. In normal play this has no effect on the addon; it's noted as a possible future consideration only for restricted (certain encounter/PvP) content.
[1.9.0]
Changed
- Removed the addon's random-DPS fallback logic entirely. The unassigned and out-of-range cases are now handled by the Priest talent Twins of the Sun Priestess, which distributes a Power Infusion cast (with no specific ally targeted) to a nearby ally, preferring damage dealers. This is more reliable than the old addon-computed fallback, which could go stale and commit to an out-of-range target.
- The macro is now a two-line pattern:
/cast [@<assigned>,help,nodead] Power Infusionfollowed by/cast [@player] Power Infusion. The assigned target is hit when castable; otherwise the second line lets Twins pick a damage dealer. When no one is assigned, the first line is a plain cast and Twins handles everything. - Removed all self-cast (
[@player]-as-self) behavior as a literal fallback;[@player]is now only the trigger that lets Twins distribute the cast. - Status line now shows the assigned target, "(not in group)" if the assigned player isn't present, or "Twins: random DPS" when unassigned.
Removed
- The DPS/any-member fallback pool, its scratch tables, and the per-member range/role/phase eligibility scan in the cast-target resolver (no longer needed — the game handles distribution).
- The now-unused spell-range API wrapper.
Notes
- The smart unassigned/out-of-range behavior requires the Twins of the Sun Priestess talent. Without it, an unassigned or failed cast follows default WoW targeting (your current friendly target, or nothing) instead.
[1.8.0]
Added
- Window position is now remembered. Drag the window where you want it and it reopens in that spot every time (across sessions), instead of always returning to center. The position is saved when you finish dragging and restored when the window is built.
Changed
- If the window is ever detected offscreen on open, it re-centers and resets the saved position so the problem doesn't recur.
/pi resetnow re-centers the window immediately (in addition to wiping the saved position along with the rest of the settings).
[1.7.1]
Changed
- Reworked the bottom button row: Assign PI, Rescan, and Clear are now three equal-width buttons (85px each) in an evenly spaced row, with Rescan centered between the other two. Previously Rescan sat alone in the title bar, which looked out of place.
- Rescan button tooltip now anchors above the button (was bottom-left) so it no longer overlaps the player list.
[1.7.0]
Added
- Rescan button and matching
/pi rescanslash command. Forces a fresh rebuild of the player list from the current raid/party roster, re-resolves the macro target, and refreshes the labels and status line. Prints the detected member count as confirmation.- Added as a safety valve for the rare case where the list looks stale/incomplete — for example if the window was opened before the raid roster finished populating, or a roster update event was coalesced by the client.
Documentation
- README updated to document the Rescan feature in both the feature list and the slash-command table.
[1.6.2]
Fixed
- Duplicate "PIManager" macros. Older versions could create multiple
same-named macros in a player's macro book — one per affected login, each with
slightly different content. Two root causes were addressed:
- Login race: macro creation was deferred off
PLAYER_LOGIN(which fired before the macro cache was populated) to the firstPLAYER_ENTERING_WORLD, guarded by a macro-system-ready check, with aPLAYER_REGEN_ENABLEDretry as a combat fallback. - Unreliable duplicate detection: replaced
GetMacroIndexByName(which only finds the first same-named macro and could return 0 during early load) with an authoritative scan that counts all "PIManager" macros across both the general and per-character ranges. The addon now edits the existing macro when exactly one is found, creates exactly one when none exists, and refuses to create more while warning the player once if duplicates are already present. - The addon never auto-deletes macros. Players with pre-existing duplicates
should delete the extras manually via
/macro, then/reload.
- Login race: macro creation was deferred off
Documentation
- Rewrote the README to match the current addon. Removed stale references to features that no longer exist (the whisper/say/party notify options, the secure cast button + Bindings.xml keybind path, an old options panel, and several commands that were removed). Documented the status line, AddonCompartment entry, faction tags, and cast confirmation. Verified every slash command, the interface number, and the file tree against the actual code.
- Recorded the Iron-Clad development rules and the known platform limitations
(server-side whisper throttling, hardware-event-gated chat channels) in
IRONCLAD_RULES.md.
Note: versions 1.6.3 through 1.6.9 were not released; development moved from 1.6.2 directly to the 1.7.x line.
This mod has no additional files

