此站点大量使用JavaScript。
请在您的浏览器中启用JavaScript。
正式服
PTR
10.2.7
PTR
10.2.6
Beta
Cancelaura macro with a twist
发表回复
返回主列表
发布者
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?
发布者
pelf
Cancelaura is not protected still, AFAIK, so yeah, you could probably do this. I don't know the exact API though.
发布者
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. ^^
发布者
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
发布者
Breadzilla
Thank you so very much Wildhorn! I appreciate it!
发布者
179389
This post was from a user who has deleted their account.
发布者
Wildhorn
@ignayshus: It doesnt.
发布者
179389
This post was from a user who has deleted their account.
发布者
Breadzilla
Well scratch that, it actually just doesn't work.. any suggestions?
发布者
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.
发布者
pelf
Wouldn't that be...
if expires and expires <= 60 then
...?
发布者
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()
发布者
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.
发布者
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.
发布者
179389
This post was from a user who has deleted their account.
发布者
HighFive
How do people not know or at least check what format are the values returned in? (hint: it's a constant)
发布者
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).
发布者
HighFive
/cheer
发表回复
您没有登录。请
登录
发表回复或
注册
如果您还没有账号。