This site makes extensive use of JavaScript.
Please enable JavaScript in your browser.
Live
PTR
10.2.5
PTR
10.2.6
Cancelaura macro with a twist
Post Reply
Return to board index
Post by
Breadzilla
Is there any way to create a cancelaura macro that works even if you spam?
Using
/cancelaura Deterrence
/cast Deterrence and my spamming just really kills me with it, is there any way to create a version of that, that doesn't cancel the deterrence within a certain amount of time from activation or something?
Post by
pelf
Cancelaura is not protected still, AFAIK, so yeah, you could probably do this. I don't know the exact API though.
Post by
Breadzilla
Well I appreciate that info, pelf.
If anyone has knowledge of the API pertaining to this task, I'd extremely appreciate it if you help me out. ^^
Post by
Wildhorn
#showtooltip Deterrance
/run if gTime then if gTime <= (GetTime() - 2) then CancelUnitBuff("player", "Deterrance") end end
/cast Deterrance
/run local _, _, _, count = UnitAura("player", "Deterrance") if count then gTime = GetTime() else gTime = nil end
Replace the 2 by the amount of seconds you want to wait before being able to cancel it.
EDIT: 16... 17 edits ftw :P
Post by
Breadzilla
Thank you so very much Wildhorn! I appreciate it!
Post by
ignayshus
I think you could also do
#show Deterrence
/castsequence reset=2 Deterrence,,,,,,,,
I assume about 4 commas per second, so if you spammed this it'd cancel your deterrence in about 2 seconds.
This assumes that spamming
/cast deterrence
would cancel the aura.
Post by
Wildhorn
@ignayshus: It doesnt.
Post by
ignayshus
<--- too lazy to check, so thanks for the heads up :)
Post by
Breadzilla
Well scratch that, it actually just doesn't work.. any suggestions?
Post by
Wanderingfox
Why so complex Wildhorn?
OP, give this a try:
#showtooltip Detterance
/run local _,_,_,_,_,_,expires = UnitAura("player", "Deterrance") if expires <= 60 and expires ~= nil then CancelUnitBuff("player", "Deterrance") end
/cast Detterance
/run UIErrorsFrame:Clear()
The last line is just there to clear up the "This ability is not ready text" feel free to omit. Also, the 60 is the number of seconds you want LEFT on deterrence in order for it to break, so if you want it to cancel 10 seconds or more into the spell, you'd use 80.
Post by
pelf
Wouldn't that be...
if expires and expires <= 60 then
...?
Post by
Wanderingfox
same thing. I'm just lazy, and I hadn't originally included the nil check, so I just tacked it onto the end XD
edit:
If you want to get really technical, the shortest implementation would probably be something like:
#showtooltip Detterance
/run local d_,_,_,_,_,_,e="Deterrance",UnitAura("player",d) if e and e<61 then CancelUnitBuff("player",d)end
/cast Detterance
/run UIErrorsFrame:Clear()
Post by
Breadzilla
Wanderingfox's works, as in the macro executes (although after fixing the spelling on Deterrence) but I'm a bit confused with the e<61 part, could you possibly explain?
Edit: Apparently it doesn't cancel either, only casts.
Post by
pelf
same thing. I'm just lazy, and I hadn't originally included the nil check, so I just tacked it onto the end XD
Well, if you don't put the null check first, it won't short circuit.
Post by
ignayshus
/run local p,d="player","Deterrence" if UnitBuff(p, d) and (GetSpellCooldown(d) < 89) then CancelUnitBuff(p, d) end
/cast Deterrence
/run UIErrorsFrame:Clear()
play with the GetSpellCooldown value til you get it where you want it. You could also use the "<=" symbol instead of "<" but then you'll probably want to drop the value to at least "88"
Post by
HighFive
How do people not know or at least check what format are the values returned in? (hint: it's a constant)
Post by
Wanderingfox
Wanderingfox's works, as in the macro executes (although after fixing the spelling on Deterrence) but I'm a bit confused with the e<61 part, could you possibly explain?
Edit: Apparently it doesn't cancel either, only casts.
Try this my shortened macro may be wrong:
#showtooltip Deterrence
/run local _,_,_,_,_,_,expires = UnitAura("player", "Deterrence") if expires and expires <= 3 then CancelUnitBuff("player", "Deterrence") end
/cast Deterrence
/run UIErrorsFrame:Clear()
To answer your question, the expires <= 3 part is a time check. Expires is set to the REMAINING time on your deterrence buff by the UnitAura call, and then it's checked against how many seconds you want remaining on the buff before you can cancel it. In other words, it's the opposite of what you had originally asked for. Instead of waiting x seconds before canceling, it waits until the buff duration is at 5-x seconds where x is how long you want to wait before canceling it.
edit:
I'm a moron... Fixed all the numbers to relate to the fact that it's checking the AURA time, not the cooldown.
edit2:
Actually tested returned data from expires, wasn't what I expected. Apparently it returns an absolute time in seconds rather than a relative one. Use:
#showtooltip Deterrence
/run local _,_,_,_,_,_,expires = UnitAura("player", "Deterrence") if expires and expires - GetTime() <= 3 then CancelUnitBuff("player", "Deterrence") end
/cast Deterrence
/run UIErrorsFrame:Clear()
How do people not know or at least check what format are the values returned in? (hint: it's a constant)
Because I've never used that part of the API and the documentation of the WoW API in general is absolutely awful?
edit3:
Last macro in this post works (verified it myself using evasion).
Post by
HighFive
/cheer
Post Reply
You are not logged in. Please
log in
to post a reply or
register
if you don't already have an account.