Jump to content

[Request Plugin] close bot/client after X minutes when character can't reach corpse


Recommended Posts

Hello,

using System.Threading;
using robotManager.Helpful;
using wManager.Wow.Helpers;
using wManager.Wow.ObjectManager;

public class Main : wManager.Plugin.IPlugin
{
    private bool _isStarted;
    public void Initialize()
    {
        _isStarted = true;
        var stopWatch = new System.Diagnostics.Stopwatch();
        while (_isStarted)
        {
            if (Conditions.InGameAndConnectedAndProductStartedNotInPause)
            {
                if (ObjectManager.Me.IsDeadMe && stopWatch.Elapsed.TotalMinutes > 5)
                {
                    Logging.Write("Bot is dead for more than 5 minutes, closing game.");
                    wManager.Wow.Memory.WowMemory.CloseHookedProcess();
                    _isStarted = false;
                }
                else if (ObjectManager.Me.IsDeadMe)
                {
                    stopWatch.Start();
                }
                else
                {
                    stopWatch.Reset();
                }
            }
            Thread.Sleep(500);
        }
    }

    public void Dispose()
    {
        _isStarted = false;
    }

    public void Settings()
    {
    }
}

 

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...