@@ -51,7 +51,8 @@ private static async Task ToBuildingId(Account acc, int index)
5151 {
5252 if ( ! acc . Wb . CurrentUrl . Contains ( "dorf2.php" ) || acc . Wb . CurrentUrl . Contains ( "id=" ) )
5353 await MainNavigate ( acc , MainNavigationButton . Buildings ) ;
54- await DriverHelper . ClickByClassName ( acc , $ "aid{ index } ", qindex : 1 ) ;
54+
55+ await DriverHelper . ExecuteScript ( acc , $ "document.getElementsByClassName(\" aid{ index } \" )[0].children[0].click();") ;
5556 }
5657 await DriverHelper . WaitLoaded ( acc ) ;
5758 }
@@ -93,6 +94,9 @@ private static string TTWarsTabUrl(BuildingEnum building, int tab)
9394 default : return "" ;
9495 }
9596 }
97+
98+ private static string [ ] tabMapping = new string [ ] { "0" , "2" , "3" , "4" , "5" } ;
99+ private static string TTWarsOverviewMapping ( OverviewTab tab ) => tabMapping [ ( int ) tab ] ;
96100
97101 /// <summary>
98102 /// Enters a specific building.
@@ -126,6 +130,8 @@ public static async Task<bool> EnterBuilding(Account acc, Building building, int
126130 }
127131 return true ;
128132 }
133+ public static async Task < bool > EnterBuilding ( Account acc , Village vill , int buildingId , int ? tab = null , Coordinates coords = null ) =>
134+ await EnterBuilding ( acc , vill . Build . Buildings . First ( x => x . Id == buildingId ) , tab , coords ) ;
129135
130136 public static async Task < bool > EnterBuilding ( Account acc , Village vill , BuildingEnum buildingEnum , int ? tab = null , Coordinates coords = null )
131137 {
@@ -189,8 +195,12 @@ public static async Task<bool> ToHero(Account acc, HeroTab tab)
189195
190196 public static async Task < bool > ToOverview ( Account acc , OverviewTab tab , TroopOverview subTab = TroopOverview . OwnTroops )
191197 {
198+ if ( acc . AccInfo . ServerVersion == ServerVersionEnum . TTwars )
199+ {
200+ await acc . Wb . Navigate ( $ "{ acc . AccInfo . ServerUrl } /dorf3.php?s={ TTWarsOverviewMapping ( tab ) } &su={ ( int ) subTab } ") ;
201+ return true ;
202+ }
192203 string query = "overview" ;
193- if ( acc . AccInfo . ServerVersion == ServerVersionEnum . TTwars ) query += "White" ;
194204 await DriverHelper . ClickByClassName ( acc , query ) ;
195205
196206 var currentTab = InfrastructureParser . CurrentlyActiveTab ( acc . Wb . Html ) ;
0 commit comments