[request] Tracking cooldowns of spells with charges menu

User Tag List

Results 1 to 5 of 5
  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)

    [request] Tracking cooldowns of spells with charges

    So here's what I've got:
    /run if (GetSpellCharges("Lava Burst") == 1) and (GetSpellCooldown("Lava Burst") <= 3) then CastSpellByName("Lava Burst") end

    it casts any time I have 1 charge of lava burst, even if the second charge has 6 seconds left before it cools down. How would I get it to only cast lava burst when the second charge is 3 seconds or less away from being off CD?

    [request] Tracking cooldowns of spells with charges
  2. #2
    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)
    API GetSpellCharges - Wowpedia - Your wiki guide to the World of Warcraft
    Looking at GetSpellCharges, there's a return for cooldownDuration. Would I be able to utilize this to get the macro to do what I want, and if so how?

    Sorry I'm not very good at scripting at all any help is appreciated.

  3. #3
    Sigiloso's Avatar Member
    Reputation
    2
    Join Date
    Dec 2013
    Posts
    5
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In before complaining about necro, Ive been googling all day and came to this thread, I need to know exactly the same, an example for spellcharges api usage. For example Fire Blast currently in legion, goes from 2 to 4 charges depending on talents. I need to see an example to see the difference from the regular GetSpellCooldown api.

    for example: How to make:

    GetSpellCooldown("Fire Blast")==0

    into the new version of fireblast with multiple charges, how to check when it has 1 charge, 2 charges, 3 and 4.

    Best regards.

    Thanks in advance for the input.

  4. #4
    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)
    See if one of these functions helps you. Just run these code blob once per UI load (use a lua scratchpad addon, or make your own addon, or condense it in a large macro)

    Code:
    function SpellRechargeCurrentStacks(spell,fractional)
      --spell is the spell you want to check
      --fractional is a boolean, if its true/1/whatever, it'll return fractional charges in addition, such as 1.52 charges left instead of 1 charge left
      local currentcharges,maxcharges,chargestarttime,rechargerate = GetSpellCharges(spell)
      if not fractional or currentcharges==maxcharges then
        return (select(1,GetSpellCharges(spell)))
      else
        local currenttime = GetTime()
        return currentcharges+((currenttime-chargestarttime)/rechargerate)
      end  
    end
    
    function SpellRechargeMaxStacks(spell)
      return (select(2,GetSpellCharges(spell)))
    end
    
    function SpellRechargeTimeLeft(spell)
      --returns real time left of the current recharging spell charge
      if (select(4,GetSpellCharges(spell)))-(GetTime()-(select(3,GetSpellCharges(spell))))<660 then
        return (select(4,GetSpellCharges(spell)))-(GetTime()-(select(3,GetSpellCharges(spell))))
      else
        return 0
      end
    end
    Then you can be like
    SpellRechargeCurrentStacks("Lava Burst",1) --returns something like 1.78

    or

    SpellRechargeCurrentStacks("Lava Burst")>1 and SpellRechargeTimeLeft("Lava Burst")>3
    Last edited by Ssateneth; 04-18-2017 at 08:53 PM.
    KuRIoS is awesome!

  5. #5
    Boosthive's Avatar Member Elite Boosting Service CoreCoins Purchaser
    Reputation
    6
    Join Date
    Jun 2014
    Posts
    127
    Thanks G/R
    12/1
    Trade Feedback
    247 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You have to use it via some lua clean code? WA can easely help you with different charges etc

Similar Threads

  1. [Request]: Draenei Male -> Tauren Male (With helm fix and hair/tail fix)
    By Siegen in forum WoW ME Questions and Requests
    Replies: 7
    Last Post: 05-09-2008, 12:05 AM
  2. [Request] I need some help with lua script (boss on death)
    By Ellenor in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 03-03-2008, 03:47 PM
  3. [Request] More frost mage spells!
    By bgebnets1 in forum WoW ME Questions and Requests
    Replies: 0
    Last Post: 11-18-2007, 02:28 PM
  4. [Request] Tree of Life -> Skeleton with UD Male Cast Ani
    By soda in forum WoW ME Questions and Requests
    Replies: 0
    Last Post: 07-01-2007, 03:40 PM
  5. Trinket+Spell with no "Not ready yet" message.
    By Alkhara Majere in forum WoW UI, Macros and Talent Specs
    Replies: 2
    Last Post: 05-22-2007, 08:43 PM
All times are GMT -5. The time now is 02:57 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