private void button채널변경_Click(object sender, EventArgs e)
        {
            AutoHotkeyHelper.ExecRaw(@"Send {-}
Sleep 500
Send {Right}
Sleep 500
Send {Enter}");
        }
        private void HPMPWatcher_MP_변경_시(object sender, EventArgs e)
        {
            Invoke(new Action(() =>
            {
                labelPixelSearch.Text = hPMPWatcher.CurrentMPPercent.ToString();
            }));

            if (hPMPWatcher.CurrentMPPercent < 20)
            {
                AutoHotkeyHelper.ExecRaw(@"Send {Del}");
            }
        }
        private void TmrMacro_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
        {
            if (공격방향_오른쪽에서_왼쪽으로)
            {
                AutoHotkeyHelper.ExecRaw(CurrentConfig.SCRIPT_PATTERN_ATTACK_1);

                FireLog("공격패턴 1 실행");
            }
            else
            {
                AutoHotkeyHelper.ExecRaw(CurrentConfig.SCRIPT_PATTERN_ATTACK_2);

                FireLog("공격패턴 2 실행");
            }
        }
        private void timer공격패턴1_Tick(object sender, EventArgs e)
        {
            if (공격방향_오른쪽에서_왼쪽으로)
            {
                AutoHotkeyHelper.ExecRaw(textBox공격패턴_1.Text);

                AddLog("공격패턴 1 실행");
            }
            else
            {
                AutoHotkeyHelper.ExecRaw(textBox공격패턴_2.Text);

                AddLog("공격패턴 2 실행");
            }
        }
        private void timer1_Tick(object sender, EventArgs e)
        {
            var color = AutoHotkeyHelper.PixelGetColor2();

            label1.Text = color;

            var tempColor  = color.Substring(2);
            var tempColorB = color.Substring(2, 2);
            var tempColorG = color.Substring(4, 2);
            var tempColorR = color.Substring(6, 2);

            panel1.BackColor = Color.FromArgb(Int32.Parse(tempColorR, System.Globalization.NumberStyles.HexNumber),
                                              Int32.Parse(tempColorG, System.Globalization.NumberStyles.HexNumber),
                                              Int32.Parse(tempColorB, System.Globalization.NumberStyles.HexNumber));


            var point = AutoHotkeyHelper.MouseGetPos();

            labelMousePosition.Text = $"X:{point.X}, Y:{point.Y}";
        }
        private void TmrMacro_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
        {
            if (공격방향_오른쪽에서_왼쪽으로)
            {
                AutoHotkeyHelper.ExecRaw(tmr공격패턴_1_script);

                Invoke(new Action(() =>
                {
                    AddLog("공격패턴 1 실행");
                }));
            }
            else
            {
                AutoHotkeyHelper.ExecRaw(tmr공격패턴_2_script);

                Invoke(new Action(() =>
                {
                    AddLog("공격패턴 2 실행");
                }));
            }
        }
        private void TimerAutoBuff_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
        {
            if (queueAutoBuff.Count == 0)
            {
                return;
            }

            timerAutoBuff.Enabled = false;
            lock (lockQueueAutoBuff)
            {
                while (queueAutoBuff.Count > 0)
                {
                    var tempKeys = queueAutoBuff.Dequeue();

                    AutoHotkeyHelper.Send(tempKeys);

                    FireLog($"{tempKeys.ToString()} 키 입력");

                    System.Threading.Thread.Sleep(700);
                }
            }
            timerAutoBuff.Enabled = true;
        }
Exemplo n.º 8
0
        private void TimerMain_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
        {
            // minimap_title
            string img5 = $"{GlobalCode.PROGRAM_IMAGES_TEST}minimap_transblack.bmp";
            var    pointMinimapTitle = AutoHotkeyHelper.ImageSearch(POINT_MINIMAP_LEFT_TOP.X, POINT_MINIMAP_LEFT_TOP.Y, 550, 150, img5);

            CourrentPointMinimapTitle = pointMinimapTitle;

            // minimap_right
            string img13      = $"{GlobalCode.PROGRAM_IMAGES_TEST}minimap_right_transblack.bmp";
            var    pointRight = AutoHotkeyHelper.ImageSearch(POINT_MINIMAP_LEFT_TOP.X, POINT_MINIMAP_LEFT_TOP.Y, 500, 300, img13);

            CourrentPointRight = pointRight;

            // minimap_left
            string img14     = $"{GlobalCode.PROGRAM_IMAGES_TEST}minimap_left_transblack.bmp";
            var    pointLeft = AutoHotkeyHelper.ImageSearch(POINT_MINIMAP_LEFT_TOP.X, POINT_MINIMAP_LEFT_TOP.Y, 300, 500, img14);

            CourrentPointLeft = pointLeft;

            if (CourrentPointMinimapTitle.HasValue == false ||
                CourrentPointRight.HasValue == false)
            {
                CourrentPointMinimapTitle = null;
                CourrentPointRight        = null;
                CourrentPointLeft         = null;
                CourrentPointUser         = null;
                CourrentPointRune         = null;
                CourrentPointHiddenStreet = null;
                CourrentPointDiffUser     = null;

                return;
            }

            // minimap_user
            string img12     = $"{GlobalCode.PROGRAM_IMAGES_TEST}minimap_user_transblack3.bmp";
            var    pointUser = AutoHotkeyHelper.ImageSearch(POINT_MINIMAP_LEFT_TOP.X, POINT_MINIMAP_LEFT_TOP.Y, Math.Min(POINT_MINIMAP_RIGHT_BOTTOM.X, pointRight.Value.X), POINT_MINIMAP_RIGHT_BOTTOM.Y, img12);

            CourrentPointUser = pointUser;

            // minimap rune
            string img15     = $"{GlobalCode.PROGRAM_IMAGES_TEST}minimap_rune_transblack.bmp";
            var    pointRune = AutoHotkeyHelper.ImageSearch(POINT_MINIMAP_LEFT_TOP.X, POINT_MINIMAP_LEFT_TOP.Y, Math.Min(POINT_MINIMAP_RIGHT_BOTTOM.X, pointRight.Value.X), POINT_MINIMAP_RIGHT_BOTTOM.Y, img15);

            CourrentPointRune = pointRune;

            // minimap hidden street
            string img16             = $"{GlobalCode.PROGRAM_IMAGES_TEST}minimap_hiddenstreet_transblack.bmp";
            var    pointHiddenStreet = AutoHotkeyHelper.ImageSearch(POINT_MINIMAP_LEFT_TOP.X, POINT_MINIMAP_LEFT_TOP.Y, Math.Min(POINT_MINIMAP_RIGHT_BOTTOM.X, pointRight.Value.X), POINT_MINIMAP_RIGHT_BOTTOM.Y, img16);

            CourrentPointHiddenStreet = pointHiddenStreet;

            // minimap diff user
            string img17         = $"{GlobalCode.PROGRAM_IMAGES_TEST}minimap_diff_user_transblack.bmp";
            var    pointDiffUser = AutoHotkeyHelper.ImageSearch(POINT_MINIMAP_LEFT_TOP.X, POINT_MINIMAP_LEFT_TOP.Y, Math.Min(POINT_MINIMAP_RIGHT_BOTTOM.X, pointRight.Value.X), POINT_MINIMAP_RIGHT_BOTTOM.Y, img17);

            CourrentPointDiffUser = pointDiffUser;

            // 왼쪽/오른쪽 방향 바꾸기
            if (pointUser.HasValue && pointLeft.HasValue &&
                pointUser.Value.X < (pointLeft.Value.X + 30))
            {
                if (화면_왼쪽에_도달_시 != null)
                {
                    화면_왼쪽에_도달_시(this, new EventArgs());
                }
            }

            if (pointUser.HasValue && pointRight.HasValue &&
                pointUser.Value.X > (pointRight.Value.X - 30))
            {
                if (화면_오른쪽에_도달_시 != null)
                {
                    화면_오른쪽에_도달_시(this, new EventArgs());
                }
            }

            if (pointMinimapTitle.HasValue && (PrevPointRune.HasValue == false) && pointRune.HasValue)
            {
                if (룬_생성_시 != null)
                {
                    룬_생성_시(this, new EventArgs());
                }
            }

            if (pointMinimapTitle.HasValue && (PrevPointHiddenStreet.HasValue == false) && pointHiddenStreet.HasValue)
            {
                if (히든_스트리트_생성_시 != null)
                {
                    히든_스트리트_생성_시(this, new EventArgs());
                }
            }

            if (pointMinimapTitle.HasValue && (PrevPointDiffUser.HasValue == false) && pointDiffUser.HasValue)
            {
                if (다른_유저가_존재_시 != null)
                {
                    다른_유저가_존재_시(this, new EventArgs());
                }
            }

            PrevPointMinimapTitle = pointMinimapTitle;
            PrevPointUser         = pointUser;
            PrevPointRune         = pointRune;
            PrevPointHiddenStreet = pointHiddenStreet;
            PrevPointDiffUser     = pointDiffUser;

            if (Tick != null)
            {
                Tick(this, new EventArgs());
            }
        }
Exemplo n.º 9
0
        private void TimerMain_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
        {
            var CurrentResolution = GetCurrentResolution();

            if (CurrentResolution == null)
            {
                CurrentHPPercent = null;
                CurrentMPPercent = null;
                return;
            }

            // left header
            string img5 = $"{GlobalCode.PROGRAM_IMAGES_TEST}hpmp_left_original.bmp";
            var pointHeader = AutoHotkeyHelper.ImageSearch(CurrentResolution.HEADER_LEFT_TOP.X, CurrentResolution.HEADER_LEFT_TOP.Y, CurrentResolution.HEADER_RIGHT_BOTTOM.X, CurrentResolution.HEADER_RIGHT_BOTTOM.Y, img5);
            
            if(pointHeader.HasValue == false)
            {
                CurrentHPPercent = null;
                CurrentMPPercent = null;
                return;
            }

            // HP
            int? findHPPointX = null;
            int? findHPPercent = null;

            for (int i = CurrentResolution.HPMP_MIN_X; i <= CurrentResolution.HPMP_MAX_X; i = i + 20)
            {
                var color = AutoHotkeyHelper.PixelGetColor(i, CurrentResolution.HP_CHECK_Y);

                if (color == CurrentResolution.HP_EMPTY_COLOR)
                {
                    findHPPointX = i;
                    break;
                }
            }

            if (findHPPointX.HasValue)
                findHPPercent = (int)(((double)(findHPPointX - CurrentResolution.HPMP_MIN_X) / (double)(CurrentResolution.HPMP_MAX_X - CurrentResolution.HPMP_MIN_X)) * 100);
            
            // MP             
            int? findMPPointX = null;
            int? findMPPercent = null;

            for (int i = CurrentResolution.HPMP_MIN_X; i <= CurrentResolution.HPMP_MAX_X; i = i + 20)
            {
                var color = AutoHotkeyHelper.PixelGetColor(i, CurrentResolution.MP_CHECK_Y);

                if (color == CurrentResolution.MP_EMPTY_COLOR)
                {
                    findMPPointX = i;
                    break;
                }
            }

            if (findMPPointX.HasValue)
                findMPPercent = (int)(((double)(findMPPointX - CurrentResolution.HPMP_MIN_X) / (double)(CurrentResolution.HPMP_MAX_X - CurrentResolution.HPMP_MIN_X)) * 100);

            if (pointHeader.HasValue && !findHPPercent.HasValue)
                findHPPercent = 100;
            if (pointHeader.HasValue && !findMPPercent.HasValue)
                findMPPercent = 100;

            if (findHPPercent.HasValue)
            {
                CurrentHPPercent = findHPPercent;

                if (PrevHPPercent.HasValue && PrevHPPercent.Value != findHPPercent.Value)
                {
                    if (HP_변경_시 != null)
                        HP_변경_시(this, new EventArgs());
                }

                
                PrevHPPercent = findHPPercent;
            }

            if (findMPPercent.HasValue)
            {
                CurrentMPPercent = findMPPercent;

                if (PrevMPPercent.HasValue && PrevMPPercent.Value != findMPPercent.Value)
                {
                    if (MP_변경_시 != null)
                        MP_변경_시(this, new EventArgs());
                }
                
                PrevMPPercent = findMPPercent;
            }

            if (Tick != null)
                Tick(this, new EventArgs());
        }