Esempio n. 1
0
        private void MainPanelTimer_Tick(object sender, EventArgs e)
        {
            try
            {
                if (_playerName != ObjectManager.Me.Name && !string.IsNullOrEmpty(ObjectManager.Me.Name) &&
                    ObjectManager.Me.IsValid)
                {
                    Thread.Sleep(1000);
                    if (_playerName != ObjectManager.Me.Name && !string.IsNullOrEmpty(ObjectManager.Me.Name) &&
                        ObjectManager.Me.IsValid)
                    {
                        Logging.WriteError(nManager.Translate.Get(nManager.Translate.Id.PlayerNameChanged));
                        Pulsator.Dispose(true);
                    }
                }

                if (ObjectManager.Me.IsValid)
                {
                    if (Health.Value < ObjectManager.Me.HealthPercent || Health.Value > ObjectManager.Me.HealthPercent)
                    {
                        Health.Value = (int)ObjectManager.Me.HealthPercent;
                    }
                    toolTip.SetToolTip(Health, ObjectManager.Me.Health + "/" + ObjectManager.Me.MaxHealth);
                }
                else
                {
                    Health.Value = 0;
                    toolTip.SetToolTip(Health, "0/" + ObjectManager.Me.MaxHealth);
                }
                if (Products.IsStarted && ObjectManager.Me.IsValid)
                {
                    XPPerHour.Text                = Statistics.ExperienceByHr().ToString();
                    HonorPerHour.Text             = Statistics.HonorByHr().ToString();
                    LootsCount.Text               = Statistics.Loots + " (" + Statistics.LootsByHr() + "/" + nManager.Translate.Get(nManager.Translate.Id.hr) + ")";
                    UnitKillsCount.Text           = Statistics.Kills + " (" + Statistics.KillsByHr() + "/" + nManager.Translate.Get(nManager.Translate.Id.hr) + ")";
                    DeathsCount.Text              = Statistics.Deaths + " (" + Statistics.DeathsByHr() + "/" + nManager.Translate.Get(nManager.Translate.Id.hr) + ")";
                    FarmsCount.Text               = Statistics.Farms + " (" + Statistics.FarmsByHr() + "/" + nManager.Translate.Get(nManager.Translate.Id.hr) + ")";
                    ProductStartedSinceLabel.Text = "Product started since : " + Others.SecToHour((Statistics.RunningTimeInSec()));
                }
                else if (!Products.IsStarted && ObjectManager.Me.IsValid)
                {
                    ProductStartedSinceLabel.Text = "";
                }
                if (ObjectManager.Target.IsValid)
                {
                    TargetName.Text = ObjectManager.Target.Name;
                    if (TargetHealth.Value < ObjectManager.Target.HealthPercent || TargetHealth.Value > ObjectManager.Target.HealthPercent)
                    {
                        TargetHealth.Value = (int)ObjectManager.Target.HealthPercent;
                    }
                    toolTip.SetToolTip(TargetHealth, ObjectManager.Target.Health + "/" + ObjectManager.Target.MaxHealth);
                    TargetLevel.Text = ObjectManager.Target.Level.ToString();
                }
                else
                {
                    TargetName.Text    = @"-";
                    TargetHealth.Value = 0;
                    toolTip.SetToolTip(TargetHealth, "0/1");
                    TargetLevel.Text = @"-";
                }
                Logging.Log log = Logging.ReadLast(Logging.LogType.S);
                LatestLog.Text            = log.ToString();
                LatestLog.ForeColor       = log.Color;
                BotStartedSinceLabel.Text = nManager.Translate.Get(nManager.Translate.Id.tnb_started_since) + @" : " + Others.SecToHour((Others.Times - LoginServer.StartTime) / 1000);
            }
            catch (Exception ex)
            {
                Logging.WriteError("Main > gameInformationTimer_Tick(object sender, EventArgs e): " + ex);
            }

            if (Display.WindowInTaskBarre(Memory.WowProcess.MainWindowHandle) &&
                Products.IsStarted)
            {
                if (!_wowInTaskBarre)
                {
                    _wowInTaskBarre = true;
                    Display.ShowWindow(Memory.WowProcess.MainWindowHandle);
                }
            }
            else
            {
                _wowInTaskBarre = false;
            }
        }
Esempio n. 2
0
 private void Main_FormClosed(object sender, FormClosedEventArgs e)
 {
     Pulsator.Dispose(true);
 }