Jump to content

Droidz

Administrators
  • Posts

    12431
  • Joined

  • Last visited

Bug Report Comments posted by Droidz

  1. Maybe I do error with enabled https://wowpedia.fandom.com/wiki/API_GetItemCooldown, seems return true when item is ready, try:

            robotManager.Events.FiniteStateMachineEvents.OnRunState += (engine, state, cancelable) =>
            {
                int itemId = 1234;
                int questId = 1234;
    
                if (!wManager.Wow.Helpers.Conditions.InGameAndConnectedAndAliveAndProductStartedNotInPause)
                    return;
                if (wManager.Wow.Helpers.Conditions.IsAttackedAndCannotIgnore)
                    return;
    
                if (state.DisplayName == "Quester")
                {
                    if (wManager.Wow.Helpers.Quest.HasQuest(questId) &&
                        !wManager.Wow.Helpers.Lua.LuaDoString<bool>("local start, duration, enable = GetItemCooldown("+ itemId + "); return enable;"))
                    {
                        cancelable.Cancel = true;
                    }
                }
            };

    or

           robotManager.Events.FiniteStateMachineEvents.OnRunState += (engine, state, cancelable) =>
            {
                int itemId = 1234;
                int questId = 1234;
    
                if (!wManager.Wow.Helpers.Conditions.InGameAndConnectedAndAliveAndProductStartedNotInPause)
                    return;
                if (wManager.Wow.Helpers.Conditions.IsAttackedAndCannotIgnore)
                    return;
    
                if (state.DisplayName == "Quester")
                {
                    if (wManager.Wow.Helpers.Quest.HasQuest(questId) &&
                        wManager.Wow.Helpers.Lua.LuaDoString<bool>("local start, duration, enable = GetItemCooldown("+ itemId + "); return start ~= nil and start > 0 and duration ~= nil and duration > 0;"))
                    {
                        cancelable.Cancel = true;
                    }
                }
            };

     

  2. Hi,

    Logging.Write("===================");
    var t = System.Diagnostics.Stopwatch.StartNew();
    
    uint id = 8326;
    var n = "Ghost";
    
    var s = System.Diagnostics.Stopwatch.StartNew();
    
    Logging.Write("TargetObject.HaveBuff(id) > " + wManager.Wow.ObjectManager.ObjectManager.Me.TargetObject.HaveBuff(id) + " > "  + s.ElapsedMilliseconds);
    s.Restart();
    
    Logging.Write("TargetObject.GetBuff(n) > " + wManager.Wow.ObjectManager.ObjectManager.Me.TargetObject.GetBuff(n) + " > "  + s.ElapsedMilliseconds);
    s.Restart();
    
    Logging.Write("Target.HaveBuff(id) > " + wManager.Wow.ObjectManager.ObjectManager.Target.HaveBuff(id) + " > "  + s.ElapsedMilliseconds);
    s.Restart();
    
    Logging.Write("Target.GetBuff(n) > " + wManager.Wow.ObjectManager.ObjectManager.Target.GetBuff(n) + " > "  + s.ElapsedMilliseconds);
    
    Logging.Write(t.ElapsedMilliseconds + " ms ========");

    I can't reproduce problem, if you can code that I can run for that.

    But it is better to use objectmanager.target to get character target (it is more safe and bot cache result)

×
×
  • Create New...