File tree Expand file tree Collapse file tree 1 file changed +25
-1
lines changed
BetterGenshinImpact/GameTask/Common/Job Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Original file line number Diff line number Diff line change 1818using System . Collections . ObjectModel ;
1919using System . Globalization ;
2020using System . IO ;
21+ using Newtonsoft . Json ;
22+ using BetterGenshinImpact . GameTask . QuickSereniteaPot ;
23+ using BetterGenshinImpact . Core . Recognition . OCR ;
2124using System . Linq ;
2225using System . Threading ;
2326using System . Threading . Tasks ;
@@ -418,7 +421,28 @@ private async Task GetReward(CancellationToken ct)
418421 {
419422 Logger . LogInformation ( "领取尘歌壶奖励:{text}" , "领取好感和宝钱" ) ;
420423 await Delay ( 1000 , ct ) ;
421- CaptureToRectArea ( ) . Find ( ElementAssets . Instance . SereniteaPotLoveRo , a => a . Click ( ) ) ;
424+
425+ var getAare = CaptureToRectArea ( ) ;
426+ var count = OcrFactory . Paddle . OcrWithoutDetector ( getAare . DeriveCrop ( getAare . Width * 1801 / 1920 ,
427+ getAare . Height * 609 / 1080 , getAare . Width * 75 / 1920 , getAare . Width * 46 / 1920 ) . SrcMat ) ;
428+
429+ var match = System . Text . RegularExpressions . Regex . Match ( count , @"(\d+)\s*[/17]\s*(8)" ) ;
430+ var shouldClick = true ;
431+ if ( match . Success )
432+ {
433+ var numericPart = StringUtils . TryParseInt ( match . Groups [ 1 ] . Value ) ;
434+ if ( numericPart == 0 )
435+ {
436+ Logger . LogWarning ( "领取尘歌壶奖励:{text}" , "没有角色可领取好感" ) ; //存好感
437+ shouldClick = false ;
438+ }
439+ }
440+
441+ if ( shouldClick )
442+ {
443+ getAare . Find ( ElementAssets . Instance . SereniteaPotLoveRo , a => a . Click ( ) ) ;
444+ }
445+
422446 await Delay ( 500 , ct ) ;
423447 var ra = CaptureToRectArea ( ) ;
424448 var list = ra . FindMulti ( new RecognitionObject
You can’t perform that action at this time.
0 commit comments