Skip to content

Commit 2132e78

Browse files
author
codebroken
committed
v 2.7.0
1 parent 60e9e93 commit 2132e78

246 files changed

Lines changed: 634 additions & 291 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

BrokenBot.au3

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
#pragma compile(Icon, "BrokenBot.org\images\icons\brokenbot.ico")
44
#pragma compile(FileDescription, BrokenBot.org - Clash of Clans Bot)
55
#pragma compile(ProductName, BrokenBot.org - Clash of Clans Bot)
6-
#pragma compile(ProductVersion, 2.6.0)
7-
#pragma compile(FileVersion, 2.6.0)
6+
#pragma compile(ProductVersion, 2.7.0)
7+
#pragma compile(FileVersion, 2.7.0)
88

99
#include <GUIConstants.au3>
1010

11-
$sBotVersion = "2.6.0"
11+
$sBotVersion = "2.7.0"
1212
$sBotTitle = "BrokenBot.org - Break FREE - v" & $sBotVersion
1313

1414
If FileExists (@ScriptDir & "\.developer") Then
@@ -85,6 +85,9 @@ If Not IsArray($ret) Then
8585
EndIf
8686
EndIf
8787

88+
;Only enable button start after all Initiation done.
89+
GUICtrlSetData($btnStart,GetLangText("btnStart") )
90+
GUICtrlSetState($btnStart, $GUI_ENABLE)
8891
While 1
8992
If $StartImmediately Then
9093
$StartImmediately = False

BrokenBot.exe

1.5 KB
Binary file not shown.

BrokenBot.org/BrokenBot32.dll

4.85 MB
Binary file not shown.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
Func checkDarkElix()
2+
_CaptureRegion()
3+
$sendHBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap)
4+
$res = DllCall(@ScriptDir & "\BrokenBot.org\BrokenBot32.dll", "str", "BrokenBotMatchBuilding", "ptr", $sendHBitmap, "int", 13, "int", 3, "int", 1, "int", 1)
5+
_WinAPI_DeleteObject($sendHBitmap)
6+
If IsArray($res) Then
7+
If $res[0] = -1 Then
8+
; failed to find DE
9+
SetLog(GetLangText("msgNoDEStorage"), $COLOR_RED)
10+
If $DebugMode = 1 Then _GDIPlus_ImageSaveToFile($hBitmap, $dirDebug & "NegDE-" & @HOUR & @MIN & @SEC & ".png")
11+
$DEx = 0
12+
$DEy = 0
13+
Return False ; return 0
14+
Else
15+
$res = StringSplit($res[0], "|", 2)
16+
$DEx = $res[1]
17+
$DEy = $res[2]
18+
If $DebugMode = 1 Then
19+
$hClone = _GDIPlus_BitmapCloneArea($hBitmap, $DEx - 30, $DEy - 30, 60, 60, _GDIPlus_ImageGetPixelFormat($hBitmap))
20+
$j = 1
21+
Do
22+
If Not FileExists($dirDebug & "PosDE-x" & $DEx & "y" & $DEy & " (" & $j & ").jpg") Then ExitLoop
23+
$j = $j + 1
24+
Until $j = 1000
25+
_GDIPlus_ImageSaveToFile($hClone, $dirDebug & "PosDE-x" & $DEx & "y" & $DEy & " (" & $j & ").jpg")
26+
_GDIPlus_ImageDispose($hClone)
27+
EndIf
28+
Return True
29+
EndIf
30+
Else
31+
SetLog(GetLangText("msgDLLFailure"), $COLOR_RED)
32+
$DEx = 0
33+
$DEy = 0
34+
Return False ; return 0
35+
EndIf
36+
EndFunc ;==>checkDarkElix

BrokenBot.org/functions/Other/checkupdate.au3

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Func checkupdate()
6363
If IsChecked($chkUpdate) Then
6464
Local $sFilePath = @TempDir & "\update.dat"
6565

66-
Local $hMasterVersion = InetGet("https://github.com/codebroken/BrokenBot/blob/master/BrokenBot.au3", $sFilePath, 3)
66+
Local $hMasterVersion = InetGet("http://www.brokenbot.org/page.php?p=vcheck", $sFilePath, 3)
6767

6868
If $hMasterVersion = 0 Then
6969
SetLog(GetLangText("msgFailedVersion"))

BrokenBot.org/functions/Strategies/SharedFunction.au3

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,72 @@ Func ChkDisconnection($disconnected = False)
5353
EndIf
5454
EndIf
5555
Return $disconnected
56+
EndFunc
57+
58+
59+
Func ChkKingAvailability()
60+
61+
$KingAvailable = False
62+
$KingUG = False
63+
ClickP($TopLeftClient) ;Click Away
64+
If $KingPos[0] = "" Then
65+
Return False
66+
Else
67+
if _sleep(500) Then Return
68+
Click($KingPos[0], $KingPos[1]) ;Click King Altar
69+
EndIf
70+
71+
If _Sleep(500) Then Return
72+
_CaptureRegion()
73+
74+
Local $KingInfoPos = _WaitForPixel(260, 581, 350, 583, Hex(0x4084B8, 6), 5, 2) ;Finds Info button, wait max 2 seconds
75+
If IsArray($KingInfoPos) = False Then
76+
SetLog(GetLangText("msgKAUnavailable"), $COLOR_RED)
77+
Else ;check if king is available for battle
78+
$KingInfoPos = _PixelSearch(510, 589, 585, 591, Hex(0xD13D08, 6), 5) ;Finds Healing button
79+
If IsArray($KingInfoPos) = False Then
80+
$KingInfoPos = _PixelSearch(510, 589, 585, 591, Hex(0xD0EC75, 6), 5) ;Finds Finish now button, when under upgrading
81+
If IsArray($KingInfoPos) Then
82+
$KingUG = True
83+
Else
84+
$KingAvailable = True
85+
EndIf
86+
EndIf
87+
EndIf
88+
Setlog (GetLangText("msgKingAvail") & $KingAvailable)
89+
Return $KingAvailable
90+
EndFunc
91+
92+
Func ChkQueenAvailability()
93+
94+
$QueenAvailable = False
95+
$QueenUG = False
96+
97+
ClickP($TopLeftClient) ;Click Away
98+
If $QueenPos[0] = "" Then
99+
Return False
100+
Else
101+
if _sleep(500) Then Return
102+
Click($QueenPos[0], $QueenPos[1]) ;Click Queen Altar
103+
EndIf
104+
105+
If _Sleep(500) Then Return
106+
_CaptureRegion()
107+
108+
Local $QueenInfoPos = _WaitForPixel(260, 581, 350, 583, Hex(0x4084B8, 6), 5, 2) ;Finds Info button, wait max 2 seconds
109+
If IsArray($QueenInfoPos) = False Then
110+
SetLog(GetLangText("msgQAUnavailable"), $COLOR_RED)
111+
Else ;check if king is available for battle
112+
$QueenInfoPos = _PixelSearch(510, 589, 585, 591, Hex(0xD13D08, 6), 5) ;Finds Healing button
113+
If IsArray($QueenInfoPos) = False Then
114+
$QueenInfoPos = _PixelSearch(510, 589, 585, 591, Hex(0xD0EC75, 6), 5) ;Finds Finish now button, when under upgrading
115+
If IsArray($QueenInfoPos) Then
116+
$QueenUG = True
117+
Else
118+
$QueenAvailable = True
119+
EndIf
120+
EndIf
121+
EndIf
122+
Setlog (GetLangText("msgQueenAvail") & $QueenAvailable)
123+
Return $QueenAvailable
56124
EndFunc

BrokenBot.org/functions/functions.au3

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
#include "GUI\frmBugReport.au3"
88
#include "GUI\WindowFixing.au3"
99

10+
#include "ImageSearch\checkDarkElix.au3"
11+
1012
#include "Other\checkupdate.au3"
1113
#include "Other\GeneralFunctions.au3"
1214
#include "Other\StatusCheck.au3"

BrokenBot.org/languages/English.ini

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ spellNameRage = "Rage"
3737
spellNameJump = "Jump"
3838
spellNameFreeze = "Freeze"
3939
btnStart = "Start Bot"
40+
btnStartInit = "Initiating..."
4041
btnStop = "Stop Bot"
4142
btnHide = "Hide BS"
4243
btnAtkNow = "Attack Now"
@@ -83,6 +84,9 @@ chkDonateBarbariansTip = "Check keywords before donating Troop 1"
8384
chkRequest = "Request for :"
8485
txtRequestDefault = "any"
8586
txtRequestTip = "Request for input."
87+
chkBlacklist = "Blacklist"
88+
chkBlacklistTip = "Check to prevent donating if the request contains a word in the box to the right"
89+
chkBlacklistTip2 = "Will not work if you are using donate to all."
8690
gtfo = "GTFO"
8791
gtfoTip = "Kick after donating"
8892
pageUpgradeBuilding = "Upgrade"
@@ -147,9 +151,9 @@ lblSpellCap = "Spell factory capacity:"
147151
lblCapacity = "Camp Capacity :"
148152
chkTrap = "Auto Rearm Traps"
149153
chkTrapTip = "Auto rearm for Traps, Crossbows & Inferno Towers"
150-
lblSearchsp = "Seach Base Speed:"
154+
lblSearchsp = "Search Base Speed:"
151155
lblSearchspTip = "Set search base speed to higher number if having frequent server sync issue"
152-
lblSearchspd = "Tips: 0 = Fast, 10 = 15 seconds wait"
156+
lblSearchspd = "Tips: 0 = Fast, 10 = Slow"
153157
lblReturnh = "Return Home Delay:"
154158
lblReturnhTip = "Set delay timing for return home during raid"
155159
lblReturndelay = "seconds after no income detected"
@@ -247,6 +251,8 @@ tiExit = "Exit"
247251
pageSearch = "Search Settings"
248252
DeadConditions = "Dead Base Conditions"
249253
lblDeadConditions = "Search for full collectors bases and ALL selected conditions"
254+
chkKingAvail = "Wait for King"
255+
chkQueenAvail = "Wait for Queen"
250256
chkDeadSnipe = "Snipe"
251257
chkDeadSnipeTip = "If checked, will attack exterior townhall of dead base regardless of other settings"
252258
AnyConditions = "Live Base Conditions"
@@ -463,6 +469,10 @@ msgDarkTroopComplete = "Dark Troop Training Complete..."
463469
msgSFUnavailable = "Your Spell Factory is not available"
464470
msgMakingSpell = "Making spell: "
465471
msgUnableCreate = "Unable to click create spells"
472+
msgKAUnavailable = "King Altar is not available"
473+
msgQAUnavailable = "Queen Altar is not available"
474+
msgKingAvail = "King available:"
475+
msgQueenAvail = "Queen available:"
466476
msgSearchCond = "Search Condition:"
467477
msgWillSaveAll = "Will save all of the towns when searching"
468478
msgOutDeadFound = "~~~~~~~Outside Townhall in Dead Base Found!~~~~~~~"
@@ -500,6 +510,7 @@ msgSpellFull = "Spell Factory is full"
500510
msgCollecting = "Collecting Resources"
501511
msgDonatingTroops = "Donating Troops"
502512
msgChatText = "Chat Text: "
513+
msgBlacklisted = "Blacklisted!"
503514
msgUnableToRead = "Unable to read troop"
504515
msgDonateRules = "donate rules."
505516
msgUnableToDetermine = "Unable to determine how to donate "
@@ -532,6 +543,9 @@ msgLocSpellFact = "-Spell Factory"
532543
msgLocLab = "-Locate Laboratory"
533544
msgBeginAttack = "======Beginning Attack======"
534545
msgWaitingFull = "~~~Waiting for full army~~~"
546+
msgHeroNotReady = "~~~Heroes are not Ready~~~"
547+
msgWarningKingUG = "!!!WARNING!!! King upgrading is in progress!"
548+
msgWarningQueenUG = "!!!WARNING!!! Queen upgrading is in progress!"
535549
msgTimeIdle = "Time Idle: "
536550
msgTimeIdleHours = " hours "
537551
msgTimeIdleMin = " minutes "
@@ -598,11 +612,13 @@ msgTrophyInitial = "T"
598612
msgGemInitial = "GEM"
599613
msgTHInitial = "TH"
600614
msgDeadInitial = "Dead"
615+
msgDeadBase = "Deadbase"
601616
msgDownloading = "Downloading update..."
602617
msgUnzipping = "Successful! Unzipping..."
603618
msgInstallandRestart = "Successful! Installing and restarting..."
604619
msgAppearsStuck = "We appear to be stuck. Resetting troop counts."
605620
msgSevereStuck = "Continually stuck. Just acting as if we have a full army camp."
621+
msgDLLError = "DLL error: Something bad happened!"
606622
boxAlreadyRunning = "Bot is already running."
607623
boxCompile1 = "Don't Run/Compile Script (x64)! try to Run/Compile Script (x86) to getting this bot work."
608624
boxCompile2 = "If this message still appear, try to re-install your AutoIt with newer version."

COCBot/Functions.au3

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#include "functions\Image Search\checkButtonUpgrade.au3"
1212
#include "functions\Image Search\checkDeadBase.au3"
1313
#include "functions\Image Search\checkTownhall.au3"
14-
#include "functions\Image Search\checkDarkElix.au3"
1514
#include "functions\Image Search\checkWall.au3"
1615

1716
#include "functions\Main Screen\checkMainScreen.au3"

COCBot/GUI Control.au3

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -85,20 +85,20 @@ Func GUIControl($hWind, $iMsg, $wParam, $lParam)
8585
chkUpgrade2()
8686
Case $chkUpgrade3
8787
chkUpgrade3()
88-
Case $chkUpgrade4
89-
chkUpgrade4()
90-
Case $chkUpgrade5
91-
chkUpgrade5()
92-
Case $chkUpgrade6
93-
chkUpgrade6()
88+
;~ Case $chkUpgrade4
89+
;~ chkUpgrade4()
90+
;~ Case $chkUpgrade5
91+
;~ chkUpgrade5()
92+
;~ Case $chkUpgrade6
93+
;~ chkUpgrade6()
9494
Case $UseJPG
9595
UseJPG()
9696
Case $UseAttackJPG
9797
UseAttackJPG()
9898
Case $lblpushbulletenabled
9999
lblpushbulletenabled()
100100
Case $btnGitHub
101-
ShellExecute("http://http://forum.brokenbot.org/forum-8.html")
101+
ShellExecute("http://www.brokenbot.org/page.php?p=support")
102102
Case $btnCloseBR
103103
GUISetState(@SW_ENABLE, $frmBot)
104104
GUISetState(@SW_HIDE, $frmBugReport)
@@ -663,7 +663,7 @@ Func btnBugRep()
663663
EndFunc ;==>btnBugRep
664664

665665
Func openWebsite()
666-
ShellExecute("http://www.brokenbot.org")
666+
ShellExecute("http://www.brokenbot.org/page.php?p=main")
667667
EndFunc ;==>openWebsite
668668

669669
Func _btnRefresh()

0 commit comments

Comments
 (0)