IsTibiaActive() public static method

public static IsTibiaActive ( ) : bool
return bool
Ejemplo n.º 1
0
 public void RefreshHealth()
 {
     try {
         bool visible = ProcessManager.IsTibiaActive();
         this.Invoke((MethodInvoker) delegate {
             RefreshHUD();
             this.Visible = alwaysShow ? true : visible;
         });
     } catch {
     }
 }
Ejemplo n.º 2
0
 private void updateTimer_Tick()
 {
     health = (float)MemoryReader.Health / MemoryReader.MaxHealth;
     mana   = (float)MemoryReader.Mana / MemoryReader.MaxMana;
     if (!alwaysShow)
     {
         try {
             bool visible = ProcessManager.IsTibiaActive();
             this.Invoke((MethodInvoker) delegate {
                 this.Visible = visible;
             });
         } catch {
         }
     }
     this.Invalidate();
 }
Ejemplo n.º 3
0
 private void CheckTimer_Tick(object sender, EventArgs e)
 {
     try {
         bool tibiaActive = ProcessManager.IsTibiaActive();
         if (tibiaActive && !this.Visible)
         {
             this.Invoke((MethodInvoker) delegate {
                 this.Visible = true;
             });
         }
         else if (!tibiaActive && this.Visible)
         {
             this.Invoke((MethodInvoker) delegate {
                 this.Visible = false;
             });
         }
     } catch { }
 }
Ejemplo n.º 4
0
        private void RefreshStats()
        {
            long life = 0, maxlife = 1, mana = 0, maxmana = 1;

            life    = MemoryReader.Health;
            maxlife = MemoryReader.MaxHealth;
            mana    = MemoryReader.Mana;
            maxmana = MemoryReader.MaxMana;
            double lifePercentage = (double)life / maxlife;
            double manaPercentage = (double)mana / maxmana;

            try {
                bool visible = ProcessManager.IsTibiaActive();
                this.Invoke((MethodInvoker) delegate {
                    RefreshHUD(lifePercentage, manaPercentage);
                    this.Visible = alwaysShow ? true : visible;
                });
            } catch { }
        }
Ejemplo n.º 5
0
 private void ShowTimer_Tick(object sender, EventArgs e)
 {
     if (alwaysShow)
     {
         return;
     }
     if (ProcessManager.IsFlashClient())
     {
         return;
     }
     try {
         if (showTimer == null || this.IsDisposed || this.Disposing)
         {
             return;
         }
         // only show the suspended window when tibia is active
         bool visible = ProcessManager.IsTibiaActive();
         this.BeginInvoke((MethodInvoker) delegate {
             this.Visible = alwaysShow ? true : visible;
         });
     } catch {
     }
 }
Ejemplo n.º 6
0
        public void RefreshHealth()
        {
            long life = 0, maxlife = 1;

            if (statusType == StatusType.Health)
            {
                life    = MemoryReader.Health;
                maxlife = MemoryReader.MaxHealth;
            }
            else if (statusType == StatusType.Mana)
            {
                life    = MemoryReader.Mana;
                maxlife = MemoryReader.MaxMana;
            }
            else if (statusType == StatusType.Experience)
            {
                int  level          = MemoryReader.Level;
                long baseExperience = GetExperience(level - 1);
                life    = MemoryReader.Experience - baseExperience;
                maxlife = GetExperience(level) - baseExperience;
            }
            if (maxlife == 0)
            {
                life    = 1;
                maxlife = 1;
            }
            double percentage = (double)life / maxlife;

            try {
                bool visible = ProcessManager.IsTibiaActive();
                this.Invoke((MethodInvoker) delegate {
                    RefreshHUD(life, maxlife, percentage);
                    this.Visible = alwaysShow ? true : visible;
                });
            } catch {
            }
        }