Speak() public méthode

public Speak ( string speech ) : void
speech string
Résultat void
Exemple #1
0
        private void Obj_AI_Base_OnCreate(GameObject sender, EventArgs args)
        {
            if (!IsActive())
            {
                return;
            }

            foreach (Obj_AI_Hero hero in ObjectManager.Get <Obj_AI_Hero>())
            {
                if (hero.IsEnemy)
                {
                    foreach (var ability in Abilities)
                    {
                        if (sender.Name.Contains(ability.Key.SpellName))
                        {
                            ability.Key.Casted     = true;
                            ability.Key.TimeCasted = (int)Game.ClockTime;
                            if (SpellTimer.GetMenuItem("SAssembliesTimersSpellSpeech").GetValue <bool>())
                            {
                                Speech.Speak(ability.Key.Name + " casted on " + hero.ChampionName);
                            }
                            CreateText(ability.Key, hero, sender);
                        }
                    }
                }
            }
        }
        private async void Speak(SpeechMessage speech)
        {
            var service = new Speech();

            await this.dispatcher.RunAsync(
                CoreDispatcherPriority.Normal,
                async() =>
            {
                try
                {
                    if (speech.Action != null && speech.Action.Equals("STOP"))
                    {
                        this.player?.Stop();
                    }
                    else
                    {
                        service.Speak(this.player, speech);
                    }
                }
                catch (Exception e)
                {
                    await
                    this.SendResult(new ResultMessage(speech)
                    {
                        Result = e.Message, ResultId = e.HResult
                    });
                }
            });
        }
Exemple #3
0
        private void Game_OnGameUpdate(EventArgs args)
        {
            if (!IsActive() || lastGameUpdateTime + new Random().Next(500, 1000) > Environment.TickCount)
            {
                return;
            }

            lastGameUpdateTime = Environment.TickCount;

            if (RelicTimer.GetActive())
            {
                foreach (RelicObject relic in Relics)
                {
                    if (!relic.Locked && (relic.Obj != null && (!relic.Obj.IsValid || relic.Obj.IsDead)))
                    {
                        if (Game.ClockTime < relic.SpawnTime)
                        {
                            relic.NextRespawnTime = relic.SpawnTime - (int)Game.ClockTime;
                        }
                        else
                        {
                            relic.NextRespawnTime = relic.RespawnTime + (int)Game.ClockTime;
                        }
                        relic.Locked = true;
                    }
                    if ((relic.NextRespawnTime - (int)Game.ClockTime) < 0)
                    {
                        relic.NextRespawnTime = 0;
                        relic.Called          = false;
                    }
                }
            }

            if (RelicTimer.GetActive())
            {
                foreach (RelicObject relic in Relics)
                {
                    if (relic.Locked)
                    {
                        if (relic.NextRespawnTime <= 0 || relic.MapType != GMap.Type)
                        {
                            continue;
                        }
                        int time = Timer.Timers.GetMenuItem("SAssembliesTimersRemindTime").GetValue <Slider>().Value;
                        if (!relic.Called && relic.NextRespawnTime - (int)Game.ClockTime <= time &&
                            relic.NextRespawnTime - (int)Game.ClockTime >= time - 1)
                        {
                            relic.Called = true;
                            Timer.PingAndCall(relic.Name + " respawns in " + time + " seconds!", relic.MinimapPosition);
                            if (RelicTimer.GetMenuItem("SAssembliesTimersRelicSpeech").GetValue <bool>())
                            {
                                Speech.Speak(relic.Name + " respawns in " + time + " seconds!");
                            }
                        }
                    }
                }
            }
        }
Exemple #4
0
        private void RandFilm()
        {
            Random r = new Random((int)DateTime.Now.Ticks);

            string[] s = GetOptions("");

            int i = r.Next(0, s.Length);

            speech.Speak("Playing " + s[i]);
            Play(s[i]);
        }
 private void Speak(InternalKillable killable, Obj_AI_Hero hero)
 {
     if (killable != null)
     {
         if (KillableTracker.GetMenuItem("SAssembliesTrackersKillableSpeech").GetValue <bool>() && !killable.Spoken && hero.IsVisible && !hero.IsDead)
         {
             Speech.Speak("Killable " + hero.ChampionName);
             killable.Spoken = true;
         }
     }
 }
Exemple #6
0
        private static void SayNotepadMenuNameIfSelected(IList <Rect> listOfNotepadMenuItemsRects, Point mouseCurrentPosition)
        {
            foreach (var position in listOfNotepadMenuItemsRects)
            {
                if (!position.Contains(mouseCurrentPosition))
                {
                    continue;
                }
                var indexOfPosition = listOfNotepadMenuItemsRects.IndexOf(position);

                Speech.Speak(Enum.GetName(typeof(NotepadMenuItems), indexOfPosition), true);
            }
        }
Exemple #7
0
 public void PlayCharSoundSync(char key)
 {
     key = char.ToUpper(key);
     if (Characters.ContainsKey(key))
     {
         try { Characters[key].PlaySync(); }
         catch { }
     }
     else
     {
         Speech.Speak(key.ToString());
     }
 }
Exemple #8
0
        private void ChatAndPing(KeyValuePair <Obj_AI_Hero, InternalGankDetector> enemy)
        {
            Obj_AI_Hero hero     = enemy.Key;
            var         pingType = PingCategory.Normal;
            var         t        = GankDetector.GetMenuItem("SAssembliesDetectorsGankPingType").GetValue <StringList>();

            pingType = (PingCategory)t.SelectedIndex + 1;
            Vector3    pos = hero.ServerPosition;
            GamePacket gPacketT;

            for (int i = 0;
                 i < GankDetector.GetMenuItem("SAssembliesDetectorsGankPingTimes").GetValue <Slider>().Value;
                 i++)
            {
                if (GankDetector.GetMenuItem("SAssembliesDetectorsGankLocalPing").GetValue <bool>())
                {
                    Game.ShowPing(pingType, pos, true);
                }
                else if (!GankDetector.GetMenuItem("SAssembliesDetectorsGankLocalPing").GetValue <bool>() &&
                         Menu.GlobalSettings.GetMenuItem("SAssembliesGlobalSettingsServerChatPingActive")
                         .GetValue <bool>())
                {
                    Game.SendPing(pingType, pos);
                }
            }

            if (
                GankDetector.GetMenuItem("SAssembliesDetectorsGankChatChoice").GetValue <StringList>().SelectedIndex ==
                1)
            {
                Game.PrintChat(Language.GetString("DETECTORS_GANK_TEXT") + ": {0}", hero.ChampionName);
            }
            else if (
                GankDetector.GetMenuItem("SAssembliesDetectorsGankChatChoice")
                .GetValue <StringList>()
                .SelectedIndex == 2 &&
                Menu.GlobalSettings.GetMenuItem("SAssembliesGlobalSettingsServerChatPingActive").GetValue <bool>())
            {
                Game.Say(Language.GetString("DETECTORS_GANK_TEXT") + ": {0}", hero.ChampionName);
            }
            if (GankDetector.GetMenuItem("SAssembliesDetectorsGankVoice").GetValue <bool>())
            {
                Speech.Speak(Language.GetString("DETECTORS_GANK_TEXT") + ": " + hero.ChampionName);
            }
            if (GankDetector.GetMenuItem("SAssembliesDetectorsGankNotification").GetValue <bool>())
            {
                Common.ShowNotification(Language.GetString("DETECTORS_GANK_TEXT") + ": " + hero.ChampionName, System.Drawing.Color.Red, 3);
            }

            //TODO: Check for Teleport etc.
        }
        private void HandleSs(KeyValuePair <Obj_AI_Hero, Time> enemy)
        {
            Obj_AI_Hero hero = enemy.Key;

            if (enemy.Value.InvisibleTime > 5 && !enemy.Value.Called && Game.Time - enemy.Value.LastTimeCalled > 30)
            {
                var pos      = new Vector2(hero.Position.X, hero.Position.Y);
                var pingType = Packet.PingType.Normal;
                var t        = SsCallerTracker.GetMenuItem("SAssembliesTrackersSsCallerPingType").GetValue <StringList>();
                pingType = (Packet.PingType)t.SelectedIndex + 1;
                GamePacket gPacketT;
                for (int i = 0;
                     i < SsCallerTracker.GetMenuItem("SAssembliesTrackersSsCallerPingTimes").GetValue <Slider>().Value;
                     i++)
                {
                    if (SsCallerTracker.GetMenuItem("SAssembliesTrackersSsCallerLocalPing").GetValue <bool>())
                    {
                        gPacketT =
                            Packet.S2C.Ping.Encoded(new Packet.S2C.Ping.Struct(pos[0], pos[1], 0, 0, pingType));
                        gPacketT.Process();
                    }
                    else if (!SsCallerTracker.GetMenuItem("SAssembliesTrackersSsCallerLocalPing").GetValue <bool>() &&
                             Menu.GlobalSettings.GetMenuItem("SAssembliesGlobalSettingsServerChatPingActive")
                             .GetValue <bool>())
                    {
                        gPacketT =
                            Packet.C2S.Ping.Encoded(new Packet.C2S.Ping.Struct(enemy.Value.LastPosition.X,
                                                                               enemy.Value.LastPosition.Y, 0, pingType));
                        gPacketT.Send();
                    }
                }
                if (SsCallerTracker.GetMenuItem("SAssembliesTrackersSsCallerChatChoice").GetValue <StringList>().SelectedIndex == 1)
                {
                    Game.PrintChat("ss {0}", hero.ChampionName);
                }
                else if (
                    SsCallerTracker.GetMenuItem("SAssembliesTrackersSsCallerChatChoice").GetValue <StringList>().SelectedIndex ==
                    2 &&
                    Menu.GlobalSettings.GetMenuItem("SAssembliesGlobalSettingsServerChatPingActive").GetValue <bool>())
                {
                    Game.Say("ss {0}", hero.ChampionName);
                }
                if (SsCallerTracker.GetMenuItem("SAssembliesTrackersSsCallerSpeech").GetValue <bool>())
                {
                    Speech.Speak("Miss " + hero.ChampionName);
                }
                enemy.Value.LastTimeCalled = (int)Game.Time;
                enemy.Value.Called         = true;
            }
        }
Exemple #10
0
        private void HandleSs(KeyValuePair <Obj_AI_Hero, Time> enemy)
        {
            Obj_AI_Hero hero = enemy.Key;

            if (enemy.Value.InvisibleTime > 5 && !enemy.Value.Called && Game.Time - enemy.Value.LastTimeCalled > 30)
            {
                var pos      = new Vector2(hero.Position.X, hero.Position.Y);
                var pingType = PingCategory.Normal;
                var t        = SsCallerTracker.GetMenuItem("SAssembliesTrackersSsCallerPingType").GetValue <StringList>();
                pingType = (PingCategory)t.SelectedIndex + 1;
                GamePacket gPacketT;
                for (int i = 0;
                     i < SsCallerTracker.GetMenuItem("SAssembliesTrackersSsCallerPingTimes").GetValue <Slider>().Value;
                     i++)
                {
                    if (SsCallerTracker.GetMenuItem("SAssembliesTrackersSsCallerLocalPing").GetValue <bool>())
                    {
                        Game.ShowPing(pingType, pos, true);
                    }
                    else if (!SsCallerTracker.GetMenuItem("SAssembliesTrackersSsCallerLocalPing").GetValue <bool>() &&
                             Menu.GlobalSettings.GetMenuItem("SAssembliesGlobalSettingsServerChatPingActive")
                             .GetValue <bool>())
                    {
                        Game.SendPing(pingType, pos);
                    }
                }
                if (SsCallerTracker.GetMenuItem("SAssembliesTrackersSsCallerChatChoice").GetValue <StringList>().SelectedIndex == 1)
                {
                    Game.PrintChat("ss {0}", hero.ChampionName);
                }
                else if (
                    SsCallerTracker.GetMenuItem("SAssembliesTrackersSsCallerChatChoice").GetValue <StringList>().SelectedIndex ==
                    2 &&
                    Menu.GlobalSettings.GetMenuItem("SAssembliesGlobalSettingsServerChatPingActive").GetValue <bool>())
                {
                    Game.Say("ss {0}", hero.ChampionName);
                }
                if (SsCallerTracker.GetMenuItem("SAssembliesTrackersSsCallerSpeech").GetValue <bool>())
                {
                    Speech.Speak("Miss " + hero.ChampionName);
                }
                if (SsCallerTracker.GetMenuItem("SAssembliesTrackersSsCallerNotification").GetValue <bool>())
                {
                    Common.ShowNotification("Miss " + hero.ChampionName, System.Drawing.Color.Red, 3);
                }
                enemy.Value.LastTimeCalled = (int)Game.Time;
                enemy.Value.Called         = true;
            }
        }
        private void ChatAndPing(KeyValuePair <Obj_AI_Hero, InternalGankDetector> enemy)
        {
            Obj_AI_Hero hero     = enemy.Key;
            var         pingType = Packet.PingType.Normal;
            var         t        = GankDetector.GetMenuItem("SAssembliesDetectorsGankPingType").GetValue <StringList>();

            pingType = (Packet.PingType)t.SelectedIndex + 1;
            Vector3    pos = hero.ServerPosition;
            GamePacket gPacketT;

            for (int i = 0;
                 i < GankDetector.GetMenuItem("SAssembliesDetectorsGankPingTimes").GetValue <Slider>().Value;
                 i++)
            {
                if (GankDetector.GetMenuItem("SAssembliesDetectorsGankLocalPing").GetValue <bool>())
                {
                    gPacketT = Packet.S2C.Ping.Encoded(new Packet.S2C.Ping.Struct(pos[0], pos[1], 0, 0, pingType));
                    gPacketT.Process();
                }
                else if (!GankDetector.GetMenuItem("SAssembliesDetectorsGankLocalPing").GetValue <bool>() &&
                         Menu.GlobalSettings.GetMenuItem("SAssembliesGlobalSettingsServerChatPingActive")
                         .GetValue <bool>())
                {
                    gPacketT = Packet.C2S.Ping.Encoded(new Packet.C2S.Ping.Struct(pos[0], pos[1], 0, pingType));
                    gPacketT.Send();
                }
            }

            if (
                GankDetector.GetMenuItem("SAssembliesDetectorsGankChatChoice").GetValue <StringList>().SelectedIndex ==
                1)
            {
                Game.PrintChat(Language.GetString("DETECTORS_GANK_TEXT") + ": {0}", hero.ChampionName);
            }
            else if (
                GankDetector.GetMenuItem("SAssembliesDetectorsGankChatChoice")
                .GetValue <StringList>()
                .SelectedIndex == 2 &&
                Menu.GlobalSettings.GetMenuItem("SAssembliesGlobalSettingsServerChatPingActive").GetValue <bool>())
            {
                Game.Say(Language.GetString("DETECTORS_GANK_TEXT") + ": {0}", hero.ChampionName);
            }
            if (GankDetector.GetMenuItem("SAssembliesDetectorsGankVoice").GetValue <bool>())
            {
                Speech.Speak(Language.GetString("DETECTORS_GANK_TEXT") + ": " + hero.ChampionName);
            }

            //TODO: Check for Teleport etc.
        }
Exemple #12
0
 public void StartRace()
 {
     foreach (var c in CountersGroup.All)
     {
         c.Reset();
         c.Start();
     }
     Race.StartRace();
     if (LastLocaton != null)
     {
         MessagingHub.Send(QueueType.Race, new RaceEvent(LastLocaton, RaceEventTypes.Start));
         MessagingHub.Send(new VibrateCommand("11"));
     }
     Speech?.Speak("Поехали");
 }
        private void Speak()
        {
            var word = TextBoxWord.Text;

            try
            {
                var speed = (int)NumericUpDownSpeed.Value;

                var speech = new Speech();
                speech.Speak(word, speed);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemple #14
0
        private Recognition.Response Search(string query)
        {
            Recognition.Response re = new Recognition.Response();
            re.grammars = new Grammar[0];

            Regex r = new Regex(@"(on|about) ((\w|\s)+) please", RegexOptions.Compiled);
            Match m = r.Match(query);

            if (m.Groups.Count > 1)
            {
                query = m.Groups[2].Value;
                wolf.Search(query);
                string text = wiki.Search(query);
                re.data = text;
                speech.Speak(text);
            }

            return(re);
        }
Exemple #15
0
 public Gank()
 {
     foreach (Obj_AI_Hero hero in ObjectManager.Get <Obj_AI_Hero>())
     {
         if (hero.IsEnemy)
         {
             Render.Text text = new Render.Text(new Vector2(0, 0), Language.GetString("DETECTORS_GANK_TEXT_JUNGLER"), 28, Color.Red);
             text.PositionUpdate = delegate
             {
                 Speech.Speak(Language.GetString("DETECTORS_GANK_TEXT_JUNGLER"));
                 return(Drawing.WorldToScreen(ObjectManager.Player.ServerPosition));
             };
             text.VisibleCondition = sender =>
             {
                 bool hasSmite = false;
                 foreach (SpellDataInst spell in hero.Spellbook.Spells)
                 {
                     if (spell.Name.ToLower().Contains("smite"))
                     {
                         hasSmite = true;
                         break;
                     }
                 }
                 return(IsActive() &&
                        GankDetector.GetMenuItem("SAssembliesDetectorsGankShowJungler").GetValue <bool>() &&
                        hero.IsVisible && !hero.IsDead &&
                        Vector3.Distance(ObjectManager.Player.ServerPosition, hero.ServerPosition) >
                        GankDetector.GetMenuItem("SAssembliesDetectorsGankTrackRangeMin").GetValue <Slider>().Value&&
                        Vector3.Distance(ObjectManager.Player.ServerPosition, hero.ServerPosition) <
                        GankDetector.GetMenuItem("SAssembliesDetectorsGankTrackRangeMax").GetValue <Slider>().Value&&
                        hasSmite);
             };
             text.OutLined = true;
             text.Centered = true;
             Enemies.Add(hero, new InternalGankDetector(text));
         }
     }
     ThreadHelper.GetInstance().Called += Game_OnGameUpdate;
     //Game.OnGameUpdate += Game_OnGameUpdate;
 }
Exemple #16
0
 public static bool PingAndCall(String text, Vector3 pos, bool call = true, bool ping = true, bool notification = true)
 {
     if (ping)
     {
         for (int i = 0; i < Timers.GetMenuItem("SAssembliesTimersPingTimes").GetValue <Slider>().Value; i++)
         {
             if (Timers.GetMenuItem("SAssembliesTimersLocalPing").GetValue <bool>())
             {
                 Game.ShowPing(PingCategory.Normal, pos, true);
             }
             else if (!Timers.GetMenuItem("SAssembliesTimersLocalPing").GetValue <bool>() &&
                      Menu.GlobalSettings.GetMenuItem("SAssembliesGlobalSettingsServerChatPingActive")
                      .GetValue <bool>())
             {
                 Game.SendPing(PingCategory.Normal, pos);
             }
         }
     }
     if (call)
     {
         if (Timers.GetMenuItem("SAssembliesTimersChat").GetValue <bool>() &&
             Menu.GlobalSettings.GetMenuItem("SAssembliesGlobalSettingsServerChatPingActive").GetValue <bool>())
         {
             Game.Say(text);
         }
     }
     if (notification)
     {
         if (Timers.GetMenuItem("SAssembliesTimersNotification").GetValue <bool>())
         {
             Common.ShowNotification(text, Color.White, 3);
         }
     }
     if (Timers.GetMenuItem("SAssembliesTimersSpeech").GetValue <bool>())
     {
         Speech.Speak(text);
     }
     return(true);
 }
Exemple #17
0
 private void Obj_AI_Base_OnCreate(GameObject sender, EventArgs args)
 {
     if (!IsActive())
     {
         return;
     }
     foreach (Obj_AI_Hero hero in ObjectManager.Get <Obj_AI_Hero>())
     {
         if (!hero.IsEnemy)
         {
             foreach (var ability in Abilities)
             {
                 if (sender.Name.Contains(ability.Key.SpellName) &&
                     /*variable*/ Vector3.Distance(sender.Position, ObjectManager.Player.ServerPosition) <= 4000)
                 {
                     ability.Key.Owner      = hero;
                     ability.Key.Casted     = true;
                     ability.Key.TimeCasted = (int)Game.ClockTime;
                     if (Vector3.Distance(sender.Position, hero.ServerPosition) <= 100)
                     {
                         ability.Key.Target = hero;
                     }
                     if (ImmuneTimer.GetMenuItem("SAssembliesTimersImmuneSpeech").GetValue <bool>())
                     {
                         if (ability.Key.Target != null)
                         {
                             Speech.Speak(ability.Key.Name + " casted on " + ability.Key.Target.ChampionName);
                         }
                         else if (ability.Key.Owner != null)
                         {
                             Speech.Speak(ability.Key.Name + " casted on " + ability.Key.Owner.ChampionName);
                         }
                     }
                 }
             }
         }
     }
 }
Exemple #18
0
        private void Obj_AI_Base_OnCreate(GameObject sender, EventArgs args)
        {
            if (!IsActive())
            {
                return;
            }

            foreach (var ability in Abilities)
            {
                if (sender.Name.ToLower().Contains(ability.Key.SpellName.ToLower()))
                {
                    Obj_AI_Hero hero =
                        ObjectManager.Get <Obj_AI_Hero>().FirstOrDefault(x => x.NetworkId == sender.NetworkId);
                    ability.Key.Casted     = true;
                    ability.Key.TimeCasted = (int)Game.ClockTime;
                    if (SpellTimer.GetMenuItem("SAssembliesTimersSpellSpeech").GetValue <bool>() &&
                        hero != null)
                    {
                        Speech.Speak(ability.Key.Name + " casted on " + hero.ChampionName);
                    }
                    CreateText(ability.Key, hero, sender);
                }
            }
        }
        private void Game_OnGameUpdate(EventArgs args)
        {
            if (!IsActive() || lastGameUpdateTime + new Random().Next(500, 1000) > Environment.TickCount)
            {
                return;
            }

            lastGameUpdateTime = Environment.TickCount;

            if (AltarTimer.GetActive())
            {
                AltarObject altarDestroyed = null;
                foreach (AltarObject altar in Altars)
                {
                    if (altar.Obj.IsValid)
                    {
                        bool hasBuff = false;
                        foreach (BuffInstance buff in altar.Obj.Buffs)
                        {
                            if (buff.Name == "treelinelanternlock")
                            {
                                hasBuff = true;
                                break;
                            }
                        }
                        if (!hasBuff)
                        {
                            altar.Locked          = false;
                            altar.NextRespawnTime = 0;
                            altar.Called          = false;
                        }
                        else if (hasBuff && altar.Locked == false)
                        {
                            altar.Locked          = true;
                            altar.NextRespawnTime = altar.RespawnTime + (int)Game.ClockTime;
                        }
                    }
                    else
                    {
                        if (altar.NextRespawnTime < (int)Game.ClockTime)
                        {
                            altarDestroyed = altar;
                        }
                    }
                }
                if (altarDestroyed != null && Altars.Remove(altarDestroyed))
                {
                }
                foreach (Obj_AI_Minion altar in ObjectManager.Get <Obj_AI_Minion>())
                {
                    AltarObject nAltar = null;
                    if (altar.Name.Contains("Buffplat"))
                    {
                        AltarObject health1 = Altars.Find(jm => jm.Obj.NetworkId == altar.NetworkId);
                        if (health1 == null)
                        {
                            if (altar.Name.Contains("_L"))
                            {
                                nAltar = new AltarObject("Left Altar", altar);
                            }
                            else
                            {
                                nAltar = new AltarObject("Right Altar", altar);
                            }
                        }
                    }

                    if (nAltar != null)
                    {
                        Altars.Add(nAltar);
                    }
                }
            }

            /////

            if (AltarTimer.GetActive())
            {
                foreach (AltarObject altar in Altars)
                {
                    if (altar.Locked)
                    {
                        if (altar.NextRespawnTime <= 0 || altar.MapType != GMap.Type)
                        {
                            continue;
                        }
                        int time = Timer.Timers.GetMenuItem("SAssembliesTimersRemindTime").GetValue <Slider>().Value;
                        if (!altar.Called && altar.NextRespawnTime - (int)Game.ClockTime <= time &&
                            altar.NextRespawnTime - (int)Game.ClockTime >= time - 1)
                        {
                            altar.Called = true;
                            Timer.PingAndCall(altar.Name + " unlocks in " + time + " seconds!", altar.Obj.ServerPosition);
                            if (AltarTimer.GetMenuItem("SAssembliesTimersAltarSpeech").GetValue <bool>())
                            {
                                Speech.Speak(altar.Name + " unlocks in " + time + " seconds!");
                            }
                        }
                    }
                }
            }
        }
        private void Game_OnGameUpdate(EventArgs args)
        {
            if (!IsActive() || lastGameUpdateTime + new Random().Next(500, 1000) > Environment.TickCount)
            {
                return;
            }

            lastGameUpdateTime = Environment.TickCount;

            if (HealthTimer.GetActive())
            {
                HealthObject healthDestroyed = null;
                foreach (HealthObject health in Healths)
                {
                    if (health.Obj.IsValid)
                    {
                        if (health.Obj.Health > 0)
                        {
                            health.Locked          = false;
                            health.NextRespawnTime = 0;
                            health.Called          = false;
                        }
                        else if (health.Obj.Health < 1 && health.Locked == false)
                        {
                            health.Locked          = true;
                            health.NextRespawnTime = health.RespawnTime + (int)Game.ClockTime;
                        }
                    }
                    if (health.NextRespawnTime < (int)Game.ClockTime && health.Locked)
                    {
                        healthDestroyed = health;
                    }
                }
                if (healthDestroyed != null)
                {
                    healthDestroyed.TextMinimap.Dispose();
                    healthDestroyed.TextMinimap.Remove();
                    healthDestroyed.TextMap.Dispose();
                    healthDestroyed.TextMap.Remove();
                    Healths.Remove(healthDestroyed);
                }
                foreach (Obj_AI_Minion health in ObjectManager.Get <Obj_AI_Minion>())
                {
                    HealthObject nHealth = null;
                    if (health.Name.Contains("Health"))
                    {
                        HealthObject health1 = Healths.Find(jm => jm.Obj.NetworkId == health.NetworkId);
                        if (health1 == null)
                        {
                            nHealth = new HealthObject(health);
                        }
                    }

                    if (nHealth != null)
                    {
                        Healths.Add(nHealth);
                    }
                }
            }

            /////

            if (HealthTimer.GetActive())
            {
                foreach (HealthObject health in Healths)
                {
                    if (health.Locked)
                    {
                        if (health.NextRespawnTime - (int)Game.ClockTime <= 0 || health.MapType != GMap.Type)
                        {
                            continue;
                        }
                        int time = Timer.Timers.GetMenuItem("SAssembliesTimersRemindTime").GetValue <Slider>().Value;
                        if (!health.Called && health.NextRespawnTime - (int)Game.ClockTime <= time &&
                            health.NextRespawnTime - (int)Game.ClockTime >= time - 1)
                        {
                            health.Called = true;
                            Timer.PingAndCall("Heal respawns in " + time + " seconds!", health.Position);
                            if (HealthTimer.GetMenuItem("SAssembliesTimersHealthSpeech").GetValue <bool>())
                            {
                                Speech.Speak("Heal respawns in " + time + " seconds!");
                            }
                        }
                    }
                }
            }
        }
Exemple #21
0
 private void On(string input)
 {
     speech.Speak(input);
 }
        private void HandleRecall(Packet.S2C.Teleport.Struct recallEx)
        {
            int time = Environment.TickCount - Game.Ping;

            for (int i = 0; i < Recalls.Count; i++)
            {
                Packet.S2C.Teleport.Struct recall = Recalls[i];
                if (true /*recallEx.Type == Recall.ObjectType.Player*/)
                {
                    var obj   = ObjectManager.GetUnitByNetworkId <Obj_AI_Hero>(recall.UnitNetworkId);
                    var objEx = ObjectManager.GetUnitByNetworkId <Obj_AI_Hero>(recallEx.UnitNetworkId);
                    if (obj == null)
                    {
                        continue;
                    }
                    if (obj.NetworkId == objEx.NetworkId) //already existing
                    {
                        recall = recallEx;
                        //recall.Recall2 = new Recall.Struct();

                        var    percentHealth = (int)((obj.Health / obj.MaxHealth) * 100);
                        String sColor;
                        String hColor = (percentHealth > 50
                            ? "<font color='#00FF00'>"
                            : (percentHealth > 30 ? "<font color='#FFFF00'>" : "<font color='#FF0000'>"));
                        if (recallEx.Status == Packet.S2C.Teleport.Status.Start)
                        {
                            String text = (recallEx.Type == Packet.S2C.Teleport.Type.Recall
                                ? Language.GetString("DETECTORS_RECALL_TEXT_RECALLING")
                                : Language.GetString("DETECTORS_RECALL_TEXT_PORTING"));
                            sColor       = "<font color='#FFFF00'>";
                            recall.Start = (int)Game.Time;
                            if (
                                RecallDetector.GetMenuItem("SAssembliesDetectorsRecallChatChoice")
                                .GetValue <StringList>()
                                .SelectedIndex == 1)
                            {
                                Game.PrintChat("{0}" + obj.ChampionName + " {1} " + Language.GetString("DETECTORS_RECALL_TEXT_WITH") + " {2} " +
                                               Language.GetString("DETECTORS_RECALL_TEXT_HP") + " {3}({4})", sColor, text,
                                               (int)obj.Health, hColor, percentHealth);
                            }
                            else if (
                                RecallDetector.GetMenuItem("SAssembliesDetectorsRecallChatChoice")
                                .GetValue <StringList>()
                                .SelectedIndex == 2 &&
                                Menu.GlobalSettings.GetMenuItem("SAssembliesGlobalSettingsServerChatPingActive")
                                .GetValue <bool>())
                            {
                                Game.Say("{0}" + obj.ChampionName + " {1} " + Language.GetString("DETECTORS_RECALL_TEXT_WITH") + " {2} " +
                                         Language.GetString("DETECTORS_RECALL_TEXT_HP") + " {3}({4})", sColor, text, (int)obj.Health,
                                         hColor, percentHealth);
                            }
                            if (RecallDetector.GetMenuItem("SAssembliesDetectorsRecallSpeech").GetValue <bool>())
                            {
                                Speech.Speak(obj.ChampionName + " " + text);
                            }
                        }
                        else if (recallEx.Status == Packet.S2C.Teleport.Status.Finish)
                        {
                            String text = (recallEx.Type == Packet.S2C.Teleport.Type.Recall
                                ? Language.GetString("DETECTORS_RECALL_TEXT_RECALLED")
                                : Language.GetString("DETECTORS_RECALL_TEXT_PORTED"));
                            sColor = "<font color='#FF0000'>";
                            if (
                                RecallDetector.GetMenuItem("SAssembliesDetectorsRecallChatChoice")
                                .GetValue <StringList>()
                                .SelectedIndex == 1)
                            {
                                Game.PrintChat("{0}" + obj.ChampionName + " {1} " + Language.GetString("DETECTORS_RECALL_TEXT_WITH") + " {2} " +
                                               Language.GetString("DETECTORS_RECALL_TEXT_HP") + " {3}({4})", sColor, text,
                                               (int)obj.Health, hColor, percentHealth);
                            }
                            else if (
                                RecallDetector.GetMenuItem("SAssembliesDetectorsRecallChatChoice")
                                .GetValue <StringList>()
                                .SelectedIndex == 2 &&
                                Menu.GlobalSettings.GetMenuItem(
                                    "SAssembliesGlobalSettingsServerChatPingActive").GetValue <bool>())
                            {
                                Game.Say("{0}" + obj.ChampionName + " {1} " + Language.GetString("DETECTORS_RECALL_TEXT_WITH") + " {2} " +
                                         Language.GetString("DETECTORS_RECALL_TEXT_HP") + " {3}({4})", sColor, text,
                                         (int)obj.Health, hColor, percentHealth);
                            }
                            if (RecallDetector.GetMenuItem("SAssembliesDetectorsRecallSpeech").GetValue <bool>())
                            {
                                Speech.Speak(obj.ChampionName + " " + text);
                            }
                        }
                        else
                        {
                            sColor = "<font color='#00FF00'>";
                            if (
                                RecallDetector.GetMenuItem("SAssembliesDetectorsRecallChatChoice")
                                .GetValue <StringList>()
                                .SelectedIndex == 1)
                            {
                                Game.PrintChat("{0}" + obj.ChampionName + " " + Language.GetString("DETECTORS_RECALL_TEXT_CANCELED") + " " +
                                               Language.GetString("DETECTORS_RECALL_TEXT_WITH") + " {1} " +
                                               Language.GetString("DETECTORS_RECALL_TEXT_HP") + "", sColor, (int)obj.Health);
                            }
                            else if (
                                RecallDetector.GetMenuItem("SAssembliesDetectorsRecallChatChoice")
                                .GetValue <StringList>()
                                .SelectedIndex == 2 &&
                                Menu.GlobalSettings.GetMenuItem(
                                    "SAssembliesGlobalSettingsServerChatPingActive").GetValue <bool>())
                            {
                                Game.Say("{0}" + obj.ChampionName + " " + Language.GetString("DETECTORS_RECALL_TEXT_CANCELED") + " "
                                         + Language.GetString("DETECTORS_RECALL_TEXT_WITH") + " {1} " +
                                         Language.GetString("DETECTORS_RECALL_TEXT_HP") + "", sColor, (int)obj.Health);
                            }
                            if (RecallDetector.GetMenuItem("SAssembliesDetectorsRecallSpeech").GetValue <bool>())
                            {
                                Speech.Speak(obj.ChampionName + " " + Language.GetString("DETECTORS_RECALL_TEXT_CANCELED"));
                            }
                        }
                        return;
                    }
                }
            }
        }
Exemple #23
0
        private void HandleRecall(Packet.S2C.Teleport.Struct recallEx)
        {
            for (int i = 0; i < _recalls.Count; i++)
            {
                Packet.S2C.Teleport.Struct recall = _recalls[i].Recall;
                var obj   = ObjectManager.GetUnitByNetworkId <Obj_AI_Hero>(recall.UnitNetworkId);
                var objEx = ObjectManager.GetUnitByNetworkId <Obj_AI_Hero>(recallEx.UnitNetworkId);
                if (obj == null)
                {
                    continue;
                }
                if (obj.NetworkId == objEx.NetworkId)
                {
                    _recalls[i].Recall = recallEx;

                    var percentHealth = (int)((obj.Health / obj.MaxHealth) * 100);
                    if (recallEx.Status == Packet.S2C.Teleport.Status.Start)
                    {
                        String text = (recallEx.Type == Packet.S2C.Teleport.Type.Recall
                            ? Language.GetString("DETECTORS_RECALL_TEXT_RECALLING")
                            : Language.GetString("DETECTORS_RECALL_TEXT_PORTING"));
                        recall.Start = (int)Game.Time;
                        if (
                            RecallDetector.GetMenuItem("SAssembliesDetectorsRecallChat").GetValue <bool>() &&
                            Menu.GlobalSettings.GetMenuItem("SAssembliesGlobalSettingsServerChatPingActive")
                            .GetValue <bool>())
                        {
                            Game.Say(obj.ChampionName + " {0} " + Language.GetString("DETECTORS_RECALL_TEXT_WITH") + " {1} " +
                                     Language.GetString("DETECTORS_RECALL_TEXT_HP") + " ({2})", text, (int)obj.Health,
                                     percentHealth);
                        }
                        for (int j = 0;
                             j < RecallDetector.GetMenuItem("SAssembliesDetectorsRecallPingTimes").GetValue <Slider>().Value;
                             j++)
                        {
                            if (RecallDetector.GetMenuItem("SAssembliesDetectorsRecallLocalPing").GetValue <bool>())
                            {
                                Game.ShowPing(PingCategory.EnemyMissing, obj.ServerPosition, true);
                            }
                            else if (!RecallDetector.GetMenuItem("SAssembliesDetectorsRecallLocalPing").GetValue <bool>() &&
                                     Menu.GlobalSettings.GetMenuItem("SAssembliesGlobalSettingsServerChatPingActive")
                                     .GetValue <bool>())
                            {
                                Game.SendPing(PingCategory.EnemyMissing, obj.ServerPosition);
                            }
                        }
                        if (RecallDetector.GetMenuItem("SAssembliesDetectorsRecallSpeech").GetValue <bool>())
                        {
                            Speech.Speak(obj.ChampionName + " " + text);
                        }
                        if (RecallDetector.GetMenuItem("SAssembliesDetectorsRecallNotification").GetValue <bool>())
                        {
                            Common.ShowNotification(obj.ChampionName + " " + text + " " + (int)obj.Health + " " +
                                                    Language.GetString("DETECTORS_RECALL_TEXT_HP") + " (" + percentHealth + ")", System.Drawing.Color.OrangeRed, 3);
                        }
                    }
                    else if (recallEx.Status == Packet.S2C.Teleport.Status.Finish)
                    {
                        String text = (recallEx.Type == Packet.S2C.Teleport.Type.Recall
                            ? Language.GetString("DETECTORS_RECALL_TEXT_RECALLED")
                            : Language.GetString("DETECTORS_RECALL_TEXT_PORTED"));
                        if (RecallDetector.GetMenuItem("SAssembliesDetectorsRecallChat").GetValue <bool>() &&
                            Menu.GlobalSettings.GetMenuItem(
                                "SAssembliesGlobalSettingsServerChatPingActive").GetValue <bool>())
                        {
                            Game.Say(obj.ChampionName + " {0} " + Language.GetString("DETECTORS_RECALL_TEXT_WITH") + " {1} " +
                                     Language.GetString("DETECTORS_RECALL_TEXT_HP") + " ({2})", text,
                                     (int)obj.Health, percentHealth);
                        }
                        for (int j = 0;
                             j < RecallDetector.GetMenuItem("SAssembliesDetectorsRecallPingTimes").GetValue <Slider>().Value;
                             j++)
                        {
                            if (RecallDetector.GetMenuItem("SAssembliesDetectorsRecallLocalPing").GetValue <bool>())
                            {
                                Game.ShowPing(PingCategory.Fallback, obj.ServerPosition, true);
                            }
                            else if (!RecallDetector.GetMenuItem("SAssembliesDetectorsRecallLocalPing").GetValue <bool>() &&
                                     Menu.GlobalSettings.GetMenuItem("SAssembliesGlobalSettingsServerChatPingActive")
                                     .GetValue <bool>())
                            {
                                Game.SendPing(PingCategory.Fallback, obj.ServerPosition);
                            }
                        }
                        if (RecallDetector.GetMenuItem("SAssembliesDetectorsRecallSpeech").GetValue <bool>())
                        {
                            Speech.Speak(obj.ChampionName + " " + text);
                        }
                        if (RecallDetector.GetMenuItem("SAssembliesDetectorsRecallNotification").GetValue <bool>())
                        {
                            Common.ShowNotification(obj.ChampionName + " " + text + " " + (int)obj.Health + " " +
                                                    Language.GetString("DETECTORS_RECALL_TEXT_HP") + " (" + percentHealth + ")", System.Drawing.Color.Red, 3);
                        }
                    }
                    else
                    {
                        if (
                            RecallDetector.GetMenuItem("SAssembliesDetectorsRecallChat").GetValue <bool>() &&
                            Menu.GlobalSettings.GetMenuItem(
                                "SAssembliesGlobalSettingsServerChatPingActive").GetValue <bool>())
                        {
                            Game.Say(obj.ChampionName + " " + Language.GetString("DETECTORS_RECALL_TEXT_CANCELED") + " "
                                     + Language.GetString("DETECTORS_RECALL_TEXT_WITH") + " {0} " +
                                     Language.GetString("DETECTORS_RECALL_TEXT_HP") + "", (int)obj.Health);
                        }
                        for (int j = 0;
                             j < RecallDetector.GetMenuItem("SAssembliesDetectorsRecallPingTimes").GetValue <Slider>().Value;
                             j++)
                        {
                            if (RecallDetector.GetMenuItem("SAssembliesDetectorsRecallLocalPing").GetValue <bool>())
                            {
                                Game.ShowPing(PingCategory.Danger, obj.ServerPosition, true);
                            }
                            else if (!RecallDetector.GetMenuItem("SAssembliesDetectorsRecallLocalPing").GetValue <bool>() &&
                                     Menu.GlobalSettings.GetMenuItem("SAssembliesGlobalSettingsServerChatPingActive")
                                     .GetValue <bool>())
                            {
                                Game.SendPing(PingCategory.Danger, obj.ServerPosition);
                            }
                        }
                        if (RecallDetector.GetMenuItem("SAssembliesDetectorsRecallSpeech").GetValue <bool>())
                        {
                            Speech.Speak(obj.ChampionName + " " + Language.GetString("DETECTORS_RECALL_TEXT_CANCELED"));
                        }
                        if (RecallDetector.GetMenuItem("SAssembliesDetectorsRecallNotification").GetValue <bool>())
                        {
                            Common.ShowNotification(obj.ChampionName + " " + Language.GetString("DETECTORS_RECALL_TEXT_CANCELED") + " " + (int)obj.Health + " " +
                                                    Language.GetString("DETECTORS_RECALL_TEXT_HP") + " (" + percentHealth + ")", System.Drawing.Color.LawnGreen, 3);
                        }
                    }
                    return;
                }
            }
        }
Exemple #24
0
        private void Game_OnGameUpdate(object sender, EventArgs args)
        {
            if (!IsActive() || lastGameUpdateTime + new Random().Next(500, 1000) > Environment.TickCount)
            {
                return;
            }

            lastGameUpdateTime = Environment.TickCount;
            Obj_AI_Hero player = ObjectManager.Player;

            foreach (var enemy in _enemies.ToList())
            {
                double dmg = 0;
                try
                {
                    if (player.Spellbook.CanUseSpell(SpellSlot.Q) == SpellState.Ready)
                    {
                        dmg += player.GetSpellDamage(enemy.Key, SpellSlot.Q);
                    }
                }
                catch (InvalidOperationException)
                {
                }
                try
                {
                    if (player.Spellbook.CanUseSpell(SpellSlot.W) == SpellState.Ready)
                    {
                        dmg += player.GetSpellDamage(enemy.Key, SpellSlot.W);
                    }
                }
                catch (InvalidOperationException)
                {
                }
                try
                {
                    if (player.Spellbook.CanUseSpell(SpellSlot.E) == SpellState.Ready)
                    {
                        dmg += player.GetSpellDamage(enemy.Key, SpellSlot.E);
                    }
                }
                catch (InvalidOperationException)
                {
                }
                try
                {
                    if (player.Spellbook.CanUseSpell(SpellSlot.R) == SpellState.Ready)
                    {
                        dmg += player.GetSpellDamage(enemy.Key, SpellSlot.R);
                    }
                }
                catch (InvalidOperationException)
                {
                }
                try
                {
                    dmg += player.GetAutoAttackDamage(enemy.Key);
                }
                catch (InvalidOperationException)
                {
                }
                _enemies[enemy.Key].Damage = dmg;
                if (enemy.Value.Damage > enemy.Key.Health)
                {
                    _enemies[enemy.Key].Line.Color = Color.OrangeRed;
                }
                if (enemy.Value.Damage < enemy.Key.Health && !GankTracker.GetMenuItem("SAssembliesTrackersGankKillable").GetValue <bool>())
                {
                    _enemies[enemy.Key].Line.Color = Color.GreenYellow;
                }
                else if (enemy.Key.Health / enemy.Key.MaxHealth < 0.1)
                {
                    _enemies[enemy.Key].Line.Color = Color.Red;
                    if (!_enemies[enemy.Key].Pinged)
                    {
                        if (GankTracker.GetMenuItem("SAssembliesTrackersGankVoice").GetValue <bool>())
                        {
                            Speech.Speak("Gankable " + enemy.Key.ChampionName);
                        }
                    }
                    if (!_enemies[enemy.Key].Pinged && GankTracker.GetMenuItem("SAssembliesTrackersGankPing").GetValue <bool>())
                    {
                        Packet.S2C.Ping.Encoded(new Packet.S2C.Ping.Struct(enemy.Key.ServerPosition[0],
                                                                           enemy.Key.ServerPosition[1], 0, 0, Packet.PingType.Normal)).Process();
                        _enemies[enemy.Key].Pinged = true;
                    }
                }
                else if (enemy.Key.Health / enemy.Key.MaxHealth > 0.1)
                {
                    _enemies[enemy.Key].Pinged = false;
                }
            }
        }
Exemple #25
0
 private void DetectDisconnect(GamePacketEventArgs args)
 {
     try
     {
         var  reader   = new BinaryReader(new MemoryStream(args.PacketData));
         byte packetId = reader.ReadByte(); //PacketId
         int  packet   = -1;
         if (Game.Version.Contains("5.24"))
         {
             packet = 68;
         }
         if (Game.Version.Contains("6.1"))
         {
             packet = 33;
         }
         if (Game.Version.Contains("6.2"))
         {
             packet = 135;
         }
         if (Game.Version.Contains("6.3"))
         {
             packet = 25;
         }
         if (Game.Version.Contains("Feb 24 2016")) //6.4
         {
             packet = 246;
         }
         if (Game.Version.Contains("6.6"))
         {
             packet = 247;
         }
         if (Game.Version.Contains("6.7"))
         {
             packet = 76;
         }
         if (Game.Version.Contains("6.8"))
         {
             packet = 199;
         }
         if (Game.Version.Contains("6.9"))
         {
             packet = 174;
         }
         if (Game.Version.Contains("6.10"))
         {
             packet = 8;
         }
         if (Game.Version.Contains("6.12"))
         {
             packet = 247;
         }
         if (Game.Version.Contains("6.13"))
         {
             packet = 49;
         }
         if (Game.Version.Contains("6.14"))
         {
             packet = 146;
         }
         if (Game.Version.Contains("6.15"))
         {
             packet = 49;
         }
         if (Game.Version.Contains("6.16"))
         {
             packet = 76;
         }
         if (Game.Version.Contains("6.18"))
         {
             packet = 107;
         }
         if (Game.Version.Contains("6.19"))
         {
             packet = 35;
         }
         if (Game.Version.Contains("6.20"))
         {
             packet = 225;
         }
         if (Game.Version.Contains("6.21"))
         {
             packet = 225;
         }
         if (Game.Version.Contains("6.22"))
         {
             packet = 42;
         }
         if (packetId != packet || args.PacketData.Length != 12)
         {
             return;
         }
         if (DisReconnectDetector.GetMenuItem("SAssembliesDetectorsDisReconnectChat").GetValue <bool>() &&
             Menu.GlobalSettings.GetMenuItem("SAssembliesGlobalSettingsServerChatPingActive").GetValue <bool>())
         {
             Game.Say("A Champion has disconnected!");
         }
         if (DisReconnectDetector.GetMenuItem("SAssembliesDetectorsDisReconnectSpeech").GetValue <bool>())
         {
             Speech.Speak("A Champion has disconnected!");
         }
         if (DisReconnectDetector.GetMenuItem("SAssembliesDetectorsDisReconnectNotification").GetValue <bool>())
         {
             Common.ShowNotification("A Champion has disconnected!", Color.LawnGreen, 3);
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine("DisconnectProcess: " + ex);
     }
 }
        private void Game_OnGameUpdate(EventArgs args)
        {
            if (!IsActive() || lastGameUpdateTime + new Random().Next(500, 1000) > Environment.TickCount)
            {
                return;
            }

            lastGameUpdateTime = Environment.TickCount;

            if (SummonerTimer.GetActive())
            {
                foreach (var hero in Summoners)
                {
                    Obj_AI_Hero      enemy          = hero.Key;
                    List <SpellSlot> summonerSpells = new List <SpellSlot>();
                    summonerSpells.Add(SpellSlot.Summoner1);
                    summonerSpells.Add(SpellSlot.Summoner2);
                    for (int i = 0; i < summonerSpells.Count(); i++)
                    {
                        SpellDataInst spellData = enemy.Spellbook.GetSpell(summonerSpells[i]);
                        if (hero.Value.Called[i])
                        {
                            if (Timer.Timers.GetMenuItem("SAssembliesTimersRemindTime").GetValue <Slider>().Value < spellData.CooldownExpires - Game.ClockTime)
                            {
                                hero.Value.Called[i] = false;
                            }
                        }
                        if (!hero.Value.Called[i] && Timer.Timers.GetMenuItem("SAssembliesTimersRemindTime").GetValue <Slider>().Value > spellData.CooldownExpires - Game.ClockTime)
                        {
                            hero.Value.Called[i] = true;
                            String text = enemy.ChampionName + " ";
                            switch (spellData.Name.ToLower())
                            {
                            case "summonerbarrier":
                                text = text + "Barrier";
                                break;

                            case "summonerboost":
                                text = text + "Cleanse";
                                break;

                            case "summonerclairvoyance":
                                text = text + "Clairvoyance";
                                break;

                            case "summonerdot":
                                text = text + "Ignite";
                                break;

                            case "summonerexhaust":
                                text = text + "Exhaust";
                                break;

                            case "summonerflash":
                                text = text + "Flash";
                                break;

                            case "summonerhaste":
                                text = text + "Ghost";
                                break;

                            case "summonerheal":
                                text = text + "Heal";
                                break;

                            case "summonermana":
                                text = text + "Clarity";
                                break;

                            case "summonerodingarrison":
                                text = text + "Garrison";
                                break;

                            case "summonerrevive":
                                text = text + "Revive";
                                break;

                            case "smite":
                                text = text + "Smite";
                                break;

                            case "summonerteleport":
                                text = text + "Teleport";
                                break;
                            }
                            text = text + " " + Timer.Timers.GetMenuItem("SAssembliesTimersRemindTime").GetValue <Slider>().Value + " sec";
                            Timer.PingAndCall(text, new Vector3(), true, false);
                            if (SummonerTimer.GetMenuItem("SAssembliesTimersSummonerSpeech").GetValue <bool>())
                            {
                                Speech.Speak(text + "onds");
                            }
                        }
                    }
                }
            }
        }
Exemple #27
0
        private void Game_OnGameUpdate(EventArgs args)
        {
            if (!IsActive() || lastGameUpdateTime + new Random().Next(500, 1000) > Environment.TickCount)
            {
                return;
            }

            lastGameUpdateTime = Environment.TickCount;
            var minions = ObjectManager.Get <Obj_AI_Base>().Where(minion => !minion.IsDead && minion.IsValid && (minion.Name.ToUpper().StartsWith("SRU") || minion.Name.ToUpper().StartsWith("TT_")));

            foreach (var jungleCamp in JungleCamps)
            {
                if (!jungleCamp.Dead)
                {
                    bool alive = false;
                    foreach (var creep in jungleCamp.Creeps)
                    {
                        foreach (var minion in minions)
                        {
                            if (minion.Name.ToUpper().Equals(creep.Name.ToUpper()))
                            {
                                alive = true;
                                break;
                            }
                        }
                        if (alive == true)
                        {
                            break;
                        }
                    }
                    if (alive == true)
                    {
                        jungleCamp.Visible = true;
                    }
                }
            }

            foreach (var jungleCamp in JungleCamps)
            {
                if (!jungleCamp.Dead && jungleCamp.Visible)
                {
                    int count = 0;
                    foreach (var creep in jungleCamp.Creeps)
                    {
                        foreach (var minion in minions)
                        {
                            if (minion.Name.ToUpper().Equals(creep.Name.ToUpper()))
                            {
                                count++;
                            }
                        }
                    }
                    if (count == 0)
                    {
                        jungleCamp.NextRespawnTime = (int)Game.ClockTime + jungleCamp.RespawnTime;
                        jungleCamp.Dead            = true;
                        jungleCamp.Visible         = false;
                    }
                }
            }

            /////////

            foreach (var enemyInfo in Enemies)
            {
                if (enemyInfo.DragonBuff < enemyInfo.GetDragonStacks())
                {
                    foreach (var jungleCamp in JungleCamps)
                    {
                        if (jungleCamp.CampId == 6)
                        {
                            jungleCamp.NextRespawnTime = (int)Game.ClockTime + jungleCamp.RespawnTime;
                            jungleCamp.Dead            = true;
                            jungleCamp.Visible         = false;
                        }
                    }
                }

                if (enemyInfo.NashorBuff != enemyInfo.HasNashorBuff())
                {
                    foreach (var jungleCamp in JungleCamps)
                    {
                        if (jungleCamp.CampId == 12 && !jungleCamp.Called)
                        {
                            jungleCamp.NextRespawnTime = (int)Game.ClockTime + jungleCamp.RespawnTime;
                            jungleCamp.Dead            = true;
                            jungleCamp.Visible         = false;
                        }
                    }
                }

                enemyInfo.DragonBuff = enemyInfo.GetDragonStacks();
                enemyInfo.NashorBuff = enemyInfo.HasNashorBuff();
            }

            /////////

            if (JungleTimer.GetActive())
            {
                foreach (JungleCamp jungleCamp in JungleCamps)
                {
                    if ((jungleCamp.NextRespawnTime - (int)Game.ClockTime) < 0)
                    {
                        jungleCamp.NextRespawnTime = 0;
                        jungleCamp.Called          = false;
                        jungleCamp.Dead            = false;
                    }
                }
            }

            /////

            if (JungleTimer.GetActive())
            {
                foreach (JungleCamp jungleCamp in JungleCamps)
                {
                    if (jungleCamp.NextRespawnTime <= 0 || jungleCamp.MapType != GMap.Type)
                    {
                        continue;
                    }
                    int time = Timer.Timers.GetMenuItem("SAssembliesTimersRemindTime").GetValue <Slider>().Value;
                    if (!jungleCamp.Called && jungleCamp.NextRespawnTime - (int)Game.ClockTime <= time &&
                        jungleCamp.NextRespawnTime - (int)Game.ClockTime >= time - 1)
                    {
                        jungleCamp.Called = true;
                        Timer.PingAndCall(jungleCamp.Name + " respawns in " + time + " seconds!",
                                          jungleCamp.MinimapPosition);
                        if (JungleTimer.GetMenuItem("SAssembliesTimersJungleSpeech").GetValue <bool>())
                        {
                            Speech.Speak(jungleCamp.Name + " respawns in " + time + " seconds!");
                        }
                    }
                }
            }
        }
 public AppHome()
 {
     this.InitializeComponent();
     Speech.Speak("Images loading");
     this.DisplayAllFiles();
 }
        private void Game_OnGameUpdate(EventArgs args)
        {
            if (!IsActive() || lastGameUpdateTime + new Random().Next(500, 1000) > Environment.TickCount)
            {
                return;
            }

            lastGameUpdateTime = Environment.TickCount;

            if (InhibitorTimer.GetActive())
            {
                if (_inhibitors == null || _inhibitors.Inhibitors == null)
                {
                    return;
                }
                foreach (InhibitorObject inhibitor in _inhibitors.Inhibitors)
                {
                    if (inhibitor.Obj.Health > 0)
                    {
                        inhibitor.Locked          = false;
                        inhibitor.NextRespawnTime = 0;
                        inhibitor.Called          = false;
                    }
                    else if (inhibitor.Obj.Health < 1 && inhibitor.Locked == false)
                    {
                        inhibitor.Locked          = true;
                        inhibitor.NextRespawnTime = inhibitor.RespawnTime + (int)Game.ClockTime;
                    }
                }
            }

            /////

            if (InhibitorTimer.GetActive())
            {
                if (_inhibitors.Inhibitors == null)
                {
                    return;
                }
                foreach (InhibitorObject inhibitor in _inhibitors.Inhibitors)
                {
                    if (inhibitor.Locked)
                    {
                        if (inhibitor.NextRespawnTime <= 0)
                        {
                            continue;
                        }
                        int time = Timer.Timers.GetMenuItem("SAssembliesTimersRemindTime").GetValue <Slider>().Value;
                        if (!inhibitor.Called && inhibitor.NextRespawnTime - (int)Game.ClockTime <= time &&
                            inhibitor.NextRespawnTime - (int)Game.ClockTime >= time - 1)
                        {
                            inhibitor.Called = true;
                            Timer.PingAndCall("Inhibitor respawns in " + time + " seconds!", inhibitor.Obj.Position);
                            if (InhibitorTimer.GetMenuItem("SAssembliesTimersInhibitorSpeech").GetValue <bool>())
                            {
                                Speech.Speak("Inhibitor respawns in " + time + " seconds!");
                            }
                        }
                    }
                }
            }
        }
Exemple #30
0
 public MainPage()
 {
     this.InitializeComponent();
     Speech.Speak("Welcome to the Intel AI DevJam IDC Classifier GUI Demo, please authenticate yourself using the camera.");
     NavigationCacheMode = NavigationCacheMode.Disabled;
 }