Beispiel #1
0
        private bool LookForClose()
        {
            var count = 0;

            do
            {
                if (this.StopAllProcessing)
                {
                    return(false);
                }
                this.UpdateSplashMessage($" Looking for close {count}.");
                Thread.Sleep(1000);
                if (this.fakeMoves)
                {
                    SmoothMouseMove.MoveMouseInCircle(this.rand.Next(this.DisplayScreen.X, this.DisplayScreen.Width));
                    //this.keyboardSimulator.TextEntry();
                    SmoothMouseMove.MoveMouse(this.rand.Next(this.DisplayScreen.X, this.DisplayScreen.Width), this.rand.Next(this.DisplayScreen.Y, this.DisplayScreen.Height), 2, 2);
                    SmoothMouseMove.MoveMouseInCircle((this.rand.Next(this.DisplayScreen.X, this.DisplayScreen.Width)));
                }

                if (count == 25)
                {
                    this.Refresh();
                }

                if (count++ > 30)
                {
                    this.UpdateSplashMessage($"Close not found after {count} trys");
                    this.Close();
                    return(true);
                }
            }while (this.CloseAd() == false);
            this.CloseSplash();
            return(true);
        }
Beispiel #2
0
        public override bool GamePrize()
        {
            if (this.StopAllProcessing)
            {
                return(false);
            }
            int count = 0;

            while (true)
            {
                if (this.StopAllProcessing)
                {
                    return(false);
                }
                var bmpScreenBitmap = this.screenShotsManager.ScreenShot("adprize.bmp");
                Thread.Sleep(this.rand.Next(500, 1500));
                Point?foundBmpAt = null;
                this.UpdateSplashMessage($" Looking for Ad ...");
                foreach (var toFindBitmap in this.toFindBitmaps)
                {
                    foundBmpAt = this.screenShotsManager.Find(bmpScreenBitmap, toFindBitmap);
                    if (foundBmpAt.HasValue)
                    {
                        this.UpdateSplashMessage($" Found Ad ...");
                        break;
                    }
                }

                if (foundBmpAt != null)
                {
                    SmoothMouseMove.MoveMouse(foundBmpAt.Value.X + this.rand.Next(5, 30), foundBmpAt.Value.Y + +this.rand.Next(2, 8), 2, 2);
                    Thread.Sleep(this.rand.Next(100, 500));
                    this.mouseSimulator?.LeftButtonClick();
                    MouseInput.MoveMouse(foundBmpAt.Value.X + this.rand.Next(50, 100), foundBmpAt.Value.Y + this.rand.Next(0, 280));
                    SmoothMouseMove.MoveMouseInCircle(50);
                    count = 0;
                    this.ShowSplashMessage(this.DisplayScreen.Location, "Finished clicking ...", 40000);
                    Thread.Sleep(this.rand.Next(100, 500));
                }

                if (count++ == 20)
                {
                    this.Refresh();
                }

                if (count > 30)
                {
                    this.Close();
                    return(true);
                }
            }
        }
Beispiel #3
0
        private bool FindTheAdAndClickIt()
        {
            if (this.StopAllProcessing)
            {
                return(false);
            }
            var   bmpScreenBitmap = this.screenShotsManager.ScreenShot("shota.bmp");
            Point?foundBmpAt      = Point.Empty;

            this.ShowSplashMessage(this.DisplayScreen.Location, "Finding Ad", 40000);
            for (int index = 0; index < this.toFindBitmaps.Count; index++)
            {
                var toFindBitmap = this.toFindBitmaps[index];
                foundBmpAt = this.screenShotsManager.Find(bmpScreenBitmap, toFindBitmap);
                if (foundBmpAt.HasValue)
                {
                    if (foundBmpAt.Value.Y > 800)
                    {
                        SmoothMouseMove.MoveMouse(foundBmpAt.Value.X, foundBmpAt.Value.Y, 1, 1);
                        MouseInput.ScrollWheel(-1);
                        Thread.Sleep(5000);
                        bmpScreenBitmap = this.screenShotsManager.ScreenShot("shota.bmp");
                        index           = 0;
                        continue;
                    }
                    break;
                }
            }

            if (foundBmpAt.HasValue)
            {
                this.UpdateSplashMessage($" Found an advert at : {foundBmpAt}");
                SmoothMouseMove.MoveMouseInCircle(5);
                SmoothMouseMove.MoveMouse(foundBmpAt.Value.X + this.rand.Next(-50, 50), foundBmpAt.Value.Y + this.rand.Next(-100, 100), 2, 1);
                SmoothMouseMove.MoveMouse(foundBmpAt.Value.X, foundBmpAt.Value.Y, 1, 1);
                Thread.Sleep(this.rand.Next(100, 1000));
                this.mouseSimulator?.LeftButtonClick();
            }
            else
            {
                this.UpdateSplashMessage($" No Ad Found ,returning false");
                return(false);
            }
            return(true);
        }
Beispiel #4
0
        public override bool FindAd()
        {
            if (this.StopAllProcessing)
            {
                return(false);
            }
            Thread.Sleep(3000); // wait for few seconds before
            var bmpScreenBitmap = this.screenShotsManager.ScreenShot("shota.bmp");
            // this.BackgroundImage = bmpScreenBitmap;
            Point?foundBmpAt = Point.Empty;

            foreach (var toFindBitmap in this.toFindBitmaps)
            {
                foundBmpAt = this.screenShotsManager.Find(bmpScreenBitmap, toFindBitmap);
                if (foundBmpAt.HasValue)
                {
                    break;
                }
            }

            if (foundBmpAt.HasValue)
            {
                Logger.Info($"Found an advert");
                SmoothMouseMove.MoveMouse(
                    foundBmpAt.Value.X + this.rand.Next(10, 40),
                    foundBmpAt.Value.Y + this.rand.Next(20, 25),
                    2,
                    1);
                Thread.Sleep(2500);
                this.mouseSimulator.LeftButtonClick();

                Point?foundCaptcha = null;
                var   counter      = 0;
                do
                {
                    if (this.StopAllProcessing)
                    {
                        return(false);
                    }
                    counter++;
                    Thread.Sleep(1000);
                    SmoothMouseMove.MoveMouseInCircle(this.rand.Next(5, 200));
                    //this.keyboardSimulator.TextEntry();
                    SmoothMouseMove.MoveMouse(this.rand.Next(this.DisplayScreen.X, this.DisplayScreen.Width), this.rand.Next(this.DisplayScreen.Y, this.DisplayScreen.Height), 2, 2);
                    SmoothMouseMove.MoveMouseInCircle(this.rand.Next(50, 100));

                    var webBrowserTabTitle = BrowserProcessHelpers.GetWebBrowserTabTitle("firefox");
                    if (webBrowserTabTitle.Contains("Internal Server Error"))
                    {
                        this.keyboardSimulator.ModifiedKeyStroke(VirtualKeyCode.CONTROL, VirtualKeyCode.VK_W);
                        Logger.Info($" Keyboard Close");
                        return(true);
                    }
                }while (!this.MegaAdCaptchaSolve(out foundCaptcha) && counter < 7);

                if (foundCaptcha.HasValue)
                {
                    SmoothMouseMove.MoveMouse(foundCaptcha.Value.X + this.rand.Next(10, 40), foundCaptcha.Value.Y + this.rand.Next(10, 24), 2, 2);
                    Thread.Sleep(50);
                    this.mouseSimulator.LeftButtonClick();
                    Thread.Sleep(1000);
                    this.keyboardSimulator.ModifiedKeyStroke(VirtualKeyCode.CONTROL, VirtualKeyCode.VK_W);
                    Logger.Info($" Keyboard Close");
                }
            }
            else
            {
                Logger.Info($"No Ad Found ...");
                return(false);
            }
            return(true);
        }