Skip to content

Commit b055b7e

Browse files
* **V7.8**
* Fix Surrender button reported by @Hecki * Fix Switch Account with new SCID Update (Support for 8 Accs) * Fix Error finding clan tab button * Fix for Invalid slot # found = -1 for Archer * Fix for October release change to Google ID * Fix for October release for "balance donations" * Fix for October release Chinese fonts in donation requests * Fix October release Quick Train * Fix Language Check * Fix Empty sieges not dropping when empty * Fix Star lab not upgrading troops in Builder Base * Fix BuilderBase can't place new building * Fix False positive on the bush when bot tries removing obstacles! Reported by @miked * Update Turkish @f A T İ H * Update Army Levels Now as Optional * Add Random Clicks * Add BuilderBase Attack * Fix Order for IceGolem Donate Reported by @ anondad * Legends sleep now random, 7 to 25 mins rather than fixed at 30. * Improvement Inferno Tower Level 6 Detection * Improvement Air Defense Level 10 Detection * Improvement X-Bow Level 6 Detection * Improvement Wizard Tower Level 11 Detection
1 parent 0983984 commit b055b7e

573 files changed

Lines changed: 2558 additions & 168062 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,29 @@
1-
* **V7.7.9**
1+
* **V7.8**
2+
* Fix Surrender button reported by @Hecki
3+
* Fix Switch Account with new SCID Update (Support for 8 Accs)
4+
* Fix Error finding clan tab button
5+
* Fix for Invalid slot # found = -1 for Archer
6+
* Fix for October release change to Google ID
7+
* Fix for October release for "balance donations"
8+
* Fix for October release Chinese fonts in donation requests
9+
* Fix October release Quick Train
10+
* Fix Language Check
11+
* Fix Empty sieges not dropping when empty
12+
* Fix Star lab not upgrading troops in Builder Base
13+
* Fix BuilderBase can't place new building
14+
* Fix False positive on the bush when bot tries removing obstacles! Reported by @MikeD
15+
* Update Turkish @F A T İ H
16+
* Update Army Levels Now as Optional
17+
* Add Random Clicks
18+
* Add BuilderBase Attack
19+
* Fix Order for IceGolem Donate Reported by @ anondad
20+
* Legends sleep now random, 7 to 25 mins rather than fixed at 30.
21+
* Improvement Inferno Tower Level 6 Detection
22+
* Improvement Air Defense Level 10 Detection
23+
* Improvement X-Bow Level 6 Detection
24+
* Improvement Wizard Tower Level 11 Detection
25+
26+
* **V7.7.9**
227
* Fix builder base remove obstacle Button not found @DUC4TI
328
* Fix share replay function
429
* Fix cannot find confirm attack button @nytol

COCBot/GUI/MBR GUI Control BOT Options.au3

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,16 +1070,16 @@ Func btnTestUpgradeWindow()
10701070
EndFunc ;==>btnTestUpgradeWindow
10711071

10721072
Func btnTestSmartWait()
1073-
Local $currentRunState = $g_bRunState
1074-
Local $bCloseWhileTrainingEnable = $g_bCloseWhileTrainingEnable
1073+
Local $currentRunState = $g_bRunState
1074+
Local $bCloseWhileTrainingEnable = $g_bCloseWhileTrainingEnable
10751075

1076-
$g_bRunState = True
1077-
$g_bCloseWhileTrainingEnable = True
1076+
$g_bRunState = True
1077+
$g_bCloseWhileTrainingEnable = True
10781078

1079-
SmartWait4Train(20)
1079+
SmartWait4Train(20)
10801080

1081-
$g_bRunState = $currentRunState
1082-
$g_bCloseWhileTrainingEnable = $bCloseWhileTrainingEnable
1081+
$g_bRunState = $currentRunState
1082+
$g_bCloseWhileTrainingEnable = $bCloseWhileTrainingEnable
10831083
EndFunc ;==>btnTestSmartWait
10841084

10851085
Func btnConsoleWindow()

COCBot/GUI/MBR GUI Control Child Army.au3

Lines changed: 32 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ Func lblTotalCountTroop2()
175175
Local $NbrOfDarkBarrack = 2 ;For the moment fix to 2 until fine detect level of each Barrack
176176
For $i = $eTroopBarbarian To $eTroopElectroDragon
177177
Local $NbrOfTroop = GUICtrlRead($g_ahTxtTrainArmyTroopCount[$i])
178-
Local $LevOfTroop = $g_aiTrainArmyTroopLevel[$i]
178+
Local $LevOfTroop = $g_aiTrainArmyTroopLevel[$i] > 0 ? $g_aiTrainArmyTroopLevel[$i] : $g_aiTroopCostPerLevel[$i][0]
179179

180180
If $NbrOfTroop > 0 And $LevOfTroop > 0 Then
181181
If IsInt($NbrOfTroop / $NbrOfBarrack) = 1 Then
@@ -189,7 +189,7 @@ Func lblTotalCountTroop2()
189189

190190
For $i = $eTroopMinion To $eTroopIceGolem
191191
Local $NbrOfTroop = GUICtrlRead($g_ahTxtTrainArmyTroopCount[$i])
192-
Local $LevOfTroop = $g_aiTrainArmyTroopLevel[$i]
192+
Local $LevOfTroop = $g_aiTrainArmyTroopLevel[$i] > 0 ? $g_aiTrainArmyTroopLevel[$i] : $g_aiTroopCostPerLevel[$i][0]
193193

194194
If $NbrOfTroop > 0 And $LevOfTroop > 0 Then
195195
If IsInt($NbrOfTroop / $NbrOfDarkBarrack) = 1 Then
@@ -228,12 +228,13 @@ EndFunc ;==>lblTotalCountSpell2
228228

229229
Func lblTotalCountSiege()
230230
; calculate total space and time for Siege composition
231-
Local $iTotalTotalTimeSiege = 0
231+
Local $iTotalTotalTimeSiege = 0, $indexLevel = 0
232232
$g_iTotalTrainSpaceSiege = 0
233233

234234
For $i = 0 To $eSiegeMachineCount - 1
235235
$g_iTotalTrainSpaceSiege += $g_aiArmyCompSiegeMachine[$i] * $g_aiSiegeMachineSpace[$i]
236-
$iTotalTotalTimeSiege += $g_aiArmyCompSiegeMachine[$i] * $g_aiSiegeMachineTrainTimePerLevel[$i][$g_aiTrainArmySiegeMachineLevel[$i]]
236+
$indexLevel = $g_aiTrainArmySiegeMachineLevel[$i] > 0 ? $g_aiTrainArmySiegeMachineLevel[$i] : $g_aiSiegeMachineCostPerLevel[$i][0]
237+
$iTotalTotalTimeSiege += $g_aiArmyCompSiegeMachine[$i] * $g_aiSiegeMachineTrainTimePerLevel[$i][$indexLevel]
237238
Next
238239

239240
GUICtrlSetData($g_hLblTotalTimeSiege, CalculTimeTo($iTotalTotalTimeSiege))
@@ -249,6 +250,7 @@ Func lblTotalCountSiege()
249250
GUICtrlSetData($g_hLblGoldCostSiege, "0")
250251
GUICtrlSetData($g_hLblCountTotalSiege, $g_iTotalTrainSpaceSiege)
251252
GUICtrlSetData($g_hLblTotalTimeSiege, " 0s")
253+
_GUI_Value_STATE("HIDE", $groupListSieges)
252254
EndIf
253255
EndFunc ;==>lblTotalCountSiege
254256

@@ -258,7 +260,7 @@ Func TotalSpellCountClick()
258260
$g_iTownHallLevel = Int($g_iTownHallLevel)
259261

260262
If $g_iTownHallLevel > 4 Or $g_iTownHallLevel = 0 Then
261-
_GUI_Value_STATE("SHOW", $g_aiTrainArmySpellLevel[$eSpellLightning] > 0 ? $g_aGroupLightning : $groupIcnLightning)
263+
_GUI_Value_STATE("SHOW", $groupLightning)
262264
Else
263265
For $i = 0 To $eSpellCount - 1
264266
GUICtrlSetData($g_ahTxtTrainArmySpellCount[$i], 0)
@@ -268,7 +270,7 @@ Func TotalSpellCountClick()
268270
EndIf
269271

270272
If $g_iTownHallLevel > 5 Or $g_iTownHallLevel = 0 Then
271-
_GUI_Value_STATE("SHOW", $g_aiTrainArmySpellLevel[$eSpellHeal] > 0 ? $groupHeal : $groupIcnHeal)
273+
_GUI_Value_STATE("SHOW", $groupHeal)
272274
Else
273275
For $i = $eSpellRage To $eSpellBat
274276
GUICtrlSetData($g_ahTxtTrainArmySpellCount[$i], 0)
@@ -277,7 +279,7 @@ Func TotalSpellCountClick()
277279
EndIf
278280

279281
If $g_iTownHallLevel > 6 Or $g_iTownHallLevel = 0 Then
280-
_GUI_Value_STATE("SHOW", $g_aiTrainArmySpellLevel[$eSpellRage] > 0 ? $groupRage : $groupIcnRage)
282+
_GUI_Value_STATE("SHOW", $groupRage)
281283
Else
282284
For $i = $eSpellJump To $eSpellBat
283285
GUICtrlSetData($g_ahTxtTrainArmySpellCount[$i], 0)
@@ -286,8 +288,8 @@ Func TotalSpellCountClick()
286288
EndIf
287289

288290
If $g_iTownHallLevel > 7 Or $g_iTownHallLevel = 0 Then
289-
_GUI_Value_STATE("SHOW", $g_aiTrainArmySpellLevel[$eSpellPoison] > 0 ? $g_aGroupPoison : $groupIcnPoison)
290-
_GUI_Value_STATE("SHOW", $g_aiTrainArmySpellLevel[$eSpellEarthquake] > 0 ? $groupEarthquake : $groupIcnEarthquake)
291+
_GUI_Value_STATE("SHOW", $groupPoison)
292+
_GUI_Value_STATE("SHOW", $groupEarthquake)
291293
Else
292294
GUICtrlSetData($g_ahTxtTrainArmySpellCount[$eSpellJump], 0)
293295
GUICtrlSetData($g_ahTxtTrainArmySpellCount[$eSpellFreeze], 0)
@@ -304,18 +306,20 @@ Func TotalSpellCountClick()
304306
EndIf
305307

306308
If $g_iTownHallLevel > 8 Or $g_iTownHallLevel = 0 Then
307-
_GUI_Value_STATE("SHOW", $g_aiTrainArmySpellLevel[$eSpellJump] > 0 ? $groupJumpSpell : $groupIcnJumpSpell)
308-
_GUI_Value_STATE("SHOW", $g_aiTrainArmySpellLevel[$eSpellFreeze] > 0 ? $groupFreeze : $groupIcnFreeze)
309-
_GUI_Value_STATE("SHOW", $g_aiTrainArmySpellLevel[$eSpellHaste] > 0 ? $groupHaste : $groupIcnHaste)
310-
_GUI_Value_STATE("SHOW", $g_aiTrainArmySpellLevel[$eSpellSkeleton] > 0 ? $groupSkeleton : $groupIcnSkeleton)
311-
_GUI_Value_STATE("SHOW", $g_aiTrainArmySpellLevel[$eSpellBat] > 0 ? $groupSkeleton : $groupIcnBat)
309+
_GUI_Value_STATE("SHOW", $groupJump)
310+
_GUI_Value_STATE("SHOW", $groupFreeze)
311+
_GUI_Value_STATE("SHOW", $groupHaste)
312+
_GUI_Value_STATE("SHOW", $groupSkeleton)
312313
Else
313314
GUICtrlSetData($g_ahTxtTrainArmySpellCount[$eSpellClone], 0)
315+
GUICtrlSetData($g_ahTxtTrainArmySpellCount[$eSpellBat], 0)
314316
GUICtrlSetData($g_ahLblTrainArmySpellLevel[$eSpellClone], 0)
317+
GUICtrlSetData($g_ahLblTrainArmySpellLevel[$eSpellBat], 0)
315318
EndIf
316319

317320
If $g_iTownHallLevel > 9 Or $g_iTownHallLevel = 0 Then
318-
_GUI_Value_STATE("SHOW", $g_aiTrainArmySpellLevel[$eSpellClone] > 0 ? $groupClone : $groupIcnClone)
321+
_GUI_Value_STATE("SHOW", $groupClone)
322+
_GUI_Value_STATE("SHOW", $groupBat)
319323
EndIf
320324

321325
lblTotalCountSpell2()
@@ -863,19 +867,12 @@ Func LevUpDownTroop($iTroopIndex, $NoChangeLev = True)
863867
EndIf
864868

865869
Local $hLevel = $g_ahLblTrainArmyTroopLevel[$iTroopIndex]
866-
Local $hCount = $g_ahTxtTrainArmyTroopCount[$iTroopIndex]
867870

868871
If $TempLev > $MaxLev Or $TempLev = 0 Then
869872
$TempLev = 0
870-
GUICtrlSetData($hCount, 0)
871-
$g_aiArmyCustomTroops[$iTroopIndex] = 0
872-
If IsGUICtrlHidden($hCount) = False Then GUICtrlSetState($hCount, $GUI_HIDE)
873873
If $NoChangeLev Then lblTotalCountTroop1()
874874
ElseIf $TempLev < 0 Then
875875
$TempLev = $MaxLev
876-
If IsGUICtrlHidden($hCount) Then GUICtrlSetState($hCount, $GUI_SHOW)
877-
ElseIf $TempLev > 0 And $TempLev <= $MaxLev And IsGUICtrlHidden($hCount) Then
878-
GUICtrlSetState($hCount, $GUI_SHOW)
879876
EndIf
880877

881878
$g_aiTrainArmyTroopLevel[$iTroopIndex] = $TempLev
@@ -900,19 +897,11 @@ Func LevUpDownSiege($iSiege, $NoChangeLev = True)
900897
EndIf
901898

902899
Local $hLevel = $g_ahLblTrainArmySiegeLevel[$iSiege]
903-
Local $hCount = $g_ahTxtTrainArmySiegeCount[$iSiege]
904900

905901
If $TempLev > $MaxLev Or $TempLev = 0 Then
906902
$TempLev = 0
907-
GUICtrlSetData($hCount, 0)
908-
$g_aiArmyCompSiegeMachine[$iSiege] = 0
909-
If IsGUICtrlHidden($hCount) = False Then GUICtrlSetState($hCount, $GUI_HIDE)
910-
;If $NoChangeLev Then lblTotalCountSiege()
911903
ElseIf $TempLev < 0 Then
912904
$TempLev = $MaxLev
913-
If IsGUICtrlHidden($hCount) Then GUICtrlSetState($hCount, $GUI_SHOW)
914-
ElseIf $TempLev > 0 And $TempLev <= $MaxLev And IsGUICtrlHidden($hCount) Then
915-
GUICtrlSetState($hCount, $GUI_SHOW)
916905
EndIf
917906

918907
$g_aiTrainArmySiegeMachineLevel[$iSiege] = $TempLev
@@ -939,19 +928,12 @@ Func LevUpDownSpell($iSpellIndex, $NoChangeLev = True)
939928
EndIf
940929

941930
Local $hLevel = $g_ahLblTrainArmySpellLevel[$iSpellIndex]
942-
Local $hCount = $g_ahTxtTrainArmySpellCount[$iSpellIndex]
943931

944932
If $TempLev > $MaxLev Or $TempLev = 0 Then
945933
$TempLev = 0
946-
GUICtrlSetData($hCount, 0)
947-
$g_aiArmyCustomSpells[$iSpellIndex] = 0
948-
If IsGUICtrlHidden($hCount) = False Then GUICtrlSetState($hCount, $GUI_HIDE)
949934
If $NoChangeLev Then lblTotalCountSpell2()
950935
ElseIf $TempLev < 0 Then
951936
$TempLev = $MaxLev
952-
If IsGUICtrlHidden($hCount) Then GUICtrlSetState($hCount, $GUI_SHOW)
953-
ElseIf $TempLev > 0 And $TempLev <= $MaxLev And IsGUICtrlHidden($hCount) Then
954-
GUICtrlSetState($hCount, $GUI_SHOW)
955937
EndIf
956938

957939
$g_aiTrainArmySpellLevel[$iSpellIndex] = $TempLev
@@ -1022,40 +1004,45 @@ Func TrainSpellLevelClick()
10221004
EndFunc ;==>TrainSpellLevelClick
10231005

10241006
Func CalCostCamp()
1025-
Local $iElixirCostCamp = 0, $iDarkCostCamp = 0
1007+
Local $iElixirCostCamp = 0, $iDarkCostCamp = 0, $indexLevel = 0
10261008

10271009
For $i = $eTroopBarbarian To $eTroopElectroDragon
1028-
$iElixirCostCamp += $g_aiArmyCustomTroops[$i] * $g_aiTroopCostPerLevel[$i][$g_aiTrainArmyTroopLevel[$i]]
1010+
$indexLevel = $g_aiTrainArmyTroopLevel[$i] > 0 ? $g_aiTrainArmyTroopLevel[$i] : $g_aiTroopCostPerLevel[$i][0]
1011+
$iElixirCostCamp += $g_aiArmyCustomTroops[$i] * $g_aiTroopCostPerLevel[$i][$indexLevel]
10291012
Next
10301013

10311014
For $i = $eTroopMinion To $eTroopIceGolem
1032-
$iDarkCostCamp += $g_aiArmyCustomTroops[$i] * $g_aiTroopCostPerLevel[$i][$g_aiTrainArmyTroopLevel[$i]]
1015+
$indexLevel = $g_aiTrainArmyTroopLevel[$i] > 0 ? $g_aiTrainArmyTroopLevel[$i] : $g_aiTroopCostPerLevel[$i][0]
1016+
$iDarkCostCamp += $g_aiArmyCustomTroops[$i] * $g_aiTroopCostPerLevel[$i][$indexLevel]
10331017
Next
10341018

10351019
GUICtrlSetData($g_hLblElixirCostCamp, _NumberFormat($iElixirCostCamp, True))
10361020
GUICtrlSetData($g_hLblDarkCostCamp, _NumberFormat($iDarkCostCamp, True))
10371021
EndFunc ;==>CalCostCamp
10381022

10391023
Func CalCostSpell()
1040-
Local $iElixirCostSpell = 0, $iDarkCostSpell = 0
1024+
Local $iElixirCostSpell = 0, $iDarkCostSpell = 0, $indexLevel = 0
10411025

10421026
For $i = $eSpellLightning To $eSpellClone
1043-
$iElixirCostSpell += $g_aiArmyCustomSpells[$i] * $g_aiSpellCostPerLevel[$i][$g_aiTrainArmySpellLevel[$i]]
1027+
$indexLevel = $g_aiTrainArmySpellLevel[$i] > 0 ? $g_aiTrainArmySpellLevel[$i] : $g_aiSpellCostPerLevel[$i][0]
1028+
$iElixirCostSpell += $g_aiArmyCustomSpells[$i] * $g_aiSpellCostPerLevel[$i][$indexLevel]
10441029
Next
10451030

10461031
For $i = $eSpellPoison To $eSpellBat
1047-
$iDarkCostSpell += $g_aiArmyCustomSpells[$i] * $g_aiSpellCostPerLevel[$i][$g_aiTrainArmySpellLevel[$i]]
1032+
$indexLevel = $g_aiTrainArmySpellLevel[$i] > 0 ? $g_aiTrainArmySpellLevel[$i] : $g_aiSpellCostPerLevel[$i][0]
1033+
$iDarkCostSpell += $g_aiArmyCustomSpells[$i] * $g_aiSpellCostPerLevel[$i][$indexLevel]
10481034
Next
10491035

10501036
GUICtrlSetData($g_hLblElixirCostSpell, _NumberFormat($iElixirCostSpell, True))
10511037
GUICtrlSetData($g_hLblDarkCostSpell, _NumberFormat($iDarkCostSpell, True))
10521038
EndFunc ;==>CalCostSpell
10531039

10541040
Func CalCostSiege()
1055-
Local $iGoldCostSiege = 0
1041+
Local $iGoldCostSiege = 0, $indexLevel = 0
10561042

10571043
For $i = 0 To $eSiegeMachineCount - 1
1058-
$iGoldCostSiege += $g_aiArmyCompSiegeMachine[$i] * $g_aiSiegeMachineCostPerLevel[$i][$g_aiTrainArmySiegeMachineLevel[$i]]
1044+
$indexLevel = $g_aiTrainArmySiegeMachineLevel[$i] > 0 ? $g_aiTrainArmySiegeMachineLevel[$i] : $g_aiSiegeMachineCostPerLevel[$i][0]
1045+
$iGoldCostSiege += $g_aiArmyCompSiegeMachine[$i] * $g_aiSiegeMachineCostPerLevel[$i][$indexLevel]
10591046
Next
10601047

10611048
GUICtrlSetData($g_hLblGoldCostSiege, _NumberFormat($iGoldCostSiege, True))

0 commit comments

Comments
 (0)