WoWInterface

WoWInterface (http://www.wowinterface.com/forums/index.php)
-   Macro Help (http://www.wowinterface.com/forums/forumdisplay.php?f=140)
-   -   Levitate Macro (http://www.wowinterface.com/forums/showthread.php?t=42199)

Verttex 12-23-11 02:34 AM

Levitate Macro
 
Can someone write a macro that casts Levitate on a target/self but if it casts it on yourself it checks to whether or not you have it and if you do it debuffs it?

Sorry its kind of hard to explain. -_-.

Dridzt 12-23-11 02:52 AM

Not possible.

Macros work with very specific conditions, presence of a buff is not among them.

Phanx 12-23-11 03:06 AM

You would need to use a modifier key to cancel the buff (and decide on your own when to use it), since macros cannot change which action they perform depending on whether or not you have a specific buff (or debuff).

Code:

/cancelaura [mod:shift] Levitate
/stopmacro [mod:shift]
/cast [help, nomod] [@player] Levitate

... will cancel Levitate if you hold the shift key, cast Levitate on your target if it is friendly and you are not holding any modifier key, or cast Levitate on yourself otherwise.

Verttex 12-23-11 07:52 AM

Quote:

Originally Posted by Phanx (Post 249944)
You would need to use a modifier key to cancel the buff (and decide on your own when to use it), since macros cannot change which action they perform depending on whether or not you have a specific buff (or debuff).

Code:

/cancelaura [mod:shift] Levitate
/stopmacro [mod:shift]
/cast [help, nomod] [@player] Levitate

... will cancel Levitate if you hold the shift key, cast Levitate on your target if it is friendly and you are not holding any modifier key, or cast Levitate on yourself otherwise.

Works great. Thanks!

afonso.lage 01-13-12 09:44 AM

I'm new with this forum, and with macros/addons but, what if you use UnitBuff to check if it has a buff active and do it?


Something like that:

/run for i=1,40 do local name,_,_,_,_,_,_,_,_=UnitBuff("player",i);if name and name == "Levitate" then CancelUnitBuff("player", i) end end

SDPhantom 01-13-12 11:43 AM

There's 2 problems with that, I think CancelUnitBuff() is a protected function, meaning not even a script can run it. Even if it wasn't, there wouldn't be a way to pass the condition through to affect the decision on whether or not to cast the spell since that's a protected function too (and so is StopMacro() that is called by the command /stopmacro).

Phanx 01-14-12 08:41 PM

Basically, Blizzard does not want addons/macros to be able to automatically check conditions and choose which ability to use. They want the player to have to make that decision.

They have given us a very limited number of conditions we can check for in macros, but if there is no macro conditional available for something you want to check, then there is no way for an addon or macro to be able to check it and choose which spell to cast on the fly.

If you only want your button to work out of combat, you can get around the restrictions by writing an addon that responds to events, checks conditions, and edits a macro or sets attributes on a secure action button, but there is no way to make this work in combat. All of the functions for editing macros, changing button attributes, casting spells, running macros, targeting units, stopping macros, etc. are protected and cannot be called by addons.

Even if you found a loophole, Blizzard would hotfix it immediately.


All times are GMT -6. The time now is 12:14 AM.

vBulletin © 2014, Jelsoft Enterprises Ltd
©2012 ZAM Network LLC