Exemplo n.º 1
0
        public void TimerElapsed()
        {
            WoWPlayerMe me = game.GetGameObjects(objects, null, npcs);

            if (me != null)
            {
                WowNpc    npc       = npcs.FirstOrDefault(l => l.Alive && POI.Contains(l.Name));
                WowObject wowObject = objects.FirstOrDefault(l => POI.Contains(l.Name));
                if (npc != null || wowObject != null)
                {
                    string name = npc != null ? npc.Name : wowObject.Name;
                    this.LogPrint("Found new POI: " + name);
                    if ((DateTime.UtcNow - lastTimeSmsSent).TotalSeconds >= timeout)
                    {
                        lastTimeSmsSent = DateTime.UtcNow;
                        this.LogPrint("Timing is OK");
                        dynamic libSMS = Utilities.GetReferenceOfPlugin("LibSMS");
                        if (libSMS != null)
                        {
                            libSMS.SendSMS($"Rare spawned: {name}\r\nTime: {DateTime.Now}");
                            Utilities.ShowNotify(this, $"Rare spawned: {name}\r\nTime: {DateTime.Now}", true, true, int.MaxValue); // $"Rare spawned: {name}" // string.Format("Rare spawned: {0}", name)
                            this.LogPrint($"Rare spawned: {name}; message is sent");
                        }
                    }
                }
            }
        }