Jump to content

Droidz

Administrators
  • Posts

    12601
  • Joined

  • Last visited

Posts posted by Droidz

  1. Hello,

     Direct access (simple but not ideal) :

    // You can reset the counter to 0 directly
    wManager.Wow.Helpers.StuckResolver.StuckCount = 0;

    Differential approach :

    // At the beginning of your recovery step, save the current value
    int initialStuckCount = wManager.Wow.Helpers.StuckResolver.StuckCount;
    
    // ... your recovery logic ...
    
    // After recovery, calculate how many new stuck events occurred
    int newStuckEvents = wManager.Wow.Helpers.StuckResolver.StuckCount - initialStuckCount;
    
    // Reset the counter to what it was initially plus any new events
    wManager.Wow.Helpers.StuckResolver.StuckCount = initialStuckCount;

    Local counter with events :

    var localStuckCounter = 0;
    
    wManager.Events.MovementEvents.OnPulseStuckResolver += cancelable =>
    {
        localStuckCounter++;
        // cancelable.Cancel(); // if you want to cancel the automatic unstuck
    };
    
    // Use localStuckCounter instead of StuckResolver.StuckCount
    // Reset localStuckCounter = 0 after your recovery

     

  2. Hello,

    Try with this plugin Main.cs :

    using System.Threading;
    using wManager.Wow.Class;
    using wManager.Wow.Enums;
    using wManager.Wow.Helpers;
    
    public class Main : wManager.Plugin.IPlugin
    {
        const int SpellId = 46457;
        const int NpcId = 50041;
        
        public void Initialize()
        {
            robotManager.Events.FiniteStateMachineEvents.OnRunState += (engine, state, cancelable) =>
            {
                if (state is wManager.Wow.Bot.States.ToTown)
                {
                    MovementManager.StopMove();
                    new Spell(SpellId).Launch(true);
                    Thread.Sleep(5000);
    
                    var npc = new Npc
                    {
                        ContinentId = (ContinentId)Usefuls.ContinentId,
                        Name = "Field Repair Bot 75B",
                        Entry = NpcId,
                        Position = wManager.Wow.ObjectManager.ObjectManager.Me.Position,
                        Type = Npc.NpcType.Repair,
                        Faction = Npc.FactionType.Neutral
                    };
                    
                    NpcDB.ListNpc.RemoveAll(n => n.Active && n.Entry == npc.Entry && n.Type == npc.Type && n.ContinentId == npc.ContinentId && n.CurrentProfileNpc);
                    
                    NpcDB.AddNpc(npc, false, true);
                }
            };
        }
    
        public void Dispose()
        {
        }
    
        public void Settings()
        {
        }
    }

     

×
×
  • Create New...