Ce site requiert JavaScript pour fonctionner.
Veuillez activer JavaScript dans votre navigateur.
Live
RPT
10.2.7
RPT
10.2.6
Bêta
Cancelaura macro with a twist
Répondre
Retourner à l'index
Publication par
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?
Publication par
pelf
Cancelaura is not protected still, AFAIK, so yeah, you could probably do this. I don't know the exact API though.
Publication par
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. ^^
Publication par
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
Publication par
Breadzilla
Thank you so very much Wildhorn! I appreciate it!
Publication par
179389
This post was from a user who has deleted their account.
Publication par
Wildhorn
@ignayshus: It doesnt.
Publication par
179389
This post was from a user who has deleted their account.
Publication par
Breadzilla
Well scratch that, it actually just doesn't work.. any suggestions?
Publication par
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.
Publication par
pelf
Wouldn't that be...
if expires and expires <= 60 then
...?
Publication par
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()
Publication par
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.
Publication par
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.
Publication par
179389
This post was from a user who has deleted their account.
Publication par
HighFive
How do people not know or at least check what format are the values returned in? (hint: it's a constant)
Publication par
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).
Publication par
HighFive
/cheer
Répondre
Vous n'êtes pas connecté. Veuillez vous
connecter
pour répondre à ce sujet, ou
vous inscrire
si vous n'avez pas déjà un compte.