diff --git a/ClAsHbOt/ClAsHbOt.exe b/ClAsHbOt/ClAsHbOt.exe index 5f0ccdf..40576bf 100644 Binary files a/ClAsHbOt/ClAsHbOt.exe and b/ClAsHbOt/ClAsHbOt.exe differ diff --git a/ClAsHbOt/ImageFiles.data b/ClAsHbOt/ImageFiles.data index cc53849..1c1cd1b 100644 --- a/ClAsHbOt/ImageFiles.data +++ b/ClAsHbOt/ImageFiles.data @@ -16,9 +16,9 @@ RaidTroopSlot RaidSlots\SlotBarbarian.bmp RaidSlots\SlotArcher.bmp RaidSlots\Slo RaidSpellSlot RaidSlots\SlotLightningSpell.bmp RaidSlots\SlotHealSpell.bmp RaidSlots\SlotRageSpell.bmp RaidSlots\SlotJumpSpell.bmp RaidSlots\SlotFreezeSpell.bmp RaidSlots\SlotPoisonSpell.bmp RaidSlots\SlotEarthquakeSpell.bmp RaidSlots\SlotHasteSpell.bmp -ArmyCampTroop Camp\CampBarbarian.bmp Camp\CampArcher.bmp Camp\CampGiant.bmp Camp\CampGoblin.bmp Camp\CampWallBreaker.bmp Camp\CampBalloon.bmp Camp\CampWizard.bmp Camp\CampHealer.bmp Camp\CampDragon.bmp Camp\CampPekka.bmp Camp\CampMinion.bmp Camp\CampHogRider.bmp Camp\CampValkyrie.bmp Camp\CampGolem.bmp Camp\CampWitch.bmp Camp\CampLavaHound.bmp Camp\CampBowler.bmp Camp\CampKing.bmp Camp\CampQueen.bmp Camp\CampWarden.bmp Camp\CampHeroDummy.bmp Camp\CampHeroDummy.bmp Camp\CampHeroDummy.bmp +ArmyCampTroop Camp\CampBarbarian.bmp Camp\CampArcher.bmp Camp\CampGiant.bmp Camp\CampGoblin.bmp Camp\CampWallBreaker.bmp Camp\CampBalloon.bmp Camp\CampWizard.bmp Camp\CampHealer.bmp Camp\CampDragon.bmp Camp\CampPekka.bmp Camp\CampBabyDragon.bmp Camp\CampMiner.bmp Camp\CampMinion.bmp Camp\CampHogRider.bmp Camp\CampValkyrie.bmp Camp\CampGolem.bmp Camp\CampWitch.bmp Camp\CampLavaHound.bmp Camp\CampBowler.bmp Camp\CampKing.bmp Camp\CampQueen.bmp Camp\CampWarden.bmp Camp\CampHeroDummy.bmp Camp\CampHeroDummy.bmp Camp\CampHeroDummy.bmp -BarracksTroopSlot Barracks\BarracksBarbarian.bmp Barracks\BarracksArcher.bmp Barracks\BarracksGiant.bmp Barracks\BarracksGoblin.bmp Barracks\BarracksWallBreaker.bmp Barracks\BarracksBalloon.bmp Barracks\BarracksWizard.bmp Barracks\BarracksHealer.bmp Barracks\BarracksDragon.bmp Barracks\BarracksPekka.bmp Barracks\BarracksMinion.bmp Barracks\BarracksHogRider.bmp Barracks\BarracksValkyrie.bmp Barracks\BarracksGolem.bmp Barracks\BarracksWitch.bmp Barracks\BarracksLavaHound.bmp Barracks\BarracksBowler.bmp +BarracksTroopSlot Barracks\BarracksBarbarian.bmp Barracks\BarracksArcher.bmp Barracks\BarracksGiant.bmp Barracks\BarracksGoblin.bmp Barracks\BarracksWallBreaker.bmp Barracks\BarracksBalloon.bmp Barracks\BarracksWizard.bmp Barracks\BarracksHealer.bmp Barracks\BarracksDragon.bmp Barracks\BarracksPekka.bmp Barracks\BarracksBabyDragon.bmp Barracks\BarracksMiner.bmp Barracks\BarracksMinion.bmp Barracks\BarracksHogRider.bmp Barracks\BarracksValkyrie.bmp Barracks\BarracksGolem.bmp Barracks\BarracksWitch.bmp Barracks\BarracksLavaHound.bmp Barracks\BarracksBowler.bmp DonateTroopSlot Donate\DonateBarbarian.bmp Donate\DonateArcher.bmp Donate\DonateGiant.bmp Donate\DonateGoblin.bmp Donate\DonateWallBreaker.bmp Donate\DonateBalloon.bmp Donate\DonateWizard.bmp Donate\DonateHealer.bmp Donate\DonateDragon.bmp Donate\DonatePekka.bmp Donate\DonateMinion.bmp Donate\DonateHogRider.bmp Donate\DonateValkyrie.bmp Donate\DonateGolem.bmp Donate\DonateWitch.bmp Donate\DonateLavaHound.bmp Donate\DonateBowler.bmp diff --git a/ClAsHbOt/Images/Barracks/BarracksBabyDragon.bmp b/ClAsHbOt/Images/Barracks/BarracksBabyDragon.bmp new file mode 100644 index 0000000..0bafd1c Binary files /dev/null and b/ClAsHbOt/Images/Barracks/BarracksBabyDragon.bmp differ diff --git a/ClAsHbOt/Images/Barracks/BarracksBalloon.bmp b/ClAsHbOt/Images/Barracks/BarracksBalloon.bmp index bd98695..f48f2a3 100644 Binary files a/ClAsHbOt/Images/Barracks/BarracksBalloon.bmp and b/ClAsHbOt/Images/Barracks/BarracksBalloon.bmp differ diff --git a/ClAsHbOt/Images/Barracks/BarracksGoblin.bmp b/ClAsHbOt/Images/Barracks/BarracksGoblin.bmp index 41ad331..3932f0d 100644 Binary files a/ClAsHbOt/Images/Barracks/BarracksGoblin.bmp and b/ClAsHbOt/Images/Barracks/BarracksGoblin.bmp differ diff --git a/ClAsHbOt/Images/Barracks/BarracksMiner.bmp b/ClAsHbOt/Images/Barracks/BarracksMiner.bmp new file mode 100644 index 0000000..0bafd1c Binary files /dev/null and b/ClAsHbOt/Images/Barracks/BarracksMiner.bmp differ diff --git a/ClAsHbOt/Images/Camp/CampBabyDragon.bmp b/ClAsHbOt/Images/Camp/CampBabyDragon.bmp new file mode 100644 index 0000000..0bafd1c Binary files /dev/null and b/ClAsHbOt/Images/Camp/CampBabyDragon.bmp differ diff --git a/ClAsHbOt/Images/Camp/CampMiner.bmp b/ClAsHbOt/Images/Camp/CampMiner.bmp new file mode 100644 index 0000000..0bafd1c Binary files /dev/null and b/ClAsHbOt/Images/Camp/CampMiner.bmp differ diff --git a/README.md b/README.md index 5c3fbce..4bea860 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Welcome to my automatic farming bot for Clash of Clans. Updated for the March 2 THIS IS THE ONLY FULLY OPEN SOURCE Clash of Clans BOT ON THE INTERNET! (The only one that includes complete source code for its compiled DLL.) Also the easiest to use...just a few choices to be made and you are off and running. -Download: [ClAsHbOt.2016-03-28.7z](https://github.com/CodeSlinger69/ClAsHbOt/releases/download/20160328/ClAsHbOt.2016.03.28.7z) +Download: [ClAsHbOt.2016-05-28.7z](https://github.com/CodeSlinger69/ClAsHbOt/releases/download/20160528/ClAsHbOt.2016.05.28.7z) Discussion thread: [Issue #22](https://github.com/CodeSlinger69/ClAsHbOt/issues/22) diff --git a/Source/ClAsHbOt Script/ArmyManager.au3 b/Source/ClAsHbOt Script/ArmyManager.au3 index 0fa8211..6505e09 100644 --- a/Source/ClAsHbOt Script/ArmyManager.au3 +++ b/Source/ClAsHbOt Script/ArmyManager.au3 @@ -289,7 +289,6 @@ EndFunc Func DequeueTroops(ByRef $hBMP) Local $dequeueTries = 6 - While IsButtonPresent($hBMP, $rTrainTroopsWindowDequeueButton) And $dequeueTries>0 And _ _GUICtrlButton_GetCheck($GUI_AutoRaidCheckBox)=$BST_CHECKED diff --git a/Source/ClAsHbOt Script/AutoRaidStrategy0.au3 b/Source/ClAsHbOt Script/AutoRaidStrategy0.au3 index 6f5dff2..395c911 100644 --- a/Source/ClAsHbOt Script/AutoRaidStrategy0.au3 +++ b/Source/ClAsHbOt Script/AutoRaidStrategy0.au3 @@ -126,6 +126,7 @@ Func AutoRaidExecuteRaidStrategy0(ByRef $hBMP) EndIf ; Deploy breakers + Sleep(3000) If $troopIndex[$eTroopWallBreaker][4] > 0 And _GUICtrlButton_GetCheck($GUI_AutoRaidUseBreakers) = $BST_CHECKED Then DebugWrite("Deploying Breakers") DeployTroopsToSafeBoxes($eTroopWallBreaker, $troopIndex, $direction) diff --git a/Source/ClAsHbOt Script/ClAsHbOt.au3 b/Source/ClAsHbOt Script/ClAsHbOt.au3 index f77d860..d876fd3 100644 --- a/Source/ClAsHbOt Script/ClAsHbOt.au3 +++ b/Source/ClAsHbOt Script/ClAsHbOt.au3 @@ -6,6 +6,10 @@ Atutomatic farming bot for Clash of Clans, with a few other features. 3/21/2016 update todo - Storage images; Gold: L10.76 +5/23/2016 update todo +- Barracks: Baby Dragon & Miner images +- Army Overview: Baby Dragon & Miner images + Other To Do - Capture "grayed" raid slot images for L1-L4 warden @@ -18,14 +22,14 @@ Notes: #ce -Global $gVersion = "20160415" +Global $gVersion = "20160528" ; For compiling #pragma compile(Icon, "cube.ico") #pragma compile(FileDescription, ClAsHbOt - fully open source farm bot) #pragma compile(ProductName, ClAsHbOt) -#pragma compile(ProductVersion, 2016.04.15) -#pragma compile(FileVersion, 2016.04.15) +#pragma compile(ProductVersion, 2016.05.28) +#pragma compile(FileVersion, 2016.05.28) #pragma compile(LegalCopyright, https://github.com/CodeSlinger69/ClAsHbOt) #pragma compile(Out, ClAsHbOt.exe) @@ -93,9 +97,8 @@ Func Main() ;TestRaidTroopsCount() ;TestArmyOverviewStatus() ;TestArmyOverviewTroopTimeRemaining() -;TestBarracksStatus() -;TestBarracksTroopSlots() -;TestBuiltTroops() +;TestBarracks() +;TestArmyOverview() ;TestEndBattleLoot() ;TestEndBattleBonus() ;TestDeployBoxCalcs() diff --git a/Source/ClAsHbOt Script/Globals.au3 b/Source/ClAsHbOt Script/Globals.au3 index 793d8a5..125314b 100644 --- a/Source/ClAsHbOt Script/Globals.au3 +++ b/Source/ClAsHbOt Script/Globals.au3 @@ -67,27 +67,27 @@ Global $gDefenseFarmClicked = False, $gBackgroundModeClicked = False Global $gAutoNeedToCollectStartingLoot = False, $gAutoNeedToCollectEndingLoot = False ; Lists of troop and spell types -Global Enum $eTroopBarbarian, $eTroopArcher, $eTroopGiant, $eTroopGoblin, $eTroopWallBreaker, _ - $eTroopBalloon, $eTroopWizard, $eTroopHealer, $eTroopDragon, $eTroopPekka, _ +Global Enum $eTroopBarbarian, $eTroopArcher, $eTroopGiant, $eTroopGoblin, $eTroopWallBreaker, $eTroopBalloon, _ + $eTroopWizard, $eTroopHealer, $eTroopDragon, $eTroopPekka, $eTroopBabyDragon, $eTroopMiner, _ $eTroopMinion, $eTroopHogRider, $eTroopValkyrie, $eTroopGolem, $eTroopWitch, _ $eTroopLavaHound, $eTroopBowler, _ $eTroopKing, $eTroopQueen, $eTroopWarden, _ $eTroopKingGrayed, $eTroopQueenGrayed, $eTroopWardenGrayed, $eTroopCount Global $gTroopCountExcludingHeroes = $eTroopCount-6 -Global $gTroopNames[$eTroopCount] = ["Barbarian", "Archer", "Giant", "Goblin", "Wall Breaker", _ - "Balloon", "Wizard", "Healer", "Dragon", "Pekka", _ +Global $gTroopNames[$eTroopCount] = ["Barbarian", "Archer", "Giant", "Goblin", "Wall Breaker", "Balloon", _ + "Wizard", "Healer", "Dragon", "Pekka", "Baby Dragon", "Miner", _ "Minion", "Hog Rider", "Valkyrie", "Golem", "Witch", _ "Lava Hound", "Bowler", _ "Barbarian King", "Archer Queen", "Grand Warden", _ "Barbarian King Grayed", "Archer Queen Grayed", "Grand Warden Grayed"] -Global $gTroopSpace[$eTroopCount] = [ 1, 1, 5, 1, 2, _ - 5, 4, 14, 20, 25, _ +Global $gTroopSpace[$eTroopCount] = [ 1, 1, 5, 1, 2, 5, _ + 4, 14, 20, 25, 10, 5, _ 2, 5, 8, 30, 12, _ 30, 8, _ 0, 0, 0, _ 0, 0, 0 ] -Global $gDonateMaxClicks[$gTroopCountExcludingHeroes] = [ 6, 6, 6, 6, 6, _ - 6, 6, 2, 1, 1, _ +Global $gDonateMaxClicks[$gTroopCountExcludingHeroes] = [ 6, 6, 6, 6, 6, 6, _ + 6, 2, 1, 1, 2, 6, _ 6, 6, 4, 1, 2, _ 1, 4 ] Global Enum $eSpellLightning, $eSpellHeal, $eSpellRage, $eSpellJump, $eSpellFreeze, $eSpellPoison, _ diff --git a/Source/ClAsHbOt Script/RegionDefs.au3 b/Source/ClAsHbOt Script/RegionDefs.au3 index 938b6e0..b9d0129 100644 --- a/Source/ClAsHbOt Script/RegionDefs.au3 +++ b/Source/ClAsHbOt Script/RegionDefs.au3 @@ -12,9 +12,9 @@ Global $rElixTextBox[10] = [50, 99, 125, 111, 0xffe8fd, 9, 34, 105, 0xE049D0, 2 Global $rDarkTextBox[10] = [50, 127, 125, 139, 0xf3f3f3, 9, 34, 133, 0x504060, 25] Global $rCupsTextBox[10] = [50, 169, 125, 181, 0xffffff, 9, 34, 175, 0xC69624, 25] -Global $rBarracksTroopBox[10] = [170, 321, 697, 529] +Global $rBarracksTroopBox[10] = [120, 321, 729, 520] Global $rBarracksButtonOffset[4] = [0, 5, 87, 56] -Global $rBarracksWindowTextBox[10] = [126, 178, 290, 190, 0xffffff, 9, 0, 0, 0, 0] +Global $rBarracksWindowTextBox[10] = [122, 178, 286, 190, 0xffffff, 9, 0, 0, 0, 0] Global $rArmyOverviewWindowTextBox[10] = [143, 175, 275, 190, 0x494949, 60, 0, 0, 0, 0] Global $rArmyOverviewTroopTimeRemainingTextBox[10] = [675, 176, 725, 186, 0x766A52, 70, 732, 182, 0xFFFFFF, 0] Global $rRaidSlotTroopCountTextBox[10] = [0, 0, 0, 0, 0xffffff, 9, 0, 0, 0, 0] @@ -56,7 +56,7 @@ Global $rLiveReplayEndScreenReturnHomeButton[8] = [14, 624, 110, 680, 71, 654, 0 Global $rWindowVillageWasAttackedOkayButton[8] = [360, 494, 500, 549, 429, 539, 0x5FAC10, 6] Global $rSafeAreaButton[8] = [819, 0, 859, 20, 0, 0, 0, 0] Global $rCollectorButton[8] = [0, 0, 14, 28, 0, 0, 0, 0] -Global $rTrainTroopsWindowDequeueButton[8] = [559, 201, 577, 216, 568, 213, 0xD00000, 0] +Global $rTrainTroopsWindowDequeueButton[8] = [554, 201, 572, 216, 563, 207, 0xFFFFFF, 0] Global $rArmyManagerButton[8] = [15, 561, 62, 609, 31, 577, 0xF8F0E0, 0] Global $rArmyManagerWindowCloseButton[8] = [712, 128, 748, 161, 728, 143, 0xFDFEFD, 6] Global $rArmyManagerWindowStandard1Button[8] = [224, 555, 280, 605, 231, 563, 0x888070, 0] diff --git a/Source/ClAsHbOt Script/Test.au3 b/Source/ClAsHbOt Script/Test.au3 index 4cfbced..288da92 100644 --- a/Source/ClAsHbOt Script/Test.au3 +++ b/Source/ClAsHbOt Script/Test.au3 @@ -159,14 +159,12 @@ Func TestRaidTroopsCount() Next EndFunc -Func TestBarracksStatus() - Local $hHBITMAP = CaptureFrameHBITMAP("TestBarracksStatus") +Func TestBarracks() + Local $hHBITMAP = CaptureFrameHBITMAP("TestBarracks") Local $queueStatus = ScrapeFuzzyText($hHBITMAP, $fontBarracksStatus, $rBarracksWindowTextBox) DebugWrite("Barracks queue status: " & $queueStatus) _WinAPI_DeleteObject($hHBITMAP) -EndFunc -Func TestBarracksTroopSlots() Local $troopSlots[$gTroopCountExcludingHeroes][4] For $i = $eTroopBarbarian To $eTroopLavaHound $troopSlots[$i][0] = -1 @@ -181,7 +179,12 @@ Func TestBarracksTroopSlots() Next EndFunc -Func TestBuiltTroops() +Func TestArmyOverview() + Local $hHBITMAP = CaptureFrameHBITMAP("TestArmyOverview") + Local $queueStatus = ScrapeFuzzyText($hHBITMAP, $fontArmyOverviewStatus, $rArmyOverviewWindowTextBox) + DebugWrite("Army Overview queue status: " & $queueStatus) + _WinAPI_DeleteObject($hHBITMAP) + Local $builtTroopCounts[$eTroopCount][5] For $i = 0 To UBound($builtTroopCounts)-1 $builtTroopCounts[$i][0] = -1 diff --git a/WikiImages/ClAsHbOt screenshot.jpg b/WikiImages/ClAsHbOt screenshot.jpg index 1ff2cde..dc98eb0 100644 Binary files a/WikiImages/ClAsHbOt screenshot.jpg and b/WikiImages/ClAsHbOt screenshot.jpg differ