@@ -343,8 +343,6 @@ private async Task<bool> TryFastUpgrade(Account acc)
343
343
// click to play video
344
344
acc . Logger . Information ( "Waiting ads video load before clicking play button" ) ;
345
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
346
349
347
{
350
348
var result = await Update ( acc ) ;
@@ -353,21 +351,18 @@ private async Task<bool> TryFastUpgrade(Account acc)
353
351
var nodeIframe = acc . Wb . Html . GetElementbyId ( "videoFeature" ) ;
354
352
if ( nodeIframe == null )
355
353
{
356
- await acc . Wb . Refresh ( ) ;
357
354
return false ;
358
355
}
359
- var elementIframe = acc . Wb . Driver . FindElementById ( "videoFeature" ) ;
360
- elementIframe . Click ( ) ;
361
-
362
- // if bot click failed and open new tab ( well done Travian devs, well done)
363
- await Task . Delay ( rand . Next ( 5000 , 9000 ) ) ;
364
356
365
- while ( ! acc . Wb . Driver . Url . Contains ( acc . AccInfo . ServerUrl ) )
366
357
{
367
- acc . Wb . Driver . Close ( ) ;
368
- await Task . Delay ( rand . Next ( 1000 , 2000 ) ) ;
358
+ var elementIframe = acc . Wb . Driver . FindElement ( By . XPath ( nodeIframe . XPath ) ) ;
359
+ Actions act = new Actions ( acc . Wb . Driver ) ;
360
+ act . MoveToElement ( elementIframe ) . Click ( ) . Build ( ) . Perform ( ) ;
369
361
}
370
362
363
+ acc . Logger . Information ( "Clicked play button, if ads doesn't play please click to help bot" ) ;
364
+ acc . Logger . Information ( "Cooldown 3 mins. If building cannot upgrade will use normal button" ) ;
365
+
371
366
try
372
367
{
373
368
await DriverHelper . WaitPageChange ( acc , "dorf" , 3 ) ;
0 commit comments