Skip to content

Commit

Permalink
* **V7.7.9**
Browse files Browse the repository at this point in the history
* 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)
  • Loading branch information
Fliegerfaust33 committed Oct 27, 2019
1 parent 90a3c3f commit 2eba17b
Show file tree
Hide file tree
Showing 40 changed files with 598 additions and 708 deletions.
13 changes: 11 additions & 2 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
* **V7.7.8**
* **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)

* **V7.7.8**
* Added Legend League attack with auto sign-up: any dead or live base search conditions are ignored
* Added precise Army to train system
* Added collect rewards in daily challenge
Expand Down Expand Up @@ -2050,4 +2059,4 @@ It mean, when see camp nearly full: ex: 210/200 , it will not do other process(d
* Bully Mode added

* **V1**
* Initial version
* Initial version
4 changes: 0 additions & 4 deletions COCBot/MBR GUI Design Mini.au3
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@ MBR GUI Design.au3; CreateMainGUI()
MBR GUI Design Child Attack - Activebase-Search.au3; CreateAttackSearchActiveBaseSearch()
MBR GUI Design Child Attack - Activebase-Attack.au3; CreateAttackSearchActiveBaseAttack()
MBR GUI Design Child Attack - Activebase-EndBattle.au3; CreateAttackSearchActiveBaseEndBattle()
MBR GUI Design Child Attack - THSnipe.au3; CreateAttackSearchTHSnipe()
MBR GUI Design Child Attack - THSnipe-Search.au3; CreateAttackSearchTHSnipeSearch()
MBR GUI Design Child Attack - THSnipe-Attack.au3; CreateAttackSearchTHSnipeAttack()
MBR GUI Design Child Attack - THSnipe-EndBattle.au3; CreateAttackSearchTHSnipeEndBattle()
MBR GUI Design Child Attack - Bully.au3; CreateAttackSearchBully()
MBR GUI Design Child Attack - Options.au3; CreateAttackSearchOptions()
MBR GUI Design Child Attack - Options-Search.au3; CreateAttackSearchOptionsSearch()
Expand Down
3 changes: 2 additions & 1 deletion COCBot/functions/Config/ImageDirectories.au3
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Global Const $g_sImgOutOfSync = @ScriptDir & "\imgxml\other\Oos[[Android]]*"

#Region Main Village
Global $g_sImgCollectRessources = @ScriptDir & "\imgxml\Resources\Collect"
Global $g_sImgCollectLootCart = @ScriptDir & "\imgxml\Resources\LootCart\LootCart_0_85.xml"
Global $g_sImgCollectLootCart = @ScriptDir & "\imgxml\Resources\CollectLootCart*"
Global $g_sImgBoat = @ScriptDir & "\imgxml\Boat\BoatNormalVillage_0_89.xml"
Global $g_sImgZoomOutDir = @ScriptDir & "\imgxml\village\NormalVillage\"
Global $g_sImgCheckWallDir = @ScriptDir & "\imgxml\Walls"
Expand All @@ -44,6 +44,7 @@ Global $g_sImgTrader = @ScriptDir & "\imgxml\FreeMagicItems\TraderIcon"
Global $g_sImgDailyDiscountWindow = @ScriptDir & "\imgxml\FreeMagicItems\DailyDiscount"
Global $g_sImgBuyDealWindow = @ScriptDir & "\imgxml\FreeMagicItems\BuyDeal"
Global Const $g_sImgUpgradeWhiteZero = @ScriptDir & "\imgxml\Main Village\Upgrade\WhiteZero*"
Global Const $g_sImgDonateCC = @ScriptDir & "\imgxml\DonateCC\"
#EndRegion

#Region Builder Base
Expand Down
26 changes: 1 addition & 25 deletions COCBot/functions/Config/ScreenCoordinates.au3
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ Global $aCenterHomeVillageClickDrag = [430, 650] ; Scroll village using this loc
Global $aIsReloadError[4] = [457, 301 + $g_iMidOffsetY, 0x33B5E5, 10] ; Pixel Search Check point For All Reload Button errors, except break ending
Global $aIsMain[4] = [280, 9, 0x77BDE0, 20] ; Main Screen, Builder Info Icon
Global $aIsMainGrayed[4] = [278, 9, 0x3C5F70, 15] ; Main Screen, Builder Info Icon grayed

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

Global $aIsConnectLost[4] = [255, 271 + $g_iMidOffsetY, 0x33B5E5, 20] ; COC message : 'Connection Lost' network error or annother device
Expand All @@ -27,7 +26,7 @@ Global $aAttackButton[2] = [60, 614 + $g_iBottomOffsetY] ; Attack Button, Main S
Global $aFindMatchButton[4] = [470, 20 + $g_iBottomOffsetY, 0xD8A420, 10] ; Find Multiplayer Match Button, Attack Screen 860x780 without shield
Global $aIsAttackShield[4] = [250, 415 + $g_iMidOffsetY, 0xE8E8E0, 10] ; Attack window, white shield verification window
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
;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
Global $aAway2[2] = [400, 10] ; Second Away Position for Windows like Donate Window where at $aAway is a button
Global $aNoShield[4] = [448, 20, 0x43484B, 15] ; Main Screen, charcoal pixel center of shield when no shield is present
Global $aHaveShield[4] = [455, 19, 0xF0F8FB, 15] ; Main Screen, Silver pixel top center of shield
Global $aHavePerGuard[4] = [455, 19, 0x10100D, 15] ; Main Screen, black pixel in sword outline top center of shield
Expand All @@ -52,31 +51,22 @@ Global $aSiegeMachineSize[2] = [755, 136 + $g_iMidOffsetY] ; Training Window, Ov
Global $aArmySpellSize[2] = [99, 284 + $g_iMidOffsetY] ; Training Window Overviewscreen, current number/total capacity
Global $g_aArmyCCSpellSize[2] = [473, 438 + $g_iMidOffsetY] ; Training Window, Overview Screen, Current CC Spell number/total cc spell capacity
Global $aArmyCCRemainTime[2] = [782, 552 + $g_iMidOffsetY] ; Training Window Overviewscreen, Minutes & Seconds remaining till can request again
Global $aIsCampNotFull[4] = [149, 150 + $g_iMidOffsetY, 0x761714, 20] ; Training Window, Overview screen Red pixel in Exclamation mark with camp is not full
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!)
Global $aBarrackFull[4] = [388, 154 + $g_iMidOffsetY, 0xE84D50, 20] ; Training Window, Barracks Screen, Red pixel in Exclamation mark with Barrack is full
Global $aBuildersDigits[2] = [324, 21] ; Main Screen, Free/Total Builders
Global $aBuildersDigitsBuilderBase[2] = [414, 21] ; Main Screen on Builders Base Free/Total Builders
Global $aLanguageCheck1[4] = [326, 8, 0xF9FAF9, 20] ; Main Screen Test Language for word 'Builders'
Global $aLanguageCheck2[4] = [329, 9, 0x060706, 20] ; Main Screen Test Language for word 'Builders'
Global $aLanguageCheck3[4] = [348, 12, 0x040403, 20] ; Main Screen Test Language for word 'Builders'
Global $aLanguageCheck4[4] = [354, 11, 0x090908, 20] ; Main Screen Test Language for word 'Builders'
Global $aTrophies[2] = [69, 84] ; Main Screen, Trophies
Global $aNoCloudsAttack[4] = [25, 606, 0xCD0D0D, 15] ; Attack Screen: No More Clouds
Global $aMessageButton[2] = [38, 143] ; Main Screen, Message Button
Global $aArmyTrainButton[2] = [40, 525 + $g_iBottomOffsetY] ; Main Screen, Army Train Button
Global $aWonOneStar[4] = [714, 538 + $g_iBottomOffsetY, 0xC0C8C0, 20] ; Center of 1st Star for winning attack on enemy
Global $aWonTwoStar[4] = [739, 538 + $g_iBottomOffsetY, 0xC0C8C0, 20] ; Center of 2nd Star for winning attack on enemy
Global $aWonThreeStar[4] = [763, 538 + $g_iBottomOffsetY, 0xC0C8C0, 20] ; Center of 3rd Star for winning attack on enemy
Global $aArmyOverviewTest[4] = [150, 554 + $g_iMidOffsetY, 0xBC2BD1, 20] ; Color purple of army overview bottom left
Global $aCancRequestCCBtn[4] = [340, 250, 0xCC4010, 20] ; Red button Cancel in window request CC
Global $aSendRequestCCBtn[2] = [524, 250] ; Green button Send in window request CC
Global $atxtRequestCCBtn[2] = [430, 140] ; textbox in window request CC
Global $aIsAtkDarkElixirFull[4] = [743, 62 + $g_iMidOffsetY, 0x270D33, 10] ; Attack Screen DE Resource bar is full
Global $aIsDarkElixirFull[4] = [708, 102 + $g_iMidOffsetY, 0x270D33, 10] ; Main Screen DE Resource bar is full
Global $aIsGoldFull[4] = [659, 2 + $g_iMidOffsetY, 0xE7C00D, 10] ; Main Screen Gold Resource bar is Full
Global $aIsElixirFull[4] = [659, 52 + $g_iMidOffsetY, 0xC027C0, 10] ; Main Screen Elixir Resource bar is Full
Global $aConfirmCoCExit[2] = [515, 410 + $g_iMidOffsetY] ; CoC Confirm Exit button (no color for button as it matches grass)
Global $aPerkBtn[4] = [95, 243 + $g_iMidOffsetY, 0x7cd8e8, 10] ; Clan Info Page, Perk Button (blue); 800x780
Global $aIsGemWindow1[4] = [573, 256 + $g_iMidOffsetY, 0xEB1316, 20] ; Main Screen, pixel left of Red X to close gem window
Global $aIsGemWindow2[4] = [577, 266 + $g_iMidOffsetY, 0xCC2025, 20] ; Main Screen, pixel below Red X to close gem window
Expand Down Expand Up @@ -138,20 +128,6 @@ Global Const $aRtnHomeCheck1[4] = [363, 548 + $g_iMidOffsetY, 0x78C11C, 20]
Global Const $aRtnHomeCheck2[4] = [497, 548 + $g_iMidOffsetY, 0x79C326, 20]
;Global Const $aRtnHomeCheck3[4] = [ 284, 28, 0x41B1CD, 20]

Global Const $aSearchLimit[6] = [19, 565, 104, 580, 0xD9DDCF, 10] ; (kaganus) no idea what this is for

;CheckImageType (Normal, Snow, etc)
Global Const $aImageTypeN1[4] = [237, 161, 0xD5A849, 30] ; Sand on Forest Edge 'Lane' 860x780
Global Const $aImageTypeN2[4] = [205, 180, 0x86A533, 30] ; Grass on Forest Edge 'Lane' 860x780
Global Const $aImageTypeS1[4] = [237, 161, 0xFEFDFD, 30] ; Snow on Forest Edge 'Lane' 860x780
Global Const $aImageTypeS2[4] = [205, 180, 0xFEFEFE, 30] ; Snow on Forest Edge 'Lane' 860x780

;ReplayShare
Global Const $aAttackLogPage[4] = [775, 125, 0xEB1115, 40] ;red on X Button of Attack Log Page
Global Const $aAttackLogAttackTab[4] = [437, 114, 0xF0F4F0, 30] ; White on Attack Log Tab (Tab Name)
Global Const $aBlueShareReplayButton[4] = [500, 156 + $g_iMidOffsetY, 0x70D4E8, 30] ; Blue Share Replay Button
Global Const $aGrayShareReplayButton[4] = [500, 156 + $g_iMidOffsetY, 0xBBBBBB, 30] ; Gray Share Replay Button

Global Const $aProfileReport[4] = [619, 344, 0x4E4D79, 20] ; Dark Purple of Profile Page when no Attacks were made

Global $aArmyTrainButtonRND[4] = [20, 540 + $g_iMidOffsetY, 55, 570 + $g_iMidOffsetY] ; Main Screen, Army Train Button, RND Screen 860x732
Expand Down
1 change: 0 additions & 1 deletion COCBot/functions/CreateArmy/CheckFullArmy.au3
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

; #FUNCTION# ====================================================================================================================
; Name ..........: CheckOverviewFullArmy
; Description ...: Checks if the army is full on the training overview screen
Expand Down
40 changes: 20 additions & 20 deletions COCBot/functions/CreateArmy/QuickTrain.au3
Original file line number Diff line number Diff line change
Expand Up @@ -28,43 +28,43 @@ Func QuickTrain()
If _Sleep(250) Then Return
EndIf

Local $Step = 1
Local $iStep = 1
While 1
Local $TroopCamp = GetCurrentArmy(48, 160)
SetLog("Checking Troop tab: " & $TroopCamp[0] & "/" & $TroopCamp[1] * 2)
If $TroopCamp[1] = 0 Then ExitLoop
Local $avTroopCamp = GetCurrentArmy(48, 160)
SetLog("Checking Troop tab: " & $avTroopCamp[0] & "/" & $avTroopCamp[1] * 2)
If $avTroopCamp[1] = 0 Then ExitLoop

If $TroopCamp[0] <= 0 Then ; 0/280
If $avTroopCamp[0] <= 0 Then ; 0/280
$iTroopStatus = 0
If $bDebug Then SetLog("No troop", $COLOR_DEBUG)

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

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

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

ElseIf $TroopCamp[0] <= $TroopCamp[1] * 2 Then ; 421-560/560
If CheckQueueTroopAndTrainRemain($TroopCamp, $bDebug) Then
ElseIf $avTroopCamp[0] <= $avTroopCamp[1] * 2 Then ; 421-560/560
If CheckQueueTroopAndTrainRemain($avTroopCamp, $bDebug) Then
$iTroopStatus = 2
If $bDebug Then SetLog($Step & ". CheckQueueTroopAndTrainRemain()", $COLOR_DEBUG)
If $bDebug Then SetLog($iStep & ". CheckQueueTroopAndTrainRemain()", $COLOR_DEBUG)
Else
RemoveExtraTroopsQueue()
If $bDebug Then SetLog($Step & ". RemoveExtraTroopsQueue()", $COLOR_DEBUG)
If $bDebug Then SetLog($iStep & ". RemoveExtraTroopsQueue()", $COLOR_DEBUG)
If _Sleep(250) Then Return
$Step += 1
If $Step = 6 Then ExitLoop
$iStep += 1
If $iStep = 6 Then ExitLoop
ContinueLoop
EndIf
EndIf
Expand Down Expand Up @@ -218,7 +218,7 @@ Func CheckQuickTrainTroop()
If Not OpenQuickTrainTab(False, "CheckQuickTrainTroop()") Then Return
If _Sleep(500) Then Return

SetLog("Reading troops & spells in quick train army...")
SetLog("Reading troops & spells in quick train army")

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

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

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

Else
SetLog("Cannot find 'Edit' button for Army " & $i + 1, $COLOR_ERROR)
SetLog('Cannot find "Edit" button for Army ' & $i + 1, $COLOR_ERROR)
$bResult = False
EndIf
Next
Expand Down
19 changes: 1 addition & 18 deletions COCBot/functions/CreateArmy/getArmySpells/getArmySpellCount.au3
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

; #FUNCTION# ====================================================================================================================
; Name ..........: GetCurTotalSpell
; Description ...: Obtains count of spells available from Training - Army Overview window
Expand All @@ -23,20 +22,4 @@ Func GetCurTotalSpell()
Next

Return $iCount
EndFunc ;==>GetCurTotalSpell

; #FUNCTION# ====================================================================================================================
; Name ..........: GetCurTotalSpells
; Description ...: Returns total count of all Spells available after call to getArmySpellCount()
; Return values .: Total current spell count or -1 when not yet read
; ===============================================================================================================================
Func GetCurTotalSpells()

Local $aCount[2]
For $i = $eSpellLightning To $eSpellBat - 1
$aCount[0] += $g_aiCurrentSpells[$i]
If $g_aiCurrentSpells[$i] >= 1 Then $aCount[1] += 1
Next

Return $aCount
EndFunc ;==>GetCurTotalSpells
EndFunc ;==>GetCurTotalSpell
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ Func getArmySpellTime($bOpenArmyWindow = False, $bCloseArmyWindow = False, $bChe
ClickP($aAway, 1, 0, "#0000") ;Click Away
If _Sleep($DELAYCHECKARMYCAMP4) Then Return
EndIf
EndFunc ;==>getArmySpellTime
EndFunc ;==>getArmySpellTime
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ Func getArmySpells($bOpenArmyWindow = False, $bCloseArmyWindow = False, $bCheckW
$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

$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
;If $bSetLog Then SetLog(" - " & $g_aiCurrentSpells[$iSpellIndex] & " " & $sSpellName & " Brewed", $COLOR_SUCCESS) ; Log What Spell is available and How many
$aCurrentSpellsLog[$iSpellIndex][0] = $sSpellName
$aCurrentSpellsLog[$iSpellIndex][1] = $g_aiCurrentSpells[$iSpellIndex]
$aCurrentSpellsLog[$iSpellIndex][2] = Slot($aSpellCoords[0], $aSpellCoords[1])
Expand Down
9 changes: 4 additions & 5 deletions COCBot/functions/Image Search/CheckTombs.au3
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,10 @@ EndFunc ;==>CleanYard

Func ClickRemoveObstacle()
Local $aiButton = findButton("RemoveObstacle", Default, 1, True)
If IsArray($aiButton) And UBound($aiButton) = 2 Then
If IsMainPage() Then
ClickP($aiButton)
Return True
EndIf
If IsArray($aiButton) And UBound($aiButton) >= 2 Then
SetDebugLog("Remove Button found! Clicking it at X: " & $aiButton[0] & ", Y: " & $aiButton[1], $COLOR_DEBUG1)
ClickP($aiButton)
Return True
Else
SetLog("Cannot find Remove Button", $COLOR_ERROR)
Return False
Expand Down
Loading

0 comments on commit 2eba17b

Please sign in to comment.