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,360
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,325
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

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


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