File tree Expand file tree Collapse file tree 3 files changed +22
-1
lines changed Expand file tree Collapse file tree 3 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,13 @@ public class CheckAttacks : BotTask
16
16
{
17
17
public override async Task < TaskRes > Execute ( Account acc )
18
18
{
19
+ StopFlag = false ;
20
+ {
21
+ acc . Logger . Information ( $ "Checking current village ...") ;
22
+ var result = await NavigationHelper . SwitchVillage ( acc , Vill ) ;
23
+ if ( StopFlag ) return TaskRes . Executed ;
24
+ if ( ! result ) return TaskRes . Executed ;
25
+ }
19
26
//await NavigationHelper.ToRallyPoint(acc, Vill, NavigationHelper.RallyPointTab.Overview)
20
27
await acc . Wb . Navigate ( $ "{ acc . AccInfo . ServerUrl } /build.php?gid=16&tt=1&filter=1&subfilters=1") ;
21
28
Original file line number Diff line number Diff line change @@ -15,6 +15,13 @@ public class UpdateTroops : BotTask
15
15
/// </summary>
16
16
public override async Task < TaskRes > Execute ( Account acc )
17
17
{
18
+ StopFlag = false ;
19
+ {
20
+ acc . Logger . Information ( $ "Checking current village ...") ;
21
+ var result = await NavigationHelper . SwitchVillage ( acc , Vill ) ;
22
+ if ( StopFlag ) return TaskRes . Executed ;
23
+ if ( ! result ) return TaskRes . Executed ;
24
+ }
18
25
// If we have Plus account, just check that.
19
26
if ( acc . AccInfo . PlusAccount )
20
27
{
Original file line number Diff line number Diff line change @@ -17,8 +17,16 @@ public override async Task<TaskRes> Execute(Account acc)
17
17
{
18
18
acc . Tasks . Remove ( typeof ( UpdateDorf1 ) , Vill , thisTask : this ) ;
19
19
acc . Tasks . Remove ( typeof ( UpdateDorf2 ) , Vill , thisTask : this ) ;
20
+ StopFlag = false ;
21
+ {
22
+ acc . Logger . Information ( $ "Checking current village ...") ;
23
+ var result = await NavigationHelper . SwitchVillage ( acc , Vill ) ;
24
+ if ( StopFlag ) return TaskRes . Executed ;
25
+ if ( ! result ) return TaskRes . Executed ;
26
+ }
20
27
21
28
await NavigationHelper . ToDorf1 ( acc ) ;
29
+ await AccountHelper . DelayWait ( acc ) ;
22
30
await NavigationHelper . ToDorf2 ( acc ) ;
23
31
24
32
// On new village import the building tasks
@@ -29,7 +37,6 @@ public override async Task<TaskRes> Execute(Account acc)
29
37
30
38
await UpdateTroopsResearchedAndLevels ( acc ) ;
31
39
32
- await Task . Delay ( AccountHelper . Delay ( acc ) ) ;
33
40
await UpdateTroopsTraining ( acc ) ;
34
41
35
42
var firstTroop = TroopsData . TribeFirstTroop ( acc . AccInfo . Tribe ) ;
You can’t perform that action at this time.
0 commit comments