Skip to content

Commit

Permalink
* **V7.2.1**
Browse files Browse the repository at this point in the history
 * 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
  • Loading branch information
cosote committed Jun 24, 2017
1 parent 129b7c2 commit 473ff05
Show file tree
Hide file tree
Showing 104 changed files with 1,301 additions and 796 deletions.
29 changes: 25 additions & 4 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
* **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

* **V7.2**
* Add Nox 3.8.2 and DirectX support, fix Click&Drag and automatic screen config
* Add new system to use translate
Expand Down Expand Up @@ -30,14 +51,14 @@
* Attacking (attack button, page detection, wait for clouds, star bonus)
* Upgrade buildings (resource type used, reading building names)
* Added detection of builder base window, and return to main base.

*** WARNING>> SOME BOT FEATURES ARE NOT OPERATIONAL!!!!
Not Working:
Not Working:
>> Building Upgrades, Lab Upgrades
Not Tested:
Not Tested:
>> 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.


* **V7.1.4**
* Add Nox 3.8.1.3 support
* Fix Strategies save file
Expand Down
8 changes: 1 addition & 7 deletions COCBot/GUI/MBR GUI Control BOT Options.au3
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,7 @@ Func chkBotAutoSlideClick()
EndFunc ;==>chkBotAutoSlideClick

Func chkUseRandomClick()
;$g_bUseRandomClick = (GUICtrlRead($g_hChkUseRandomClick) = $GUI_CHECKED)
$g_bRunState = True
Local $ArmyCamp = GetOCRCurrent(48, 160)
_CaptureRegion2(48,160,115, 174)
DebugImageSave("hi", False)
_ArrayDisplay($ArmyCamp)
$g_bRunState = False
$g_bUseRandomClick = (GUICtrlRead($g_hChkUseRandomClick) = $GUI_CHECKED)
EndFunc ;==>chkUseRandomClick
#cs
Func chkUpdatingWhenMinimized()
Expand Down
40 changes: 33 additions & 7 deletions COCBot/GUI/MBR GUI Control Splash.au3
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
; Parameters ....:
; Return values .: None
; Author ........: mikemikemikecoc (2016)
; Modified ......: CodeSlinger69 (2017)
; Modified ......: CodeSlinger69 (2017), MonkeyHunter (05-2017)
; Remarks .......: This file is part of MyBot, previously known as ClashGameBot. Copyright 2015-2017
; MyBot is distributed under the terms of the GNU GPL
; Related .......:
Expand All @@ -17,11 +17,34 @@
Func SplashStep($status, $bIncreaseStep = True)
If $bIncreaseStep = True Then $g_iSplashCurrentStep += 1

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

If $g_bDisableSplash Then Return

GUICtrlSetData($g_hSplashProgress, ($g_iSplashCurrentStep / $g_iSplashTotalSteps) * 100)
GUICtrlSetData($g_lSplashStatus, $status)

If $g_bMyBotDance Then ; can robot dance? Yes, like a drunk Code Monkey
Static $aSplashInfo, $iStartX, $iStartY, $iStep, $iStepIndex = 0
If $iStepIndex = 0 Then
$aSplashInfo = WinGetPos($g_hSplash) ; grab current position and size information
If @error Then SetLog("SplashStep " & $g_iSplashCurrentStep & " Failed to find GUI Window!", $COLOR_ERROR)
; $aSplashInfo[0] = X position, [1] = Y position, [2] = Width, [3] = Height
$iStartY = Int(@DesktopHeight - 50 - $aSplashInfo[3]) ; compute starting Y position just above bottom of display
$iStartX = Int((@DesktopWidth / 2) - ($aSplashInfo[2] / 2)) ; compute starting X position in middle of display
$iStep = Int($iStartY / ($g_iSplashTotalSteps - 1))
;SetDebuglog("SplashStep " & $g_iSplashCurrentStep & " X:Y= " & $aSplashInfo[0] & ":" & $aSplashInfo[1] & ", W:H= " & $aSplashInfo[2] & ":" & $aSplashInfo[3], $COLOR_DEBUG)
;SetDebuglog("$iStartX= " & $iStartX & ", $iStartY= " & $iStartY & ", $iStep= " & $iStep, $COLOR_DEBUG)
EndIf
; bottom to top with little shuffle added
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]]

;SetDebugLog("SplashStep " & $g_iSplashCurrentStep & " Location: " & $iStartX - $aSplashLoc[$iStepIndex][0] & ":" & $iStartY - $aSplashLoc[$iStepIndex][1] & ", $iStepIndex= " & $iStepIndex, $COLOR_DEBUG)
WinMove($g_hSplash, "", $iStartX - $aSplashLoc[$iStepIndex][0], $iStartY - $aSplashLoc[$iStepIndex][1], Default, Default, 8)
$iStepIndex += 1
If $iStepIndex > 9 Then $iStepIndex = 0 ; reset to zero when at top
EndIf

EndFunc ;==>SplashStep

Func UpdateSplashTitle($title)
Expand All @@ -31,9 +54,12 @@ Func UpdateSplashTitle($title)
EndFunc ;==>UpdateSplashTitle

Func DestroySplashScreen()
If IsHWnd($g_hSplash) Then GUIDelete($g_hSplash)

; allow now other bots to launch
ReleaseMutex($g_hSplashMutex)
$g_hSplashMutex = 0
If IsHWnd($g_hSplash) Then GUIDelete($g_hSplash)
; allow now other bots to launch
ReleaseMutex($g_hSplashMutex)
$g_hSplashMutex = 0
EndFunc ;==>DestroySplashScreen

Func MoveSplashScreen()
_WinAPI_PostMessage($g_hSplash, $WM_SYSCOMMAND, 0xF012, 0) ; SC_DRAGMOVE = 0xF012
EndFunc ;==>MoveSplashScreen
30 changes: 15 additions & 15 deletions COCBot/GUI/MBR GUI Design Bottom.au3
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,15 @@ Func CreateBottomPanel()

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

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

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

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

;~ Village
Expand All @@ -107,43 +107,43 @@ Func CreateBottomPanel()
$g_hLblResultGoldNow = GUICtrlCreateLabel("", $x - 5, $y + 2, 60, 15, $SS_RIGHT)
$g_hLblResultGoldHourNow = GUICtrlCreateLabel("", $x, $y + 2, 60, 15, $SS_RIGHT)
GUICtrlSetState(-1, $GUI_HIDE)
$g_hPicResultGoldNow = GUICtrlCreateIcon ($g_sLibIconPath, $eIcnGold, $x + 60, $y, 16, 16)
$g_hPicResultGoldNow = _GUICtrlCreateIcon ($g_sLibIconPath, $eIcnGold, $x + 60, $y, 16, 16)
GUICtrlSetState(-1, $GUI_HIDE)
$g_hPicResultGoldTemp = GUICtrlCreateIcon ($g_sLibIconPath, $eIcnGold, $x - 5, $y, 16, 16)
$g_hPicResultGoldTemp = _GUICtrlCreateIcon ($g_sLibIconPath, $eIcnGold, $x - 5, $y, 16, 16)
$g_hLblResultElixirNow = GUICtrlCreateLabel("", $x - 5, $y + 22, 60, 15, $SS_RIGHT)
$g_hLblResultElixirHourNow = GUICtrlCreateLabel("", $x, $y + 22, 60, 15, $SS_RIGHT)
GUICtrlSetState(-1, $GUI_HIDE)
$g_hPicResultElixirNow = GUICtrlCreateIcon ($g_sLibIconPath, $eIcnElixir, $x + 60, $y + 20, 16, 16)
$g_hPicResultElixirNow = _GUICtrlCreateIcon ($g_sLibIconPath, $eIcnElixir, $x + 60, $y + 20, 16, 16)
GUICtrlSetState(-1, $GUI_HIDE)
$g_hPicResultElixirTemp = GUICtrlCreateIcon ($g_sLibIconPath, $eIcnElixir, $x - 5, $y + 20, 16, 16)
$g_hPicResultElixirTemp = _GUICtrlCreateIcon ($g_sLibIconPath, $eIcnElixir, $x - 5, $y + 20, 16, 16)
$g_hLblResultDENow = GUICtrlCreateLabel("", $x, $y + 42, 55, 15, $SS_RIGHT)
$g_hLblResultDEHourNow = GUICtrlCreateLabel("", $x, $y + 42, 60, 15, $SS_RIGHT)
GUICtrlSetState(-1, $GUI_HIDE)
$g_hPicResultDENow = GUICtrlCreateIcon ($g_sLibIconPath, $eIcnDark, $x + 60, $y + 40, 16, 16)
$g_hPicResultDENow = _GUICtrlCreateIcon ($g_sLibIconPath, $eIcnDark, $x + 60, $y + 40, 16, 16)
GUICtrlSetState(-1, $GUI_HIDE)
$g_hPicResultDETemp = GUICtrlCreateIcon ($g_sLibIconPath, $eIcnDark, $x - 5, $y + 40, 16, 16)
$g_hPicResultDETemp = _GUICtrlCreateIcon ($g_sLibIconPath, $eIcnDark, $x - 5, $y + 40, 16, 16)

$x += 75
;trophy / runtime
$g_hLblResultTrophyNow = GUICtrlCreateLabel("", $x, $y + 2, 55, 15, $SS_RIGHT)
$g_hPicResultTrophyNow = GUICtrlCreateIcon ($g_sLibIconPath, $eIcnTrophy, $x + 59, $y , 16, 16)
$g_hPicResultTrophyNow = _GUICtrlCreateIcon ($g_sLibIconPath, $eIcnTrophy, $x + 59, $y , 16, 16)
$g_hLblResultRuntimeNow = GUICtrlCreateLabel("00:00:00", $x, $y + 2, 50, 15, $SS_RIGHT)
GUICtrlSetState(-1, $GUI_HIDE)
$g_hPicResultRuntimeNow = GUICtrlCreateIcon($g_sLibIconPath, $eIcnHourGlass, $x +57, $y, 16, 16)
$g_hPicResultRuntimeNow = _GUICtrlCreateIcon($g_sLibIconPath, $eIcnHourGlass, $x +57, $y, 16, 16)
GUICtrlSetState(-1, $GUI_HIDE)
;builders/attacked
$g_hLblResultBuilderNow = GUICtrlCreateLabel("", $x, $y + 22, 55, 15, $SS_RIGHT)
$g_hPicResultBuilderNow = GUICtrlCreateIcon ($g_sLibIconPath, $eIcnBuilder, $x + 59, $y + 20, 16, 16)
$g_hPicResultBuilderNow = _GUICtrlCreateIcon ($g_sLibIconPath, $eIcnBuilder, $x + 59, $y + 20, 16, 16)
$g_hLblResultAttackedHourNow = GUICtrlCreateLabel("0", $x, $y + 22, 50, 15, $SS_RIGHT)
GUICtrlSetState(-1, $GUI_HIDE)
$g_hPicResultAttackedHourNow = GUICtrlCreateIcon($g_sLibIconPath, $eIcnBldgTarget, $x +59, $y + 20, 16, 16)
$g_hPicResultAttackedHourNow = _GUICtrlCreateIcon($g_sLibIconPath, $eIcnBldgTarget, $x +59, $y + 20, 16, 16)
GUICtrlSetState(-1, $GUI_HIDE)
;gems/skipped
$g_hLblResultGemNow = GUICtrlCreateLabel("", $x + 5, $y + 42, 50, 15, $SS_RIGHT)
$g_hPicResultGemNow = GUICtrlCreateIcon ($g_sLibIconPath, $eIcnGem, $x + 59, $y + 40, 16, 16)
$g_hPicResultGemNow = _GUICtrlCreateIcon ($g_sLibIconPath, $eIcnGem, $x + 59, $y + 40, 16, 16)
$g_hLblResultSkippedHourNow = GUICtrlCreateLabel("0", $x, $y + 42, 50, 15, $SS_RIGHT)
GUICtrlSetState(-1, $GUI_HIDE)
$g_hPicResultSkippedHourNow = GUICtrlCreateIcon ($g_sLibIconPath, $eIcnBldgX, $x + 59, $y + 40, 16, 16)
$g_hPicResultSkippedHourNow = _GUICtrlCreateIcon ($g_sLibIconPath, $eIcnBldgX, $x + 59, $y + 40, 16, 16)
GUICtrlSetState(-1, $GUI_HIDE)

$x = 285
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Func CreateAttackSearchActiveBaseScripted()
_GUICtrlSetTip(-1, GetTranslatedFileIni("MBR GUI Design Child Attack - Attack Scripted", "CmbScriptName", -1))
GUICtrlSetState(-1, $GUI_UNCHECKED)
GUICtrlSetOnEvent(-1, "cmbScriptNameAB")
GUICtrlCreateIcon($g_sLibIconPath, $eIcnReload, $x + 210, $y + 2, 16, 16)
_GUICtrlCreateIcon($g_sLibIconPath, $eIcnReload, $x + 210, $y + 2, 16, 16)
_GUICtrlSetTip(-1, GetTranslatedFileIni("MBR GUI Design Child Attack - Attack Scripted", "IconReload_Info_01", -1))
GUICtrlSetOnEvent(-1, 'UpdateComboScriptNameAB') ; Run this function when the secondary GUI [X] is clicked

Expand All @@ -49,17 +49,17 @@ Func CreateAttackSearchActiveBaseScripted()
_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."))
GUICtrlSetState(-1, $GUI_UNCHECKED)
GUICtrlSetOnEvent(-1, "cmbScriptDroplineAB")
GUICtrlCreateIcon($g_sLibIconPath, $eIcnEdit, $x + 210, $y + 2, 16, 16)
_GUICtrlCreateIcon($g_sLibIconPath, $eIcnEdit, $x + 210, $y + 2, 16, 16)
_GUICtrlSetTip(-1, GetTranslatedFileIni("MBR GUI Design Child Attack - Attack Scripted", "IconShow-Edit_Info_01", -1))
GUICtrlSetOnEvent(-1, "EditScriptAB")

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

$y +=25
GUICtrlCreateIcon($g_sLibIconPath, $eIcnCopy, $x + 210, $y + 2, 16, 16)
_GUICtrlCreateIcon($g_sLibIconPath, $eIcnCopy, $x + 210, $y + 2, 16, 16)
_GUICtrlSetTip(-1, GetTranslatedFileIni("MBR GUI Design Child Attack - Attack Scripted", "IconCopy_Info_01", -1))
GUICtrlSetOnEvent(-1, "DuplicateScriptAB")
GUICtrlCreateGroup("", -99, -99, 1, 1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,21 +86,21 @@ Func CreateAttackSearchActiveBaseStandard()
$g_hChkAttackNearGoldMineAB = GUICtrlCreateCheckbox("", $x + 20, $y, 17, 17)
$sTxtTip = GetTranslatedFileIni("MBR GUI Design Child Attack - Attack Standard", "ChkAttackNearGoldMine_Info_01", -1)
_GUICtrlSetTip(-1, $sTxtTip)
GUICtrlCreateIcon($g_sLibIconPath, $eIcnMine, $x + 40 , $y - 3 , 24, 24)
_GUICtrlCreateIcon($g_sLibIconPath, $eIcnMine, $x + 40 , $y - 3 , 24, 24)
_GUICtrlSetTip(-1, $sTxtTip)

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

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

;GUISetState()
Expand Down
Loading

0 comments on commit 473ff05

Please sign in to comment.