Skip to content

Commit a7831c9

Browse files
committed
Merge pull request #26 from codebroken/beta
2.5.6
2 parents 8f9085b + 80e0e54 commit a7831c9

15 files changed

Lines changed: 269 additions & 31 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ logs/
99
Loots/
1010
config/*.ini
1111
strategies/*.ini
12+
.developer
1213

1314
######################
1415
## Windows detritus ##

BrokenBot.au3

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,18 @@
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.5.5)
7-
#pragma compile(FileVersion, 2.5.5)
6+
#pragma compile(ProductVersion, 2.5.6)
7+
#pragma compile(FileVersion, 2.5.6)
88

99
#include <GUIConstants.au3>
1010

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

14+
If FileExists (@ScriptDir & "\.developer") Then
15+
$sBotTitle = "BrokenBot - In Development"
16+
EndIf
17+
1418
Global $StartupLanguage = IniRead(@ScriptDir & "\config\default.ini", "config", "language", "English")
1519

1620
If _Singleton($sBotTitle, 1) = 0 Then
@@ -19,8 +23,7 @@ If _Singleton($sBotTitle, 1) = 0 Then
1923
EndIf
2024

2125
If @AutoItX64 = 1 Then
22-
MsgBox(0, "", GetLangText("boxCompile1") & @CRLF & _
23-
GetLangText("boxCompile2"))
26+
MsgBox(0, "", GetLangText("boxCompile1") & @CRLF & GetLangText("boxCompile2"))
2427
Exit
2528
EndIf
2629

BrokenBot.exe

1.5 KB
Binary file not shown.

BrokenBot.org/languages/English.ini

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,13 @@ chkMeetTHO = "TH Outside"
262262
chkMeetTHOTip = "Townhall must be on outer edges of base"
263263
chkSnipe = "Snipe"
264264
chkSnipeTip = "If checked, will attack exterior townhall of live base regardless of other settings"
265+
RedConditions = "Search Condition Reduction"
266+
lblRedNumOfSerach = "Red per No. Searches:"
267+
lblRedGoldPercent = "Gold Reduction(%):"
268+
lblRedElixirPercent = "Elixir Reduction(%):"
269+
lblRedDEPercent = "DE Reduction(%):"
270+
lblRedTrophyPercent = "Trophy Reduction(%):"
271+
lblRedNukePercent = "Nuke Reduction(%):"
265272
btnSearchMode = "Search Mode"
266273
btnSearchModeTip = "Does not attack. Searches for base that meets conditions."
267274
pageAttack = "Attack Method"
@@ -592,6 +599,8 @@ msgDeadInitial = "Dead"
592599
msgDownloading = "Downloading update..."
593600
msgUnzipping = "Successful! Unzipping..."
594601
msgInstallandRestart = "Successful! Installing and restarting..."
602+
msgAppearsStuck = "We appear to be stuck. Resetting troop counts."
603+
msgSevereStuck = "Continually stuck. Just acting as if we have a full army camp."
595604
boxAlreadyRunning = "Bot is already running."
596605
boxCompile1 = "Don't Run/Compile Script (x64)! try to Run/Compile Script (x86) to getting this bot work."
597606
boxCompile2 = "If this message still appear, try to re-install your AutoIt with newer version."
@@ -672,6 +681,7 @@ pushStatRn = "\n-DE Gain: "
672681
pushStatRo = "\n-Trophies Gain: "
673682
pushStatRp = "\n\nOther Stats\n-Attacked: "
674683
pushStatRq = "\n-Skipped: "
684+
pushStatRq1 = "\n-Disconnected: "
675685
pushStatRr = "\n-Search Cost: "
676686
pushStatRs = "\n-Bot Run Time: "
677687
pushDisca = "Disconnected"
@@ -686,3 +696,4 @@ pushFBf = " available!"
686696
pushVR = "Village Report"
687697
pushLR = "Last Raid Report:"
688698
pushLRb = "Gain: \n["
699+
pushBS = "Base Searched:"

COCBot/functions/Notification/PushBullet.au3

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ Func _RemoteControl()
7474
_DeleteMessage($iden[$x])
7575
ElseIf $title[$x] = "BOT STATS" Then
7676
SetLog(GetLangText("msgPBStats"))
77-
_Push(GetLangText("pushStatRa"), GetLangText("pushStatRb") & GUICtrlRead($lblresultgoldtstart) & GetLangText("pushStatRc") & GUICtrlRead($lblresultelixirstart) & GetLangText("pushStatRd") & GUICtrlRead($lblresultdestart) & GetLangText("pushStatRe") & GUICtrlRead($lblresulttrophystart) & GetLangText("pushStatRf") & GUICtrlRead($lblresultgoldnow) & GetLangText("pushStatRg") & GUICtrlRead($lblresultelixirnow) & GetLangText("pushStatRh") & GUICtrlRead($lblresultdenow) & GetLangText("pushStatRi") & GUICtrlRead($lblresulttrophynow) & GetLangText("pushStatRj") & GetLangText("pushStatRk") & GUICtrlRead($lblwallupgradecount) & GetLangText("pushStatRl") & GUICtrlRead($lblresultgoldgain) & GetLangText("pushStatRm") & GUICtrlRead($lblresultelixirgain) & GetLangText("pushStatRn") & GUICtrlRead($lblresultdegain) & GetLangText("pushStatRo") & GUICtrlRead($lblresulttrophygain) & GetLangText("pushStatRp") & GUICtrlRead($lblresultvillagesattacked) & GetLangText("pushStatRq")& GUICtrlRead($lblresultvillagesskipped) & GetLangText("pushStatRr") & GUICtrlRead($lblresultsearchcost) & GetLangText("pushStatRs") & StringFormat("%02i:%02i:%02i", $hour, $min, $sec))
77+
_Push(GetLangText("pushStatRa"), GetLangText("pushStatRb") & GUICtrlRead($lblresultgoldtstart) & GetLangText("pushStatRc") & GUICtrlRead($lblresultelixirstart) & GetLangText("pushStatRd") & GUICtrlRead($lblresultdestart) & GetLangText("pushStatRe") & GUICtrlRead($lblresulttrophystart) & GetLangText("pushStatRf") & GUICtrlRead($lblresultgoldnow) & GetLangText("pushStatRg") & GUICtrlRead($lblresultelixirnow) & GetLangText("pushStatRh") & GUICtrlRead($lblresultdenow) & GetLangText("pushStatRi") & GUICtrlRead($lblresulttrophynow) & GetLangText("pushStatRj") & GetLangText("pushStatRk") & GUICtrlRead($lblwallupgradecount) & GetLangText("pushStatRl") & GUICtrlRead($lblresultgoldgain) & GetLangText("pushStatRm") & GUICtrlRead($lblresultelixirgain) & GetLangText("pushStatRn") & GUICtrlRead($lblresultdegain) & GetLangText("pushStatRo") & GUICtrlRead($lblresulttrophygain) & GetLangText("pushStatRp") & GUICtrlRead($lblresultvillagesattacked) & GetLangText("pushStatRq")& GUICtrlRead($lblresultvillagesskipped) & GetLangText("pushStatRq1")& GUICtrlRead($lblresultsearchdisconnected) & GetLangText("pushStatRr") & GUICtrlRead($lblresultsearchcost) & GetLangText("pushStatRs") & StringFormat("%02i:%02i:%02i", $hour, $min, $sec))
7878
_DeleteMessage($iden[$x])
7979
ElseIf $title[$x] = "BOT LOGS" Then
8080
SetLog(GetLangText("msgPBLog"))

COCBot/functions/Strategies/Standard/Config.au3

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Func Standard_LoadConfig()
2222
_GUICtrlComboBox_SetCurSel($cmbAny, IniRead($configFile, "search", "AnyAndOr", "0"))
2323
_GUICtrlComboBox_SetCurSel($cmbDead, IniRead($configFile, "search", "DeadAndOr", "0"))
2424

25+
2526
If IniRead($configFile, "search", "conditionDeadGoldElixir", "0") = 1 Then
2627
GUICtrlSetState($chkDeadGE, $GUI_CHECKED)
2728
Else
@@ -100,6 +101,14 @@ Func Standard_LoadConfig()
100101
Standard_chkDeadActivate()
101102
Standard_chkAnyActivate()
102103

104+
;Search reduction settings inside search tab
105+
GUICtrlSetData($txtRedNumOfSerach, IniRead($configFile, "search", "RedutionNumOfSerach", "30"))
106+
GUICtrlSetData($txtRedGoldPercent, IniRead($configFile, "search", "ReductionGoldPercent", "5"))
107+
GUICtrlSetData($txtRedElixirPercent, IniRead($configFile, "search", "ReductionElixirPercent", "5"))
108+
GUICtrlSetData($txtRedDEPercent, IniRead($configFile, "search", "ReductionDEPercent", "5"))
109+
GUICtrlSetData($txtRedTrophyPercent, IniRead($configFile, "search", "ReductionTrophyPercent", "5"))
110+
GUICtrlSetData($txtRedNukePercent, IniRead($configFile, "search", "ReductionNukePercent", "5"))
111+
103112
;Attack Settings-------------------------------------------------------------------------
104113
_GUICtrlComboBox_SetCurSel($cmbDeadDeploy, IniRead($configFile, "attack", "deploy-dead", "0"))
105114
_GUICtrlComboBox_SetCurSel($cmbDeadAlgorithm, IniRead($configFile, "attack", "algorithm-dead", "0"))
@@ -314,6 +323,14 @@ Func Standard_SaveConfig($configFile)
314323
Else
315324
IniWrite($configFile, "search", "conditionSnipe", 0)
316325
EndIf
326+
;Search reduction setting in search tab
327+
If GUICtrlRead($txtRedNumOfSerach) = 0 Then GUICtrlSetData($txtRedNumOfSerach,30)
328+
IniWrite($configFile, "search", "RedutionNumOfSerach", GUICtrlRead($txtRedNumOfSerach))
329+
IniWrite($configFile, "search", "ReductionGoldPercent", GUICtrlRead($txtRedGoldPercent))
330+
IniWrite($configFile, "search", "ReductionElixirPercent", GUICtrlRead($txtRedElixirPercent))
331+
IniWrite($configFile, "search", "ReductionDEPercent", GUICtrlRead($txtRedDEPercent))
332+
IniWrite($configFile, "search", "ReductionTrophyPercent", GUICtrlRead($txtRedTrophyPercent))
333+
IniWrite($configFile, "search", "ReductionNukePercent", GUICtrlRead($txtRedNukePercent))
317334

318335
;Attack Settings-------------------------------------------------------------------------
319336
IniWrite($configFile, "attack", "deploy-dead", _GUICtrlComboBox_GetCurSel($cmbDeadDeploy))

COCBot/functions/Strategies/Standard/GUIDesign.au3

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,35 @@ Func Standard_LoadGUI()
8484
GUICtrlSetState($chkMeetTH, $GUI_DISABLE)
8585
GUICtrlSetState($cmbTH, $GUI_DISABLE)
8686
GUICtrlSetState($chkMeetTHO, $GUI_DISABLE)
87+
; -- tab search condition reduction
88+
$RedConditions = GUICtrlCreateGroup(GetLangText("RedConditions"), 18, 315, 397, 150)
89+
$lblRedNumOfSerach = GUICtrlCreateLabel(GetLangText("lblRedNumOfSerach"), 30, 340, 120, 20)
90+
Global $txtRedNumOfSerach = GUICtrlCreateInput("30", 160, 340, 50, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER))
91+
GUICtrlSetLimit(-1, 3)
92+
$lblRedGoldPercent = GUICtrlCreateLabel(GetLangText("lblRedGoldPercent"), 30, 370, 120, 20)
93+
Global $txtRedGoldPercent = GUICtrlCreateInput("5", 160, 370, 50, 21, BitOR($ES_CENTER, $ES_NUMBER))
94+
GUICtrlSetLimit(-1, 2)
95+
$lblRedElixirPercent = GUICtrlCreateLabel(GetLangText("lblRedElixirPercent"), 220, 370, 120, 20)
96+
Global $txtRedElixirPercent = GUICtrlCreateInput("5", 350, 370, 50, 21, BitOR($ES_CENTER, $ES_NUMBER))
97+
GUICtrlSetLimit(-1, 2)
98+
$lblRedDEPercent = GUICtrlCreateLabel(GetLangText("lblRedDEPercent"), 30, 400, 120, 20)
99+
Global $txtRedDEPercent = GUICtrlCreateInput("5", 160, 400, 50, 21, BitOR($ES_CENTER, $ES_NUMBER))
100+
GUICtrlSetLimit(-1, 2)
101+
$lblRedTrophyPercent = GUICtrlCreateLabel(GetLangText("lblRedTrophyPercent"), 220, 400, 120, 20)
102+
Global $txtRedTrophyPercent = GUICtrlCreateInput("5", 350, 400, 50, 21, BitOR($ES_CENTER, $ES_NUMBER))
103+
GUICtrlSetLimit(-1, 2)
104+
$lblRedNukePercent = GUICtrlCreateLabel(GetLangText("lblRedNukePercent"), 30, 430, 120, 20)
105+
Global $txtRedNukePercent = GUICtrlCreateInput("5", 160, 430, 50, 21, BitOR($ES_CENTER, $ES_NUMBER))
106+
GUICtrlSetLimit(-1, 2)
107+
; -- end of session
87108
GUICtrlCreateGroup("", -99, -99, 1, 1)
88109
Global $btnSearchMode = GUICtrlCreateButton(GetLangText("btnSearchMode"), 20, 527, 393, 25)
89110
GUICtrlSetOnEvent(-1, "Standard_btnSearchMode")
90111
GUICtrlSetTip(-1, GetLangText("btnSearchModeTip"))
91112
GUICtrlSetState($btnSearchMode, $GUI_DISABLE)
92113

114+
115+
93116
; ---------------------------------------------------------------------------
94117
$pageAttack = GUICtrlCreateTabItem(GetLangText("pageAttack"))
95118

COCBot/functions/Strategies/Standard/Plugin.au3

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ $StratNames = "Standard"
1212
Global $prevTroopComp = -1
1313
Global $BarbariansComp, $ArchersComp, $GiantsComp, $GoblinsComp, $WBComp
1414
Global $fullarmy, $fullSpellFactory
15+
Global $stuckCount = 0
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
Func Standard_PrepNextBattle()
2+
$stuckCount = 0
23
Standard_Train(True)
34
EndFunc ;==>Standard_PrepNextBattle
45

COCBot/functions/Strategies/Standard/ReadyCheck.au3

Lines changed: 147 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,20 @@
1-
Func Standard_ReadyCheck()
1+
Func Standard_ReadyCheck($TimeSinceNewTroop)
2+
3+
If $TimeSinceNewTroop > Standard_GetTrainTime() + 60 Then
4+
If $stuckCount < 3 Then
5+
$FirstStart = True
6+
SetLog(GetLangText("msgAppearsStuck"))
7+
$stuckCount +=1
8+
ElseIf $stuckCount = 3
9+
SetLog(GetLangText("msgSevereStuck"))
10+
$stuckCount += 1
11+
EndIf
12+
EndIf
13+
214
$fullarmy = Standard_CheckArmyCamp()
315
If StatusCheck() Then Return False
416

5-
If Not $fullarmy Then Standard_Train()
17+
If Not $fullarmy And $stuckCount < 3 Then Standard_Train()
618
If StatusCheck() Then Return False
719

820
If IsChecked($chkMakeSpells) Then
@@ -13,16 +25,149 @@ Func Standard_ReadyCheck()
1325
If StatusCheck() Then Return False
1426
EndIf
1527

28+
If $stuckCount >= 3 And IsChecked($chkDeadActivate) Then
29+
$fullArmy = True
30+
Return True
31+
EndIf
32+
33+
If $stuckCount >= 3 And IsChecked($chkAnyActivate) Then
34+
$fullArmy = True
35+
Return True
36+
EndIf
1637

1738
If $fullarmy And IsChecked($chkDeadActivate) Then Return True
1839
If $fullarmy And IsChecked($chkAnyActivate) Then Return True
40+
1941
If IsChecked($chkMakeSpells) Then
2042
If $fullSpellFactory And IsChecked($chkNukeOnly) And Not IsChecked($chkNukeOnlyWithFullArmy) Then Return True
2143
EndIf
2244

2345
Return False
2446
EndFunc ;==>Standard_ReadyCheck
2547

48+
Func Standard_GetTrainTime()
49+
$MaxTrainTime = 0
50+
Switch _GUICtrlComboBox_GetCurSel($cmbTroopComp)
51+
Case 0
52+
$MaxTrainTime = 25
53+
Case 1
54+
$MaxTrainTime = 20
55+
Case 2
56+
$MaxTrainTime = 30
57+
Case 3
58+
$MaxTrainTime = 25
59+
Case 4
60+
$MaxTrainTime = 120
61+
Case 5
62+
$MaxTrainTime = 120
63+
Case 6
64+
$MaxTrainTime = 30
65+
Case 7
66+
$MaxTrainTime = 120
67+
Case 8
68+
Switch _GUICtrlComboBox_GetCurSel($cmbBarrack1)
69+
Case 0
70+
$MaxTrainTime = 20
71+
Case 1
72+
$MaxTrainTime = 25
73+
Case 2
74+
$MaxTrainTime = 120
75+
Case 3
76+
$MaxTrainTime = 30
77+
Case 4
78+
$MaxTrainTime = 120
79+
Case 5
80+
$MaxTrainTime = 240
81+
Case 6
82+
$MaxTrainTime = 480
83+
Case 7
84+
$MaxTrainTime = 900
85+
Case 8
86+
$MaxTrainTime = 1800
87+
Case 9
88+
$MaxTrainTime = 2700
89+
Case 10
90+
$MaxTrainTime = 0
91+
EndSwitch
92+
Switch _GUICtrlComboBox_GetCurSel($cmbBarrack2)
93+
Case 0
94+
If $MaxTrainTime < 20 Then $MaxTrainTime = 20
95+
Case 1
96+
If $MaxTrainTime < 25 Then $MaxTrainTime = 25
97+
Case 2
98+
If $MaxTrainTime < 120 Then $MaxTrainTime = 120
99+
Case 3
100+
If $MaxTrainTime < 30 Then $MaxTrainTime = 30
101+
Case 4
102+
If $MaxTrainTime < 120 Then $MaxTrainTime = 120
103+
Case 5
104+
If $MaxTrainTime < 240 Then $MaxTrainTime = 240
105+
Case 6
106+
If $MaxTrainTime < 480 Then $MaxTrainTime = 480
107+
Case 7
108+
If $MaxTrainTime < 900 Then $MaxTrainTime = 900
109+
Case 8
110+
If $MaxTrainTime < 1800 Then $MaxTrainTime = 1800
111+
Case 9
112+
If $MaxTrainTime < 2700 Then $MaxTrainTime = 2700
113+
Case 10
114+
; Nothing
115+
EndSwitch
116+
Switch _GUICtrlComboBox_GetCurSel($cmbBarrack3)
117+
Case 0
118+
If $MaxTrainTime < 20 Then $MaxTrainTime = 20
119+
Case 1
120+
If $MaxTrainTime < 25 Then $MaxTrainTime = 25
121+
Case 2
122+
If $MaxTrainTime < 120 Then $MaxTrainTime = 120
123+
Case 3
124+
If $MaxTrainTime < 30 Then $MaxTrainTime = 30
125+
Case 4
126+
If $MaxTrainTime < 120 Then $MaxTrainTime = 120
127+
Case 5
128+
If $MaxTrainTime < 240 Then $MaxTrainTime = 240
129+
Case 6
130+
If $MaxTrainTime < 480 Then $MaxTrainTime = 480
131+
Case 7
132+
If $MaxTrainTime < 900 Then $MaxTrainTime = 900
133+
Case 8
134+
If $MaxTrainTime < 1800 Then $MaxTrainTime = 1800
135+
Case 9
136+
If $MaxTrainTime < 2700 Then $MaxTrainTime = 2700
137+
Case 10
138+
; Nothing
139+
EndSwitch
140+
Switch _GUICtrlComboBox_GetCurSel($cmbBarrack4)
141+
Case 0
142+
If $MaxTrainTime < 20 Then $MaxTrainTime = 20
143+
Case 1
144+
If $MaxTrainTime < 25 Then $MaxTrainTime = 25
145+
Case 2
146+
If $MaxTrainTime < 120 Then $MaxTrainTime = 120
147+
Case 3
148+
If $MaxTrainTime < 30 Then $MaxTrainTime = 30
149+
Case 4
150+
If $MaxTrainTime < 120 Then $MaxTrainTime = 120
151+
Case 5
152+
If $MaxTrainTime < 240 Then $MaxTrainTime = 240
153+
Case 6
154+
If $MaxTrainTime < 480 Then $MaxTrainTime = 480
155+
Case 7
156+
If $MaxTrainTime < 900 Then $MaxTrainTime = 900
157+
Case 8
158+
If $MaxTrainTime < 1800 Then $MaxTrainTime = 1800
159+
Case 9
160+
If $MaxTrainTime < 2700 Then $MaxTrainTime = 2700
161+
Case 10
162+
; Nothing
163+
EndSwitch
164+
Case 9
165+
; Doesn't work currently
166+
$MaxTrainTime = 0
167+
EndSwitch
168+
Return $MaxTrainTime
169+
EndFunc
170+
26171
Func Standard_CheckArmyCamp()
27172
SetLog(GetLangText("msgCheckingCamp"), $COLOR_BLUE)
28173
$fullarmy = False

0 commit comments

Comments
 (0)