Skip to content

Commit 473ff05

Browse files
committed
* **V7.2.1**
* Add Builder Base collect resources and activate Clock Tower * Add Bot Android Option "Use script for accurate Click & Drag", unchecking can solve swipe issues * Improve reliability of detecting if window is open to builder base and not main base * Improve ADB handling when ADB process killed * Fix random errors with upgrade building/hero "windows not detected as open" by moving pixel check location with new values * Fix errors reading building upgrade cost when not enough resources with new XML file for pink text * Fix 20 Seconds launch delay (due to Android initialization) * Fix confusing error message during training referring to TrainRevamp tab * Fix recursive loop error when problem occurs when finding train icons with ImgLoc * Fix pixel values & locations for Shield & Guard check used for Unbreakable mode * Fix undeclared variable error when using Milk Attack * Fix train window hero upgrade detection not attacking when waiting for heroes * Fix rage spell brewing * Fix BlueStacks reboot loop * Fix Warden instant activation when using CSV attack scripts, due slow render of Warden health status in attack bar * Update Azerbaijan and Turkish Language By Z E C K * Update Arabic Language By @awssaad * Update Vietnamese Language by NguyenAnhHD * Remove erroneous message when heroes are upgrading, and 1 attack mode selected "wait for heroes" but is not enabled
1 parent 129b7c2 commit 473ff05

104 files changed

Lines changed: 1301 additions & 796 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: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1+
* **V7.2.1**
2+
* Add Builder Base collect resources and activate Clock Tower
3+
* Add Bot Android Option "Use script for accurate Click & Drag", unchecking can solve swipe issues
4+
* Improve reliability of detecting if window is open to builder base and not main base
5+
* Improve ADB handling when ADB process killed
6+
* Fix random errors with upgrade building/hero "windows not detected as open" by moving pixel check location with new values
7+
* Fix errors reading building upgrade cost when not enough resources with new XML file for pink text
8+
* Fix 20 Seconds launch delay (due to Android initialization)
9+
* Fix confusing error message during training referring to TrainRevamp tab
10+
* Fix recursive loop error when problem occurs when finding train icons with ImgLoc
11+
* Fix pixel values & locations for Shield & Guard check used for Unbreakable mode
12+
* Fix undeclared variable error when using Milk Attack
13+
* Fix train window hero upgrade detection not attacking when waiting for heroes
14+
* Fix rage spell brewing
15+
* Fix BlueStacks reboot loop
16+
* Fix Warden instant activation when using CSV attack scripts, due slow render of Warden health status in attack bar
17+
* Update Azerbaijan and Turkish Language By Z E C K
18+
* Update Arabic Language By @awssaad
19+
* Update Vietnamese Language by NguyenAnhHD
20+
* Remove erroneous message when heroes are upgrading, and 1 attack mode selected "wait for heroes" but is not enabled
21+
122
* **V7.2**
223
* Add Nox 3.8.2 and DirectX support, fix Click&Drag and automatic screen config
324
* Add new system to use translate
@@ -30,14 +51,14 @@
3051
* Attacking (attack button, page detection, wait for clouds, star bonus)
3152
* Upgrade buildings (resource type used, reading building names)
3253
* Added detection of builder base window, and return to main base.
33-
54+
3455
*** WARNING>> SOME BOT FEATURES ARE NOT OPERATIONAL!!!!
35-
Not Working:
56+
Not Working:
3657
>> Building Upgrades, Lab Upgrades
37-
Not Tested:
58+
Not Tested:
3859
>> Halt modes, Attack schedule, unbreakable mode, quick train, boosting, alternate attack modes (TH side attack, DE side attack, etc), various CoC Reload error messages, and debug test buttons.
3960

40-
61+
4162
* **V7.1.4**
4263
* Add Nox 3.8.1.3 support
4364
* Fix Strategies save file

COCBot/GUI/MBR GUI Control BOT Options.au3

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,7 @@ Func chkBotAutoSlideClick()
8383
EndFunc ;==>chkBotAutoSlideClick
8484

8585
Func chkUseRandomClick()
86-
;$g_bUseRandomClick = (GUICtrlRead($g_hChkUseRandomClick) = $GUI_CHECKED)
87-
$g_bRunState = True
88-
Local $ArmyCamp = GetOCRCurrent(48, 160)
89-
_CaptureRegion2(48,160,115, 174)
90-
DebugImageSave("hi", False)
91-
_ArrayDisplay($ArmyCamp)
92-
$g_bRunState = False
86+
$g_bUseRandomClick = (GUICtrlRead($g_hChkUseRandomClick) = $GUI_CHECKED)
9387
EndFunc ;==>chkUseRandomClick
9488
#cs
9589
Func chkUpdatingWhenMinimized()

COCBot/GUI/MBR GUI Control Splash.au3

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
; Parameters ....:
66
; Return values .: None
77
; Author ........: mikemikemikecoc (2016)
8-
; Modified ......: CodeSlinger69 (2017)
8+
; Modified ......: CodeSlinger69 (2017), MonkeyHunter (05-2017)
99
; Remarks .......: This file is part of MyBot, previously known as ClashGameBot. Copyright 2015-2017
1010
; MyBot is distributed under the terms of the GNU GPL
1111
; Related .......:
@@ -17,11 +17,34 @@
1717
Func SplashStep($status, $bIncreaseStep = True)
1818
If $bIncreaseStep = True Then $g_iSplashCurrentStep += 1
1919

20-
SetDebugLog("SplashStep " & $g_iSplashCurrentStep & " of " & $g_iSplashTotalSteps & ": " & $status & "(" & Round(__TimerDiff($g_hSplashTimer)/1000, 2) & " sec)")
20+
SetDebugLog("SplashStep " & $g_iSplashCurrentStep & " of " & $g_iSplashTotalSteps & ": " & $status & "(" & Round(__TimerDiff($g_hSplashTimer) / 1000, 2) & " sec)")
2121

2222
If $g_bDisableSplash Then Return
23+
2324
GUICtrlSetData($g_hSplashProgress, ($g_iSplashCurrentStep / $g_iSplashTotalSteps) * 100)
2425
GUICtrlSetData($g_lSplashStatus, $status)
26+
27+
If $g_bMyBotDance Then ; can robot dance? Yes, like a drunk Code Monkey
28+
Static $aSplashInfo, $iStartX, $iStartY, $iStep, $iStepIndex = 0
29+
If $iStepIndex = 0 Then
30+
$aSplashInfo = WinGetPos($g_hSplash) ; grab current position and size information
31+
If @error Then SetLog("SplashStep " & $g_iSplashCurrentStep & " Failed to find GUI Window!", $COLOR_ERROR)
32+
; $aSplashInfo[0] = X position, [1] = Y position, [2] = Width, [3] = Height
33+
$iStartY = Int(@DesktopHeight - 50 - $aSplashInfo[3]) ; compute starting Y position just above bottom of display
34+
$iStartX = Int((@DesktopWidth / 2) - ($aSplashInfo[2] / 2)) ; compute starting X position in middle of display
35+
$iStep = Int($iStartY / ($g_iSplashTotalSteps - 1))
36+
;SetDebuglog("SplashStep " & $g_iSplashCurrentStep & " X:Y= " & $aSplashInfo[0] & ":" & $aSplashInfo[1] & ", W:H= " & $aSplashInfo[2] & ":" & $aSplashInfo[3], $COLOR_DEBUG)
37+
;SetDebuglog("$iStartX= " & $iStartX & ", $iStartY= " & $iStartY & ", $iStep= " & $iStep, $COLOR_DEBUG)
38+
EndIf
39+
; bottom to top with little shuffle added
40+
Local $aSplashLoc[10][2] = [[-100, 0], [100, $iStep], [-100, $iStep * 2], [100, $iStep * 3], [-100, $iStep * 4], [100, $iStep * 5], [-100, $iStep * 6], [100, $iStep * 7], [-100, $iStep * 8], [0, $iStep * 9]]
41+
42+
;SetDebugLog("SplashStep " & $g_iSplashCurrentStep & " Location: " & $iStartX - $aSplashLoc[$iStepIndex][0] & ":" & $iStartY - $aSplashLoc[$iStepIndex][1] & ", $iStepIndex= " & $iStepIndex, $COLOR_DEBUG)
43+
WinMove($g_hSplash, "", $iStartX - $aSplashLoc[$iStepIndex][0], $iStartY - $aSplashLoc[$iStepIndex][1], Default, Default, 8)
44+
$iStepIndex += 1
45+
If $iStepIndex > 9 Then $iStepIndex = 0 ; reset to zero when at top
46+
EndIf
47+
2548
EndFunc ;==>SplashStep
2649

2750
Func UpdateSplashTitle($title)
@@ -31,9 +54,12 @@ Func UpdateSplashTitle($title)
3154
EndFunc ;==>UpdateSplashTitle
3255

3356
Func DestroySplashScreen()
34-
If IsHWnd($g_hSplash) Then GUIDelete($g_hSplash)
35-
36-
; allow now other bots to launch
37-
ReleaseMutex($g_hSplashMutex)
38-
$g_hSplashMutex = 0
57+
If IsHWnd($g_hSplash) Then GUIDelete($g_hSplash)
58+
; allow now other bots to launch
59+
ReleaseMutex($g_hSplashMutex)
60+
$g_hSplashMutex = 0
3961
EndFunc ;==>DestroySplashScreen
62+
63+
Func MoveSplashScreen()
64+
_WinAPI_PostMessage($g_hSplash, $WM_SYSCOMMAND, 0xF012, 0) ; SC_DRAGMOVE = 0xF012
65+
EndFunc ;==>MoveSplashScreen

COCBot/GUI/MBR GUI Design Bottom.au3

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,15 @@ Func CreateBottomPanel()
9090

9191
If $g_bAndroidAdbScreencap = True Then chkBackground() ; update background mode GUI
9292

93-
$g_hPicTwoArrowShield = GUICtrlCreateIcon($g_sLibIconPath, $eIcn2Arrow, $x + 190, $y + 10, 48, 48)
93+
$g_hPicTwoArrowShield = _GUICtrlCreateIcon($g_sLibIconPath, $eIcn2Arrow, $x + 190, $y + 10, 48, 48)
9494

9595
$g_hLblVersion = GUICtrlCreateLabel($g_sBotVersion, 200, $y + 60, 60, 17, $SS_CENTER)
9696
GUICtrlSetColor(-1, $COLOR_MEDGRAY)
9797

98-
$g_hPicArrowLeft = GUICtrlCreateIcon($g_sLibIconPath, $eIcnArrowLeft, $x + 249, $y + 30, 16, 16)
98+
$g_hPicArrowLeft = _GUICtrlCreateIcon($g_sLibIconPath, $eIcnArrowLeft, $x + 249, $y + 30, 16, 16)
9999
$sTxtTip = GetTranslatedFileIni("MBR GUI Design Bottom", "GrpVillage_Info_01", "Switch between village info and stats")
100100
_GUICtrlSetTip(-1, $sTxtTip)
101-
$g_hPicArrowRight = GUICtrlCreateIcon($g_sLibIconPath, $eIcnArrowRight, $x + 247 + 198, $y + 30, 16, 16)
101+
$g_hPicArrowRight = _GUICtrlCreateIcon($g_sLibIconPath, $eIcnArrowRight, $x + 247 + 198, $y + 30, 16, 16)
102102
_GUICtrlSetTip(-1, $sTxtTip)
103103

104104
;~ Village
@@ -107,43 +107,43 @@ Func CreateBottomPanel()
107107
$g_hLblResultGoldNow = GUICtrlCreateLabel("", $x - 5, $y + 2, 60, 15, $SS_RIGHT)
108108
$g_hLblResultGoldHourNow = GUICtrlCreateLabel("", $x, $y + 2, 60, 15, $SS_RIGHT)
109109
GUICtrlSetState(-1, $GUI_HIDE)
110-
$g_hPicResultGoldNow = GUICtrlCreateIcon ($g_sLibIconPath, $eIcnGold, $x + 60, $y, 16, 16)
110+
$g_hPicResultGoldNow = _GUICtrlCreateIcon ($g_sLibIconPath, $eIcnGold, $x + 60, $y, 16, 16)
111111
GUICtrlSetState(-1, $GUI_HIDE)
112-
$g_hPicResultGoldTemp = GUICtrlCreateIcon ($g_sLibIconPath, $eIcnGold, $x - 5, $y, 16, 16)
112+
$g_hPicResultGoldTemp = _GUICtrlCreateIcon ($g_sLibIconPath, $eIcnGold, $x - 5, $y, 16, 16)
113113
$g_hLblResultElixirNow = GUICtrlCreateLabel("", $x - 5, $y + 22, 60, 15, $SS_RIGHT)
114114
$g_hLblResultElixirHourNow = GUICtrlCreateLabel("", $x, $y + 22, 60, 15, $SS_RIGHT)
115115
GUICtrlSetState(-1, $GUI_HIDE)
116-
$g_hPicResultElixirNow = GUICtrlCreateIcon ($g_sLibIconPath, $eIcnElixir, $x + 60, $y + 20, 16, 16)
116+
$g_hPicResultElixirNow = _GUICtrlCreateIcon ($g_sLibIconPath, $eIcnElixir, $x + 60, $y + 20, 16, 16)
117117
GUICtrlSetState(-1, $GUI_HIDE)
118-
$g_hPicResultElixirTemp = GUICtrlCreateIcon ($g_sLibIconPath, $eIcnElixir, $x - 5, $y + 20, 16, 16)
118+
$g_hPicResultElixirTemp = _GUICtrlCreateIcon ($g_sLibIconPath, $eIcnElixir, $x - 5, $y + 20, 16, 16)
119119
$g_hLblResultDENow = GUICtrlCreateLabel("", $x, $y + 42, 55, 15, $SS_RIGHT)
120120
$g_hLblResultDEHourNow = GUICtrlCreateLabel("", $x, $y + 42, 60, 15, $SS_RIGHT)
121121
GUICtrlSetState(-1, $GUI_HIDE)
122-
$g_hPicResultDENow = GUICtrlCreateIcon ($g_sLibIconPath, $eIcnDark, $x + 60, $y + 40, 16, 16)
122+
$g_hPicResultDENow = _GUICtrlCreateIcon ($g_sLibIconPath, $eIcnDark, $x + 60, $y + 40, 16, 16)
123123
GUICtrlSetState(-1, $GUI_HIDE)
124-
$g_hPicResultDETemp = GUICtrlCreateIcon ($g_sLibIconPath, $eIcnDark, $x - 5, $y + 40, 16, 16)
124+
$g_hPicResultDETemp = _GUICtrlCreateIcon ($g_sLibIconPath, $eIcnDark, $x - 5, $y + 40, 16, 16)
125125

126126
$x += 75
127127
;trophy / runtime
128128
$g_hLblResultTrophyNow = GUICtrlCreateLabel("", $x, $y + 2, 55, 15, $SS_RIGHT)
129-
$g_hPicResultTrophyNow = GUICtrlCreateIcon ($g_sLibIconPath, $eIcnTrophy, $x + 59, $y , 16, 16)
129+
$g_hPicResultTrophyNow = _GUICtrlCreateIcon ($g_sLibIconPath, $eIcnTrophy, $x + 59, $y , 16, 16)
130130
$g_hLblResultRuntimeNow = GUICtrlCreateLabel("00:00:00", $x, $y + 2, 50, 15, $SS_RIGHT)
131131
GUICtrlSetState(-1, $GUI_HIDE)
132-
$g_hPicResultRuntimeNow = GUICtrlCreateIcon($g_sLibIconPath, $eIcnHourGlass, $x +57, $y, 16, 16)
132+
$g_hPicResultRuntimeNow = _GUICtrlCreateIcon($g_sLibIconPath, $eIcnHourGlass, $x +57, $y, 16, 16)
133133
GUICtrlSetState(-1, $GUI_HIDE)
134134
;builders/attacked
135135
$g_hLblResultBuilderNow = GUICtrlCreateLabel("", $x, $y + 22, 55, 15, $SS_RIGHT)
136-
$g_hPicResultBuilderNow = GUICtrlCreateIcon ($g_sLibIconPath, $eIcnBuilder, $x + 59, $y + 20, 16, 16)
136+
$g_hPicResultBuilderNow = _GUICtrlCreateIcon ($g_sLibIconPath, $eIcnBuilder, $x + 59, $y + 20, 16, 16)
137137
$g_hLblResultAttackedHourNow = GUICtrlCreateLabel("0", $x, $y + 22, 50, 15, $SS_RIGHT)
138138
GUICtrlSetState(-1, $GUI_HIDE)
139-
$g_hPicResultAttackedHourNow = GUICtrlCreateIcon($g_sLibIconPath, $eIcnBldgTarget, $x +59, $y + 20, 16, 16)
139+
$g_hPicResultAttackedHourNow = _GUICtrlCreateIcon($g_sLibIconPath, $eIcnBldgTarget, $x +59, $y + 20, 16, 16)
140140
GUICtrlSetState(-1, $GUI_HIDE)
141141
;gems/skipped
142142
$g_hLblResultGemNow = GUICtrlCreateLabel("", $x + 5, $y + 42, 50, 15, $SS_RIGHT)
143-
$g_hPicResultGemNow = GUICtrlCreateIcon ($g_sLibIconPath, $eIcnGem, $x + 59, $y + 40, 16, 16)
143+
$g_hPicResultGemNow = _GUICtrlCreateIcon ($g_sLibIconPath, $eIcnGem, $x + 59, $y + 40, 16, 16)
144144
$g_hLblResultSkippedHourNow = GUICtrlCreateLabel("0", $x, $y + 42, 50, 15, $SS_RIGHT)
145145
GUICtrlSetState(-1, $GUI_HIDE)
146-
$g_hPicResultSkippedHourNow = GUICtrlCreateIcon ($g_sLibIconPath, $eIcnBldgX, $x + 59, $y + 40, 16, 16)
146+
$g_hPicResultSkippedHourNow = _GUICtrlCreateIcon ($g_sLibIconPath, $eIcnBldgX, $x + 59, $y + 40, 16, 16)
147147
GUICtrlSetState(-1, $GUI_HIDE)
148148

149149
$x = 285

COCBot/GUI/MBR GUI Design Child Attack - Activebase Attack Scripted.au3

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Func CreateAttackSearchActiveBaseScripted()
3131
_GUICtrlSetTip(-1, GetTranslatedFileIni("MBR GUI Design Child Attack - Attack Scripted", "CmbScriptName", -1))
3232
GUICtrlSetState(-1, $GUI_UNCHECKED)
3333
GUICtrlSetOnEvent(-1, "cmbScriptNameAB")
34-
GUICtrlCreateIcon($g_sLibIconPath, $eIcnReload, $x + 210, $y + 2, 16, 16)
34+
_GUICtrlCreateIcon($g_sLibIconPath, $eIcnReload, $x + 210, $y + 2, 16, 16)
3535
_GUICtrlSetTip(-1, GetTranslatedFileIni("MBR GUI Design Child Attack - Attack Scripted", "IconReload_Info_01", -1))
3636
GUICtrlSetOnEvent(-1, 'UpdateComboScriptNameAB') ; Run this function when the secondary GUI [X] is clicked
3737

@@ -49,17 +49,17 @@ Func CreateAttackSearchActiveBaseScripted()
4949
_GUICtrlSetTip(-1, GetTranslatedFileIni("MBR GUI Design Child Attack - Attack Scripted", "CmbScriptDropline_Info_01", "Choose the drop line edges. Default is outer corner and safer. First Redline point can improve attack."))
5050
GUICtrlSetState(-1, $GUI_UNCHECKED)
5151
GUICtrlSetOnEvent(-1, "cmbScriptDroplineAB")
52-
GUICtrlCreateIcon($g_sLibIconPath, $eIcnEdit, $x + 210, $y + 2, 16, 16)
52+
_GUICtrlCreateIcon($g_sLibIconPath, $eIcnEdit, $x + 210, $y + 2, 16, 16)
5353
_GUICtrlSetTip(-1, GetTranslatedFileIni("MBR GUI Design Child Attack - Attack Scripted", "IconShow-Edit_Info_01", -1))
5454
GUICtrlSetOnEvent(-1, "EditScriptAB")
5555

5656
$y +=25
57-
GUICtrlCreateIcon($g_sLibIconPath, $eIcnAddcvs, $x + 210, $y + 2, 16, 16)
57+
_GUICtrlCreateIcon($g_sLibIconPath, $eIcnAddcvs, $x + 210, $y + 2, 16, 16)
5858
_GUICtrlSetTip(-1, GetTranslatedFileIni("MBR GUI Design Child Attack - Attack Scripted", "IconCreate_Info_01", -1))
5959
GUICtrlSetOnEvent(-1, "NewScriptAB")
6060

6161
$y +=25
62-
GUICtrlCreateIcon($g_sLibIconPath, $eIcnCopy, $x + 210, $y + 2, 16, 16)
62+
_GUICtrlCreateIcon($g_sLibIconPath, $eIcnCopy, $x + 210, $y + 2, 16, 16)
6363
_GUICtrlSetTip(-1, GetTranslatedFileIni("MBR GUI Design Child Attack - Attack Scripted", "IconCopy_Info_01", -1))
6464
GUICtrlSetOnEvent(-1, "DuplicateScriptAB")
6565
GUICtrlCreateGroup("", -99, -99, 1, 1)

COCBot/GUI/MBR GUI Design Child Attack - Activebase Attack Standard.au3

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,21 +86,21 @@ Func CreateAttackSearchActiveBaseStandard()
8686
$g_hChkAttackNearGoldMineAB = GUICtrlCreateCheckbox("", $x + 20, $y, 17, 17)
8787
$sTxtTip = GetTranslatedFileIni("MBR GUI Design Child Attack - Attack Standard", "ChkAttackNearGoldMine_Info_01", -1)
8888
_GUICtrlSetTip(-1, $sTxtTip)
89-
GUICtrlCreateIcon($g_sLibIconPath, $eIcnMine, $x + 40 , $y - 3 , 24, 24)
89+
_GUICtrlCreateIcon($g_sLibIconPath, $eIcnMine, $x + 40 , $y - 3 , 24, 24)
9090
_GUICtrlSetTip(-1, $sTxtTip)
9191

9292
$x += 75
9393
$g_hChkAttackNearElixirCollectorAB = GUICtrlCreateCheckbox("", $x, $y, 17, 17)
9494
$sTxtTip = GetTranslatedFileIni("MBR GUI Design Child Attack - Attack Standard", "ChkAttackNearElixirCollector_Info_01", -1)
9595
_GUICtrlSetTip(-1, $sTxtTip)
96-
GUICtrlCreateIcon($g_sLibIconPath, $eIcnCollector, $x + 20 , $y - 3 , 24, 24)
96+
_GUICtrlCreateIcon($g_sLibIconPath, $eIcnCollector, $x + 20 , $y - 3 , 24, 24)
9797
_GUICtrlSetTip(-1, $sTxtTip)
9898

9999
$x += 55
100100
$g_hChkAttackNearDarkElixirDrillAB = GUICtrlCreateCheckbox("", $x, $y, 17, 17)
101101
$sTxtTip = GetTranslatedFileIni("MBR GUI Design Child Attack - Attack Standard", "ChkAttackNearDarkElixirDrill_Info_01", -1)
102102
_GUICtrlSetTip(-1, $sTxtTip)
103-
$g_hPicAttackNearDarkElixirDrillAB = GUICtrlCreateIcon($g_sLibIconPath, $eIcnDrill, $x + 20 , $y - 3, 24, 24)
103+
$g_hPicAttackNearDarkElixirDrillAB = _GUICtrlCreateIcon($g_sLibIconPath, $eIcnDrill, $x + 20 , $y - 3, 24, 24)
104104
_GUICtrlSetTip(-1, $sTxtTip)
105105

106106
;GUISetState()

0 commit comments

Comments
 (0)