void OnMapProcessorResult(object sender, ImageProcessorEventArgs <GameMapProcessorResult <MapMoveInfo> > e) { var vectors = e.ImageProcessorResult.VectorizationResult; AddToMapHistory(new HistoryElement <MapMoveInfo>() { MoveInfos = vectors }); }
void OnFogResult(object sender, ImageProcessorEventArgs <GameMapProcessorResult <MapDirectionMoveInfo> > e) { time += NativeApiWrapper.StandartDelay; var calcRes = e.ImageProcessorResult.VectorizationResult.ToList(); var itemsToRemove = calcRes.Where(a => a.Angle >= MaxAngle || a.Angle <= MinAngle).ToList(); foreach (var item in itemsToRemove) { calcRes.Remove(item); } AddToFogHistory(new HistoryElement <MapDirectionMoveInfo>() { MoveInfos = calcRes }); if (!mapHistory.Any()) { return; } if (lockObserver.Locked) { return; } if (time > MaxAreaTime) { OnAreaEnded(); return; } var mainAngle = MainAreaOrientation; IEnumerable <MapDirectionMoveInfo> vectorizationResult = null;; if (!calcRes.Any()) { var lastSuccessResult = fogHistory.OrderByDescending(a => a.ID).Where(a => a.MoveInfos.Any()); if (lastSuccessResult.Any()) { vectorizationResult = lastSuccessResult.OrderBy(a => a.ID).Last().MoveInfos; } } else { vectorizationResult = calcRes; } if (vectorizationResult == null) { OnAreaEnded(); return; } var nextMarker = ProcessNextMarker(vectorizationResult); mainAngle = nextMarker.CenterAngle; AttackPusher.CenterAngle = nextMarker.CenterAngle; var point = NativeApiWrapper.GetScreenRotatedPoint((int)mainAngle); AvailableInput.MouseMove(point); AvailableInput.Input(Settings.MoveKey); }
private void OnLootResult(object sender, ImageProcessorEventArgs <GameMapProcessorResult <LootMoveResult> > e) { var res = e.ImageProcessorResult.VectorizationResult; if (!res.Any()) { return; } var point = res.OrderBy(a => a.Vector.Length()).FirstOrDefault().LootCord; AvailableInput.MouseMove(point); AvailableInput.Input(InputCodes.LButton); }
private async void ImageProcessor_ProcessingDone(object sender, ImageProcessorEventArgs e) { // Update display through dispatcher DisplayBrightness(e.Brightness); // Send telemetry if (remoteCameraViewModel.IsTelemetryActive) { remoteCameraViewModel.CloudHelper.SendBrightness(e.Brightness); } // Anomaly detection (training) if (remoteCameraViewModel.IsTrainingActive) { await remoteCameraViewModel.AnomalyDetector.AddTrainingValue(e.Brightness); } // Anomaly detection if (remoteCameraViewModel.IsAnomalyDetectionActive) { await remoteCameraViewModel.AnomalyDetector.AddTestValue(e.Brightness); } }
private void OnResult(object sender, ImageProcessorEventArgs <GameMapProcessorResult <LootMoveResult> > e) { pictureBox1.Image = e.ImageProcessorResult.ResultBitmap; }