Example #1
0
        private string GetCaptcha()
        {
            CheckLic();
            var b   = new Sbmp(_sc);
            var bcl = b.Crop(_bdoWindow.LCaptcha);
            var bcr = b.Crop(_bdoWindow.RCaptcha);

            bcl = ImgHelpers.Threshold(bcl);
            bcr = ImgHelpers.Threshold(bcr);
            bcl = bcl.Crop(ImgHelpers.GetRect(bcl));
            bcr = bcr.Crop(ImgHelpers.GetRect(bcr));
            var s = _tr.Recognize(bcl);

            if (s == "-")
            {
                bcl.GetBmp().Save(DateTime.Now.ToShortTimeString() + "l.bmp");
            }
            s += _tr.Recognize(bcr);
            if (s[1] == '-')
            {
                bcr.GetBmp().Save(DateTime.Now.ToShortTimeString() + "r.bmp");
            }
            bcl.Dispose();
            bcr.Dispose();
            b.Dispose();
            return(s);
        }
Example #2
0
 private void BoardRefresh()
 {
     Dispatcher.Invoke(() =>
     {
         Items.Children.Clear();
         for (var i = 0; i < _bitems.Count; i++)
         {
             _bitems[i].G.Margin = new Thickness(0, i * 62 + 5, 0, 0);
             Items.Children.Add(_bitems[i].G);
         }
         if (_bitems.Count == 0)
         {
             //TaskBoard.Visibility = Visibility.Hidden;
             LABSS.Content    = "[Выкл]";
             LABSS.Foreground = new SolidColorBrush(Color.FromArgb(0xff, 0xee,
                                                                   0x22, 0x22));
             IStartBack.Source = ImgHelpers.BitmapToImageSource(Properties.Resources.startback);
         }
         else
         {
             TaskBoard.Visibility = Visibility.Visible;
         }
         LItemsCount.Content = _bitems.Count.ToString();
     });
 }
Example #3
0
 internal AItem()
 {
     _un  = true;
     Img  = new Sbmp(Properties.Resources.unk);
     ImgS = Img.Crop(new Rectangle(13, 12, 37, 37));
     G    = new Grid
     {
         Width  = 246,
         Height = 60,
         HorizontalAlignment = HorizontalAlignment.Left,
         VerticalAlignment   = VerticalAlignment.Top
     };
     ImgL = new Image
     {
         Width  = 200,
         Height = 60,
         HorizontalAlignment = HorizontalAlignment.Left,
         VerticalAlignment   = VerticalAlignment.Top,
         Source = ImgHelpers.BitmapToImageSource(Img.GetBmp()),
         Margin = new Thickness(0, 0, 0, 0)
     };
     ImgX = new Image
     {
         Width  = 46,
         Height = 60,
         HorizontalAlignment = HorizontalAlignment.Left,
         VerticalAlignment   = VerticalAlignment.Top,
         Source = ImgHelpers.BitmapToImageSource(Properties.Resources.del),
         Margin = new Thickness(200, 0, 0, 0)
     };
     RenderOptions.SetBitmapScalingMode(ImgL, BitmapScalingMode.HighQuality);
     RenderOptions.SetBitmapScalingMode(ImgX, BitmapScalingMode.HighQuality);
     G.Children.Add(ImgL);
     G.Children.Add(ImgX);
 }
Example #4
0
 private void MMouseListenerOnMouseMove(object sender, MouseEventArgs e)
 {
     if (_bdoWindow.Ws != BdoWindow.WindowState.Main || _state != State.On)
     {
         return;
     }
     if (AbsC(Gmax).Contains(e.X, e.Y))
     {
         Imgmax.Source  = ImgHelpers.BitmapToImageSource(Properties.Resources._61);
         Tt1.Visibility = Visibility.Visible;
     }
     else
     {
         Imgmax.Source  = ImgHelpers.BitmapToImageSource(Properties.Resources._6);
         Tt1.Visibility = Visibility.Hidden;
     }
     if (new Rectangle(AbsC(Gsp).X, AbsC(Gsp).Y, AbsC(Gsp).Width - 50, AbsC(Gsp).Height).Contains(e.X, e.Y))
     {
         Imgsp.Source   = ImgHelpers.BitmapToImageSource(Properties.Resources._81);
         Tt2.Visibility = Visibility.Visible;
         Tt3.Visibility = Visibility.Hidden;
     }
     else if (new Rectangle(AbsC(Gsp).X + 50, AbsC(Gsp).Y, AbsC(Gsp).Width - 50, AbsC(Gsp).Height).Contains(e.X,
                                                                                                            e.Y))
     {
         Imgsp.Source   = ImgHelpers.BitmapToImageSource(Properties.Resources._82);
         Tt2.Visibility = Visibility.Hidden;
         Tt3.Visibility = Visibility.Visible;
     }
     else
     {
         Imgsp.Source   = ImgHelpers.BitmapToImageSource(Properties.Resources._8);
         Tt2.Visibility = Visibility.Hidden;
         Tt3.Visibility = Visibility.Hidden;
     }
     Tt4.Visibility = AbsC(IDResume).Contains(e.X, e.Y) ? Visibility.Visible : Visibility.Hidden;
     Tt5.Visibility = AbsC(IResume).Contains(e.X, e.Y) ? Visibility.Visible : Visibility.Hidden;
     Tt6.Visibility = AbsC(IStop).Contains(e.X, e.Y) ? Visibility.Visible : Visibility.Hidden;
     Tt7.Visibility = AbsC(IDela).Contains(e.X, e.Y) ? Visibility.Visible : Visibility.Hidden;
     Tt8.Visibility = AbsC(IAddUn).Contains(e.X, e.Y) ? Visibility.Visible : Visibility.Hidden;
     if (new Rectangle(_bdoWindow.CAX - 34, _bdoWindow.CAY - 219, 52, 30).Contains(e.X, e.Y))
     {
         Gmax.Visibility = Visibility.Hidden;
         Gsp.Visibility  = Visibility.Hidden;
     }
     else
     {
         Gmax.Visibility = Visibility.Visible;
         Gsp.Visibility  = Visibility.Visible;
     }
 }
Example #5
0
        private void MainWindow_OnLoaded(object sender, RoutedEventArgs e)
        {
            AppDomain.CurrentDomain.AssemblyResolve += CurrentDomainOnAssemblyResolve;
            ArgCheck();
            if (Process.GetProcessesByName("BDOA").Length > 1)
            {
                Process.GetCurrentProcess().Kill();
            }
            _lic       = new License("http://angelhci.bget.ru/LBDOA.php");
            _bdoWindow = new BdoWindow();
            _sc        = new DxScreenCapture();
            _dControl  = new DControl(_speed);
            Imports.SetWindowLong(Process.GetCurrentProcess().MainWindowHandle, -20,
                                  Imports.GetWindowLong(Process.GetCurrentProcess().MainWindowHandle, -20) | 0x00000020);
            Start();
            CheckLic();
            new Thread(IntScan).Start();
            Imgmax.Source   = ImgHelpers.BitmapToImageSource(Properties.Resources._6);
            Imgsp.Source    = ImgHelpers.BitmapToImageSource(Properties.Resources._8);
            IResume.Source  = ImgHelpers.BitmapToImageSource(Properties.Resources.resume);
            IDResume.Source = ImgHelpers.BitmapToImageSource(Properties.Resources.delres);
            IStop.Source    = ImgHelpers.BitmapToImageSource(Properties.Resources.delallg);
            IAddUn.Source   = ImgHelpers.BitmapToImageSource(Properties.Resources.addun);

            IStartBack.Source = ImgHelpers.BitmapToImageSource(Properties.Resources.startback);
            IDela.Source      = ImgHelpers.BitmapToImageSource(Properties.Resources.dela);

            RenderOptions.SetBitmapScalingMode(Imgmax, BitmapScalingMode.HighQuality);
            RenderOptions.SetBitmapScalingMode(Imgsp, BitmapScalingMode.HighQuality);
            RenderOptions.SetBitmapScalingMode(IResume, BitmapScalingMode.HighQuality);
            RenderOptions.SetBitmapScalingMode(IDResume, BitmapScalingMode.HighQuality);
            RenderOptions.SetBitmapScalingMode(IStop, BitmapScalingMode.HighQuality);
            RenderOptions.SetBitmapScalingMode(IStartBack, BitmapScalingMode.HighQuality);
            RenderOptions.SetBitmapScalingMode(IDela, BitmapScalingMode.HighQuality);
            RenderOptions.SetBitmapScalingMode(IAddUn, BitmapScalingMode.HighQuality);
            _state = State.Off;
            Dispatcher.Invoke(() =>
            {
                LABS.Content    = "[Выкл]";
                LABS.Foreground = new SolidColorBrush(Color.FromArgb(0xcc, 0xcc,
                                                                     0x22, 0x22));
            });
        }
Example #6
0
 private void BuyingProc()
 {
     CheckLic();
     while (_bitems.Count != 0 && _listByuing && _state == State.On)
     {
         var b = new Sbmp(_sc);
         for (var i = 0; i < 7 && _listByuing; i++)
         {
             try
             {
                 for (var j = 0; j < _bitems.Count && _listByuing; j++)
                 {
                     var q = _bitems[j];
                     if (q._un)
                     {
                         var c = b.GetPixel(_bdoWindow.CAX - 270, _bdoWindow.CAY - 157 + i * 62);
                         if (c.R == c.G || c.G == c.B)
                         {
                             continue;
                         }
                         Exec(i);
                         Dispatcher.Invoke(() =>
                         {
                             if (_bstate == BState.DelRes)
                             {
                                 DelItem(j);
                             }
                             if (_bstate == BState.Stop)
                             {
                                 DelAllItem();
                             }
                         });
                         throw new InvalidOperationException();
                     }
                     else
                     {
                         if (
                             !q.ImgS.Compare(b,
                                             new Rectangle(_bdoWindow.CAX - 267, _bdoWindow.CAY - 155 + i * 62, 150, 37), 25,
                                             100))
                         {
                             continue;
                         }
                         Exec(i);
                         //if (s == BuyMessage.Bought)
                         Dispatcher.Invoke(() =>
                         {
                             if (_bstate == BState.DelRes)
                             {
                                 DelItem(j);
                             }
                             if (_bstate == BState.Stop)
                             {
                                 DelAllItem();
                             }
                         });
                         throw new InvalidOperationException();
                     }
                 }
             }
             catch (InvalidOperationException)
             {
                 break;
             }
         }
     }
     _listByuing = false;
     Dispatcher.Invoke(() =>
     {
         LABSS.Content    = "[Выкл]";
         LABSS.Foreground = new SolidColorBrush(Color.FromArgb(0xff, 0xee,
                                                               0x22, 0x22));
         IStartBack.Source = ImgHelpers.BitmapToImageSource(Properties.Resources.startback);
     });
 }
Example #7
0
        private void AMouseDown(object sender, MouseEventExtArgs e)
        {
            if (_bdoWindow.Ws != BdoWindow.WindowState.Main || _getImg || _state != State.On)
            {
                return;
            }
            if (_exec)
            {
                return;
            }
            if (AbsC(Gmax).Contains(e.X, e.Y))
            {
                _bmax     = !_bmax;
                Emax.Fill = _bmax
                    ? new SolidColorBrush(Color.FromArgb(255, 0x33, 0xcc, 0x33))
                    : new SolidColorBrush(Color.FromArgb(255, 0xcc, 0x33, 0x33));
            }
            if (new Rectangle(AbsC(Gsp).X, AbsC(Gsp).Y, AbsC(Gsp).Width - 50, AbsC(Gsp).Height).Contains(e.X, e.Y))
            {
                if (_speed > 0)
                {
                    _speed--;
                }
                Dispatcher.Invoke(() => { Lbsp.Content = _speed.ToString(); });
                _dControl.Sett(_speed);
            }
            if (new Rectangle(AbsC(Gsp).X + 50, AbsC(Gsp).Y, AbsC(Gsp).Width - 50, AbsC(Gsp).Height).Contains(e.X, e.Y))
            {
                if (_speed < 11)
                {
                    _speed++;
                }
                Dispatcher.Invoke(() => { Lbsp.Content = _speed.ToString(); });
                _dControl.Sett(_speed);
            }
            if (AbsC(Items).Contains(e.X, e.Y))
            {
                for (var i = 0; i < _bitems.Count; i++)
                {
                    if (AbsC(_bitems[i].ImgX).Contains(e.X, e.Y))
                    {
                        DelItem(i);
                    }
                }
            }
            if (AbsC(IResume).Contains(e.X, e.Y))
            {
                Dispatcher.Invoke(() =>
                {
                    IResume.Source  = ImgHelpers.BitmapToImageSource(Properties.Resources.resumeg);
                    IDResume.Source = ImgHelpers.BitmapToImageSource(Properties.Resources.delres);
                    IStop.Source    = ImgHelpers.BitmapToImageSource(Properties.Resources.delall);
                });
                _bstate = BState.Res;
            }
            if (AbsC(IDResume).Contains(e.X, e.Y))
            {
                Dispatcher.Invoke(() =>
                {
                    IResume.Source  = ImgHelpers.BitmapToImageSource(Properties.Resources.resume);
                    IDResume.Source = ImgHelpers.BitmapToImageSource(Properties.Resources.delresg);
                    IStop.Source    = ImgHelpers.BitmapToImageSource(Properties.Resources.delall);
                });
                _bstate = BState.DelRes;
            }
            if (AbsC(IStop).Contains(e.X, e.Y))
            {
                Dispatcher.Invoke(() =>
                {
                    IResume.Source  = ImgHelpers.BitmapToImageSource(Properties.Resources.resume);
                    IDResume.Source = ImgHelpers.BitmapToImageSource(Properties.Resources.delres);
                    IStop.Source    = ImgHelpers.BitmapToImageSource(Properties.Resources.delallg);
                });
                _bstate = BState.Stop;
            }
            if (AbsC(IDela).Contains(e.X, e.Y))
            {
                DelAllItem();
            }
            if (AbsC(IStartBack).Contains(e.X, e.Y))
            {
                if (_listByuing)
                {
                    _listByuing = false;
                    Dispatcher.Invoke(() =>
                    {
                        LABSS.Content    = "[Выкл]";
                        LABSS.Foreground = new SolidColorBrush(Color.FromArgb(0xff, 0xee,
                                                                              0x22, 0x22));
                        IStartBack.Source = ImgHelpers.BitmapToImageSource(Properties.Resources.startback);
                    });
                }
                else
                {
                    _listByuing = true;
                    new Thread(() => { BuyingProc(); }).Start();
                    Dispatcher.Invoke(() =>
                    {
                        LABSS.Content    = "[Вкл]";
                        LABSS.Foreground = new SolidColorBrush(Color.FromArgb(0xff, 0x22,
                                                                              0xcc, 0x22));
                        IStartBack.Source = ImgHelpers.BitmapToImageSource(Properties.Resources.startbackp);
                    });
                }
            }
            if (AbsC(IAddUn).Contains(e.X, e.Y))
            {
                AddItem();
            }
            var pos = GetLotPos(e.X, e.Y);

            if (pos == -1)
            {
                return;
            }
            if (e.Button == MouseButtons.Left)
            {
                e.Handled = true;
                new Thread(() => { Exec(pos); }).Start();
            }
            if (e.Button != MouseButtons.Right)
            {
                return;
            }
            e.Handled = true;
            new Thread(() => { AddItem(GetItemImg(pos)); }).Start();
        }