[Macro][Request] How do I track debuff durations? menu

User Tag List

Results 1 to 7 of 7
  1. #1
    fedelis's Avatar Active Member
    Reputation
    58
    Join Date
    Jul 2008
    Posts
    54
    Thanks G/R
    7/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Macro][Request] How do I track debuff durations?

    Looking for a lua script I can run to check if my target has corruption, if not cast corruption, if it does then if it has less than or equal to 5 seconds recast it.

    I really suck at lua/scripting in general, so the way I was going to do it was as two parts.

    /run if not UnitDebuff("target", "Corruption", unitCaster~="player") then CastSpellByName("Corruption") end
    /run if UnitDebuff("target", "Corruption", unitCaster~="player") and expirationTime-GetTime()<6 then CastSpellByName("Corruption") end


    First line works fine, second line doesn't work at all. Any help would be greatly appreciated!

    [Macro][Request] How do I track debuff durations?
  2. #2
    ev0's Avatar ★ Elder ★ murlocs.com

    CoreCoins Purchaser Authenticator enabled
    Reputation
    1850
    Join Date
    Jul 2012
    Posts
    2,737
    Thanks G/R
    313/377
    Trade Feedback
    16 (100%)
    Mentioned
    7 Post(s)
    Tagged
    7 Thread(s)
    change: expirationTime to expires and < 6 to < 600 (it's in milliseconds)

    http://wowprogramming.com/docs/api/UnitDebuff

    //edit, i can't test until i get home, i'm just looking at API calls from work
    Need a guild in the US? Visit murlocs.com

  3. #3
    fedelis's Avatar Active Member
    Reputation
    58
    Join Date
    Jul 2008
    Posts
    54
    Thanks G/R
    7/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Tried the following on a target with corruption at 4 seconds and it still didn't work Thanks for the input though!

    /run if UnitDebuff("target", "Corruption", unitCaster~="player") and expires-GetTime()<600 then CastSpellByName("Corruption") end

  4. #4
    ev0's Avatar ★ Elder ★ murlocs.com

    CoreCoins Purchaser Authenticator enabled
    Reputation
    1850
    Join Date
    Jul 2012
    Posts
    2,737
    Thanks G/R
    313/377
    Trade Feedback
    16 (100%)
    Mentioned
    7 Post(s)
    Tagged
    7 Thread(s)
    I'll take a peek when i get home, another 2-3 hours.
    Need a guild in the US? Visit murlocs.com

  5. #5
    seasick's Avatar Sergeant
    Reputation
    16
    Join Date
    Aug 2013
    Posts
    49
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    dont you need to give expirationTime a value before you use it or am I missing something?

    you need to add
    name, rank, icon, count, dispelType, duration, expires = UnitDebuff(whatever)

    into the macro before you can use expires



    edit: try this

    /run expires=select(7,UnitDebuff("target", "Corruption")) if not expires or (expires-GetTime())<6 then CastSpellByName("Corruption") end
    Last edited by seasick; 05-20-2015 at 07:42 PM.

  6. #6
    Ssateneth's Avatar Contributor
    Reputation
    141
    Join Date
    May 2008
    Posts
    866
    Thanks G/R
    0/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello. No need to declare a variable. I will help.

    You had this.

    Code:
    /run if not UnitDebuff("target", "Corruption", unitCaster~="player") then CastSpellByName("Corruption") end 
    /run if UnitDebuff("target", "Corruption", unitCaster~="player") and expirationTime-GetTime()<6 then CastSpellByName("Corruption") end
    Switch it up to this.

    Code:
    /run if not UnitDebuff("target", "Corruption", "", "player") or (select(7,UnitDebuff("target","Corruption","","player")))-GetTime()<6 then CastSpellByName("Corruption") end
    You forgot the 3rd argument in UnitDebuff, the spell's rank. It's a required argument if you want to filter the owner of the spell (the 4th argument). Most spell ranks are empty, hence the "". Also the 7th return can be directly compared to GetTime, both of which work in seconds and not milliseconds. The only useful return I know of that works in milliseconds and not seconds is unit casting/channel info's start/end/duration times.
    Last edited by Ssateneth; 05-20-2015 at 08:03 PM.
    KuRIoS is awesome!

  7. Thanks fedelis (1 members gave Thanks to Ssateneth for this useful post)
  8. #7
    fedelis's Avatar Active Member
    Reputation
    58
    Join Date
    Jul 2008
    Posts
    54
    Thanks G/R
    7/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks a lot for the help guys it works great now!

Similar Threads

  1. [Request] How to change territory...
    By Ellenor in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 01-31-2008, 10:49 AM
  2. [Request] How to change instance Level?
    By Ellenor in forum World of Warcraft Emulator Servers
    Replies: 6
    Last Post: 01-29-2008, 07:42 AM
  3. [Request]How to change casting bar.
    By benny10 in forum WoW UI, Macros and Talent Specs
    Replies: 1
    Last Post: 11-29-2007, 09:39 AM
  4. Lock 19BG Macro Request
    By Herzeleid in forum WoW UI, Macros and Talent Specs
    Replies: 10
    Last Post: 07-03-2007, 05:52 PM
  5. Rogue blind macro request
    By albundy_1 in forum World of Warcraft General
    Replies: 2
    Last Post: 03-22-2007, 09:23 AM
All times are GMT -5. The time now is 07:14 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search