Skip to content

Commit

Permalink
* **V7.7.1**
Browse files Browse the repository at this point in the history
* Added MyBot.run Forum user authentication registration to bot fixing COPYCAT problems
* Added Android click mode (minitouch or WinAPI) to Bot/Android options, default is now minitouch as it's most stable
* Added REMAIN cmd in csv attack
* Added KOPLAYER 2.0.0 support
* Fixed "Troop ... is not available due to full queue"
* Fixed "Cannot find/verify 'Okay' Button in Army tab #2"
* Fixed minitouch port initialization
* Fixed attackbar troop count detection, when count is 200+
* Fixed minitouch group clicks deploy
* Fixed LeapDroid render mode detecion
* Fixed LeapDroid "device offline" problem
* Fixed SmartFarm debug errors
* Fixed hero sometime not dropped when CSV recalc not detecting hero anymore
* Fixed stopping ADB shell instance when bot stopped
* Fixed bot exeution when "Zone.Identifier" exist on exe or dll files
* Improved BB boat detection to return to home base
* Improved minitouch fixing tcp connection problems
* Improved manual clicks when bot stopped/paused and bot is docked
* Improved BlueStack/BlueStacks2 command line key to be used on any BlueStacks version
* Improved MEmu smartwait closing CoC preventing CoC unresponsiveness crash
* Improved Builder Base village measuring/zoomout
* Improved one star battle end to activate also Warden
* Improved Copycat warning
  • Loading branch information
cosote committed Mar 1, 2019
1 parent 117a53e commit 2d71167
Show file tree
Hide file tree
Showing 56 changed files with 2,155 additions and 380 deletions.
27 changes: 26 additions & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,4 +1,29 @@
* **V7.7**
* **V7.7.1**
* Added MyBot.run Forum user authentication registration to bot fixing COPYCAT problems
* Added Android click mode (minitouch or WinAPI) to Bot/Android options, default is now minitouch as it's most stable
* Added REMAIN cmd in csv attack
* Added KOPLAYER 2.0.0 support
* Fixed "Troop ... is not available due to full queue"
* Fixed "Cannot find/verify 'Okay' Button in Army tab #2"
* Fixed minitouch port initialization
* Fixed attackbar troop count detection, when count is 200+
* Fixed minitouch group clicks deploy
* Fixed LeapDroid render mode detecion
* Fixed LeapDroid "device offline" problem
* Fixed SmartFarm debug errors
* Fixed hero sometime not dropped when CSV recalc not detecting hero anymore
* Fixed stopping ADB shell instance when bot stopped
* Fixed bot exeution when "Zone.Identifier" exist on exe or dll files
* Improved BB boat detection to return to home base
* Improved minitouch fixing tcp connection problems
* Improved manual clicks when bot stopped/paused and bot is docked
* Improved BlueStack/BlueStacks2 command line key to be used on any BlueStacks version
* Improved MEmu smartwait closing CoC preventing CoC unresponsiveness crash
* Improved Builder Base village measuring/zoomout
* Improved one star battle end to activate also Warden
* Improved Copycat warning

* **V7.7**
* Added Automatic Builder Base Troop Upgrades
* Added Wall detection in CSV attack, see BoWiHe v3.2 by @Zeck for details
* Added zoomout mode under Bot/Android/Android Options
Expand Down
8 changes: 6 additions & 2 deletions COCBot/GUI/MBR GUI Design Child Bot - Android.au3
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
; ===============================================================================================================================
#include-once

Global $g_hCmbCOCDistributors = 0, $g_hCmbAndroidBackgroundMode = 0, $g_hCmbAndroidZoomoutMode = 0, $g_hCmbSuspendAndroid = 0, _
Global $g_hCmbCOCDistributors = 0, $g_hCmbAndroidBackgroundMode = 0, $g_hCmbAndroidZoomoutMode = 0, $g_hCmbSuspendAndroid = 0, $g_hChkAndroidAdbClick = 0, _
$g_hChkAndroidAdbClickDragScript = 0, $g_hBtnAndroidAdbShell = 0, $g_hBtnAndroidHome = 0, $g_hBtnAndroidBack = 0, $g_hTxtAndroidRebootHours = 0, _
$g_hChkAndroidCloseWithBot = 0, $g_hBtnAndroidEnableTouch = 0, $g_hBtnAndroidDisableTouch = 0, $g_lblHelpBot = 0

Expand All @@ -31,7 +31,7 @@ Func CreateBotAndroid()
$y += $h + 5
$y2 = $y
$w = $g_iSizeWGrpTab2 - 2
$h = 21 + 5 * 25
$h = 21 + 6 * 25
GUICtrlCreateGroup(GetTranslatedFileIni("Android", "Android_Options", "Android Options"), $x - 20, $y - 20, $w, $h)
GUICtrlCreateLabel(GetTranslatedFileIni("Android", "LblBackgroundMode", "Screencapture Background Mode"), $x - 8, $y + 5, 180, 22, $SS_RIGHT)
$g_hCmbAndroidBackgroundMode = GUICtrlCreateCombo("", $x - 8 + 180 + 5, $y, 200, -1, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL))
Expand All @@ -46,6 +46,10 @@ Func CreateBotAndroid()
_GUICtrlSetTip(-1, GetTranslatedFileIni("Android", "CmbZoomoutMode_Info", 'Control how the zoomout is done. Default chooses usually Minitouch script, which is most stable.'))
_GUICtrlComboBox_SetCurSel(-1, $g_iAndroidZoomoutMode)
GUICtrlSetOnEvent(-1, "cmbAndroidBackgroundMode")
$y += 25
$g_hChkAndroidAdbClick = GUICtrlCreateCheckbox(GetTranslatedFileIni("Android", "ChkAdbClick", "Use minitouch for Click"), $x, $y, -1, -1)
_GUICtrlSetTip(-1, GetTranslatedFileIni("Android", "ChkAdbClick_Info", "Use minitouch for Android clicks.\r\nIf unchecked use WinAPI control messages."))
GUICtrlSetState(-1, (($g_bAndroidAdbClickEnabled) ? ($GUI_CHECKED) : ($GUI_UNCHECKED)))
$y += 25
$g_hChkAndroidAdbClickDragScript = GUICtrlCreateCheckbox(GetTranslatedFileIni("Android", "ChkAdbClickDragScript", "Use minitouch for accurate Click && Drag"), $x, $y, -1, -1)
_GUICtrlSetTip(-1, GetTranslatedFileIni("Android", "ChkAdbClickDragScript_Info", "Use minitouch for accurate Click & Drag.\r\nIf unchecked use more compatible 'input swipe' or WinAPI."))
Expand Down
53 changes: 32 additions & 21 deletions COCBot/GUI/MBR GUI Design Splash.au3
Original file line number Diff line number Diff line change
Expand Up @@ -29,33 +29,38 @@ Func CreateSplashScreen($iSteps = Default)

Local $iGuiState = @SW_SHOWNOACTIVATE
Local $bDisableSplash = $g_bDisableSplash
Local $bCustomWindow = IsString($iSteps)

If $iSteps = Default Then
$g_iSplashTotalSteps = 10
Else
$iGuiState = @SW_SHOW
$bDisableSplash = False
$g_iSplashTotalSteps = $iSteps
$g_iSplashCurrentStep = 0
$g_hSplashTimer = 0
If Not $bCustomWindow Then
$g_iSplashTotalSteps = $iSteps
$g_iSplashCurrentStep = 0
$g_hSplashTimer = 0
EndIf
EndIf

Local $sSplashImg = $g_sLogoPath
Local $hImage, $iX, $iY
Local $iT = 20 ; Top of logo (additional space)
Local $iB = 10 ; Bottom of logo (additional space)

Switch $g_iGuiMode ; in Mini GIU or GUI less mode we have less steps
Case 0 ; No GUI
$g_iSplashTotalSteps = 3
Case 2 ; Mini GUI
$g_iSplashTotalSteps = 4
EndSwitch
If Not $bCustomWindow Then
Switch $g_iGuiMode ; in Mini GIU or GUI less mode we have less steps
Case 0 ; No GUI
$g_iSplashTotalSteps = 3
Case 2 ; Mini GUI
$g_iSplashTotalSteps = 4
EndSwitch

; Launch only one bot at a time... it simply consumes too much CPU
$g_hSplashMutex = AcquireMutexTicket("Launching", 1, Default, False)
; Launch only one bot at a time... it simply consumes too much CPU
$g_hSplashMutex = AcquireMutexTicket("Launching", 1, Default, False)
EndIf

If $bDisableSplash = False Then
If $bDisableSplash = False Or $bCustomWindow Then

Local $hSplashImg = _GDIPlus_BitmapCreateFromFile($sSplashImg)
; Determine dimensions of splash image
Expand All @@ -73,25 +78,31 @@ Func CreateSplashScreen($iSteps = Default)
Local $iLeft = $iCenterX - $iX / 2 ; position splash UI centered on width

; Create Splash container
$g_hSplash = GUICreate("", $iX, $iHeight, $iLeft, $iTop, BitOR($WS_POPUP, $WS_BORDER), BitOR($WS_EX_TOPMOST, $WS_EX_WINDOWEDGE, $WS_EX_TOOLWINDOW))
$g_hSplash = GUICreate("", $iX, $iHeight, $iLeft, $iTop, BitOR($WS_POPUP, $WS_BORDER, $DS_MODALFRAME), BitOR($WS_EX_TOPMOST, $WS_EX_WINDOWEDGE, $WS_EX_TOOLWINDOW))
GUISetBkColor($COLOR_WHITE, $g_hSplash)
$g_lSplashPic = _GUICtrlCreatePic($hSplashImg, 0, $iT) ; Splash Image
GUICtrlSetOnEvent(-1, "MoveSplashScreen")
$g_lSplashTitle = GUICtrlCreateLabel($g_sBotTitle, 15, $iY + $iT + $iB + 3, $iX - 30, 15, $SS_CENTER) ; Splash Title
GUICtrlSetOnEvent(-1, "MoveSplashScreen")
$g_hSplashProgress = GUICtrlCreateProgress(15, $iY + $iT + $iB + 20, $iX - 30, 10, $PBS_SMOOTH, BitOR($WS_EX_TOPMOST, $WS_EX_WINDOWEDGE, $WS_EX_TOOLWINDOW)) ; Splash Progress
$g_lSplashStatus = GUICtrlCreateLabel(GetTranslatedFileIni("MBR GUI Design - Loading", "SplashStep_Loading", "Loading..."), 15, $iY + $iT + $iB + 38, $iX - 30, 15, $SS_CENTER) ; Splash Title
If Not $bCustomWindow Then
$g_lSplashTitle = GUICtrlCreateLabel($g_sBotTitle, 15, $iY + $iT + $iB + 3, $iX - 30, 15, $SS_CENTER) ; Splash Title
GUICtrlSetOnEvent(-1, "MoveSplashScreen")
$g_hSplashProgress = GUICtrlCreateProgress(15, $iY + $iT + $iB + 20, $iX - 30, 10, $PBS_SMOOTH, BitOR($WS_EX_TOPMOST, $WS_EX_WINDOWEDGE, $WS_EX_TOOLWINDOW)) ; Splash Progress
$g_lSplashStatus = GUICtrlCreateLabel(GetTranslatedFileIni("MBR GUI Design - Loading", "SplashStep_Loading", "Loading..."), 15, $iY + $iT + $iB + 38, $iX - 30, 15, $SS_CENTER) ; Splash Title
EndIf
GUICtrlSetOnEvent(-1, "MoveSplashScreen")

; Cleanup GDI resources
_GDIPlus_BitmapDispose($hSplashImg)

; Show Splash
GUISetState($iGuiState, $g_hSplash)

If $g_bDebugSetlog Then SetDebugLog("Splash created: $g_hSplash=" & $g_hSplash & ", $g_lSplashPic=" & $g_lSplashPic & ", $g_lSplashTitle=" & $g_lSplashTitle & ", $g_hSplashProgress=" & $g_hSplashProgress & ", $g_lSplashStatus=" & $g_lSplashStatus)

$g_hSplashTimer = __TimerInit()
If Not $bCustomWindow Then
; Show Splash
GUISetState($iGuiState, $g_hSplash)
$g_hSplashTimer = __TimerInit()
EndIf

Local $a = [$iX, $iHeight, $iY + $iT + $iB]
Return $a
EndIf

EndFunc ;==>CreateSplashScreen
Expand Down
3 changes: 3 additions & 0 deletions COCBot/MBR Functions.au3
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
#include "functions\Other\StopWatch.au3"
;#include "functions\Other\Synchronization.au3" ; now included in LaunchConsole.au3
#include "functions\Other\OnAutoItErrorRegisterBot.au3"
#Include "functions\Other\Json.au3"


#include "functions\Attack\AttackReport.au3"
#include "functions\Attack\AttackStats.au3"
Expand Down Expand Up @@ -297,6 +299,7 @@

#include "functions\Other\Api.au3"
#include "functions\Other\ApiClient.au3"
#include "functions\Other\ForumAuthentication.au3"

; moved to the end to avoid any global declare issues
#include "functions\Config\profileFunctions.au3"
Expand Down
4 changes: 3 additions & 1 deletion COCBot/MBR GUI Action.au3
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,9 @@ Func BotStop()

;DistributorsUpdateGUI()
AndroidBotStopEvent() ; signal android that bot is now stopping
AndroidAdbTerminateShellInstance() ; terminate shell instance
If $g_bTerminateAdbShellOnStop Then
AndroidAdbTerminateShellInstance() ; terminate shell instance
EndIf
AndroidShield("btnStop", Default)

EnableControls($g_hFrmBotBottom, Default, $g_aFrmBotBottomCtrlState)
Expand Down
22 changes: 21 additions & 1 deletion COCBot/MBR GUI Control.au3
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,27 @@ Func GUIControl_WM_MOUSE($hWin, $iMsg, $wParam, $lParam)
SetCriticalMessageProcessing($wasCritical)
Return $GUI_RUNDEFMSG
EndIf
If $iMsg <> $WM_MOUSEMOVE Or $g_iAndroidEmbedMode <> 0 Then

Local $bMinitouch = True
If $bMinitouch Then
Static $s_x, $s_y
Local $iBytesSent = 0
Switch $iMsg
Case $WM_MOUSEMOVE
If $s_x <> $x Or $s_y <> $y Then
$iBytesSent = Minitouch($x, $y, 0)
EndIf
Case $WM_LBUTTONDOWN
$iBytesSent = Minitouch($x, $y, 1)
Case $WM_LBUTTONUP
$iBytesSent = Minitouch($x, $y, 2)
EndSwitch
$bMinitouch = ($iBytesSent > 0)
$s_x = $x
$s_y = $y
EndIf

If Not $bMinitouch And ($iMsg <> $WM_MOUSEMOVE Or $g_iAndroidEmbedMode <> 0) Then
; not all message got thru here, so disabled
;$x += $g_aiMouseOffset[0]
;$y += $g_aiMouseOffset[1]
Expand Down
7 changes: 5 additions & 2 deletions COCBot/MBR Global Variables.au3
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <APIErrorsConstants.au3>
#include <WindowsConstants.au3>
#include <WinAPI.au3>
#include <WinAPIFiles.au3>
#include <WinAPISys.au3>
#include <Process.au3>
#include <Math.au3> ; Added for Weak Base
Expand Down Expand Up @@ -223,14 +224,15 @@ Global $g_bAndroidAdbZoomoutEnabled = True ; Use Android ADB zoom-out script
Global $g_bAndroidAdbClickDragEnabled = True ; Use Android ADB click drag script or input swipe
Global $g_bAndroidAdbInputEnabled = True ; Enable Android ADB send text (CC requests), swipe not used as click drag anymore
Global $g_iAndroidAdbInputWordsCharLimit = 10 ; Android ADB send text words (split by space) with this limit of specified characters per command (0 = disabled and entire text is sent at once)
Global $g_bAndroidAdbClickEnabled = False ; Enable Android ADB mouse click
Global $g_bAndroidAdbClickEnabled = True ; Enable Android ADB mouse click
Global $g_bAndroidAdbClicksEnabled = False ; (Experimental & Dangerous!) Enable Android KeepClicks() and ReleaseClicks() to fire collected clicks all at once, only available when also $g_bAndroidAdbClick = True
Global $g_iAndroidAdbClicksTroopDeploySize = 0 ; (Experimental & Dangerous!) Deploy more troops at once, 0 = deploy group, only available when also $g_bAndroidAdbClicksEnabled = True (currently only just in CSV Deploy)
Global $g_bAndroidAdbInstanceEnabled = True ; Enable Android steady ADB shell instance when available
Global $g_bAndroidSuspendedEnabled = True ; Enable Android Suspend & Resume during Search and Attack
Global $g_iAndroidSuspendModeFlags = 1 ; Android Suspend & Resume mode bit flags: 0=Disabled, 1=Only during Search/Attack, 2=For every ImgLoc call, 4=Suspend entire Android (not advised!)
Global $g_bNoFocusTampering = False ; If enabled, no ControlFocus or WinActivate is called, except when really required (like Zoom-Out for Droid4X, might break restart stability when Android Window not responding)
Global $g_iAndroidRecoverStrategy = 1 ; 0 = Stop ADB Daemon first then restart Android; 1 = Restart Android first then restart ADB Daemon
Global $g_bTerminateAdbShellOnStop = False

; "BlueStacks2" $g_avAndroidAppConfig is also updated based on Registry settings in Func InitBlueStacks2() with these special variables
Global $__BlueStacks_SystemBar = 48
Expand Down Expand Up @@ -435,7 +437,8 @@ Global $g_iThreads = 0 ; Used by ImgLoc for parallism (for this bot instance), 0

; Profile file/folder paths
Global $g_sProfilePath = @ScriptDir & "\Profiles"
Global $g_sPrivateProfilePath = @MyDocumentsDir & "\MyBot.run-Profiles" ; Used to save private & very sensitive profile information like shared_prefs (notification tokens will be saved in future here also)
Global Const $g_sPrivateProfilePath = @MyDocumentsDir & "\MyBot.run-Profiles" ; Used to save private & very sensitive profile information like shared_prefs (notification tokens will be saved in future here also)
Global Const $g_sPrivateAuthenticationFile = @MyDocumentsDir & "\MyBot.run-Profiles\.mybot.run.authentication"
Global Const $g_sProfilePresetPath = @ScriptDir & "\Strategies"
Global $g_sProfileCurrentName = "" ; Name of profile currently being used
Global $g_sProfileConfigPath = "" ; Path to the current config.ini being used in this profile
Expand Down
6 changes: 4 additions & 2 deletions COCBot/functions/Android/Android Status & Information.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,16 @@ MyBot Command Line Key (2.x/3.x): BlueStacks2
Default Instance Key: Android
Second Instance Key (only for BlueStacks 3.x): Android_1

Known issues/bugs: True Background mode using ADB not available for older versions (no ADB screencap & no ADB mouse click).
Known issues/bugs: True Background mode using ADB not available for older versions.
Older versions might not install the right Clash of Clans APK: "CPU ABI incompatible" error in Play Store.
In that case just install the latest arm-v7a version from apkmirror.com: https://www.apkmirror.com/wp-content/themes/APKMirror/download.php?id=599517
ADB connection for BlueStacks2 can require one-time ADB daemon restart (initiated automatically by bot).
ADB connection does interfere with LeapDroid default instance when running at the same time, review LeapDroid section to change ADB port.

KOPLAYER
========
http://www.koplayer.com/
Versions 1.4.1055, 1.4.1049
Versions 2.0.0, 1.4.1055, 1.4.1049
MyBot Command Line Key: KOPLAYER
Default Instance Key: KOPLAYER
Second Instance Key: KOPLAYER_1
Expand Down
Loading

0 comments on commit 2d71167

Please sign in to comment.