Skip to content

Commit

Permalink
Merge pull request #26 from codebroken/beta
Browse files Browse the repository at this point in the history
2.5.6
  • Loading branch information
codebroken committed May 17, 2015
2 parents 8f9085b + 80e0e54 commit a7831c9
Show file tree
Hide file tree
Showing 15 changed files with 269 additions and 31 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ logs/
Loots/
config/*.ini
strategies/*.ini
.developer

######################
## Windows detritus ##
Expand Down
13 changes: 8 additions & 5 deletions BrokenBot.au3
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,18 @@
#pragma compile(Icon, "BrokenBot.org\images\icons\brokenbot.ico")
#pragma compile(FileDescription, BrokenBot.org - Clash of Clans Bot)
#pragma compile(ProductName, BrokenBot.org - Clash of Clans Bot)
#pragma compile(ProductVersion, 2.5.5)
#pragma compile(FileVersion, 2.5.5)
#pragma compile(ProductVersion, 2.5.6)
#pragma compile(FileVersion, 2.5.6)

#include <GUIConstants.au3>

$sBotVersion = "2.5.5"
$sBotVersion = "2.5.6"
$sBotTitle = "BrokenBot.org - Break FREE - v" & $sBotVersion

If FileExists (@ScriptDir & "\.developer") Then
$sBotTitle = "BrokenBot - In Development"
EndIf

Global $StartupLanguage = IniRead(@ScriptDir & "\config\default.ini", "config", "language", "English")

If _Singleton($sBotTitle, 1) = 0 Then
Expand All @@ -19,8 +23,7 @@ If _Singleton($sBotTitle, 1) = 0 Then
EndIf

If @AutoItX64 = 1 Then
MsgBox(0, "", GetLangText("boxCompile1") & @CRLF & _
GetLangText("boxCompile2"))
MsgBox(0, "", GetLangText("boxCompile1") & @CRLF & GetLangText("boxCompile2"))
Exit
EndIf

Expand Down
Binary file modified BrokenBot.exe
Binary file not shown.
11 changes: 11 additions & 0 deletions BrokenBot.org/languages/English.ini
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,13 @@ chkMeetTHO = "TH Outside"
chkMeetTHOTip = "Townhall must be on outer edges of base"
chkSnipe = "Snipe"
chkSnipeTip = "If checked, will attack exterior townhall of live base regardless of other settings"
RedConditions = "Search Condition Reduction"
lblRedNumOfSerach = "Red per No. Searches:"
lblRedGoldPercent = "Gold Reduction(%):"
lblRedElixirPercent = "Elixir Reduction(%):"
lblRedDEPercent = "DE Reduction(%):"
lblRedTrophyPercent = "Trophy Reduction(%):"
lblRedNukePercent = "Nuke Reduction(%):"
btnSearchMode = "Search Mode"
btnSearchModeTip = "Does not attack. Searches for base that meets conditions."
pageAttack = "Attack Method"
Expand Down Expand Up @@ -592,6 +599,8 @@ msgDeadInitial = "Dead"
msgDownloading = "Downloading update..."
msgUnzipping = "Successful! Unzipping..."
msgInstallandRestart = "Successful! Installing and restarting..."
msgAppearsStuck = "We appear to be stuck. Resetting troop counts."
msgSevereStuck = "Continually stuck. Just acting as if we have a full army camp."
boxAlreadyRunning = "Bot is already running."
boxCompile1 = "Don't Run/Compile Script (x64)! try to Run/Compile Script (x86) to getting this bot work."
boxCompile2 = "If this message still appear, try to re-install your AutoIt with newer version."
Expand Down Expand Up @@ -672,6 +681,7 @@ pushStatRn = "\n-DE Gain: "
pushStatRo = "\n-Trophies Gain: "
pushStatRp = "\n\nOther Stats\n-Attacked: "
pushStatRq = "\n-Skipped: "
pushStatRq1 = "\n-Disconnected: "
pushStatRr = "\n-Search Cost: "
pushStatRs = "\n-Bot Run Time: "
pushDisca = "Disconnected"
Expand All @@ -686,3 +696,4 @@ pushFBf = " available!"
pushVR = "Village Report"
pushLR = "Last Raid Report:"
pushLRb = "Gain: \n["
pushBS = "Base Searched:"
2 changes: 1 addition & 1 deletion COCBot/functions/Notification/PushBullet.au3
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Func _RemoteControl()
_DeleteMessage($iden[$x])
ElseIf $title[$x] = "BOT STATS" Then
SetLog(GetLangText("msgPBStats"))
_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))
_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))
_DeleteMessage($iden[$x])
ElseIf $title[$x] = "BOT LOGS" Then
SetLog(GetLangText("msgPBLog"))
Expand Down
17 changes: 17 additions & 0 deletions COCBot/functions/Strategies/Standard/Config.au3
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Func Standard_LoadConfig()
_GUICtrlComboBox_SetCurSel($cmbAny, IniRead($configFile, "search", "AnyAndOr", "0"))
_GUICtrlComboBox_SetCurSel($cmbDead, IniRead($configFile, "search", "DeadAndOr", "0"))


If IniRead($configFile, "search", "conditionDeadGoldElixir", "0") = 1 Then
GUICtrlSetState($chkDeadGE, $GUI_CHECKED)
Else
Expand Down Expand Up @@ -100,6 +101,14 @@ Func Standard_LoadConfig()
Standard_chkDeadActivate()
Standard_chkAnyActivate()

;Search reduction settings inside search tab
GUICtrlSetData($txtRedNumOfSerach, IniRead($configFile, "search", "RedutionNumOfSerach", "30"))
GUICtrlSetData($txtRedGoldPercent, IniRead($configFile, "search", "ReductionGoldPercent", "5"))
GUICtrlSetData($txtRedElixirPercent, IniRead($configFile, "search", "ReductionElixirPercent", "5"))
GUICtrlSetData($txtRedDEPercent, IniRead($configFile, "search", "ReductionDEPercent", "5"))
GUICtrlSetData($txtRedTrophyPercent, IniRead($configFile, "search", "ReductionTrophyPercent", "5"))
GUICtrlSetData($txtRedNukePercent, IniRead($configFile, "search", "ReductionNukePercent", "5"))

;Attack Settings-------------------------------------------------------------------------
_GUICtrlComboBox_SetCurSel($cmbDeadDeploy, IniRead($configFile, "attack", "deploy-dead", "0"))
_GUICtrlComboBox_SetCurSel($cmbDeadAlgorithm, IniRead($configFile, "attack", "algorithm-dead", "0"))
Expand Down Expand Up @@ -314,6 +323,14 @@ Func Standard_SaveConfig($configFile)
Else
IniWrite($configFile, "search", "conditionSnipe", 0)
EndIf
;Search reduction setting in search tab
If GUICtrlRead($txtRedNumOfSerach) = 0 Then GUICtrlSetData($txtRedNumOfSerach,30)
IniWrite($configFile, "search", "RedutionNumOfSerach", GUICtrlRead($txtRedNumOfSerach))
IniWrite($configFile, "search", "ReductionGoldPercent", GUICtrlRead($txtRedGoldPercent))
IniWrite($configFile, "search", "ReductionElixirPercent", GUICtrlRead($txtRedElixirPercent))
IniWrite($configFile, "search", "ReductionDEPercent", GUICtrlRead($txtRedDEPercent))
IniWrite($configFile, "search", "ReductionTrophyPercent", GUICtrlRead($txtRedTrophyPercent))
IniWrite($configFile, "search", "ReductionNukePercent", GUICtrlRead($txtRedNukePercent))

;Attack Settings-------------------------------------------------------------------------
IniWrite($configFile, "attack", "deploy-dead", _GUICtrlComboBox_GetCurSel($cmbDeadDeploy))
Expand Down
23 changes: 23 additions & 0 deletions COCBot/functions/Strategies/Standard/GUIDesign.au3
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,35 @@ Func Standard_LoadGUI()
GUICtrlSetState($chkMeetTH, $GUI_DISABLE)
GUICtrlSetState($cmbTH, $GUI_DISABLE)
GUICtrlSetState($chkMeetTHO, $GUI_DISABLE)
; -- tab search condition reduction
$RedConditions = GUICtrlCreateGroup(GetLangText("RedConditions"), 18, 315, 397, 150)
$lblRedNumOfSerach = GUICtrlCreateLabel(GetLangText("lblRedNumOfSerach"), 30, 340, 120, 20)
Global $txtRedNumOfSerach = GUICtrlCreateInput("30", 160, 340, 50, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER))
GUICtrlSetLimit(-1, 3)
$lblRedGoldPercent = GUICtrlCreateLabel(GetLangText("lblRedGoldPercent"), 30, 370, 120, 20)
Global $txtRedGoldPercent = GUICtrlCreateInput("5", 160, 370, 50, 21, BitOR($ES_CENTER, $ES_NUMBER))
GUICtrlSetLimit(-1, 2)
$lblRedElixirPercent = GUICtrlCreateLabel(GetLangText("lblRedElixirPercent"), 220, 370, 120, 20)
Global $txtRedElixirPercent = GUICtrlCreateInput("5", 350, 370, 50, 21, BitOR($ES_CENTER, $ES_NUMBER))
GUICtrlSetLimit(-1, 2)
$lblRedDEPercent = GUICtrlCreateLabel(GetLangText("lblRedDEPercent"), 30, 400, 120, 20)
Global $txtRedDEPercent = GUICtrlCreateInput("5", 160, 400, 50, 21, BitOR($ES_CENTER, $ES_NUMBER))
GUICtrlSetLimit(-1, 2)
$lblRedTrophyPercent = GUICtrlCreateLabel(GetLangText("lblRedTrophyPercent"), 220, 400, 120, 20)
Global $txtRedTrophyPercent = GUICtrlCreateInput("5", 350, 400, 50, 21, BitOR($ES_CENTER, $ES_NUMBER))
GUICtrlSetLimit(-1, 2)
$lblRedNukePercent = GUICtrlCreateLabel(GetLangText("lblRedNukePercent"), 30, 430, 120, 20)
Global $txtRedNukePercent = GUICtrlCreateInput("5", 160, 430, 50, 21, BitOR($ES_CENTER, $ES_NUMBER))
GUICtrlSetLimit(-1, 2)
; -- end of session
GUICtrlCreateGroup("", -99, -99, 1, 1)
Global $btnSearchMode = GUICtrlCreateButton(GetLangText("btnSearchMode"), 20, 527, 393, 25)
GUICtrlSetOnEvent(-1, "Standard_btnSearchMode")
GUICtrlSetTip(-1, GetLangText("btnSearchModeTip"))
GUICtrlSetState($btnSearchMode, $GUI_DISABLE)



; ---------------------------------------------------------------------------
$pageAttack = GUICtrlCreateTabItem(GetLangText("pageAttack"))

Expand Down
1 change: 1 addition & 0 deletions COCBot/functions/Strategies/Standard/Plugin.au3
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ $StratNames = "Standard"
Global $prevTroopComp = -1
Global $BarbariansComp, $ArchersComp, $GiantsComp, $GoblinsComp, $WBComp
Global $fullarmy, $fullSpellFactory
Global $stuckCount = 0
1 change: 1 addition & 0 deletions COCBot/functions/Strategies/Standard/PrepNextBattle.au3
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Func Standard_PrepNextBattle()
$stuckCount = 0
Standard_Train(True)
EndFunc ;==>Standard_PrepNextBattle

149 changes: 147 additions & 2 deletions COCBot/functions/Strategies/Standard/ReadyCheck.au3
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
Func Standard_ReadyCheck()
Func Standard_ReadyCheck($TimeSinceNewTroop)

If $TimeSinceNewTroop > Standard_GetTrainTime() + 60 Then
If $stuckCount < 3 Then
$FirstStart = True
SetLog(GetLangText("msgAppearsStuck"))
$stuckCount +=1
ElseIf $stuckCount = 3
SetLog(GetLangText("msgSevereStuck"))
$stuckCount += 1
EndIf
EndIf

$fullarmy = Standard_CheckArmyCamp()
If StatusCheck() Then Return False

If Not $fullarmy Then Standard_Train()
If Not $fullarmy And $stuckCount < 3 Then Standard_Train()
If StatusCheck() Then Return False

If IsChecked($chkMakeSpells) Then
Expand All @@ -13,16 +25,149 @@ Func Standard_ReadyCheck()
If StatusCheck() Then Return False
EndIf

If $stuckCount >= 3 And IsChecked($chkDeadActivate) Then
$fullArmy = True
Return True
EndIf

If $stuckCount >= 3 And IsChecked($chkAnyActivate) Then
$fullArmy = True
Return True
EndIf

If $fullarmy And IsChecked($chkDeadActivate) Then Return True
If $fullarmy And IsChecked($chkAnyActivate) Then Return True

If IsChecked($chkMakeSpells) Then
If $fullSpellFactory And IsChecked($chkNukeOnly) And Not IsChecked($chkNukeOnlyWithFullArmy) Then Return True
EndIf

Return False
EndFunc ;==>Standard_ReadyCheck

Func Standard_GetTrainTime()
$MaxTrainTime = 0
Switch _GUICtrlComboBox_GetCurSel($cmbTroopComp)
Case 0
$MaxTrainTime = 25
Case 1
$MaxTrainTime = 20
Case 2
$MaxTrainTime = 30
Case 3
$MaxTrainTime = 25
Case 4
$MaxTrainTime = 120
Case 5
$MaxTrainTime = 120
Case 6
$MaxTrainTime = 30
Case 7
$MaxTrainTime = 120
Case 8
Switch _GUICtrlComboBox_GetCurSel($cmbBarrack1)
Case 0
$MaxTrainTime = 20
Case 1
$MaxTrainTime = 25
Case 2
$MaxTrainTime = 120
Case 3
$MaxTrainTime = 30
Case 4
$MaxTrainTime = 120
Case 5
$MaxTrainTime = 240
Case 6
$MaxTrainTime = 480
Case 7
$MaxTrainTime = 900
Case 8
$MaxTrainTime = 1800
Case 9
$MaxTrainTime = 2700
Case 10
$MaxTrainTime = 0
EndSwitch
Switch _GUICtrlComboBox_GetCurSel($cmbBarrack2)
Case 0
If $MaxTrainTime < 20 Then $MaxTrainTime = 20
Case 1
If $MaxTrainTime < 25 Then $MaxTrainTime = 25
Case 2
If $MaxTrainTime < 120 Then $MaxTrainTime = 120
Case 3
If $MaxTrainTime < 30 Then $MaxTrainTime = 30
Case 4
If $MaxTrainTime < 120 Then $MaxTrainTime = 120
Case 5
If $MaxTrainTime < 240 Then $MaxTrainTime = 240
Case 6
If $MaxTrainTime < 480 Then $MaxTrainTime = 480
Case 7
If $MaxTrainTime < 900 Then $MaxTrainTime = 900
Case 8
If $MaxTrainTime < 1800 Then $MaxTrainTime = 1800
Case 9
If $MaxTrainTime < 2700 Then $MaxTrainTime = 2700
Case 10
; Nothing
EndSwitch
Switch _GUICtrlComboBox_GetCurSel($cmbBarrack3)
Case 0
If $MaxTrainTime < 20 Then $MaxTrainTime = 20
Case 1
If $MaxTrainTime < 25 Then $MaxTrainTime = 25
Case 2
If $MaxTrainTime < 120 Then $MaxTrainTime = 120
Case 3
If $MaxTrainTime < 30 Then $MaxTrainTime = 30
Case 4
If $MaxTrainTime < 120 Then $MaxTrainTime = 120
Case 5
If $MaxTrainTime < 240 Then $MaxTrainTime = 240
Case 6
If $MaxTrainTime < 480 Then $MaxTrainTime = 480
Case 7
If $MaxTrainTime < 900 Then $MaxTrainTime = 900
Case 8
If $MaxTrainTime < 1800 Then $MaxTrainTime = 1800
Case 9
If $MaxTrainTime < 2700 Then $MaxTrainTime = 2700
Case 10
; Nothing
EndSwitch
Switch _GUICtrlComboBox_GetCurSel($cmbBarrack4)
Case 0
If $MaxTrainTime < 20 Then $MaxTrainTime = 20
Case 1
If $MaxTrainTime < 25 Then $MaxTrainTime = 25
Case 2
If $MaxTrainTime < 120 Then $MaxTrainTime = 120
Case 3
If $MaxTrainTime < 30 Then $MaxTrainTime = 30
Case 4
If $MaxTrainTime < 120 Then $MaxTrainTime = 120
Case 5
If $MaxTrainTime < 240 Then $MaxTrainTime = 240
Case 6
If $MaxTrainTime < 480 Then $MaxTrainTime = 480
Case 7
If $MaxTrainTime < 900 Then $MaxTrainTime = 900
Case 8
If $MaxTrainTime < 1800 Then $MaxTrainTime = 1800
Case 9
If $MaxTrainTime < 2700 Then $MaxTrainTime = 2700
Case 10
; Nothing
EndSwitch
Case 9
; Doesn't work currently
$MaxTrainTime = 0
EndSwitch
Return $MaxTrainTime
EndFunc

Func Standard_CheckArmyCamp()
SetLog(GetLangText("msgCheckingCamp"), $COLOR_BLUE)
$fullarmy = False
Expand Down
Loading

0 comments on commit a7831c9

Please sign in to comment.