Skip to content

Commit

Permalink
* **V7.5.1**
Browse files Browse the repository at this point in the history
* Fixed Switch account on SC_ID log out Button
* Fixed Personal Break time stuck on reload button
* Fixed Personal Break time not forcing to switch to another account
* Fixed Bluestacks v3 undocked and request troops
* Fixed Wizard detection on attack bar
* Fixed Treasury Window check for CoC v10.134.11 (9th april 2018)
* Improve Switch Account check for donation only accounts + PBT account = All account, goes to a none PBT village.
* Improve collect free magic items and 'No Space in Clan Castle'
* Improve Clan Games and Quick Train for Troops Challenges
* Update Russian Language File (by @vlab97)
  • Loading branch information
Fliegerfaust committed Apr 15, 2018
1 parent e4436dd commit c8e67d3
Show file tree
Hide file tree
Showing 43 changed files with 275 additions and 222 deletions.
16 changes: 14 additions & 2 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
* **V7.5**
* **V7.5.1**
* Fixed Switch account on SC_ID log out Button
* Fixed Personal Break time stuck on reload button
* Fixed Personal Break time not forcing to switch to another account
* Fixed Bluestacks v3 undocked and request troops
* Fixed Wizard detection on attack bar
* Fixed Treasury Window check for CoC v10.134.11 (9th april 2018)
* Improve Switch Account check for donation only accounts + PBT account = All account, goes to a none PBT village.
* Improve collect free magic items and 'No Space in Clan Castle'
* Improve Clan Games and Quick Train for Troops Challenges
* Update Russian Language File (by @Vlab97)

* **V7.5**
* Add Clan Games support (special thx go to ViperZ and Uncle Xbenk)
* Add Collect free magic poisons
* Add Collect Free Magic Items
* Add support for SuperCell ID accounts switch
* Fix DonateCC "Unable to read Chat Request" in both Chinese languages and Korean language
* Fix "Log in with Supercell ID" screen (push CoC shared_prefs folder if detected, click by account list when shared_prefs is not available and switch accounts enabled)
Expand Down
2 changes: 1 addition & 1 deletion COCBot/GUI/MBR GUI Design About.au3
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Func CreateAboutTab()
GUICtrlCreateLabel($sText, $x - 5, $y, 410, 20, BitOR($WS_VISIBLE, $ES_AUTOVSCROLL, $SS_LEFT), 0)
GUICtrlSetFont(-1, 9.5, $FW_BOLD, Default, "Arial")
GUICtrlSetColor(-1, $COLOR_NAVY)
$sText = "Cosote, Fliegerfaust, MHK2012, MMHK, NguyenAnhHD, TripleM"
$sText = "Cosote, Fliegerfaust, MHK2012, MMHK, TripleM"
GUICtrlCreateLabel($sText, $x + 5, $y + 15, 410, 50, BitOR($WS_VISIBLE, $ES_AUTOVSCROLL, $SS_LEFT), 0)
GUICtrlSetFont(-1, 9, $FW_MEDIUM, Default, "Arial")

Expand Down
2 changes: 1 addition & 1 deletion COCBot/MBR Functions.au3
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
#include "functions\Main Screen\checkAttackDisable.au3"
#include "functions\Main Screen\RemoveGhostTrayIcons.au3"
#include "functions\Main Screen\waitMainScreen.au3"
#include "functions\Main Screen\isOnBuilderIsland.au3"
#include "functions\Main Screen\isOnBuilderBase.au3"

; Android support for MEmu, LeapDroid, Droid4X, Nox, BlueStacks...
#include "functions\Android\AndroidMenuShortcuts.au3"
Expand Down
4 changes: 3 additions & 1 deletion COCBot/functions/Android/AndroidBlueStacks.au3
Original file line number Diff line number Diff line change
Expand Up @@ -312,9 +312,11 @@ Func InitBlueStacks2($bCheckOnly = False)
If $bInstalled And Not $bCheckOnly Then
$__VBoxManage_Path = $__BlueStacks_Path & "BstkVMMgr.exe"
; Also required for BS3 2.55.70.1203
; 2.56.75.1279 doesn't need any compensation!!
Local $bs3 = GetVersionNormalized("2.50.0.0")
Local $bs3WithFrame = GetVersionNormalized("2.56.75")
local $bsNow = GetVersionNormalized($__BlueStacks_Version)
If StringInStr($__BlueStacks_Version, "4.") = 1 Or (StringInStr($__BlueStacks_Version, "2.") = 1 And $bsNow >= $bs3) Then
If StringInStr($__BlueStacks_Version, "4.") = 1 Or (StringInStr($__BlueStacks_Version, "2.") = 1 And $bsNow >= $bs3 And $bsNow < $bs3WithFrame) Then
; Mouse clicks in Window are off by -13 on Y-axis, so set special value now
Local $aOff = [0, 13]
If $g_aiMouseOffsetWindowOnly[0] <> $aOff[0] Or $g_aiMouseOffsetWindowOnly[1] <> $aOff[1] Then
Expand Down
48 changes: 24 additions & 24 deletions COCBot/functions/Android/Distributors.au3
Original file line number Diff line number Diff line change
Expand Up @@ -22,30 +22,30 @@ Func InitializeCOCDistributors() ;initialized in InitializeMBR() after language

; Clash Of Magic private server, https://www.clashofmagic.net/, Server 3: http://download825.mediafireuserdownload.com/g29mv74piaqg/jeab7w484b77n86/Magic-CoC_S3-9.105-R1.apk
Dim $_g_asDISTRIBUTORS[24][4] = [ _
["Google", "com.supercell.clashofclans", "com.supercell.clashofclans.GameApp", GetTranslatedFileIni("MBR Distributors", "Emulator_Item_01", "Google")], _
["Kunlun", "com.supercell.clashofclans.kunlun", "com.supercell.clashofclans.GameAppKunlun", GetTranslatedFileIni("MBR Distributors", "Emulator_Item_02", "Kunlun")], _
["Qihoo", "com.supercell.clashofclans.qihoo", "com.supercell.clashofclans.GameAppKunlun", GetTranslatedFileIni("MBR Distributors", "Emulator_Item_03", "Qihoo")], _
["Baidu", "com.supercell.clashofclans.baidu", "com.supercell.clashofclans.GameAppKunlun", GetTranslatedFileIni("MBR Distributors", "Emulator_Item_04", "Baidu")], _
["9game", "com.supercell.clashofclans.uc", "com.supercell.clashofclans.uc.GameApp", GetTranslatedFileIni("MBR Distributors", "Emulator_Item_05", "9game")], _
["Wandoujia/Downjoy", "com.supercell.clashofclans.wdj", "com.supercell.clashofclans.GameAppKunlun", GetTranslatedFileIni("MBR Distributors", "Emulator_Item_06", "Wandoujia/Downjoy")], _
["Huawei", "com.supercell.clashofclans.huawei", "com.supercell.clashofclans.GameAppKunlun", GetTranslatedFileIni("MBR Distributors", "Emulator_Item_07", "Huawei")], _
["OPPO", "com.supercell.clashofclans.nearme.gamecenter", "com.supercell.clashofclans.GameAppKunlun", GetTranslatedFileIni("MBR Distributors", "Emulator_Item_08", "OPPO")], _
["VIVO", "com.supercell.clashofclans.vivo", "com.supercell.clashofclans.GameAppKunlun", GetTranslatedFileIni("MBR Distributors", "Emulator_Item_09", "VIVO")], _
["Anzhi", "com.supercell.clashofclans.anzhi", "com.supercell.clashofclans.GameAppKunlun", GetTranslatedFileIni("MBR Distributors", "Emulator_Item_10", "Anzhi")], _
["Kaopu", "com.supercell.clashofclans.ewan.kaopu", "com.supercell.clashofclans.GameAppKunlun", GetTranslatedFileIni("MBR Distributors", "Emulator_Item_11", "Kaopu")], _
["Lenovo", "com.supercell.clashofclans.lenovo", "com.supercell.clashofclans.GameAppKunlun", GetTranslatedFileIni("MBR Distributors", "Emulator_Item_12", "Lenovo")], _
["Guopan", "com.supercell.clashofclans.wdj", "com.flamingo.sdk.view.WDJSplashActivity", GetTranslatedFileIni("MBR Distributors", "Emulator_Item_13", "Guopan")], _
["Xiaomi", "com.supercell.clashofclans.mi", "com.supercell.clashofclans.mi.GameAppXiaomi", GetTranslatedFileIni("MBR Distributors", "Emulator_Item_14", "Xiaomi")], _
["Haimawan", "com.supercell.clashofclans.ewan.hm", "cn.ewan.supersdk.activity.SplashActivity", GetTranslatedFileIni("MBR Distributors", "Emulator_Item_15", "Haimawan")], _
["Leshi", "com.supercell.clashofclans.ewan.leshi", "cn.ewan.supersdk.activity.SplashActivity", GetTranslatedFileIni("MBR Distributors", "Emulator_Item_16", "Leshi")], _
["Microvirt", "com.supercell.clashofclans.ewan.xyaz", "cn.ewan.supersdk.activity.SplashActivity", GetTranslatedFileIni("MBR Distributors", "Emulator_Item_17", "Microvirt")], _
["Yeshen", "com.supercell.clashofclans.ewan.yeshen", "cn.ewan.supersdk.activity.SplashActivity", GetTranslatedFileIni("MBR Distributors", "Emulator_Item_18", "Yeshen")], _
["Aiyouxi", "com.supercell.clashofclans.ewan.egame", "cn.ewan.supersdk.activity.SplashActivity", GetTranslatedFileIni("MBR Distributors", "Emulator_Item_19", "Aiyouxi")], _
["Tencent", "com.tencent.tmgp.supercell.clashofclans", "com.tencent.tmgp.supercell.clashofclans.GameAppTencent", GetTranslatedFileIni("MBR Distributors", "Emulator_Item_20", "Tencent")], _
["Clash Of Magic, The Black Magic: S1", "net.clashofmagic.s1", "com.supercell.clashofclans.GameApp", GetTranslatedFileIni("MBR Distributors", "Emulator_Item_21", "Clash Of Magic, The Black Magic: S1")], _
["Clash Of Magic, The Power Of Magic: S2", "net.clashofmagic.s2", "com.supercell.clashofclans.GameApp", GetTranslatedFileIni("MBR Distributors", "Emulator_Item_22", "Clash Of Magic, The Power Of Magic: S2")], _
["Clash Of Magic, The Hall Of Magic: S3", "net.clashofmagic.s3", "com.supercell.clashofclans.GameApp", GetTranslatedFileIni("MBR Distributors", "Emulator_Item_23", "Clash Of Magic, The Hall Of Magic: S3")], _
["Clash Of Magic, The Hall Of Magic 2: S4", "net.clashofmagic.s4", "com.supercell.clashofclans.GameApp", GetTranslatedFileIni("MBR Distributors", "Emulator_Item_24", "Clash Of Magic, The Hall Of Magic 2: S4")] _
["Google", "com.supercell.clashofclans", "com.supercell.clashofclans.GameApp", "Google"], _
["Kunlun", "com.supercell.clashofclans.kunlun", "com.supercell.clashofclans.GameAppKunlun", "Kunlun"], _
["Qihoo", "com.supercell.clashofclans.qihoo", "com.supercell.clashofclans.GameAppKunlun","Qihoo"], _
["Baidu", "com.supercell.clashofclans.baidu", "com.supercell.clashofclans.GameAppKunlun", "Baidu"], _
["9game", "com.supercell.clashofclans.uc", "com.supercell.clashofclans.uc.GameApp", "9game"], _
["Wandoujia/Downjoy", "com.supercell.clashofclans.wdj", "com.supercell.clashofclans.GameAppKunlun", "Wandoujia/Downjoy"], _
["Huawei", "com.supercell.clashofclans.huawei", "com.supercell.clashofclans.GameAppKunlun", "Huawei"], _
["OPPO", "com.supercell.clashofclans.nearme.gamecenter", "com.supercell.clashofclans.GameAppKunlun", "OPPO"], _
["VIVO", "com.supercell.clashofclans.vivo", "com.supercell.clashofclans.GameAppKunlun", "VIVO"], _
["Anzhi", "com.supercell.clashofclans.anzhi", "com.supercell.clashofclans.GameAppKunlun", "Anzhi"], _
["Kaopu", "com.supercell.clashofclans.ewan.kaopu", "com.supercell.clashofclans.GameAppKunlun", "Kaopu"], _
["Lenovo", "com.supercell.clashofclans.lenovo", "com.supercell.clashofclans.GameAppKunlun", "Lenovo"], _
["Guopan", "com.supercell.clashofclans.wdj", "com.flamingo.sdk.view.WDJSplashActivity", "Guopan"], _
["Xiaomi", "com.supercell.clashofclans.mi", "com.supercell.clashofclans.mi.GameAppXiaomi","Xiaomi"], _
["Haimawan", "com.supercell.clashofclans.ewan.hm", "cn.ewan.supersdk.activity.SplashActivity", "Haimawan"], _
["Leshi", "com.supercell.clashofclans.ewan.leshi", "cn.ewan.supersdk.activity.SplashActivity", "Leshi"], _
["Microvirt", "com.supercell.clashofclans.ewan.xyaz", "cn.ewan.supersdk.activity.SplashActivity", "Microvirt"], _
["Yeshen", "com.supercell.clashofclans.ewan.yeshen", "cn.ewan.supersdk.activity.SplashActivity","Yeshen"], _
["Aiyouxi", "com.supercell.clashofclans.ewan.egame", "cn.ewan.supersdk.activity.SplashActivity","Aiyouxi"], _
["Tencent", "com.tencent.tmgp.supercell.clashofclans", "com.tencent.tmgp.supercell.clashofclans.GameAppTencent","Tencent"], _
["Clash Of Magic, The Black Magic: S1", "net.clashofmagic.s1", "com.supercell.clashofclans.GameApp", "Clash Of Magic, The Black Magic: S1"], _
["Clash Of Magic, The Power Of Magic: S2", "net.clashofmagic.s2", "com.supercell.clashofclans.GameApp","Clash Of Magic, The Power Of Magic: S2"], _
["Clash Of Magic, The Hall Of Magic: S3", "net.clashofmagic.s3", "com.supercell.clashofclans.GameApp", "Clash Of Magic, The Hall Of Magic: S3"], _
["Clash Of Magic, The Hall Of Magic 2: S4", "net.clashofmagic.s4", "com.supercell.clashofclans.GameApp", "Clash Of Magic, The Hall Of Magic 2: S4"] _
]
EndFunc ;==>InitializeCOCDistributors

Expand Down
4 changes: 2 additions & 2 deletions COCBot/functions/Config/DelayTimes.au3
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ Global Const $DELAYCHECKOBSTACLES10 = 1800000 ; 30 minutes
;isGemOpen
Global Const $DELAYISGEMOPEN1 = 350

;isOnBuilderIsland
Global Const $DELAYISBUILDERISLAND = 300
;isOnBuilderBase
Global Const $DELAYISBUILDERBASE = 300

;waitMainScreen
Global Const $DELAYWAITMAINSCREEN1 = 2000
Expand Down
3 changes: 3 additions & 0 deletions COCBot/functions/Config/ImageDirectories.au3
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ Global $g_sImgCleanYard = @ScriptDir & "\imgxml\Resources\Obstacles"
Global $g_sImgCleanYardSnow = @ScriptDir & "\imgxml\Obstacles_Snow"
Global $g_sImgGemBox = @ScriptDir & "\imgxml\Resources\GemBox"
Global $g_sImgCollectReward = @ScriptDir & "\imgxml\Resources\ClaimReward"
Global $g_sImgTrader = @ScriptDir & "\imgxml\FreeMagicItems\TraderIcon"
Global $g_sImgDailyDiscountWindow = @ScriptDir & "\imgxml\FreeMagicItems\DailyDiscount"
Global $g_sImgBuyDealWindow = @ScriptDir & "\imgxml\FreeMagicItems\BuyDeal"
#EndRegion

#Region Builder Base
Expand Down
6 changes: 3 additions & 3 deletions COCBot/functions/Config/ScreenCoordinates.au3
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Global $aIsReloadError[4] = [457, 301 + $g_iMidOffsetY, 0x33B5E5, 10] ; Pixel Se
Global $aIsMain[4] = [278, 9, 0x77BDE0, 20] ; Main Screen, Builder Info Icon
Global $aIsMainGrayed[4] = [278, 9, 0x3C5F70, 15] ; Main Screen, Builder Info Icon grayed

Global $aIsOnBuilderIsland[4] = [838, 18, 0xffff46, 10] ; Check the Gold Coin from resources , is a square not round
Global $aIsOnBuilderBase[4] = [838, 18, 0xffff46, 10] ; Check the Gold Coin from resources , is a square not round

Global $aTopLeftClient[4] = [1, 1, 0x000000, 0] ; TopLeftClient: Tolerance not needed
Global $aTopMiddleClient[4] = [475, 1, 0x000000, 0] ; TopMiddleClient: Tolerance not needed
Expand Down Expand Up @@ -95,7 +95,7 @@ Global $aDetectLang[2] = [16, 634 + $g_iBottomOffsetY] ; Detect Language, bottom
Global $aGreenArrowTrainTroops[2] = [389, 125]
Global $aGreenArrowBrewSpells[2] = [585, 125]
Global $g_aShopWindowOpen[4] = [804, 54, 0xC00508, 15] ; Red pixel in lower right corner of RED X to close shop window
Global $aTreasuryWindow[4] = [689, 172 + $g_iMidOffsetY, 0xFF8D95, 20] ; Redish pixel above X to close treasury window
Global $aTreasuryWindow[4] = [689, 138 + $g_iMidOffsetY, 0xFF8D95, 20] ; Redish pixel above X to close treasury window
Global $aAttackForTreasury[4] = [88, 619 + $g_iMidOffsetY, 0xF0EBE8, 5] ; Red pixel below X to close treasury window
Global $aAtkHasDarkElixir[4] = [ 31, 144, 0x282020, 10] ; Attack Page, Check for DE icon
Global $aVillageHasDarkElixir[4] = [837, 134, 0x3D2D3D, 10] ; Main Page, Base has dark elixir storage
Expand Down Expand Up @@ -182,7 +182,7 @@ Global $aTextBox[4] = [320, 160 + $g_iMidOffsetY, 0xFFFFFF, 10] ; Text box, Whit
Global $aButtonVillageOkay[4] = [500, 170 + $g_iMidOffsetY, 0x81CA2D, 20] ; Okay button, Green
;SuperCell ID
Global $aButtonConnectedSCID[4] = [430, 205 + $g_iMidOffsetY, 0x6EB730, 20] ; Setting creen, Supercell ID Connected button
Global $aButtonLogOutSCID[4] = [700, 400 + $g_iMidOffsetY, 0x308AFB, 20] ; Supercell ID, Log Out button
Global $aButtonLogOutSCID[4] = [700, 285 + $g_iMidOffsetY, 0x308AFB, 20] ; Supercell ID, Log Out button
Global $aButtonConfirmSCID[4] = [460, 410 + $g_iMidOffsetY, 0x328AFB, 20] ; Supercell ID, Confirm button
Global $aListAccountSCID[4] = [490, 185 + $g_iMidOffsetY, 0x000000, 10] ; Supercell ID, Black check in word "ID"
Global $aCloseTabSCID[4] = [732, 145] ; Button Close Supercell ID tab
Expand Down
2 changes: 1 addition & 1 deletion COCBot/functions/Image Search/CheckTombs.au3
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ Func CleanYard()
$Filename = $matchedValues[0] ; Filename
For $i = 0 To UBound($aPoints) - 1
$CleanYardXY = $aPoints[$i] ; Coords
If isInsideDiamondXY($CleanYardXY[0], $CleanYardXY[1]) Then ; secure x because of clan chat tab
If UBound($CleanYardXY) > 1 And isInsideDiamondXY($CleanYardXY[0], $CleanYardXY[1]) Then ; secure x because of clan chat tab
If $g_bDebugSetlog Then SetDebugLog($Filename & " found (" & $CleanYardXY[0] & "," & $CleanYardXY[1] & ")", $COLOR_SUCCESS)
If IsMainPage() Then Click($CleanYardXY[0], $CleanYardXY[1], 1, 0, "#0430")
$Locate = 1
Expand Down
2 changes: 1 addition & 1 deletion COCBot/functions/Image Search/QuickMIS.au3
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Func QuickMIS($ValueReturned, $directory, $Left = 0, $Top = 0, $Right = $g_iGAME

If $g_bDebugSetlog Or $Debug Then
SetDebugLog($ValueReturned & " Found: " & $Result & ", using " & $g_iQuickMISX & "," & $g_iQuickMISY, $COLOR_PURPLE)
DebugQuickMIS($Left, $Top, "BC1_detected[" & $Name & "_" & $g_iQuickMISX + $Left & "x" & $g_iQuickMISY + $Top & "]")
If $g_bDebugImageSave Then DebugQuickMIS($Left, $Top, "BC1_detected[" & $Name & "_" & $g_iQuickMISX + $Left & "x" & $g_iQuickMISY + $Top & "]")
EndIf

Return True
Expand Down
2 changes: 1 addition & 1 deletion COCBot/functions/Main Screen/checkMainScreen.au3
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Func _checkMainScreen($bSetLog = Default, $bBuilderBase = Default) ;Checks if in
$iErrorCount = 0
$iCheckBeforeRestartAndroidCount = 3

If $bBuilderBase Then $aPixelToCheck = $aIsOnBuilderIsland
If $bBuilderBase Then $aPixelToCheck = $aIsOnBuilderBase
Local $bLocated
While _CaptureRegions() And Not _checkMainScreenImage($bLocated, $aPixelToCheck)
$i += 1
Expand Down
24 changes: 13 additions & 11 deletions COCBot/functions/Main Screen/checkObstacles.au3
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,11 @@ Func _checkObstacles($bBuilderBase = False, $bRecursive = False) ;Checks if some

_CaptureRegions()

If checkObstacles_Network() Then Return True
If Not $bRecursive And checkObstacles_GfxError() Then Return True
Local $bIsOnBuilderIsland = _CheckPixel($aIsOnBuilderIsland, $g_bNoCapturePixel)
If Not $bRecursive Then
If checkObstacles_Network() Then Return True
If checkObstacles_GfxError() Then Return True
EndIf
Local $bIsOnBuilderIsland = _CheckPixel($aIsOnBuilderBase, $g_bNoCapturePixel)
If $bBuilderBase = False And $bIsOnBuilderIsland = True Then
SetLog("Detected Builder Base, trying to switch back to Main Village")
If SwitchBetweenBases(False) Then
Expand Down Expand Up @@ -94,7 +96,7 @@ Func _checkObstacles($bBuilderBase = False, $bRecursive = False) ;Checks if some
PushMsg("AnotherDevice")
EndIf
If _SleepStatus($g_iAnotherDeviceWaitTime * 1000) Then Return ; Wait as long as user setting in GUI, default 120 seconds
If Not $bRecursive Then checkObstacles_ReloadCoC($aReloadButton, "#0127")
checkObstacles_ReloadCoC($aReloadButton, "#0127", $bRecursive)
If $g_bForceSinglePBLogoff Then $g_bGForcePBTUpdate = True
checkObstacles_ResetSearch()
Return True
Expand All @@ -106,7 +108,7 @@ Func _checkObstacles($bBuilderBase = False, $bRecursive = False) ;Checks if some
If TestCapture() Then Return "Village must take a break"
PushMsg("TakeBreak")
If _SleepStatus($DELAYCHECKOBSTACLES4) Then Return ; 2 Minutes
If Not $bRecursive Then checkObstacles_ReloadCoC($aReloadButton, "#0128") ;Click on reload button
checkObstacles_ReloadCoC($aReloadButton, "#0128", $bRecursive) ;Click on reload button
If $g_bForceSinglePBLogoff Then $g_bGForcePBTUpdate = True
checkObstacles_ResetSearch()
Return True
Expand Down Expand Up @@ -216,12 +218,12 @@ Func _checkObstacles($bBuilderBase = False, $bRecursive = False) ;Checks if some
SetLog("Warning: Can not find type of Reload error message", $COLOR_ERROR)
EndSelect
If TestCapture() Then Return "Village is out of sync or inactivity or connection lost or maintenance"
If Not $bRecursive Then Return checkObstacles_ReloadCoC($aReloadButton, "#0131") ; Click for out of sync or inactivity or connection lost or maintenance
checkObstacles_ReloadCoC($aReloadButton, "#0131", $bRecursive) ; Click for out of sync or inactivity or connection lost or maintenance
EndIf
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
If TestCapture() = 0 And GetAndroidProcessPID() = 0 Then
; CoC not running
If Not $bRecursive Then Return checkObstacles_ReloadCoC() ; just start CoC (but first close it!)
Return checkObstacles_ReloadCoC(Default, "", $bRecursive) ; just start CoC (but first close it!)
EndIf
Local $bHasTopBlackBar = _ColorCheck(_GetPixelColor(10, 3), Hex(0x000000, 6), 1) And _ColorCheck(_GetPixelColor(300, 6), Hex(0x000000, 6), 1) And _ColorCheck(_GetPixelColor(600, 9), Hex(0x000000, 6), 1)
If _ColorCheck(_GetPixelColor(235, 209 + $g_iMidOffsetY), Hex(0x9E3826, 6), 20) Then
Expand Down Expand Up @@ -301,7 +303,7 @@ Func _checkObstacles($bBuilderBase = False, $bRecursive = False) ;Checks if some
;PureClick(250 + $x, 328 + $g_iMidOffsetY + $y, 1, 0, "#0129");Check for "CoC has stopped error, looking for OK message" on screen
PureClick($CSFoundCoords[0], $CSFoundCoords[1], 1, 0, "#0129") ;Check for "CoC has stopped error, looking for OK message" on screen
If _Sleep($DELAYCHECKOBSTACLES2) Then Return
If Not $bRecursive Then Return checkObstacles_ReloadCoC()
Return checkObstacles_ReloadCoC(Default, "", $bRecursive)
EndIf

If $bHasTopBlackBar Then
Expand All @@ -319,17 +321,17 @@ Func _checkObstacles($bBuilderBase = False, $bRecursive = False) ;Checks if some
EndFunc ;==>_checkObstacles

; It's more stable to restart CoC app than click the message restarting the game
Func checkObstacles_ReloadCoC($point = Default, $debugtxt = "")
Func checkObstacles_ReloadCoC($point = Default, $debugtxt = "", $bRecursive = False)
If TestCapture() Then Return "Reload CoC"
ForceCaptureRegion(True)
OcrForceCaptureRegion(True)
If $point = Default Then
CloseCoC(True)
If Not $bRecursive Then CloseCoC(True)
Else
If UBound($point) > 1 Then
PureClickP($point, 1, 0, $debugtxt)
EndIf
OpenCoC()
If Not $bRecursive Then OpenCoC()
EndIf
If _Sleep($DELAYCHECKOBSTACLES3) Then Return
Return True
Expand Down
Loading

0 comments on commit c8e67d3

Please sign in to comment.