getbuffname macro help...

UI and Macro
I have put in my share of work finding an answer and i know im close. what im looking for is the correct string that will return the name of the buff that my mouse cursor is currently over. So far the closest i have come is to be able to print out the frame name that the buff is in by using this string here ... /run print(GetMouseFocus():GetName())...but that will only return the frames name and not the buffs name. So while i am one step closer, i still dont have what i want. unless i can /cancelaura by frame???

what im ultimatly trying to accomplish is this: Satrina Buff Frames is a great addon, but is having issues clicking off a buff, there is no fix for it provided by the author and yes i have looked! so i would like to write my own macro that will simply allow me to mouse over the unwanted buff frame and then activate the macro, probably keybound and /cancelaura

Now this seems simple enuff, but im down to the last few hairs on my head to rip out trying to get it accomplished, this seems like the appopriate place to ask this quesstion, and i thank you all for taking the time to read this. Im sure im not the first person to encounter this problem and once i find the solution I intend to post it on every other forum i have found with frustrated people with the same inability to click off buffs while using SBF. Its a GREAT addon btw, except for this lil issue here.

Yer Friendly Horde Paladin, Psilo
Nm lol.
This is a tricky one, actually.

The name may or may not be a table entry in the frame itself for Satrina's Buff Frames. You can put the mouse over a buff and /dump GetMouseFocus() to look at its table entries. Unfortunately once you get the name I don't think you can really do anything with it, since the API to cancel a buff is now protected.

The proper way to cancel a buff is to set a cancelaura attribute to a button (like the buff itself).

buff:SetAttribute("type2","cancelaura") -- type2 is the type on a right click
buff:SetAttribute("index2",3) -- or "spell2","name of spell"

BUT you can't program those in combat. Which creates an unholy mess since secure buttons can't move and buffs are constantly coming and going.

Looking into this further, Blizzard really needs to add some support here.

edit: for kicks I downloaded 3.2 SBF. Out of combat you can use this macro to cancel a buff under the mouse:

/run local m,f=GetMouseFocus(),CnB or CreateFrame("Button","CnB",nil,"SecureActionButtonTemplate") f:SetAttribute("type","cancelaura") f:SetAttribute("unit","player") f:SetAttribute("spell",m and m._buff and
/click CnB

In combat you'd need to set the buffs to be interactive so it doesn't filter them and it can cancel by its buff id.

edit2: to answer your original question of how you get the name of the buff under the mouse with Satrina's Buff Frames. In SBF 3.2 it's GetMouseFocus()
o my stars! awesome answer btw, i wish i could just set them to unfiltered but it defeats the whole purpose of having the addon to begin wit, i find it very useful to be able to see 'art of war' procs and not just have it lumped in w/ every other raid buff! so what you are saying is that it basicly cant be done in combat? well thats not a huge deal becasuse anything i need to click off in combat i have set to a key modified macro ... like for divine plee... /cancelaura [mod:shift]Divine Plea... so its not a big deal.. its more for turning off annoying things like that damn easter quests. people had no idea how much of a pain it was to constantly type it all out everytime i wanted to get out of that damn bunny form. o if it can be done at least out of combat with your macro i feel its done alot and its a step in the right direction. The author of the addon did say it was blizz fault that it couldnt be done, but im suprised he never offered at least this. thank you so much, im going to test it now and let ya know how it goes.
yup, it def works for out of combat and i thank you so much, im going to head over to sbf curse page right now and let them know, giving you full credit of korse.

so if it combat you can do /cancelaura 'name of buff'. then i must ask, why cant you combine the two /cancelaura [GetMouseFocus()]...clearly thats terribly wrong, but am i way off in thinking it SHOULD be that simple?
Unfortunately there's no variation of /cancelaura [GetMouseFocus()] that would work. Slash commands are secure because they're never programmable. It will try to cancel a buff named literally "[GetMouseFocus()]" or whatever you put after the slash command without calculating an answer. If you could generate a programmable slash command on the fly, then you could "/cast [@whoeverIsCursed] Remove Curse" and undo the whole point of the macro language they added on dec 5 2006.

If you get talking to the new author of SBF, you might want to mention a frame to intercept clicks out of combat. I use one in a couple of my mods to seamlessly mimic protected actions out of combat. Basically, in the unsecure button's OnEnter, you check if you're out of combat and Show a secure button anchored to the button you just entered, and set the type2, unit2 and spell2 attributes to "cancelaura", "player" and In the button's OnLeave and on PLAYER_REGEN_DISABLED (entering combat), you hide the frame. So now you can right-click unsecure buffs out of combat. You're actually right-clicking an invisible frame intercepting the click to cancel the buff.

Satrina would've implemented something like this if she was still working on the mod. Satrina was spooky-level genius, not just for the tremendous amount of math contributed to warrior mechanics over the years. Before Blizzard simplified the combat log into easily-digestible events, she actually merged a running UNIT_COMBAT with the combat chats to derive a more precise log of what happened. It was freakishly brilliant.
you def know yer stuff, this macro for out of combat has already helped so much

Join the Conversation

Return to Forum