Skip to content

Commit 2eba17b

Browse files
* **V7.7.9**
* Fix builder base remove obstacle Button not found @DUC4TI * Fix share replay function * Fix cannot find confirm attack button @Nytol * Fix loot cart collection (October 2019 Update) * Fix clan games (October 2019 Update) * Fix donations (October 2019 Update) * Fix quick train (October 2019 Update)
1 parent 90a3c3f commit 2eba17b

40 files changed

Lines changed: 598 additions & 708 deletions

CHANGELOG

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
1-
* **V7.7.8**
1+
* **V7.7.9**
2+
* Fix builder base remove obstacle Button not found @DUC4TI
3+
* Fix share replay function
4+
* Fix cannot find confirm attack button @nytol
5+
* Fix loot cart collection (October 2019 Update)
6+
* Fix clan games (October 2019 Update)
7+
* Fix donations (October 2019 Update)
8+
* Fix quick train (October 2019 Update)
9+
10+
* **V7.7.8**
211
* Added Legend League attack with auto sign-up: any dead or live base search conditions are ignored
312
* Added precise Army to train system
413
* Added collect rewards in daily challenge
@@ -2050,4 +2059,4 @@ It mean, when see camp nearly full: ex: 210/200 , it will not do other process(d
20502059
* Bully Mode added
20512060

20522061
* **V1**
2053-
* Initial version
2062+
* Initial version

COCBot/MBR GUI Design Mini.au3

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,6 @@ MBR GUI Design.au3; CreateMainGUI()
4646
MBR GUI Design Child Attack - Activebase-Search.au3; CreateAttackSearchActiveBaseSearch()
4747
MBR GUI Design Child Attack - Activebase-Attack.au3; CreateAttackSearchActiveBaseAttack()
4848
MBR GUI Design Child Attack - Activebase-EndBattle.au3; CreateAttackSearchActiveBaseEndBattle()
49-
MBR GUI Design Child Attack - THSnipe.au3; CreateAttackSearchTHSnipe()
50-
MBR GUI Design Child Attack - THSnipe-Search.au3; CreateAttackSearchTHSnipeSearch()
51-
MBR GUI Design Child Attack - THSnipe-Attack.au3; CreateAttackSearchTHSnipeAttack()
52-
MBR GUI Design Child Attack - THSnipe-EndBattle.au3; CreateAttackSearchTHSnipeEndBattle()
5349
MBR GUI Design Child Attack - Bully.au3; CreateAttackSearchBully()
5450
MBR GUI Design Child Attack - Options.au3; CreateAttackSearchOptions()
5551
MBR GUI Design Child Attack - Options-Search.au3; CreateAttackSearchOptionsSearch()

COCBot/functions/Config/ImageDirectories.au3

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Global Const $g_sImgOutOfSync = @ScriptDir & "\imgxml\other\Oos[[Android]]*"
3131

3232
#Region Main Village
3333
Global $g_sImgCollectRessources = @ScriptDir & "\imgxml\Resources\Collect"
34-
Global $g_sImgCollectLootCart = @ScriptDir & "\imgxml\Resources\LootCart\LootCart_0_85.xml"
34+
Global $g_sImgCollectLootCart = @ScriptDir & "\imgxml\Resources\CollectLootCart*"
3535
Global $g_sImgBoat = @ScriptDir & "\imgxml\Boat\BoatNormalVillage_0_89.xml"
3636
Global $g_sImgZoomOutDir = @ScriptDir & "\imgxml\village\NormalVillage\"
3737
Global $g_sImgCheckWallDir = @ScriptDir & "\imgxml\Walls"
@@ -44,6 +44,7 @@ Global $g_sImgTrader = @ScriptDir & "\imgxml\FreeMagicItems\TraderIcon"
4444
Global $g_sImgDailyDiscountWindow = @ScriptDir & "\imgxml\FreeMagicItems\DailyDiscount"
4545
Global $g_sImgBuyDealWindow = @ScriptDir & "\imgxml\FreeMagicItems\BuyDeal"
4646
Global Const $g_sImgUpgradeWhiteZero = @ScriptDir & "\imgxml\Main Village\Upgrade\WhiteZero*"
47+
Global Const $g_sImgDonateCC = @ScriptDir & "\imgxml\DonateCC\"
4748
#EndRegion
4849

4950
#Region Builder Base

COCBot/functions/Config/ScreenCoordinates.au3

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ Global $aCenterHomeVillageClickDrag = [430, 650] ; Scroll village using this loc
1616
Global $aIsReloadError[4] = [457, 301 + $g_iMidOffsetY, 0x33B5E5, 10] ; Pixel Search Check point For All Reload Button errors, except break ending
1717
Global $aIsMain[4] = [280, 9, 0x77BDE0, 20] ; Main Screen, Builder Info Icon
1818
Global $aIsMainGrayed[4] = [278, 9, 0x3C5F70, 15] ; Main Screen, Builder Info Icon grayed
19-
2019
Global $aIsOnBuilderBase[4] = [838, 18, 0xffff46, 10] ; Check the Gold Coin from resources , is a square not round
2120

2221
Global $aIsConnectLost[4] = [255, 271 + $g_iMidOffsetY, 0x33B5E5, 20] ; COC message : 'Connection Lost' network error or annother device
@@ -27,7 +26,7 @@ Global $aAttackButton[2] = [60, 614 + $g_iBottomOffsetY] ; Attack Button, Main S
2726
Global $aFindMatchButton[4] = [470, 20 + $g_iBottomOffsetY, 0xD8A420, 10] ; Find Multiplayer Match Button, Attack Screen 860x780 without shield
2827
Global $aIsAttackShield[4] = [250, 415 + $g_iMidOffsetY, 0xE8E8E0, 10] ; Attack window, white shield verification window
2928
Global $aAway[2] = [175, 10] ; Away click, moved from 1,1 to prevent scroll window from top, moved from 0,10 to 175,32 to prevent structure click or 175,10 to just fix MEmu 2.x opening and closing toolbar
30-
;Global $aRemoveShldButton[4] = [470, 18, 0xA80408, 10] ; Legacy - Main Screen, Red pixel lower part of Minus sign to remove shield, used to validate latest COC installed
29+
Global $aAway2[2] = [400, 10] ; Second Away Position for Windows like Donate Window where at $aAway is a button
3130
Global $aNoShield[4] = [448, 20, 0x43484B, 15] ; Main Screen, charcoal pixel center of shield when no shield is present
3231
Global $aHaveShield[4] = [455, 19, 0xF0F8FB, 15] ; Main Screen, Silver pixel top center of shield
3332
Global $aHavePerGuard[4] = [455, 19, 0x10100D, 15] ; Main Screen, black pixel in sword outline top center of shield
@@ -52,31 +51,22 @@ Global $aSiegeMachineSize[2] = [755, 136 + $g_iMidOffsetY] ; Training Window, Ov
5251
Global $aArmySpellSize[2] = [99, 284 + $g_iMidOffsetY] ; Training Window Overviewscreen, current number/total capacity
5352
Global $g_aArmyCCSpellSize[2] = [473, 438 + $g_iMidOffsetY] ; Training Window, Overview Screen, Current CC Spell number/total cc spell capacity
5453
Global $aArmyCCRemainTime[2] = [782, 552 + $g_iMidOffsetY] ; Training Window Overviewscreen, Minutes & Seconds remaining till can request again
55-
Global $aIsCampNotFull[4] = [149, 150 + $g_iMidOffsetY, 0x761714, 20] ; Training Window, Overview screen Red pixel in Exclamation mark with camp is not full
5654
Global $aIsCampFull[4] = [128, 151 + $g_iMidOffsetY, 0xFFFFFF, 10] ; Training Window, Overview screen White pixel in check mark with camp IS full (can not test for Green, as it has trees under it!)
57-
Global $aBarrackFull[4] = [388, 154 + $g_iMidOffsetY, 0xE84D50, 20] ; Training Window, Barracks Screen, Red pixel in Exclamation mark with Barrack is full
5855
Global $aBuildersDigits[2] = [324, 21] ; Main Screen, Free/Total Builders
5956
Global $aBuildersDigitsBuilderBase[2] = [414, 21] ; Main Screen on Builders Base Free/Total Builders
60-
Global $aLanguageCheck1[4] = [326, 8, 0xF9FAF9, 20] ; Main Screen Test Language for word 'Builders'
61-
Global $aLanguageCheck2[4] = [329, 9, 0x060706, 20] ; Main Screen Test Language for word 'Builders'
62-
Global $aLanguageCheck3[4] = [348, 12, 0x040403, 20] ; Main Screen Test Language for word 'Builders'
63-
Global $aLanguageCheck4[4] = [354, 11, 0x090908, 20] ; Main Screen Test Language for word 'Builders'
6457
Global $aTrophies[2] = [69, 84] ; Main Screen, Trophies
6558
Global $aNoCloudsAttack[4] = [25, 606, 0xCD0D0D, 15] ; Attack Screen: No More Clouds
66-
Global $aMessageButton[2] = [38, 143] ; Main Screen, Message Button
6759
Global $aArmyTrainButton[2] = [40, 525 + $g_iBottomOffsetY] ; Main Screen, Army Train Button
6860
Global $aWonOneStar[4] = [714, 538 + $g_iBottomOffsetY, 0xC0C8C0, 20] ; Center of 1st Star for winning attack on enemy
6961
Global $aWonTwoStar[4] = [739, 538 + $g_iBottomOffsetY, 0xC0C8C0, 20] ; Center of 2nd Star for winning attack on enemy
7062
Global $aWonThreeStar[4] = [763, 538 + $g_iBottomOffsetY, 0xC0C8C0, 20] ; Center of 3rd Star for winning attack on enemy
71-
Global $aArmyOverviewTest[4] = [150, 554 + $g_iMidOffsetY, 0xBC2BD1, 20] ; Color purple of army overview bottom left
7263
Global $aCancRequestCCBtn[4] = [340, 250, 0xCC4010, 20] ; Red button Cancel in window request CC
7364
Global $aSendRequestCCBtn[2] = [524, 250] ; Green button Send in window request CC
7465
Global $atxtRequestCCBtn[2] = [430, 140] ; textbox in window request CC
7566
Global $aIsAtkDarkElixirFull[4] = [743, 62 + $g_iMidOffsetY, 0x270D33, 10] ; Attack Screen DE Resource bar is full
7667
Global $aIsDarkElixirFull[4] = [708, 102 + $g_iMidOffsetY, 0x270D33, 10] ; Main Screen DE Resource bar is full
7768
Global $aIsGoldFull[4] = [659, 2 + $g_iMidOffsetY, 0xE7C00D, 10] ; Main Screen Gold Resource bar is Full
7869
Global $aIsElixirFull[4] = [659, 52 + $g_iMidOffsetY, 0xC027C0, 10] ; Main Screen Elixir Resource bar is Full
79-
Global $aConfirmCoCExit[2] = [515, 410 + $g_iMidOffsetY] ; CoC Confirm Exit button (no color for button as it matches grass)
8070
Global $aPerkBtn[4] = [95, 243 + $g_iMidOffsetY, 0x7cd8e8, 10] ; Clan Info Page, Perk Button (blue); 800x780
8171
Global $aIsGemWindow1[4] = [573, 256 + $g_iMidOffsetY, 0xEB1316, 20] ; Main Screen, pixel left of Red X to close gem window
8272
Global $aIsGemWindow2[4] = [577, 266 + $g_iMidOffsetY, 0xCC2025, 20] ; Main Screen, pixel below Red X to close gem window
@@ -138,20 +128,6 @@ Global Const $aRtnHomeCheck1[4] = [363, 548 + $g_iMidOffsetY, 0x78C11C, 20]
138128
Global Const $aRtnHomeCheck2[4] = [497, 548 + $g_iMidOffsetY, 0x79C326, 20]
139129
;Global Const $aRtnHomeCheck3[4] = [ 284, 28, 0x41B1CD, 20]
140130

141-
Global Const $aSearchLimit[6] = [19, 565, 104, 580, 0xD9DDCF, 10] ; (kaganus) no idea what this is for
142-
143-
;CheckImageType (Normal, Snow, etc)
144-
Global Const $aImageTypeN1[4] = [237, 161, 0xD5A849, 30] ; Sand on Forest Edge 'Lane' 860x780
145-
Global Const $aImageTypeN2[4] = [205, 180, 0x86A533, 30] ; Grass on Forest Edge 'Lane' 860x780
146-
Global Const $aImageTypeS1[4] = [237, 161, 0xFEFDFD, 30] ; Snow on Forest Edge 'Lane' 860x780
147-
Global Const $aImageTypeS2[4] = [205, 180, 0xFEFEFE, 30] ; Snow on Forest Edge 'Lane' 860x780
148-
149-
;ReplayShare
150-
Global Const $aAttackLogPage[4] = [775, 125, 0xEB1115, 40] ;red on X Button of Attack Log Page
151-
Global Const $aAttackLogAttackTab[4] = [437, 114, 0xF0F4F0, 30] ; White on Attack Log Tab (Tab Name)
152-
Global Const $aBlueShareReplayButton[4] = [500, 156 + $g_iMidOffsetY, 0x70D4E8, 30] ; Blue Share Replay Button
153-
Global Const $aGrayShareReplayButton[4] = [500, 156 + $g_iMidOffsetY, 0xBBBBBB, 30] ; Gray Share Replay Button
154-
155131
Global Const $aProfileReport[4] = [619, 344, 0x4E4D79, 20] ; Dark Purple of Profile Page when no Attacks were made
156132

157133
Global $aArmyTrainButtonRND[4] = [20, 540 + $g_iMidOffsetY, 55, 570 + $g_iMidOffsetY] ; Main Screen, Army Train Button, RND Screen 860x732

COCBot/functions/CreateArmy/CheckFullArmy.au3

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
; #FUNCTION# ====================================================================================================================
32
; Name ..........: CheckOverviewFullArmy
43
; Description ...: Checks if the army is full on the training overview screen

COCBot/functions/CreateArmy/QuickTrain.au3

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -28,43 +28,43 @@ Func QuickTrain()
2828
If _Sleep(250) Then Return
2929
EndIf
3030

31-
Local $Step = 1
31+
Local $iStep = 1
3232
While 1
33-
Local $TroopCamp = GetCurrentArmy(48, 160)
34-
SetLog("Checking Troop tab: " & $TroopCamp[0] & "/" & $TroopCamp[1] * 2)
35-
If $TroopCamp[1] = 0 Then ExitLoop
33+
Local $avTroopCamp = GetCurrentArmy(48, 160)
34+
SetLog("Checking Troop tab: " & $avTroopCamp[0] & "/" & $avTroopCamp[1] * 2)
35+
If $avTroopCamp[1] = 0 Then ExitLoop
3636

37-
If $TroopCamp[0] <= 0 Then ; 0/280
37+
If $avTroopCamp[0] <= 0 Then ; 0/280
3838
$iTroopStatus = 0
3939
If $bDebug Then SetLog("No troop", $COLOR_DEBUG)
4040

41-
ElseIf $TroopCamp[0] < $TroopCamp[1] Then ; 1-279/280
41+
ElseIf $avTroopCamp[0] < $avTroopCamp[1] Then ; 1-279/280
4242
If Not IsQueueEmpty("Troops", True, False) Then DeleteQueued("Troops")
4343
$bNeedRecheckTroop = True
4444
If $bDebug Then SetLog("$bNeedRecheckTroop for at Army Tab: " & $bNeedRecheckTroop, $COLOR_DEBUG)
4545

46-
ElseIf $TroopCamp[0] = $TroopCamp[1] Then ; 280/280
46+
ElseIf $avTroopCamp[0] = $avTroopCamp[1] Then ; 280/280
4747
$iTroopStatus = 1
4848
If $bDebug Then SetLog($g_bDoubleTrain ? "ready to make double troop training" : "troops are training perfectly", $COLOR_DEBUG)
4949

50-
ElseIf $TroopCamp[0] <= $TroopCamp[1] * 1.5 Then ; 281-420/560
50+
ElseIf $avTroopCamp[0] <= $avTroopCamp[1] * 1.5 Then ; 281-420/560
5151
RemoveExtraTroopsQueue()
52-
If $bDebug Then SetLog($Step & ". RemoveExtraTroopsQueue()", $COLOR_DEBUG)
52+
If $bDebug Then SetLog($iStep & ". RemoveExtraTroopsQueue()", $COLOR_DEBUG)
5353
If _Sleep(250) Then Return
54-
$Step += 1
55-
If $Step = 6 Then ExitLoop
54+
$iStep += 1
55+
If $iStep = 6 Then ExitLoop
5656
ContinueLoop
5757

58-
ElseIf $TroopCamp[0] <= $TroopCamp[1] * 2 Then ; 421-560/560
59-
If CheckQueueTroopAndTrainRemain($TroopCamp, $bDebug) Then
58+
ElseIf $avTroopCamp[0] <= $avTroopCamp[1] * 2 Then ; 421-560/560
59+
If CheckQueueTroopAndTrainRemain($avTroopCamp, $bDebug) Then
6060
$iTroopStatus = 2
61-
If $bDebug Then SetLog($Step & ". CheckQueueTroopAndTrainRemain()", $COLOR_DEBUG)
61+
If $bDebug Then SetLog($iStep & ". CheckQueueTroopAndTrainRemain()", $COLOR_DEBUG)
6262
Else
6363
RemoveExtraTroopsQueue()
64-
If $bDebug Then SetLog($Step & ". RemoveExtraTroopsQueue()", $COLOR_DEBUG)
64+
If $bDebug Then SetLog($iStep & ". RemoveExtraTroopsQueue()", $COLOR_DEBUG)
6565
If _Sleep(250) Then Return
66-
$Step += 1
67-
If $Step = 6 Then ExitLoop
66+
$iStep += 1
67+
If $iStep = 6 Then ExitLoop
6868
ContinueLoop
6969
EndIf
7070
EndIf
@@ -218,7 +218,7 @@ Func CheckQuickTrainTroop()
218218
If Not OpenQuickTrainTab(False, "CheckQuickTrainTroop()") Then Return
219219
If _Sleep(500) Then Return
220220

221-
SetLog("Reading troops & spells in quick train army...")
221+
SetLog("Reading troops & spells in quick train army")
222222

223223
; reset troops/spells in quick army
224224
Local $aEmptyTroop[$eTroopCount] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
@@ -231,7 +231,7 @@ Func CheckQuickTrainTroop()
231231

232232
Local $iTroopCamp = 0, $iSpellCamp = 0, $sLog = ""
233233

234-
Local $aEditButton[3][4] = [[808, 300, 0xd2f17a, 20], [808, 418, 0xd0f078, 20], [808, 536, 0xccee74, 20]] ; green
234+
Local $aEditButton[3][4] = [[808, 292, 0xd2f17a, 20], [808, 400, 0xcff077, 20], [808, 505, 0xd6f37e, 20]] ; green
235235
Local $aSaveButton[4] = [808, 300, 0xdcf684, 20] ; green
236236
Local $aCancelButton[4] = [650, 300, 0xff8c91, 20] ; red
237237
Local $aRemoveButton[4] = [535, 300, 0xff8f94, 20] ; red
@@ -360,7 +360,7 @@ Func CheckQuickTrainTroop()
360360
If _Sleep(1000) Then Return
361361

362362
Else
363-
SetLog("Cannot find 'Edit' button for Army " & $i + 1, $COLOR_ERROR)
363+
SetLog('Cannot find "Edit" button for Army ' & $i + 1, $COLOR_ERROR)
364364
$bResult = False
365365
EndIf
366366
Next
Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
; #FUNCTION# ====================================================================================================================
32
; Name ..........: GetCurTotalSpell
43
; Description ...: Obtains count of spells available from Training - Army Overview window
@@ -23,20 +22,4 @@ Func GetCurTotalSpell()
2322
Next
2423

2524
Return $iCount
26-
EndFunc ;==>GetCurTotalSpell
27-
28-
; #FUNCTION# ====================================================================================================================
29-
; Name ..........: GetCurTotalSpells
30-
; Description ...: Returns total count of all Spells available after call to getArmySpellCount()
31-
; Return values .: Total current spell count or -1 when not yet read
32-
; ===============================================================================================================================
33-
Func GetCurTotalSpells()
34-
35-
Local $aCount[2]
36-
For $i = $eSpellLightning To $eSpellBat - 1
37-
$aCount[0] += $g_aiCurrentSpells[$i]
38-
If $g_aiCurrentSpells[$i] >= 1 Then $aCount[1] += 1
39-
Next
40-
41-
Return $aCount
42-
EndFunc ;==>GetCurTotalSpells
25+
EndFunc ;==>GetCurTotalSpell

COCBot/functions/CreateArmy/getArmySpells/getArmySpellTime.au3

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@ Func getArmySpellTime($bOpenArmyWindow = False, $bCloseArmyWindow = False, $bChe
3939
ClickP($aAway, 1, 0, "#0000") ;Click Away
4040
If _Sleep($DELAYCHECKARMYCAMP4) Then Return
4141
EndIf
42-
EndFunc ;==>getArmySpellTime
42+
EndFunc ;==>getArmySpellTime

COCBot/functions/CreateArmy/getArmySpells/getArmySpells.au3

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ Func getArmySpells($bOpenArmyWindow = False, $bCloseArmyWindow = False, $bCheckW
5454
$g_aiCurrentSpells[$iSpellIndex] = Number(getBarracksNewTroopQuantity(Slot($aSpellCoords[0], $aSpellCoords[1]), 341, $bNeedCapture)) ; Get The Quantity of the Spell, Slot() Does return the exact spot to read the Number from
5555

5656
$sSpellName = $g_aiCurrentSpells[$iSpellIndex] >= 2 ? $g_asSpellNames[$iSpellIndex] & " Spells" : $g_asSpellNames[$iSpellIndex] & " Spell" ; Select the right Spell Name, If more than one then use Spells at the end
57-
;If $bSetLog Then SetLog(" - " & $g_aiCurrentSpells[$iSpellIndex] & " " & $sSpellName & " Brewed", $COLOR_SUCCESS) ; Log What Spell is available and How many
5857
$aCurrentSpellsLog[$iSpellIndex][0] = $sSpellName
5958
$aCurrentSpellsLog[$iSpellIndex][1] = $g_aiCurrentSpells[$iSpellIndex]
6059
$aCurrentSpellsLog[$iSpellIndex][2] = Slot($aSpellCoords[0], $aSpellCoords[1])

COCBot/functions/Image Search/CheckTombs.au3

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -192,11 +192,10 @@ EndFunc ;==>CleanYard
192192

193193
Func ClickRemoveObstacle()
194194
Local $aiButton = findButton("RemoveObstacle", Default, 1, True)
195-
If IsArray($aiButton) And UBound($aiButton) = 2 Then
196-
If IsMainPage() Then
197-
ClickP($aiButton)
198-
Return True
199-
EndIf
195+
If IsArray($aiButton) And UBound($aiButton) >= 2 Then
196+
SetDebugLog("Remove Button found! Clicking it at X: " & $aiButton[0] & ", Y: " & $aiButton[1], $COLOR_DEBUG1)
197+
ClickP($aiButton)
198+
Return True
200199
Else
201200
SetLog("Cannot find Remove Button", $COLOR_ERROR)
202201
Return False

0 commit comments

Comments
 (0)