Action Emotes #1 — how my addon works
What the Lua currently does
UseAction(slot, checkCursor, onSelf)is captured in_Orig_UseActionand replaced with a wrapper.- Each press lazily initializes settings, optionally prints the slot when watch mode is on and compares the integer slot to
WATCH_SLOT. - On a match,
doEmoteNow()comparesGetTime()withLAST_EMOTE_TIME. It returns while less than 21 seconds have elapsed. - On an eligible press, it records the time, selects one of ten tokens through
math.randomand callsDoEmote, with a text-emote fallback ifDoEmoteis unavailable. - The wrapper calls the original
UseAction, preserving the underlying button action by design.
What the addon remembers
VARIABLES_LOADED, PLAYER_ENTERING_WORLD, PLAYER_LOGIN and PLAYER_LOGOUT are registered. The first two hydrate the saved slot; login seeds the PRNG; logout copies the slot into BuxbrewChargeDB. /bbc slot also saves immediately. The DB is account-wide, not character-specific.
The timer and watch-mode switch are not persisted. There is no separate cooldown scheduler, animation asset or dependency.
What I still need to verify
- The file
BuxbreCharge.tocdoes not exactly match the project name; this may block loading depending on the installed folder name. - Global
UseActionreplacement can interact with other addons; load order and correct delegation must be checked. - The timer uses
GetTime()and starts fromLAST_EMOTE_TIME = 0; an immediate first emote is not guaranteed if client uptime is less than 21 seconds. - Code reading is not equivalent to live-client confirmation.
Files in my repository
BuxbrewCharge.lua (implementation), BuxbreCharge.toc (manifest), README.md, LICENSE, and development records. No automated tests are committed in the inspected tree.
Document information
Creative: Babuni
Source evidence: BuxbrewCharge.lua, BuxbreCharge.toc.