Esempio n. 1
0
        private void timer_antiAFK_Tick(object sender, EventArgs e)
        {
            timerAntiAFK.Interval = rand.Next(30000, 90000);

            if (settings.PauseFocus)
            {
                if (GetForegroundWindow() != hWnd_wow)
                {
                    WoWCommand.sendAntiAFK(hWnd_wow);
                }
            }
            else
            {
                WoWCommand.sendAntiAFK(hWnd_wow);
            }
        }
Esempio n. 2
0
        private void QueueStatus_IsReady(string queueReadyName, string mapName)
        {
            DTModule module = new DTModule();
            bool     pve = false, pvp = false;

            queueReady = true;
            Image img = null;

            switch (queueReadyName)
            {
            case "Dungeon Finder":
                pve      = true;
                resetLFD = true;
                module   = lfdModule;
                img      = Properties.Resources.dungeon_finder_icon;
                break;

            case "Raid Finder":
                pve      = true;
                resetLFR = true;
                module   = lfrModule;
                img      = Properties.Resources.raid_finder_icon;
                break;

            case "Battleground 1":
                pvp    = true;
                module = bg1Module;
                img    = Properties.Resources.pvp_finder_icon;
                break;

            case "Battleground 2":
                pvp    = true;
                module = bg2Module;
                img    = Properties.Resources.pvp_finder_icon;
                break;

            case "Random Dungeon":
                pve      = true;
                resetLFD = true;
                module   = lfdModule;
                img      = Properties.Resources.dungeon_finder_icon;
                break;
            }

            Helper.setReady(module, mapName);

            timerAntiAFK.Stop();

            if (settings.BalloonTips)
            {
                notifyIcon1.BalloonTipText = String.Format("{0} queue is ready!", queueReadyName);
                notifyIcon1.ShowBalloonTip(500);
            }

            if (settings.Sound)
            {
                ready.Play();
            }

            if (settings.AutoJoin)
            {
                if (pve)
                {
                    WoWCommand.sendSlashCommand(hWnd_wow, "/click LFGDungeonReadyDialogEnterDungeonButton");
                }
                if (pvp)
                {
                    WoWCommand.sendSlashCommand(hWnd_wow, "/click StaticPopup1Button1");
                }
            }

            if (!settings.TrayOnly)
            {
                this.Show();
                this.WindowState = FormWindowState.Normal;
            }

            if (settings.BringToFront)
            {
                SetForegroundWindow(hWnd_wow);
                ShowWindow(hWnd_wow, SW_RESTORE);
            }

            if (settings.UseMQTT)
            {
                try
                {
                    MQTT.send(queueReadyName + " - " + mapName);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(String.Format("Unexpected MQTT error : {0}", ex.InnerException), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }

            if (settings.DesktopNotification)
            {
                if (!notification.Visible)
                {
                    DialogResult result = notification.ShowDialog(new DesktopNotification.costumArguments(img, queueReadyName, mapName));

                    if (result == DialogResult.OK)
                    {
                        SetForegroundWindow(hWnd_wow);
                        ShowWindow(hWnd_wow, SW_RESTORE);
                    }
                }
            }



            if (settings.PushProider != 0)
            {
                Notification.sendPushNotification(settings.PushProider, settings.PushKey, "Queue ready!", String.Format("Your {0} queue is now ready!", queueReadyName));
            }
            if (settings.MailNotification)
            {
                Notification.sendMail(settings.MailAddress, "Queue ready", String.Format("Your {0} queue is now ready!", queueReadyName));
            }
        }