Jump to content
  • Vanilla: ObjectManager.Me.GlobalCooldownEnabled always returns false


    Ordush
    • Version: All Product: WRobot General Type: Bug Status: Not a Bug

    I have long wondered why my fghtclasses spams spells.
    I just realized that ObjectManager.Me.GlobalCooldownEnabled  always returns false on vanilla. That explains it.
    Any way to fix this?



    User Feedback

    Recommended Comments

    1 hour ago, skeletonboy360 said:

    I used aquatic form to check gcd on mine. Anything with 0 cd would work. 

    if (SpellManager.GetSpellCooldownTimeLeft(“Aquatic Form”) > 0)

    return. 

    Thanks for the tip.
    The issue with that is just that you need to have the spell on the action bar in vanilla for that to work. ?

    Link to comment
    Share on other sites

    @Ordush 

    @Droidz

    public static float GetGlobalCooldown()
        {
            string luaString = @"
            local i = 1
            while true do
                local spellName, spellRank = GetSpellName(i, BOOKTYPE_SPELL);
                if not spellName or i >= 10 then
                    break;
                end
       
                local start, duration, enabled = GetSpellCooldown(i, BOOKTYPE_SPELL);
                if enabled == 1 and start > 0 and duration > 0 then
                    local cooldownLeft = duration - (GetTime() - start)
                    --DEFAULT_CHAT_FRAME:AddMessage('GCD check for ' .. spellName .. ' ' .. cooldownLeft);
                    if (cooldownLeft < 1500 and cooldownLeft ~= 0) then
                        return cooldownLeft / 1000;
                    end
                end
    
                i = i + 1;
            end
    
            return 0;
            ";
    
            return Lua.LuaDoString<float>(luaString);
        }

    Correct me if I'm wrong, but this should work (pure Lua, vanilla). Checks 10 first spells in spellbook for their cd. Rogues have 1 second GCD tho, so idk

    Link to comment
    Share on other sites

    3 hours ago, Matenia said:

    @Ordush 

    @Droidz

    
    public static float GetGlobalCooldown()
        {
            string luaString = @"
            local i = 1
            while true do
                local spellName, spellRank = GetSpellName(i, BOOKTYPE_SPELL);
                if not spellName or i >= 10 then
                    break;
                end
       
                local start, duration, enabled = GetSpellCooldown(i, BOOKTYPE_SPELL);
                if enabled == 1 and start > 0 and duration > 0 then
                    local cooldownLeft = duration - (GetTime() - start)
                    --DEFAULT_CHAT_FRAME:AddMessage('GCD check for ' .. spellName .. ' ' .. cooldownLeft);
                    if (cooldownLeft < 1500 and cooldownLeft ~= 0) then
                        return cooldownLeft / 1000;
                    end
                end
    
                i = i + 1;
            end
    
            return 0;
            ";
    
            return Lua.LuaDoString<float>(luaString);
        }

    Correct me if I'm wrong, but this should work (pure Lua, vanilla). Checks 10 first spells in spellbook for their cd. Rogues have 1 second GCD tho, so idk

    Yep works. I already pointed Droidz towards your shit Schaka. ?

    Link to comment
    Share on other sites



    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

×
×
  • Create New...