I'm using a text notification to remind me to cast Focus Magic if not already present on someone, including who it was most previously cast on. I have a set of two text displays, which works, but I'm wondering if there is a better or more efficient way to do it.
The first display simply triggers when I cast Focus Magic, and records who it was cast on. The custom trigger will always return false as I don't want it to display anything, just set the global variable.
function(_, _, message, _, _, source, _, destGUID, dest, _, _, spellName)
if(message == "SPELL_CAST_SUCCESS" and UnitIsUnit(source or "", "player") and spellName and spellName:find("Focus Magic")) then
WeakAuras_FM_Target = dest
The second display triggers if Focus Magic is not found.
if (WeakAuras_FM_Target) then
return "Reapply FM on\n"..WeakAuras_FM_Target
return "Apply FM"
Is there a way to achieve the same thing with 1 display? Or a more efficient way to do it with 2 displays?
Well, I would recommend condensing it into one display using two triggers. Use the Custom Trigger as the Main Trigger, but instead of making it always return false, make it always return true. Also, you could move the Custom Text function to the Name Info of your Custom Trigger, and change the Display Text from "%c" to "%n" (that should make it update far less often, provided the mechanics of dynamic info updates are working how I think they should).
Actually this display requires a little finesse to make it visible when necessary but not update unnecessarily all the time. Once I'm done raiding I'll think about it more.
After some thought, I don't think there is any elegant way to improve the CPU efficiency of this display; trying to keep the Custom Text function (which updates every frame) from handling the displayed string either causes updates that occur too frequently or too infrequently (for example, my first suggested alteration caused updates too infrequently).
You can still move the two displays into a single display with two triggers (with Required for Activation set to "Any Triggers") for better organization.
You must login to post a comment. Don't have an account? Register to get one!