Thread Tools Display Modes
12-23-11, 02:34 AM   #1
Verttex
Super Monkey
 
Verttex's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 297
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. -_-.
__________________
  Reply With Quote
12-23-11, 02:52 AM   #2
Dridzt
A Pyroguard Emberseer
 
Dridzt's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2005
Posts: 1,359
Not possible.

Macros work with very specific conditions, presence of a buff is not among them.
  Reply With Quote
12-23-11, 03:06 AM   #3
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
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.
  Reply With Quote
12-23-11, 07:52 AM   #4
Verttex
Super Monkey
 
Verttex's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 297
Originally Posted by Phanx View Post
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!
__________________
  Reply With Quote
01-13-12, 09:44 AM   #5
afonso.lage
A Kobold Labourer
Join Date: Jan 2012
Posts: 1
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
  Reply With Quote
01-13-12, 11:43 AM   #6
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,313
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).
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote
01-14-12, 08:41 PM   #7
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
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.
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » Macro Help » Levitate Macro

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off