private void buttonFindSense_Click(object sender, EventArgs e) { var senseFindBitmaps = this.screenShotsManager.LoadAllBitmapsFromDirectory(Settings.Default.ClickSenseFindDir); var senseCloseBitmaps = this.screenShotsManager.LoadAllBitmapsFromDirectory(Settings.Default.ClickSenseCloseDir); this.catBitmaps = this.screenShotsManager.LoadAllBitmapsFromDirectoryAsDictionary(@".\\Cats\\"); this.clixSenseAdProcessor = new ClixSenseAdProcessor( this.screenShotsManager, senseFindBitmaps, this.catBitmaps, senseCloseBitmaps, Settings.Default.ClickSenseScreenIndex, Settings.Default.ScreenZoomFactorX, Settings.Default.ScreenZoomFactorY, this.checkBoxFakeMoves.Checked, Dispatcher.CurrentDispatcher); try { var senseTask = Task.Run( () => { this.clixSenseAdProcessor.DoAdProcessing(); ThreadHelpers.ShowThreadInformation($"Main Task(Task #{Task.CurrentId})"); }); } catch (OperationCanceledException exception) { Logger.Info($" Operation was cancelled. {exception.Message}"); } catch (Exception exception) { Logger.Info(exception); } }
private void buttonClixGridPrize_Click(object sender, EventArgs e) { var senseFindBitmaps = this.screenShotsManager.LoadAllBitmapsFromDirectory(Settings.Default.ClickSenseFindDir); var senseCloseBitmaps = this.screenShotsManager.LoadAllBitmapsFromDirectory(Settings.Default.ClickSenseCloseDir); this.clixSenseAdProcessor = new ClixSenseAdProcessor( this.screenShotsManager, senseFindBitmaps, this.catBitmaps, senseCloseBitmaps, Settings.Default.ClickSenseScreenIndex, Settings.Default.ScreenZoomFactorX, Settings.Default.ScreenZoomFactorY, this.checkBoxFakeMoves.Checked, Dispatcher.CurrentDispatcher); var endGame = @".\\ClixGridEnd\\endGame.bmp"; if (!File.Exists(endGame)) { this.ShowSplashMessage(new Point(Screen.PrimaryScreen.Bounds.Width / 2, Screen.PrimaryScreen.Bounds.Height / 2), $"File did not exist {endGame}", 3000); return; } var bmpEndGame2Find = (Bitmap)Image.FromFile(endGame); try { var senseTask = Task.Run( () => { this.clixSenseAdProcessor.GamePrize(bmpEndGame2Find); // ThreadHelpers.ShowThreadInformation($"Main Task(Task #{Task.CurrentId})"); }); } catch (OperationCanceledException exception) { Logger.Info($" Operation was cancelled. {exception.Message}"); } catch (Exception exception) { Logger.Info(exception); } }