Skip to content

Commit c92c7ed

Browse files
committed
add delay to watch ads
1 parent 15faab5 commit c92c7ed

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

TbsCore/Tasks/LowLevel/UpgradeBuilding.cs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -341,19 +341,22 @@ private async Task<bool> TryFastUpgrade(Account acc)
341341
}
342342

343343
// click to play video
344-
acc.Wb.UpdateHtml();
344+
acc.Logger.Information("Waiting ads video load before clicking play button");
345+
await Task.Delay(rand.Next(5000, 9000));
346+
acc.Logger.Information("Clicked play button, if ads doesn't play please click to help bot");
347+
acc.Logger.Information("Cooldown 3 mins. If building cannot upgrade will use normal button");
348+
349+
{
350+
var result = await Update(acc);
351+
if (!result) return false;
352+
}
345353
var nodeIframe = acc.Wb.Html.GetElementbyId("videoFeature");
346354
if (nodeIframe == null)
347355
{
348356
await acc.Wb.Refresh();
349357
return false;
350358
}
351359
var elementIframe = acc.Wb.Driver.FindElementById("videoFeature");
352-
if (elementIframe == null)
353-
{
354-
await acc.Wb.Refresh();
355-
return false;
356-
}
357360
elementIframe.Click();
358361

359362
try
@@ -372,6 +375,7 @@ private async Task<bool> TryFastUpgrade(Account acc)
372375
else
373376
{
374377
await acc.Wb.Refresh();
378+
return false;
375379
}
376380
}
377381

0 commit comments

Comments
 (0)