private void PreguntarSiNOactivo_Tick(object sender, EventArgs e) { PreguntarSiNOactivo.Interval = 5000; Process[] LoL = Process.GetProcessesByName("League of Legends"); if (LoL.Length < 1) { this.Hide(); // Arrays remove SharkiQuerys.Hechizos.RemoveRange(0, SharkiQuerys.Hechizos.Count - 1); SharkiQuerys.Enemigos.RemoveRange(0, SharkiQuerys.Enemigos.Count - 1); PreguntarSiActivo.Start(); PreguntarSiNOactivo.Stop(); } }
private void PreguntarSiActivo_Tick(object sender, EventArgs e) { PreguntarSiActivo.Interval = 5000; Process[] LoL = Process.GetProcessesByName("League of Legends"); if (LoL.Length > 0) { SharkiQuerys.Obtener_Enemigos(); if (!String.IsNullOrEmpty(SharkiQuerys._controlar_excepcion)) { PreguntarSiActivo.Stop(); MessageBox.Show("Es probable que el nombre de invocador introducido no coincida con el nombre de invocador de la " + "partida o que el modo de juego en el que se está jugando actualmente no esté implementado. ", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); SharkiQuerys._controlar_excepcion = ""; this.Close(); Ventana.Show(); return; } else { for (int i = 0; i < ImagenCampeon.Count(); i++) { ImagenCampeon[i].ImageLocation = "http://opgg-static.akamaized.net/images/lol/champion/" + SharkiQuerys.Enemigos[i].Image.Full; } for (int j = 0; j < ImagenHechizos.Count(); j++) { ImagenHechizos[j].ImageLocation = "http://ddragon.leagueoflegends.com/cdn/6.24.1/img/spell/" + SharkiQuerys.Hechizos[j].Image.Full; } } this.Show(); PreguntarSiActivo.Stop(); PreguntarSiNOactivo.Start(); } }