Skip to content

Commit

Permalink
* **V7.6**
Browse files Browse the repository at this point in the history
* Added New Logo/banner by Hecki
* Added Double Train Army by Demen
* Added Support for attack bar with more than 11 slots by Demen
* Added Siege Machines at Train
* Added Siege Machines at Donation.
* Added Siege Machines at Clan Games.
* Added Siege Machines at Attack.
* Added Local DB [using SQLite] to collect more attack stats.
* Added Smart-Farm Attack to standard dead bases attack
* Added Boost using Magic Training Potion by ViperZ
* Added Telegram - Shutdown , Hibernate and Standby with a confirm message, just to avoid user errors
* Added Telegram and invalid commands
* Added Profile button to save current setting without having to start bot
* Fixed Reset last command on Telegram
* Fixed UI Responsiveness when the telegram is checked
* Fixed Forced PBT for Normal Switch
* Fixed Some issues in switch from-to Builder base - Main Village, Get village measuring and zoomout
* Fixed Village Measuring and Zoomout problem when the emulator is to slow
* Fixed The Standby command on Telegram
* Fixed Queued Troops and Spells new bundle of images
* Improved Siege Switch and attack bar benchmarks, 'big' images had size reduction and screencaptures
* Improved Switch between Bases
* Improved Builder Base detection
* Improved Bot function sequences, your army is ready to attack then before any other routine will train and attack
* Improved Request CC, only "Wait for Castle" on Search Tab, settings are on Request Tab
* Improved Request CC, enforce Spells even without "Wait for Castle"
* Improved Donate CC, will not proceed with the routine if the words doesn't match , reducing times and logs , by Demen
* Improved Clone Detection on Army window and Spells Log
* Removed PushBullet code because the limit of 100/month
* Updated Android Status & Information.txt
  • Loading branch information
promac2k committed Aug 6, 2018
1 parent 6be34ae commit 28c5206
Show file tree
Hide file tree
Showing 224 changed files with 10,052 additions and 4,969 deletions.
34 changes: 33 additions & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,4 +1,36 @@
* **V7.5.4**
* **V7.6**
* Added New Logo/banner by @Hecki
* Added Double Train Army by @Demen
* Added Support for attack bar with more than 11 slots by @Demen
* Added Siege Machines at Train
* Added Siege Machines at Donation.
* Added Siege Machines at Clan Games.
* Added Siege Machines at Attack.
* Added Local DB [using SQLite] to collect more attack stats.
* Added Smart-Farm Attack to standard dead bases attack
* Added Boost using Magic Training Potion by @ViperZ
* Added Telegram - Shutdown , Hibernate and Standby with a confirm message, just to avoid user errors
* Added Telegram and invalid commands
* Added Profile button to save current setting without having to start bot
* Fixed Reset last command on Telegram
* Fixed UI Responsiveness when the telegram is checked
* Fixed Forced PBT for Normal Switch
* Fixed Some issues in switch from-to Builder base - Main Village, Get village measuring and zoomout
* Fixed Village Measuring and Zoomout problem when the emulator is to slow
* Fixed The Standby command on Telegram
* Fixed Queued Troops and Spells new bundle of images
* Improved Siege Switch and attack bar benchmarks, 'big' images had size reduction and screencaptures
* Improved Switch between Bases
* Improved Builder Base detection
* Improved Bot function sequences, your army is ready to attack then before any other routine will train and attack
* Improved Request CC, only "Wait for Castle" on Search Tab, settings are on Request Tab
* Improved Request CC, enforce Spells even without "Wait for Castle"
* Improved Donate CC, will not proceed with the routine if the words doesn't match , reducing times and logs , by @Demen
* Improved Clone Detection on Army window and Spells Log
* Removed PushBullet code because the limit of 100/month
* Updated Android Status & Information.txt

* **V7.5.4**
* Added Electro Dragon in to Clan Games
* Added Only request donation, when specific Clan Castle type is missing by @Demen
* Added Restart search to pick healed heroes up by @Demen
Expand Down
4 changes: 4 additions & 0 deletions COCBot/GUI/MBR GUI Control Attack Scripted.au3
Original file line number Diff line number Diff line change
Expand Up @@ -506,11 +506,15 @@ EndFunc ;==>cmbScriptDroplineAB

Func AttackNow()
Local $tempbRunState = $g_bRunState
Local $tempSieges = $g_aiCurrentSiegeMachines
$g_aiCurrentSiegeMachines[$eSiegeWallWrecker] = 1
$g_aiCurrentSiegeMachines[$eSiegeBattleBlimp] = 1
$g_aiAttackAlgorithm[$LB] = 1 ; Select Scripted Attack
$g_sAttackScrScriptName[$LB] = GuiCtrlRead($g_hCmbScriptNameAB) ; Select Scripted Attack File From The Combo Box, Cos it wasn't refreshing until pressing Start button
$g_iMatchMode = $LB ; Select Live Base As Attack Type
$g_bRunState = True
PrepareAttack($g_iMatchMode) ;
Attack() ; Fire xD
$g_aiCurrentSiegeMachines = $tempSieges
$g_bRunState = $tempbRunState
EndFunc ;==>AttackNow
51 changes: 43 additions & 8 deletions COCBot/GUI/MBR GUI Control Attack Standard.au3
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,52 @@ Func chkSmartAttackRedAreaAB()
EndFunc ;==>chkSmartAttackRedAreaAB

Func chkRandomSpeedAtkDB()
If GUICtrlRead($g_hChkRandomSpeedAtkDB) = $GUI_CHECKED Then
;$iChkDBRandomSpeedAtk = 1
GUICtrlSetState($g_hCmbStandardUnitDelayDB, $GUI_DISABLE)
GUICtrlSetState($g_hCmbStandardWaveDelayDB, $GUI_DISABLE)
Else
;$iChkDBRandomSpeedAtk = 0
GUICtrlSetState($g_hCmbStandardUnitDelayDB, $GUI_ENABLE)
GUICtrlSetState($g_hCmbStandardWaveDelayDB, $GUI_ENABLE)
Local $iCmbValue = _GUICtrlComboBox_GetCurSel($g_hCmbDBAlgorithm)
If $iCmbValue = 0 Then
If GUICtrlRead($g_hChkRandomSpeedAtkDB) = $GUI_CHECKED Then
GUICtrlSetState($g_hChkRandomSpeedAtkDB1, $GUI_CHECKED)
GUICtrlSetState($g_hCmbStandardUnitDelayDB, $GUI_DISABLE)
GUICtrlSetState($g_hCmbStandardWaveDelayDB, $GUI_DISABLE)
GUICtrlSetState($g_hCmbStandardUnitDelayDB1, $GUI_DISABLE)
GUICtrlSetState($g_hCmbStandardWaveDelayDB1, $GUI_DISABLE)
Else
GUICtrlSetState($g_hChkRandomSpeedAtkDB1, $GUI_UNCHECKED)
GUICtrlSetState($g_hCmbStandardUnitDelayDB, $GUI_ENABLE)
GUICtrlSetState($g_hCmbStandardWaveDelayDB, $GUI_ENABLE)
GUICtrlSetState($g_hCmbStandardUnitDelayDB1, $GUI_ENABLE)
GUICtrlSetState($g_hCmbStandardWaveDelayDB1, $GUI_ENABLE)
chkSpeedAtkDB()
EndIf
EndIf
If $iCmbValue = 3 Then
If GUICtrlRead($g_hChkRandomSpeedAtkDB1) = $GUI_CHECKED And $iCmbValue = 3 Then
GUICtrlSetState($g_hChkRandomSpeedAtkDB, $GUI_CHECKED)
GUICtrlSetState($g_hCmbStandardUnitDelayDB, $GUI_DISABLE)
GUICtrlSetState($g_hCmbStandardWaveDelayDB, $GUI_DISABLE)
GUICtrlSetState($g_hCmbStandardUnitDelayDB1, $GUI_DISABLE)
GUICtrlSetState($g_hCmbStandardWaveDelayDB1, $GUI_DISABLE)
Else
GUICtrlSetState($g_hChkRandomSpeedAtkDB, $GUI_UNCHECKED)
GUICtrlSetState($g_hCmbStandardUnitDelayDB, $GUI_ENABLE)
GUICtrlSetState($g_hCmbStandardWaveDelayDB, $GUI_ENABLE)
GUICtrlSetState($g_hCmbStandardUnitDelayDB1, $GUI_ENABLE)
GUICtrlSetState($g_hCmbStandardWaveDelayDB1, $GUI_ENABLE)
chkSpeedAtkDB()
EndIf
EndIf
EndFunc ;==>chkRandomSpeedAtkDB

Func chkSpeedAtkDB()
Local $iCmbValue = _GUICtrlComboBox_GetCurSel($g_hCmbDBAlgorithm)
If $iCmbValue = 3 And GUICtrlRead($g_hChkRandomSpeedAtkDB1) = $GUI_UNCHECKED then
_GUICtrlComboBox_SetCurSel($g_hCmbStandardUnitDelayDB, _GUICtrlComboBox_GetCurSel($g_hCmbStandardUnitDelayDB1))
_GUICtrlComboBox_SetCurSel($g_hCmbStandardWaveDelayDB, _GUICtrlComboBox_GetCurSel($g_hCmbStandardWaveDelayDB1))
ElseIf $iCmbValue = 0 And GUICtrlRead($g_hChkRandomSpeedAtkDB) = $GUI_UNCHECKED then
_GUICtrlComboBox_SetCurSel($g_hCmbStandardUnitDelayDB1, _GUICtrlComboBox_GetCurSel($g_hCmbStandardUnitDelayDB))
_GUICtrlComboBox_SetCurSel($g_hCmbStandardWaveDelayDB1, _GUICtrlComboBox_GetCurSel($g_hCmbStandardWaveDelayDB))
EndIf
EndFunc

Func chkSmartAttackRedAreaDB()
If GUICtrlRead($g_hChkSmartAttackRedAreaDB) = $GUI_CHECKED Then
$g_abAttackStdSmartAttack[$DB] = 1
Expand Down
23 changes: 22 additions & 1 deletion COCBot/GUI/MBR GUI Control BOT Options.au3
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,10 @@ Func chkDisableNotifications()
EndFunc ;==>chkDisableNotifications

Func chkUseRandomClick()
$g_bUseRandomClick = (GUICtrlRead($g_hChkUseRandomClick) = $GUI_CHECKED)
$g_bRunState = True
getArmySiegeMachines()
$g_bRunState = False
;$g_bUseRandomClick = (GUICtrlRead($g_hChkUseRandomClick) = $GUI_CHECKED)
EndFunc ;==>chkUseRandomClick
#cs
Func chkUpdatingWhenMinimized()
Expand Down Expand Up @@ -525,6 +528,8 @@ Func btnTestDonateCC()
EndIf
SetLog("Detecting Troops...")
DetectSlotTroop($eBowl)
SetLog("Detecting Sieges...")
DetectSlotSiege($eSiegeBattleBlimp)
SetLog("Detecting Spells...")
DetectSlotSpell($eSkSpell)
SetLog(_PadStringCenter(" Test DonateCC end ", 54, "="), $COLOR_INFO)
Expand Down Expand Up @@ -1156,3 +1161,19 @@ EndFunc ;==>btnTestSmartWait
Func btnConsoleWindow()
ConsoleWindow()
EndFunc ;==>btnConsoleWindow

Func chkSQLite()
$g_bUseStatistics = GUICtrlRead($g_hChkSqlite) = $GUI_CHECKED
EndFunc ;==>chkSQLite

Func SQLiteExport()

If Not $g_bUseStatistics Then
Setlog("")
Return
EndIf
Setlog("Exporting data from SQlite, please wait!", $COLOR_ACTION)
ExportDataBase(False)
Setlog("Export successfully completed.", $COLOR_SUCCESS)

EndFunc ;==>SQLiteExport
7 changes: 5 additions & 2 deletions COCBot/GUI/MBR GUI Control Bottom.au3
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,11 @@ Func Initiate()
$g_bFirstStart = True
$g_bInitiateSwitchAcc = True
$g_iFirstTimeLab = 0
$g_bDoubleTrainDone = False
Local $abEmptyDoubleTrainDone = [False, False, False, False, False, False, False, False]
$g_abDoubleTrainDone = $abEmptyDoubleTrainDone

If $g_bNotifyDeleteAllPushesOnStart Then _DeletePush()
;~ If $g_bNotifyDeleteAllPushesOnStart Then _DeletePush()

If Not $g_bSearchMode Then
$g_hTimerSinceStarted = __TimerInit()
Expand Down Expand Up @@ -384,7 +387,7 @@ Func ToggleGuiControls($bEnabled, $bOptimizedRedraw = True)
$g_bGUIControlDisabled = True
For $i = $g_hFirstControlToHide To $g_hLastControlToHide
If IsAlwaysEnabledControl($i) Then ContinueLoop
If $g_bNotifyPBEnable And $i = $g_hBtnNotifyDeleteMessages Then ContinueLoop ; exclude the DeleteAllMesages button when PushBullet is enabled
;If $g_bNotifyPBEnable And $i = $g_hBtnNotifyDeleteMessages Then ContinueLoop ; exclude the DeleteAllMesages button when PushBullet is enabled
If Not $bEnabled Then
; Save state of all controls on tabs
$g_aiControlPrevState[$i] = BitAND(GUICtrlGetState($i), $GUI_ENABLE)
Expand Down
111 changes: 111 additions & 0 deletions COCBot/GUI/MBR GUI Control Child Army.au3
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Func chkUseQTrain()
_GUI_Value_STATE("ENABLE", $grpCookSpell)
lblTotalCountTroop1()
TotalSpellCountClick()
lblTotalCountSiege()
EndIf
EndFunc ;==>chkUseQTrain

Expand Down Expand Up @@ -174,6 +175,31 @@ Func lblTotalCountSpell2()
CalCostSpell()
EndFunc ;==>lblTotalCountSpell2

Func lblTotalCountSiege()
; calculate total space and time for Siege composition
Local $iTotalTotalTimeSiege = 0
$g_iTotalTrainSpaceSiege = 0

For $i = 0 To $eSiegeMachineCount - 1
$g_iTotalTrainSpaceSiege += $g_aiArmyCompSiegeMachine[$i] * $g_aiSiegeMachineSpace[$i]
$iTotalTotalTimeSiege += $g_aiArmyCompSiegeMachine[$i] * $g_aiSiegeMachineTrainTimePerLevel[$i][$g_aiTrainArmySiegeMachineLevel[$i]]
Next

GUICtrlSetData($g_hLblTotalTimeSiege, CalculTimeTo($iTotalTotalTimeSiege))
GUICtrlSetData($g_hLblCountTotalSiege, $g_iTotalTrainSpaceSiege)
GUICtrlSetBkColor($g_hLblCountTotalSiege, $g_iTotalTrainSpaceSiege <= 2 ? $COLOR_MONEYGREEN : $COLOR_RED)

CalCostSiege()
If $g_iTownHallLevel <> 12 and $g_iTownHallLevel > 0 then
$g_iTotalTrainSpaceSiege = 0
GUICtrlSetBkColor($g_hLblCountTotalSiege,$COLOR_RED)
_GUICtrlSetTip($g_hLblCountTotalSiege, GetTranslatedFileIni("MBR GUI Design Child Attack - Troops", "LblCountTotal_Info_03", "Workshop Level 1 Required!"))
GUICtrlSetData($g_hLblGoldCostSiege, "0")
GUICtrlSetData($g_hLblCountTotalSiege, $g_iTotalTrainSpaceSiege)
GUICtrlSetData($g_hLblTotalTimeSiege, " 0s")
EndIf
EndFunc

Func TotalSpellCountClick()
Local $bWasRedraw = SetRedrawBotWindow(False, Default, Default, Default, "TotalSpellCountClick")
_GUI_Value_STATE("HIDE", $groupListSpells)
Expand Down Expand Up @@ -804,6 +830,45 @@ Func LevUpDownTroop($iTroopIndex, $NoChangeLev = True)
If GUICtrlGetBkColor($hLevel) <> $iColor Then GUICtrlSetBkColor($hLevel, $iColor)
EndFunc ;==>LevUpDownTroop

Func LevUpDownSiege($iSiege, $NoChangeLev = True)
Local $MaxLev = $g_aiSiegeMachineCostPerLevel[$iSiege][0]
Local $TempLev = 0

If $NoChangeLev Then
If _IsPressed("10") Or _IsPressed("02") Then
$TempLev = $g_aiTrainArmySiegeMachineLevel[$iSiege] - 1
Else
$TempLev = $g_aiTrainArmySiegeMachineLevel[$iSiege] + 1
EndIf
Else
$TempLev = $g_aiTrainArmySiegeMachineLevel[$iSiege]
EndIf

Local $hLevel = $g_ahLblTrainArmySiegeLevel[$iSiege]
Local $hCount = $g_ahTxtTrainArmySiegeCount[$iSiege]

If $TempLev > $MaxLev Or $TempLev = 0 Then
$TempLev = 0
GUICtrlSetData($hCount, 0)
$g_aiArmyCompSiegeMachine[$iSiege] = 0
If IsGUICtrlHidden($hCount) = False Then GUICtrlSetState($hCount, $GUI_HIDE)
;If $NoChangeLev Then lblTotalCountSiege()
ElseIf $TempLev < 0 Then
$TempLev = $MaxLev
If IsGUICtrlHidden($hCount) Then GUICtrlSetState($hCount, $GUI_SHOW)
ElseIf $TempLev > 0 And $TempLev <= $MaxLev And IsGUICtrlHidden($hCount) Then
GUICtrlSetState($hCount, $GUI_SHOW)
EndIf

$g_aiTrainArmySiegeMachineLevel[$iSiege] = $TempLev

Local $iColor = ($TempLev = $MaxLev ? $COLOR_YELLOW : $COLOR_WHITE)
GUICtrlSetData($hLevel, $TempLev)
If GUICtrlGetBkColor($hLevel) <> $iColor Then GUICtrlSetBkColor($hLevel, $iColor)
lblTotalCountSiege()
CalCostSiege()
EndFunc

Func LevUpDownSpell($iSpellIndex, $NoChangeLev = True)
Local $MaxLev = $g_aiSpellCostPerLevel[$iSpellIndex][0]
Local $TempLev = 0
Expand Down Expand Up @@ -861,6 +926,25 @@ Func TrainTroopLevelClick()
WEnd
EndFunc ;==>TrainTroopLevelClick

Func TrainSiegeLevelClick()
If $g_bRunState = True Then Return

Local $iSiege = -1
For $i = 0 To $eSiegeMachineCount - 1
If @GUI_CtrlId = $g_ahPicTrainArmySiege[$i] Then
$iSiege = $i
ExitLoop
EndIf
Next

If $iSiege = -1 Then Return

While _IsPressed(01)
LevUpDownSiege($iSiege)
Sleep($DELAYLVUP)
lblTotalCountSiege()
WEnd
EndFunc

Func TrainSpellLevelClick()
If $g_bRunState = True Then Return
Expand Down Expand Up @@ -912,6 +996,16 @@ Func CalCostSpell()
GUICtrlSetData($g_hLblDarkCostSpell, _NumberFormat($iDarkCostSpell, True))
EndFunc ;==>CalCostSpell

Func CalCostSiege()
Local $iGoldCostSiege = 0

For $i = 0 To $eSiegeMachineCount - 1
$iGoldCostSiege += $g_aiArmyCompSiegeMachine[$i] * $g_aiSiegeMachineCostPerLevel[$i][$g_aiTrainArmySiegeMachineLevel[$i]]
NExt

GUICtrlSetData($g_hLblGoldCostSiege, _NumberFormat($iGoldCostSiege, True))
EndFunc

Func CalculTimeTo($TotalTotalTime)
Local $HourToTrain = 0
Local $MinToTrain = 0
Expand Down Expand Up @@ -942,13 +1036,20 @@ Func Removecamp()
$g_aiArmyCompSpells[$S] = 0
GUICtrlSetData($g_ahTxtTrainArmySpellCount[$S], $g_aiArmyCompSpells[$S])
Next
For $S = 0 To $eSiegeMachineCount - 1
$g_aiArmyCompSiegeMachine[$S] = 0
GUICtrlSetData($g_ahTxtTrainArmySiegeCount[$S], $g_aiArmyCompSiegeMachine[$S])
Next
GUICtrlSetData($g_hLblTotalTimeCamp, " 0s")
GUICtrlSetData($g_hLblTotalTimeSpell, " 0s")
GUICtrlSetData($g_hLblElixirCostCamp, "0")
GUICtrlSetData($g_hLblDarkCostCamp, "0")
GUICtrlSetData($g_hLblElixirCostSpell, "0")
GUICtrlSetData($g_hLblDarkCostSpell, "0")
GUICtrlSetData($g_hLblCountTotal, 0)
GUICtrlSetData($g_hLblGoldCostSiege, "0")
GUICtrlSetData($g_hLblCountTotalSiege, 0)
GUICtrlSetData($g_hLblTotalTimeSiege, " 0s")
EndFunc ;==>Removecamp

Func TrainTroopCountEdit()
Expand All @@ -961,6 +1062,16 @@ Func TrainTroopCountEdit()
Next
EndFunc ;==>TrainTroopCountEdit

Func TrainSiegeCountEdit()
For $i = 0 To $eSiegeMachineCount - 1
If @GUI_CtrlId = $g_ahTxtTrainArmySiegeCount[$i] Then
$g_aiArmyCompSiegeMachine[$i] = GUICtrlRead($g_ahTxtTrainArmySiegeCount[$i])
lblTotalCountSiege()
Return
EndIf
Next
EndFunc ;==>TrainTroopCountEdit

Func TrainSpellCountEdit()
For $i = 0 To $eSpellCount - 1
If @GUI_CtrlId = $g_ahTxtTrainArmySpellCount[$i] Then
Expand Down
Loading

0 comments on commit 28c5206

Please sign in to comment.