示例#1
0
        // Nothing here :)
        #endregion

        #region yarWorker
        public void YarWorker()
        {
            while (true)
            {
                // Handle errors and other strange situations
                ErrorHandling();

                _bs.PluginPulse    = DateTime.Now.Ticks;
                _bs.IsRunning      = BotMain.IsRunning;
                _bs.IsLoadingWorld = ZetaDia.IsLoadingWorld;
                _bs.Coinage        = 0;
                try
                {
                    if (ZetaDia.Me != null)
                    {
                        _bs.Coinage = ZetaDia.Me.Inventory.Coinage;
                    }
                }
                catch (System.Exception ex)
                {
                    _bs.Coinage = -1;
                }

                if (BotMain.IsPaused || BotMain.IsPausedForStateExecution)
                {
                    _bs.IsPaused = true;
                }
                else if (BotMain.IsRunning)
                {
                    _bs.IsPaused = false;
                    _bs.LastRun  = DateTime.Now.Ticks;
                }
                else
                {
                    _bs.IsPaused = false;
                }

                if (ZetaDia.IsInGame)
                {
                    _bs.LastGame = DateTime.Now.Ticks;
                    _bs.IsInGame = true;
                }
                else
                {
                    if (_bs.IsInGame)
                    {
                        Send("GameLeft", true);
                        Send("NewMonsterPowerLevel", true); // Request Monsterpower level
                    }
                    _bs.IsInGame = false;
                }

                // Send stats
                Send("XML:" + _bs.ToXmlString(), xml: true);
                Thread.Sleep(3000);
            }
        }
示例#2
0
        public void YarWorker()
        {
            Log("YAR Worker Thread Started");
            while (true)
            {
                try
                {
                    if (BotMain.BotThread != null)
                    {
                        _bs.IsRunning = BotMain.BotThread.IsAlive;
                    }
                    else
                    {
                        _bs.IsRunning = false;
                    }

                    bool isInGame = false;
                    try
                    {
                        isInGame = ZetaDia.IsInGame;
                    }
                    catch { }
                    // Calculate game runs
                    if (isInGame)
                    {
                        _bs.LastGame = DateTime.UtcNow.Ticks;
                        _bs.IsInGame = true;
                    }
                    else
                    {
                        if (_bs.IsInGame)
                        {
                            Send("GameLeft", true);
                            Send("NewDifficultyLevel", true); // Request Difficulty level
                        }
                        _bs.IsInGame = false;
                    }

                    // Send stats
                    Send("XML:" + _bs.ToXmlString(), xml: true);

                    LogWorker();

                    Thread.Sleep(750);
                }
                catch (ThreadAbortException)
                {
                    Log("YAR Thread Aborted");
                }
                catch (Exception ex)
                {
                    LogException(ex);
                }
            }
        }
示例#3
0
        // Nothing here :)
        #endregion

        #region yarWorker
        public void YarWorker()
        {
            while (true)
            {
                _bs.PluginPulse = DateTime.Now.Ticks;
                _bs.IsRunning   = BotMain.IsRunning;

                // Send stats
                Send("XML:" + _bs.ToXmlString(), xml: true);
                Thread.Sleep(3000);
            }
        }
示例#4
0
        // Nothing here :)
        #endregion

        #region yarWorker
        public void YarWorker()
        {
            while (true)
            {
                if (ZetaDia.Memory.Process.HasExited)
                {
                    Send("D3Exit");
                    Log("Attempting to safely close Demonbuddy");
                    SafeCloseProcess();
                    return;
                }

                _bs.IsRunning = BotMain.IsRunning;
                _bs.IsPaused  = BotMain.IsPaused;

                // Send stats
                Send("XML:" + _bs.ToXmlString(), xml: true);
                Thread.Sleep(750);
            }
        }
示例#5
0
        // Nothing here :)
        #endregion

        #region yarWorker
        public void YarWorker()
        {
            while (true)
            {
                if (ZetaDia.Memory.Process.HasExited)
                {
                    Send("D3Exit");
                    Log("Attempting to safely close Demonbuddy");
                    SafeCloseProcess();
                    return;
                }

                _bs.IsRunning = BotMain.IsRunning;

                // Handle errors and other strange situations
                ErrorHandling();

                // Send stats
                Send("XML:" + _bs.ToXmlString(), xml: true);
                Thread.Sleep(750);
            }
        }