Skip to content

Commit 189f793

Browse files
committed
Merge pull request #31 from codebroken/beta
Update master
2 parents cfc7ff5 + 26f3b90 commit 189f793

19 files changed

Lines changed: 206 additions & 218 deletions

File tree

BrokenBot.au3

Lines changed: 3 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.5.7)
7-
#pragma compile(FileVersion, 2.5.7)
6+
#pragma compile(ProductVersion, 2.5.8)
7+
#pragma compile(FileVersion, 2.5.8)
88

99
#include <GUIConstants.au3>
1010

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

1414
If FileExists (@ScriptDir & "\.developer") Then

BrokenBot.exe

1 KB
Binary file not shown.

BrokenBot.org/functions/Strategies/SharedFunction.au3

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ Func ChkDisconnection($disconnected = False)
4040
;increase disconnect counts
4141
GUICtrlSetData($lblresultsearchdisconnected, GUICtrlRead($lblresultsearchdisconnected) + 1)
4242
If $DebugMode = 1 Then _GDIPlus_ImageSaveToFile($hBitmap, $dirDebug & "DisConnt-" & @HOUR & @MIN & @SEC & ".png")
43-
If $PushBulletEnabled = 1 Then
4443

44+
If $PushBulletEnabled = 1 and IsChecked($lbldisconnect) Then
4545
Local $iCount = _FileCountLines($sLogPath)
4646
Local $myLines = ""
4747
Local $i

BrokenBot.org/languages/English.ini

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ AtkSpeed = "Deploy Speed"
6363
lblUnitDelay = "Unit Delay:"
6464
lblWaveDelay = "Wave Delay:"
6565
Randomspeedatk = "Random Speeds"
66-
lblAttackdelay = "Delays of troops deployment speed, 1 (fast) = like a Bot, 10 (slow) = Like a Human. Random will make bot more varied and closer to a person."
66+
lblAttackdelay = "Delays of troops deployment speed, 1 (fast) = like a crazy bot, 10 (slow) = Like a slow human. Speeds always randomized to look less bot-like."
6767
pageDonateSettings = "Donate/Request"
6868
Barbarians = "Troop 1"
6969
chkDonateAll = "Donate to All"
@@ -118,19 +118,21 @@ lblpushbulletremoteTip = "Enables pushbullet remote function"
118118
lblpushbulletdelete = "Delete Msg on Start"
119119
lblpushbulletdeleteTip = "Will delete your messages on start button click"
120120
lblpushmessage = "Push Messages As Text"
121-
lblvillagereport = "Village Report"
121+
lblvillagereport = "Hourly Village Report"
122122
lblmatchfound = "Match Found"
123123
lbllastraid = "Last Raid"
124124
lblfreebuilder = "Free Builder"
125+
lbldisconnect = "Disconnection"
125126
lblpushbulletloot = "As JPG"
127+
lblpushuser = "Enter user name here to get user specific info and multi-bot control"
126128
UseJPG = "Last Raid"
127129
UseJPGTip = "Attach the loot jpg file in push message"
128130
UseAttackJPG = "Attack"
129131
UseAttackJPGTip = "Attach the attack jpg file in push message"
130-
lblpushbullet2 = "PushBullet Remote"
132+
lblpushbullet2 = "PushBullet Multi-user"
131133
pushbullettoken2 = "You can remotely control your bot using the following command format"
132134
pushbullettoken3 = "Enter the command in the title of the message"
133-
pushbullettoken4 = "Bot <command> where <command> is:"
135+
pushbullettoken4 = "Bot <command> <user> Where <command> is:"
134136
pushbullettoken5 = "Pause - pause the bot"
135137
pushbullettoken6 = "Resume - resume the bot"
136138
pushbullettoken7 = "Stats - send bot current statistics"
@@ -696,4 +698,5 @@ pushFBf = " available!"
696698
pushVR = "Village Report"
697699
pushLR = "Last Raid Report:"
698700
pushLRb = "Gain: \n["
699-
pushBS = "Base Searched:"
701+
pushBS = "Base Searched:"
702+
pushLootA = "Loot Available:"

COCBot/GUI Control.au3

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ Func GUIControl($hWind, $iMsg, $wParam, $lParam)
4040
chkRequest()
4141
Case $tabMain
4242
tabMain()
43-
Case $Randomspeedatk
44-
Randomspeedatk()
4543
Case $chkNoAttack
4644
If IsChecked($chkNoAttack) Then
4745
If IsChecked($lblpushbulletenabled) Then
@@ -159,6 +157,8 @@ Func btnStart()
159157
EndIf
160158
GUICtrlSetState($pageGeneral, $GUI_SHOW)
161159
$FirstAttack = True
160+
; Set hourly village report timer
161+
$PushBulletvillagereportTimer = TimerInit()
162162

163163
CreateLogFile()
164164

@@ -468,18 +468,6 @@ Func chkRequest()
468468
EndIf
469469
EndFunc ;==>chkRequest
470470

471-
Func Randomspeedatk()
472-
If IsChecked($Randomspeedatk) Then
473-
$iRandomspeedatk = 1
474-
GUICtrlSetState($cmbUnitDelay, $GUI_DISABLE)
475-
GUICtrlSetState($cmbWaveDelay, $GUI_DISABLE)
476-
Else
477-
$iRandomspeedatk = 0
478-
GUICtrlSetState($cmbUnitDelay, $GUI_ENABLE)
479-
GUICtrlSetState($cmbWaveDelay, $GUI_ENABLE)
480-
EndIf
481-
EndFunc ;==>Randomspeedatk
482-
483471
Func tabMain()
484472
If _GUICtrlTab_GetCurSel($tabMain) = 0 Then
485473
ControlShow("", "", $txtLog)
@@ -607,6 +595,8 @@ Func lblpushbulletenabled()
607595
GUICtrlSetState($lblpushbulletdelete, $GUI_ENABLE)
608596
GUICtrlSetState($lblvillagereport, $GUI_ENABLE)
609597
GUICtrlSetState($lblmatchfound, $GUI_ENABLE)
598+
GUICtrlSetState($lblfreebuilder, $GUI_ENABLE)
599+
GUICtrlSetState($lbldisconnect, $GUI_ENABLE)
610600
GUICtrlSetState($lbllastraid, $GUI_ENABLE)
611601
GUICtrlSetState($UseJPG, $GUI_ENABLE)
612602
Else
@@ -616,6 +606,8 @@ Func lblpushbulletenabled()
616606
GUICtrlSetState($lblpushbulletdelete, $GUI_DISABLE)
617607
GUICtrlSetState($lblvillagereport, $GUI_DISABLE)
618608
GUICtrlSetState($lblmatchfound, $GUI_DISABLE)
609+
GUICtrlSetState($lblfreebuilder, $GUI_DISABLE)
610+
GUICtrlSetState($lbldisconnect, $GUI_DISABLE)
619611
GUICtrlSetState($lbllastraid, $GUI_DISABLE)
620612
GUICtrlSetState($UseJPG, $GUI_DISABLE)
621613
EndIf
@@ -633,8 +625,7 @@ Func btnBugRep()
633625
EndIf
634626
Next
635627

636-
GUICtrlSetData($inpSettings, "")
637-
$firstLine = True
628+
GUICtrlSetData($inpSettings, "Global Settings:")
638629
If FileExists($config) Then
639630
$hConfig = FileOpen($config)
640631
While True
@@ -643,15 +634,26 @@ Func btnBugRep()
643634
If StringInStr($strNextLine, "accounttoken=") Then
644635
$strNextLine = "accounttoken=REDACTED"
645636
EndIf
646-
If Not $firstLine Then
647-
GUICtrlSetData($inpSettings, GUICtrlRead($inpSettings) & @CRLF & $strNextLine)
648-
Else
649-
$firstLine = False
650-
GUICtrlSetData($inpSettings, $strNextLine)
637+
If StringInStr($strNextLine, "user=") Then
638+
$strNextLine = "user=REDACTED"
651639
EndIf
640+
GUICtrlSetData($inpSettings, GUICtrlRead($inpSettings) & @CRLF & $strNextLine)
641+
WEnd
642+
FileClose($hConfig)
643+
Else
644+
GUICtrlSetData($inpSettings, GUICtrlRead($inpSettings) & @CRLF & "No settings file found")
645+
EndIf
646+
GUICtrlSetData($inpSettings, GUICtrlRead($inpSettings) & @CRLF & @CRLF & "Strategy settings:")
647+
If FileExists($dirStrat & GUICtrlRead($lstStrategies) & ".ini") Then
648+
$hConfig = FileOpen($dirStrat & GUICtrlRead($lstStrategies) & ".ini")
649+
While True
650+
$strNextLine = FileReadLine($hConfig)
651+
If @error Then ExitLoop
652+
GUICtrlSetData($inpSettings, GUICtrlRead($inpSettings) & @CRLF & $strNextLine)
652653
WEnd
654+
FileClose($hConfig)
653655
Else
654-
GUICtrlSetData($inpSettings, "No log file found")
656+
GUICtrlSetData($inpSettings, GUICtrlRead($inpSettings) & @CRLF & "No strategy settings file found")
655657
EndIf
656658

657659
GUISetState(@SW_DISABLE, $frmBot)

COCBot/GUI Design.au3

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,6 @@ GUICtrlSetData(-1, "1|2|3|4|5|6|7|8|9|10", "5")
8181
$lblWaveDelay = GUICtrlCreateLabel(GetLangText("lblWaveDelay"), 155, 292, 75, 17)
8282
$cmbWaveDelay = GUICtrlCreateCombo("", 225, 289, 50, 17, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL))
8383
GUICtrlSetData(-1, "1|2|3|4|5|6|7|8|9|10", "5")
84-
$Randomspeedatk = GUICtrlCreateCheckbox(GetLangText("Randomspeedatk"), 295, 292, 100, 17)
85-
GUICtrlSetOnEvent(-1, "Randomspeedatk")
8684
$lblAttackdelay = GUICtrlCreateLabel(GetLangText("lblAttackdelay"), 35, 315, 350, 67, $SS_CENTER)
8785
GUICtrlCreateGroup("", -99, -99, 1, 1)
8886

@@ -222,24 +220,26 @@ GUICtrlSetTip(-1, GetLangText("lblpushbulletenabledTip"))
222220
$lblpushbulletdebug = GUICtrlCreateCheckbox(GetLangText("lblpushbulletdebug"), 100, 65, 60, 17)
223221
GUICtrlSetTip(-1, GetLangText("lblpushbulletdebugTip"))
224222
$lblpushbulletremote = GUICtrlCreateCheckbox(GetLangText("lblpushbulletremote"), 170, 65, 60, 17)
225-
GUICtrlSetTip(-1, GetLangText("lblpushbulletremoteTip"))
223+
GUICtrlSetTip(-1, GetLangText("pushbullettoken2") & @CRLF & GetLangText("pushbullettoken3") & @CRLF & GetLangText("pushbullettoken4") & @CRLF & @CRLF & GetLangText("pushbullettoken5") & @CRLF & GetLangText("pushbullettoken6") & @CRLF & GetLangText("pushbullettoken7") & @CRLF & GetLangText("pushbullettoken8") & @CRLF & GetLangText("pushbullettoken9"))
226224
$lblpushbulletdelete = GUICtrlCreateCheckbox(GetLangText("lblpushbulletdelete"), 240, 65, 120, 17)
227225
GUICtrlSetTip(-1, GetLangText("lblpushbulletdeleteTip"))
228226

229-
$lblpushmessage = GUICtrlCreateGroup(GetLangText("lblpushmessage"), 30, 115, 200, 80)
230-
$lblvillagereport = GUICtrlCreateCheckbox(GetLangText("lblvillagereport"), 40, 140, 95, 17)
227+
$lblpushmessage = GUICtrlCreateGroup(GetLangText("lblpushmessage"), 30, 115, 200, 88)
228+
$lbldisconnect = GUICtrlCreateCheckbox(GetLangText("lbldisconnect"), 40, 140, 95, 17)
231229
$lblmatchfound = GUICtrlCreateCheckbox(GetLangText("lblmatchfound"), 40, 160, 95, 17)
232230
$lbllastraid = GUICtrlCreateCheckbox(GetLangText("lbllastraid"), 140, 140, 80, 17)
233231
$lblfreebuilder = GUICtrlCreateCheckbox(GetLangText("lblfreebuilder"), 140, 160, 80, 17)
232+
$lblvillagereport = GUICtrlCreateCheckbox(GetLangText("lblvillagereport"), 40, 180, 150, 17)
234233

235-
$lblpushbulletloot = GUICtrlCreateGroup(GetLangText("lblpushbulletloot"), 240, 115, 140, 80)
234+
$lblpushbulletloot = GUICtrlCreateGroup(GetLangText("lblpushbulletloot"), 240, 115, 140, 88)
236235
$UseJPG = GUICtrlCreateCheckbox(GetLangText("UseJPG"), 260, 135, 60, 17)
237236
GUICtrlSetTip(-1, GetLangText("UseJPGTip"))
238237
$UseAttackJPG = GUICtrlCreateCheckbox(GetLangText("UseAttackJPG"), 260, 155, 60, 17)
239238
GUICtrlSetTip(-1, GetLangText("UseAttackJPGTip"))
240239

241-
$lblpushbullet2 = GUICtrlCreateGroup(GetLangText("lblpushbullet2"), 20, 210, 370, 140)
242-
$pushbullettoken2 = GUICtrlCreateLabel(GetLangText("pushbullettoken2") & @CRLF & GetLangText("pushbullettoken3") & @CRLF & GetLangText("pushbullettoken4") & @CRLF & @CRLF & GetLangText("pushbullettoken5") & @CRLF & GetLangText("pushbullettoken6") & @CRLF & GetLangText("pushbullettoken7") & @CRLF & GetLangText("pushbullettoken8") & @CRLF & GetLangText("pushbullettoken9"), 25, 230, 340, 350, $SS_LEFT)
240+
$lblpushbullet2 = GUICtrlCreateGroup(GetLangText("lblpushbullet2"), 20, 210, 370, 70)
241+
$lblpushUser = GUICtrlCreateLabel(GetLangText("lblpushuser"), 30, 230, 350, 20)
242+
$inppushUser = GUICtrlCreateInput("", 30, 250, 150, 20)
243243

244244
; ---------------------------------------------------------------------------------------------------------------------
245245
; Misc ----------------------------------------------------------------------------------------------------------------

COCBot/Global Variables.au3

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,13 +282,16 @@ Global $PushBullettype = 0
282282
Global $PushBulletattacktype = 0
283283
Global $FileName = ""
284284
Global $PushBulletvillagereport = 0
285+
Global $PushBulletvillagereportTimer
286+
Global $PushBulletvillagereportInterval = 3600000 ; an hour
285287
Global $PushBulletmatchfound = 0
286288
Global $PushBulletlastraid = 0
287289
Global $PushBullettotalgain = 0
288290
Global $PushBulletdebug = 0
289291
Global $PushBulletremote = 0
290292
Global $PushBulletdelete = 0
291293
Global $PushBulletfreebuilder = 0
294+
Global $PushBulletdisconnection = 0
292295
Global $sLogFileName
293296
Global $Raid = 0
294297
Global $buildernotified = False
@@ -300,12 +303,14 @@ Global $SearchCost = 0
300303
Global $sTimerRC
301304
Global $PauseBot = False
302305

306+
;Match found
307+
Global $MatchFoundText =""
308+
303309
;Last Raid
304310
Global $LastRaidGold = 0
305311
Global $LastRaidElixir = 0
306312
Global $LastRaidDarkElixir = 0
307313
Global $LastRaidTrophy = 0
308-
309314
;UpTroops
310315
Global $ichkLab
311316
Global $icmbLaboratory

COCBot/functions/Config/applyConfig.au3

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,6 @@ Func applyConfig() ;Applies the data from config to the controls in GUI
8484
_GUICtrlComboBox_SetCurSel($cmbUnitDelay, $icmbUnitDelay)
8585
_GUICtrlComboBox_SetCurSel($cmbWaveDelay, $icmbWaveDelay)
8686

87-
If $iRandomspeedatk = 1 Then
88-
GUICtrlSetState($Randomspeedatk, $GUI_CHECKED)
89-
Else
90-
GUICtrlSetState($Randomspeedatk, $GUI_UNCHECKED)
91-
EndIf
92-
Randomspeedatk()
93-
9487
;Lab
9588
If $ichkLab = 1 Then
9689
GUICtrlSetState($chkLab, $GUI_CHECKED)
@@ -217,6 +210,12 @@ Func applyConfig() ;Applies the data from config to the controls in GUI
217210
GUICtrlSetState($lblfreebuilder, $GUI_UNCHECKED)
218211
EndIf
219212

213+
If $PushBulletdisconnection = 1 Then
214+
GUICtrlSetState($lbldisconnect, $GUI_CHECKED)
215+
Else
216+
GUICtrlSetState($lbldisconnect, $GUI_UNCHECKED)
217+
EndIf
218+
220219
If $PushBullettype = 1 Then
221220
GUICtrlSetState($UseJPG, $GUI_CHECKED)
222221
Else

COCBot/functions/Config/readConfig.au3

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ Func readConfig() ;Reads config and sets it to the variables
1717
;---------------------------------------------------------------------------------------
1818
$icmbUnitDelay = IniRead($config, "attack", "UnitD", "0")
1919
$icmbWaveDelay = IniRead($config, "attack", "WaveD", "0")
20-
$iRandomspeedatk = IniRead($config, "attack", "randomatk", "0")
2120

2221
;---------------------------------------------------------------------------------------
2322
; Donate settings ----------------------------------------------------------------------
@@ -62,6 +61,8 @@ Func readConfig() ;Reads config and sets it to the variables
6261
$PushBulletremote = IniRead($config, "notification", "remote", "0")
6362
$PushBulletdelete = IniRead($config, "notification", "delete", "0")
6463
$PushBulletfreebuilder = IniRead($config, "notification", "freebuilder", "0")
64+
$PushBulletdisconnection = IniRead($config, "notification", "disconnection", "0")
65+
GUICtrlSetData($inppushuser, IniRead($config, "notification", "user", ""))
6566

6667
;---------------------------------------------------------------------------------------
6768
; Misc settings ------------------------------------------------------------------------

COCBot/functions/Config/saveConfig.au3

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ Func saveConfig() ;Saves the controls settings to the config
2828
;---------------------------------------------------------------------------------------
2929
IniWrite($config, "attack", "UnitD", _GUICtrlComboBox_GetCurSel($cmbUnitDelay))
3030
IniWrite($config, "attack", "WaveD", _GUICtrlComboBox_GetCurSel($cmbWaveDelay))
31-
IniWrite($config, "attack", "randomatk", GUICtrlRead($Randomspeedatk))
3231
;---------------------------------------------------------------------------------------
3332
; Donate settings ----------------------------------------------------------------------
3433
;---------------------------------------------------------------------------------------
@@ -185,6 +184,11 @@ Func saveConfig() ;Saves the controls settings to the config
185184
Else
186185
IniWrite($config, "notification", "freebuilder", 0)
187186
EndIf
187+
If IsChecked($lbldisconnect) Then
188+
IniWrite($config, "notification", "disconnection", 1)
189+
Else
190+
IniWrite($config, "notification", "disconnection", 0)
191+
EndIf
188192
If IsChecked($lblpushbulletdebug) Then
189193
IniWrite($config, "notification", "debug", 1)
190194
Else
@@ -211,6 +215,7 @@ Func saveConfig() ;Saves the controls settings to the config
211215
Else
212216
IniWrite($config, "notification", "attackimage", 0)
213217
EndIf
218+
IniWrite($config, "notification", "user", GUICtrlRead($inppushuser))
214219

215220
;---------------------------------------------------------------------------------------
216221
; Misc settings ------------------------------------------------------------------------

0 commit comments

Comments
 (0)