/// <summary> /// Determines if this village should be attacked. /// </summary> /// <returns></returns> private async Task <bool> ShouldAttack(CancellationToken ct) { ReadOnlyCollection <IWebElement> reports = villageInfoScreen.GetLastReports(); // Previous attacks, predict if it's worth to attack based on the most recent report if (reports.Count > 0) { // We click the first report and read it reports[0].Click(); BattleReport report = battleReportScreen.ReadReport(); await Task.Delay(random.Next(450, 700), ct); return(report.ShouldAttackAgain()); } // No previous attacks means attack. return(true); }