diff --git a/BrokenBot.au3 b/BrokenBot.au3 index 151d104..907d6c9 100644 --- a/BrokenBot.au3 +++ b/BrokenBot.au3 @@ -1,119 +1,119 @@ -#RequireAdmin -#AutoIt3Wrapper_UseX64=n -#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, 3.1.0) -#pragma compile(FileVersion, 3.1.0) - -#include - -$sBotVersion = "3.1.0" -$sBotTitle = "BrokenBot.org - Break FREE - v" & $sBotVersion - -If FileExists(@ScriptDir & "\.developer") Then - $sBotTitle = "BrokenBot.org - In Development" -EndIf - -Global $StartupLanguage = IniRead(@ScriptDir & "\config\default.ini", "config", "language", "English") - -If _Singleton($sBotTitle, 1) = 0 Then - MsgBox(0, "", GetLangText("boxAlreadyRunning")) - Exit -EndIf - -If @AutoItX64 = 1 Then - MsgBox(0, "", GetLangText("boxCompile1") & @CRLF & GetLangText("boxCompile2")) - Exit -EndIf - -If Not FileExists(@ScriptDir & "\License.txt") Then - $license = InetGet("http://www.gnu.org/licenses/gpl-3.0.txt", @ScriptDir & "\License.txt") - InetClose($license) -EndIf - -#include "COCBot\Global Variables.au3" -#include "COCBot\GUI Design.au3" -#include "COCBot\Functions.au3" -#include "BrokenBot.org\functions\functions.au3" -#include "COCBot\GUI Control.au3" -#include-once - -; Event registration -GUIRegisterMsg($WM_COMMAND, "GUIControl") -GUIRegisterMsg($WM_SYSCOMMAND, "GUIControl") -GUIRegisterMsg(0x0003, "_WinMoved") - -; Initialize everything -DirCreate($dirLogs) -DirCreate($dirLoots) -DirCreate($dirAllTowns) -DirCreate($dirDebug) -DirCreate($dirAttack) -DirCreate($dirConfigs) -DirCreate($dirStrat) -readConfig() -applyConfig() -checkupdate() -_PluginDefaults() -_btnRefresh() -_GUICtrlListBox_SetCurSel($lstStrategies, 0) -_lstStrategies() - -HotKeySet("^!+p", "_ScreenShot") - -$sTimer = TimerInit() -AdlibRegister("SetTime", 1000) - -Local $StartImmediately = False -If IsArray($CmdLine) Then - If $CmdLine[0] = 1 Then $StartImmediately = True - If $CmdLine[0] = 2 Then - ; Add option to start with specific profile - EndIf -EndIf - -$hHBitmap = _ScreenCapture_Capture("", 0, 0, 860, 720) -$ret = DllCall(@ScriptDir & "\BrokenBot.org\BrokenBot32.dll", "str", "BrokenBotRedLineCheck", "ptr", $hHBitmap, "int", 1, "int", 1, "int", 0, "int", 0, "int", 0) -_WinAPI_DeleteObject($hHBitmap) -If Not IsArray($ret) Then - If MsgBox($MB_ICONWARNING + $MB_OKCANCEL, GetLangText("msgMissing"), GetLangText("msgMissing1") & @CRLF & @CRLF & GetLangText("msgMissing2") & @CRLF & @CRLF & GetLangText("msgMissing3") & " " & GetLangText("msgMissing4") & " " & GetLangText("msgMissing5") & @CRLF & @CRLF & GetLangText("msgMissing6")) = $IDOK Then - ShellExecute("https://www.microsoft.com/en-us/download/details.aspx?id=40784") - DllClose($KernelDLL) - _GDIPlus_Shutdown() - _Crypt_Shutdown() - _GUICtrlRichEdit_Destroy($txtLog) - Exit - EndIf -ElseIf $ret[0] = -2 Then - MsgBox(48, "BrokenBot.org", GetLangText("msgLicense") & @CRLF & @CRLF & "Please visit BrokenBot.org") -EndIf - -If IniRead(@LocalAppDataDir & "\BrokenBot.org.ini", "default", "1", "") = "" Or IniRead(@LocalAppDataDir & "\BrokenBot.org.ini", "default", "2", "") = "" Then - GUICtrlSetImage($btnBBValidate, @ScriptDir & "\images\Resource\bad.bmp") - GUICtrlSetTip($btnBBValidate, GetLangText("tipBBValidBad")) -Else - GUICtrlSetData($inpBBPassword, _Decrypt(IniRead(@LocalAppDataDir & "\BrokenBot.org.ini", "default", "2", ""))) - _btnBBValidate() - GUICtrlSetData($inpBBPassword, "") -EndIf - -;Only enable button start after all Initiation done. -GUICtrlSetData($btnStart, GetLangText("btnStart")) -GUICtrlSetState($btnStart, $GUI_ENABLE) -While 1 - If $StartImmediately Then - $StartImmediately = False - btnStart() - EndIf - Switch TrayGetMsg() - Case $tiAbout - MsgBox(64 + $MB_APPLMODAL + $MB_TOPMOST, $sBotTitle, "Clash of Clans Bot" & @CRLF & @CRLF & _ - "Version: " & $sBotVersion & @CRLF & _ - "Released under the GNU GPLv3 license.", 0, $frmBot) - Case $tiExit - SetLog(GetLangText("msgExit"), $COLOR_ORANGE) - ExitLoop - EndSwitch - Sleep(50) -WEnd +#RequireAdmin +#AutoIt3Wrapper_UseX64=n +#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, 3.2.0) +#pragma compile(FileVersion, 3.2.0) + +#include + +$sBotVersion = "3.2.0" +$sBotTitle = "BrokenBot.org - Break FREE - v" & $sBotVersion + +If FileExists(@ScriptDir & "\.developer") Then + $sBotTitle = "BrokenBot.org - In Development" +EndIf + +Global $StartupLanguage = IniRead(@ScriptDir & "\config\default.ini", "config", "language", "English") + +If _Singleton($sBotTitle, 1) = 0 Then + MsgBox(0, "", GetLangText("boxAlreadyRunning")) + Exit +EndIf + +If @AutoItX64 = 1 Then + MsgBox(0, "", GetLangText("boxCompile1") & @CRLF & GetLangText("boxCompile2")) + Exit +EndIf + +If Not FileExists(@ScriptDir & "\License.txt") Then + $license = InetGet("http://www.gnu.org/licenses/gpl-3.0.txt", @ScriptDir & "\License.txt") + InetClose($license) +EndIf + +#include "COCBot\Global Variables.au3" +#include "COCBot\GUI Design.au3" +#include "COCBot\Functions.au3" +#include "BrokenBot.org\functions\functions.au3" +#include "COCBot\GUI Control.au3" +#include-once + +; Event registration +GUIRegisterMsg($WM_COMMAND, "GUIControl") +GUIRegisterMsg($WM_SYSCOMMAND, "GUIControl") +GUIRegisterMsg(0x0003, "_WinMoved") + +; Initialize everything +DirCreate($dirLogs) +DirCreate($dirLoots) +DirCreate($dirAllTowns) +DirCreate($dirDebug) +DirCreate($dirAttack) +DirCreate($dirConfigs) +DirCreate($dirStrat) +readConfig() +applyConfig() +checkupdate() +_PluginDefaults() +_btnRefresh() +_GUICtrlListBox_SetCurSel($lstStrategies, 0) +_lstStrategies() + +HotKeySet("^!+p", "_ScreenShot") + +$sTimer = TimerInit() +AdlibRegister("SetTime", 1000) + +Local $StartImmediately = False +If IsArray($CmdLine) Then + If $CmdLine[0] = 1 Then $StartImmediately = True + If $CmdLine[0] = 2 Then + ; Add option to start with specific profile + EndIf +EndIf + +$hHBitmap = _ScreenCapture_Capture("", 0, 0, 860, 720) +$ret = DllCall(@ScriptDir & "\BrokenBot.org\BrokenBot32.dll", "str", "BrokenBotRedLineCheck", "ptr", $hHBitmap, "int", 1, "int", 1, "int", 0, "int", 0, "int", 0) +_WinAPI_DeleteObject($hHBitmap) +If Not IsArray($ret) Then + If MsgBox($MB_ICONWARNING + $MB_OKCANCEL, GetLangText("msgMissing"), GetLangText("msgMissing1") & @CRLF & @CRLF & GetLangText("msgMissing2") & @CRLF & @CRLF & GetLangText("msgMissing3") & " " & GetLangText("msgMissing4") & " " & GetLangText("msgMissing5") & @CRLF & @CRLF & GetLangText("msgMissing6")) = $IDOK Then + ShellExecute("https://www.microsoft.com/en-us/download/details.aspx?id=40784") + DllClose($KernelDLL) + _GDIPlus_Shutdown() + _Crypt_Shutdown() + _GUICtrlRichEdit_Destroy($txtLog) + Exit + EndIf +ElseIf $ret[0] = -2 Then + MsgBox(48, "BrokenBot.org", GetLangText("msgLicense") & @CRLF & @CRLF & "Please visit BrokenBot.org") +EndIf + +If IniRead(@LocalAppDataDir & "\BrokenBot.org.ini", "default", "1", "") = "" Or IniRead(@LocalAppDataDir & "\BrokenBot.org.ini", "default", "2", "") = "" Then + GUICtrlSetImage($btnBBValidate, @ScriptDir & "\images\Resource\bad.bmp") + GUICtrlSetTip($btnBBValidate, GetLangText("tipBBValidBad")) +Else + GUICtrlSetData($inpBBPassword, _Decrypt(IniRead(@LocalAppDataDir & "\BrokenBot.org.ini", "default", "2", ""))) + _btnBBValidate() + GUICtrlSetData($inpBBPassword, "") +EndIf + +;Only enable button start after all Initiation done. +GUICtrlSetData($btnStart, GetLangText("btnStart")) +GUICtrlSetState($btnStart, $GUI_ENABLE) +While 1 + If $StartImmediately Then + $StartImmediately = False + btnStart() + EndIf + Switch TrayGetMsg() + Case $tiAbout + MsgBox(64 + $MB_APPLMODAL + $MB_TOPMOST, $sBotTitle, "Clash of Clans Bot" & @CRLF & @CRLF & _ + "Version: " & $sBotVersion & @CRLF & _ + "Released under the GNU GPLv3 license.", 0, $frmBot) + Case $tiExit + SetLog(GetLangText("msgExit"), $COLOR_ORANGE) + ExitLoop + EndSwitch + Sleep(50) +WEnd diff --git a/BrokenBot.exe b/BrokenBot.exe index ef2086d..080561e 100644 Binary files a/BrokenBot.exe and b/BrokenBot.exe differ diff --git a/BrokenBot.org/BrokenBot32.dll b/BrokenBot.org/BrokenBot32.dll index af0608e..b56b275 100644 Binary files a/BrokenBot.org/BrokenBot32.dll and b/BrokenBot.org/BrokenBot32.dll differ diff --git a/BrokenBot.org/BrokenBotHelper.au3 b/BrokenBot.org/BrokenBotHelper.au3 new file mode 100755 index 0000000..bc307d5 --- /dev/null +++ b/BrokenBot.org/BrokenBotHelper.au3 @@ -0,0 +1,97 @@ +; This code was created for public use by BrokenBot.org and falls under the GPLv3 license. +; This code can be incorporated into open source/non-profit projects free of charge and without consent. +; **NOT FOR COMMERCIAL USE** by any project which includes any part of the code in this sub-directory without express written consent of BrokenBot.org +; You **MAY NOT SOLICIT DONATIONS** from any project which includes any part of the code in this sub-directory without express written consent of BrokenBot.org +; +; External script that can run necessary image detection functions asynchronously from main autoit code. + +; Passed to function: Pointer to BB, pointer to return variable, Background mode, Left, Top, Right, Bottom, Function, ID, MaxNum, Mask, SpeedBoost +#NoTrayIcon + +#include +#include +#include + + +$Title = "BlueStacks App Player" +$HWnD = WinGetHandle($Title) +Dim $BSpos[2] + +_GDIPlus_Startup() + +$BackgroundMode = Number($CmdLine[2]) +$iLeft = Number($CmdLine[3]) +$iTop = Number($CmdLine[4]) +$iRight = Number($CmdLine[5]) +$iBottom = Number($CmdLine[6]) + +If $BackgroundMode = 1 Then + $iW = Number($iRight) - Number($iLeft) + $iH = Number($iBottom) - Number($iTop) + $hDC_Capture = _WinAPI_GetWindowDC(ControlGetHandle($Title, "", "[CLASS:BlueStacksApp; INSTANCE:1]")) + $hMemDC = _WinAPI_CreateCompatibleDC($hDC_Capture) + $hHBitmap = _WinAPI_CreateCompatibleBitmap($hDC_Capture, $iW, $iH) + $hObjectOld = _WinAPI_SelectObject($hMemDC, $hHBitmap) + DllCall("user32.dll", "int", "PrintWindow", "hwnd", $HWnD, "handle", $hMemDC, "int", 0) + _WinAPI_SelectObject($hMemDC, $hHBitmap) + _WinAPI_BitBlt($hMemDC, 0, 0, $iW, $iH, $hDC_Capture, $iLeft, $iTop, 0x00CC0020) + $hBitmap = _GDIPlus_BitmapCreateFromHBITMAP($hHBitmap) + _WinAPI_DeleteDC($hMemDC) + _WinAPI_SelectObject($hMemDC, $hObjectOld) + _WinAPI_ReleaseDC($HWnD, $hDC_Capture) +Else + $aPos = ControlGetPos($Title, "", "[CLASS:BlueStacksApp; INSTANCE:1]") + $tPoint = DllStructCreate("int X;int Y") + DllStructSetData($tPoint, "X", $aPos[0]) + DllStructSetData($tPoint, "Y", $aPos[1]) + _WinAPI_ClientToScreen(WinGetHandle(WinGetTitle($Title)), $tPoint) + $BSpos[0] = DllStructGetData($tPoint, "X") + $BSpos[1] = DllStructGetData($tPoint, "Y") + $hHBitmap = _ScreenCapture_Capture("", $iLeft + $BSpos[0], $iTop + $BSpos[1], $iRight + $BSpos[0], $iBottom + $BSpos[1]) + $hBitmap = _GDIPlus_BitmapCreateFromHBITMAP($hHBitmap) +EndIf + +If $CmdLine[1] = 1 Then + $mH = $CmdLine[8] + $mS = $CmdLine[9] + $ci = $CmdLine[10] + $cl = $CmdLine[11] + $cr = $CmdLine[12] + $hCheckHBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap) + $res = DllCall(@ScriptDir & "\BrokenBot32.dll", "str", "BrokenBotRedLineCheck", "ptr", $hCheckHBitmap, "int", $mH, "int", $mS, "int", $ci, "int", $cl, "int", $cr) +ElseIf $CmdLine[1] = 2 Then + $x = $CmdLine[8] + $y = $CmdLine[9] + $width = $CmdLine[10] + $height = $CmdLine[11] + $type = $CmdLine[12] + $leftaligned = $CmdLine[13] + $reversed = $CmdLine[14] + $hClone = _GDIPlus_BitmapCloneArea($hBitmap, $x, $y, $width, $height, _GDIPlus_ImageGetPixelFormat($hBitmap)) + $hCheckHBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hClone) + $res = DllCall(@ScriptDir & "\BrokenBot32.dll", "str", "BrokenBotReadText", "ptr", $hCheckHBitmap, "int", $type, "int", $leftaligned, "int", $reversed) +ElseIf $CmdLine[1] = 3 Then + $Function = $CmdLine[7] + $ID = $CmdLine[8] + $MaxNum = $CmdLine[9] + $Mask = $CmdLine[10] + $SpeedBoost = $CmdLine[11] + + $hCheckHBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap) + $res = DllCall(@ScriptDir & "\BrokenBot32.dll", "str", $Function, "ptr", $hCheckHBitmap, "int", number($ID), "int", 3, "int", number($MaxNum), "int", number($Mask), "int", number($SpeedBoost)) +EndIf + +_WinAPI_DeleteObject($hCheckHBitmap) +If IsArray($res) Then + RegWrite("HKEY_CURRENT_USER\Software\BrokenBot", "Transfer", "REG_SZ", $res[0]) +Else + RegWrite("HKEY_CURRENT_USER\Software\BrokenBot", "Transfer", "REG_SZ", "-4") +EndIf + +_WinAPI_DeleteObject($hHBitmap) +_GDIPlus_BitmapDispose($hBitmap) + +_GDIPlus_Shutdown() + +Exit + diff --git a/BrokenBot.org/BrokenBotHelper.exe b/BrokenBot.org/BrokenBotHelper.exe new file mode 100755 index 0000000..31ff43e Binary files /dev/null and b/BrokenBot.org/BrokenBotHelper.exe differ diff --git a/BrokenBot.org/License.txt b/BrokenBot.org/License.txt index a541a26..8a856a3 100644 --- a/BrokenBot.org/License.txt +++ b/BrokenBot.org/License.txt @@ -1,9 +1,26 @@ -License -ANY and ALL code included (recursively) in this sub-directory of the project is Under GPLv3 with the following modification: - -- This code was created for public use by BrokenBot.org and falls under the GPLv3 license. -- This code can be incorporated into open source/non-profit projects free of charge and without consent. -- **NOT FOR COMMERCIAL USE** by any project which includes any part of the code in this sub-directory without express written consent of BrokenBot.org -- You **MAY NOT SOLICIT DONATIONS** from any project which includes any part of the code in this sub-directory without express written consent of BrokenBot.org - -- This license may not be modified by anyone other than BrokenBot.org \ No newline at end of file +License +ANY and ALL code included (recursively) in this sub-directory of the project is Under GPLv3 with the following modification: + +- This code was created for public use by BrokenBot.org and falls under the GPLv3 license. +- This code can be incorporated into open source/non-profit projects free of charge and without consent. +- **NOT FOR COMMERCIAL USE** by any project which includes any part of the code in this sub-directory without express written consent of BrokenBot.org +- You **MAY NOT SOLICIT DONATIONS** from any project which includes any part of the code in this sub-directory without express written consent of BrokenBot.org + +- This license may not be modified by anyone other than BrokenBot.org + + +----------------------------------------------------------------------------------------- +This project utilizes the Open Source Computer Vision Library, Copyright 2015 Itseez + +By downloading, copying, installing or using the software you agree to this license. +If you do not agree to this license, do not download, install, copy or use the software. + +License Agreement +For Open Source Computer Vision Library +(3-clause BSD License) +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: +Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. +Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. +Neither the names of the copyright holders nor the names of the contributors may be used to endorse or promote products derived from this software without specific prior written permission. +This software is provided by the copyright holders and contributors “as is” and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall copyright holders or contributors be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of +the use of this software, even if advised of the possibility of such damage. \ No newline at end of file diff --git a/BrokenBot.org/README.md b/BrokenBot.org/README.md index 3ca9e28..7cdcb1f 100644 --- a/BrokenBot.org/README.md +++ b/BrokenBot.org/README.md @@ -1,28 +1,28 @@ -## BrokenBot.org - Clash of Clans Bot - -### Community -Forums available for discussion at: http://BrokenBot.org - -### Reference -For your convenience, and referring to pushbullet's document: -https://docs.pushbullet.com/ - -### BrokenBot.org Contributors -- codebroken - Filipino -- cool7su - AutoIt Development -- maxcom - AutoIt Development, Web Presence -- msh2050 - AutoIt Development -- usabug - AutoIt Development -- cmestres - AutoIt Development -- samkhowaja - Graphic Design - -### License -ANY and ALL code included (recursively) in this sub-directory of the project is Under GPLv3 with the following modification: - -- This code was created for public use by BrokenBot.org and falls under the GPLv3 license. -- This code can be incorporated into open source/non-profit projects free of charge and without consent. -- **NOT FOR COMMERCIAL USE** by any project which includes any part of the code in this sub-directory without express written consent of BrokenBot.org -- You **MAY NOT SOLICIT DONATIONS** from any project which includes any part of the code in this sub-directory without express written consent of BrokenBot.org - ----------- -Clash of Clans is a Registered Trademark of SuperCell. This project is not affiliated with SuperCell or any of its affiliates in any way. Project is available without warranty express or implied. +## BrokenBot.org - Clash of Clans Bot + +### Community +Forums available for discussion at: http://BrokenBot.org + +### Reference +For your convenience, and referring to pushbullet's document: +https://docs.pushbullet.com/ + +### BrokenBot.org Contributors +- codebroken - Filipino +- cool7su - AutoIt Development +- maxcom - AutoIt Development, Web Presence +- msh2050 - AutoIt Development +- usabug - AutoIt Development +- cmestres - AutoIt Development +- samkhowaja - Graphic Design + +### License +ANY and ALL code included (recursively) in this sub-directory of the project is Under GPLv3 with the following modification: + +- This code was created for public use by BrokenBot.org and falls under the GPLv3 license. +- This code can be incorporated into open source/non-profit projects free of charge and without consent. +- **NOT FOR COMMERCIAL USE** by any project which includes any part of the code in this sub-directory without express written consent of BrokenBot.org +- You **MAY NOT SOLICIT DONATIONS** from any project which includes any part of the code in this sub-directory without express written consent of BrokenBot.org + +---------- +Clash of Clans is a Registered Trademark of SuperCell. This project is not affiliated with SuperCell or any of its affiliates in any way. Project is available without warranty express or implied. diff --git a/BrokenBot.org/functions/GUI/WindowFixing.au3 b/BrokenBot.org/functions/GUI/WindowFixing.au3 index c8238bf..eb0da49 100644 --- a/BrokenBot.org/functions/GUI/WindowFixing.au3 +++ b/BrokenBot.org/functions/GUI/WindowFixing.au3 @@ -1,20 +1,20 @@ -; This code was created for public use by BrokenBot.org and falls under the GPLv3 license. -; This code can be incorporated into open source/non-profit projects free of charge and without consent. -; **NOT FOR COMMERCIAL USE** by any project which includes any part of the code in this sub-directory without express written consent of BrokenBot.org -; You **MAY NOT SOLICIT DONATIONS** from any project which includes any part of the code in this sub-directory without express written consent of BrokenBot.org -; -Func _WinMoved($hWndGUI, $MsgID, $WParam, $LParam) - $curWinLoc = WinGetPos($frmBot) - If ($curWinLoc[0] + 208) < (@DesktopWidth / 2) Then - ; On left side of screen - WinMove($frmAttackConfig, "", $curWinLoc[0] + 426, $curWinLoc[1], 435, $curWinLoc[3]) - $slideOut = 0x00040001 - $slideIn = 0x00050002 - Else - ; On right side of screen - WinMove($frmAttackConfig, "", $curWinLoc[0] - 439, $curWinLoc[1], 435, $curWinLoc[3]) - $slideOut = 0x00040002 - $slideIn = 0x00050001 - EndIf -EndFunc ;==>_WinMoved - +; This code was created for public use by BrokenBot.org and falls under the GPLv3 license. +; This code can be incorporated into open source/non-profit projects free of charge and without consent. +; **NOT FOR COMMERCIAL USE** by any project which includes any part of the code in this sub-directory without express written consent of BrokenBot.org +; You **MAY NOT SOLICIT DONATIONS** from any project which includes any part of the code in this sub-directory without express written consent of BrokenBot.org +; +Func _WinMoved($hWndGUI, $MsgID, $WParam, $LParam) + $curWinLoc = WinGetPos($frmBot) + If ($curWinLoc[0] + 208) < (@DesktopWidth / 2) Then + ; On left side of screen + WinMove($frmAttackConfig, "", $curWinLoc[0] + 426, $curWinLoc[1], 435, $curWinLoc[3]) + $slideOut = 0x00040001 + $slideIn = 0x00050002 + Else + ; On right side of screen + WinMove($frmAttackConfig, "", $curWinLoc[0] - 439, $curWinLoc[1], 435, $curWinLoc[3]) + $slideOut = 0x00040002 + $slideIn = 0x00050001 + EndIf +EndFunc ;==>_WinMoved + diff --git a/BrokenBot.org/functions/GUI/frmAttackConfig.au3 b/BrokenBot.org/functions/GUI/frmAttackConfig.au3 index acffb3d..4f1f57f 100644 --- a/BrokenBot.org/functions/GUI/frmAttackConfig.au3 +++ b/BrokenBot.org/functions/GUI/frmAttackConfig.au3 @@ -1,7 +1,7 @@ -; This code was created for public use by BrokenBot.org and falls under the GPLv3 license. -; This code can be incorporated into open source/non-profit projects free of charge and without consent. -; **NOT FOR COMMERCIAL USE** by any project which includes any part of the code in this sub-directory without express written consent of BrokenBot.org -; You **MAY NOT SOLICIT DONATIONS** from any project which includes any part of the code in this sub-directory without express written consent of BrokenBot.org -; -$frmAttackConfig = GUICreate("Attack config panel", 410, 410, -1, -1, $WS_BORDER + $WS_POPUP, $WS_EX_MDICHILD, $frmBot) -GUISetState(@SW_HIDE, $frmAttackConfig) +; This code was created for public use by BrokenBot.org and falls under the GPLv3 license. +; This code can be incorporated into open source/non-profit projects free of charge and without consent. +; **NOT FOR COMMERCIAL USE** by any project which includes any part of the code in this sub-directory without express written consent of BrokenBot.org +; You **MAY NOT SOLICIT DONATIONS** from any project which includes any part of the code in this sub-directory without express written consent of BrokenBot.org +; +$frmAttackConfig = GUICreate("Attack config panel", 410, 410, -1, -1, $WS_BORDER + $WS_POPUP, $WS_EX_MDICHILD, $frmBot) +GUISetState(@SW_HIDE, $frmAttackConfig) diff --git a/BrokenBot.org/functions/GUI/frmBugReport.au3 b/BrokenBot.org/functions/GUI/frmBugReport.au3 index 3f6bcb2..0bf118a 100644 --- a/BrokenBot.org/functions/GUI/frmBugReport.au3 +++ b/BrokenBot.org/functions/GUI/frmBugReport.au3 @@ -1,14 +1,14 @@ -; This code was created for public use by BrokenBot.org and falls under the GPLv3 license. -; This code can be incorporated into open source/non-profit projects free of charge and without consent. -; **NOT FOR COMMERCIAL USE** by any project which includes any part of the code in this sub-directory without express written consent of BrokenBot.org -; You **MAY NOT SOLICIT DONATIONS** from any project which includes any part of the code in this sub-directory without express written consent of BrokenBot.org -; -$frmBugReport = GUICreate(GetLangText("frmBugReport"), 400, 500, -1, -1, $DS_MODALFRAME);, -1, $frmBot) -$lblInstructions = GUICtrlCreateLabel(GetLangText("lblInstructions"), 20, 10, 360, 135) -$lblLog = GUICtrlCreateLabel(GetLangText("lblLog"), 20, 145, 220, 18) -$inpLog = GUICtrlCreateEdit("", 20, 165, 360, 120, $WS_VSCROLL + $ES_MULTILINE + $ES_READONLY) -$lblSettings = GUICtrlCreateLabel(GetLangText("lblSettings"), 20, 290, 150, 18) -$inpSettings = GUICtrlCreateEdit("", 20, 310, 360, 120, $WS_VSCROLL + $ES_MULTILINE + $ES_READONLY) -$btnGitHub = GUICtrlCreateButton(GetLangText("btnGitHub"), 20, 440, 170, 25) -$btnCloseBR = GUICtrlCreateButton(GetLangText("btnCloseBR"), 210, 440, 170, 25) -GUISetState(@SW_HIDE, $frmBugReport) +; This code was created for public use by BrokenBot.org and falls under the GPLv3 license. +; This code can be incorporated into open source/non-profit projects free of charge and without consent. +; **NOT FOR COMMERCIAL USE** by any project which includes any part of the code in this sub-directory without express written consent of BrokenBot.org +; You **MAY NOT SOLICIT DONATIONS** from any project which includes any part of the code in this sub-directory without express written consent of BrokenBot.org +; +$frmBugReport = GUICreate(GetLangText("frmBugReport"), 400, 500, -1, -1, $DS_MODALFRAME);, -1, $frmBot) +$lblInstructions = GUICtrlCreateLabel(GetLangText("lblInstructions"), 20, 10, 360, 135) +$lblLog = GUICtrlCreateLabel(GetLangText("lblLog"), 20, 145, 220, 18) +$inpLog = GUICtrlCreateEdit("", 20, 165, 360, 120, $WS_VSCROLL + $ES_MULTILINE + $ES_READONLY) +$lblSettings = GUICtrlCreateLabel(GetLangText("lblSettings"), 20, 290, 150, 18) +$inpSettings = GUICtrlCreateEdit("", 20, 310, 360, 120, $WS_VSCROLL + $ES_MULTILINE + $ES_READONLY) +$btnGitHub = GUICtrlCreateButton(GetLangText("btnGitHub"), 20, 440, 170, 25) +$btnCloseBR = GUICtrlCreateButton(GetLangText("btnCloseBR"), 210, 440, 170, 25) +GUISetState(@SW_HIDE, $frmBugReport) diff --git a/BrokenBot.org/functions/ImageSearch/checkDarkElix.au3 b/BrokenBot.org/functions/ImageSearch/checkDarkElix.au3 index 3e8e8e1..effbb56 100644 --- a/BrokenBot.org/functions/ImageSearch/checkDarkElix.au3 +++ b/BrokenBot.org/functions/ImageSearch/checkDarkElix.au3 @@ -1,43 +1,43 @@ -; This code was created for public use by BrokenBot.org and falls under the GPLv3 license. -; This code can be incorporated into open source/non-profit projects free of charge and without consent. -; **NOT FOR COMMERCIAL USE** by any project which includes any part of the code in this sub-directory without express written consent of BrokenBot.org -; You **MAY NOT SOLICIT DONATIONS** from any project which includes any part of the code in this sub-directory without express written consent of BrokenBot.org -; -Func checkDarkElix() - _CaptureRegion() - $sendHBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap) - $res = DllCall(@ScriptDir & "\BrokenBot.org\BrokenBot32.dll", "str", "BrokenBotMatchBuilding", "ptr", $sendHBitmap, "int", 13, "int", 3, "int", 1, "int", 1, "int", (IsChecked($chkSpeedBoost) ? (1) : (0))) - _WinAPI_DeleteObject($sendHBitmap) - If IsArray($res) Then - If $res[0] = -1 Then - ; failed to find DE - SetLog(GetLangText("msgNoDEStorage"), $COLOR_RED) - If $DebugMode = 1 Then _GDIPlus_ImageSaveToFile($hBitmap, $dirDebug & "NegDE-" & @HOUR & @MIN & @SEC & ".png") - $DEx = 0 - $DEy = 0 - Return False ; return 0 - ElseIf $res[0] = -2 Then - SetLog(GetLangText("msgLicense"), $COLOR_RED) - Else - $res = StringSplit($res[0], "|", 2) - $DEx = $res[1] - $DEy = $res[2] - If $DebugMode = 1 Then - $hClone = _GDIPlus_BitmapCloneArea($hBitmap, $DEx - 30, $DEy - 30, 60, 60, _GDIPlus_ImageGetPixelFormat($hBitmap)) - $j = 1 - Do - If Not FileExists($dirDebug & "PosDE-x" & $DEx & "y" & $DEy & " (" & $j & ").jpg") Then ExitLoop - $j = $j + 1 - Until $j = 1000 - _GDIPlus_ImageSaveToFile($hClone, $dirDebug & "PosDE-x" & $DEx & "y" & $DEy & " (" & $j & ").jpg") - _GDIPlus_ImageDispose($hClone) - EndIf - Return True - EndIf - Else - SetLog(GetLangText("msgDLLError"), $COLOR_RED) - $DEx = 0 - $DEy = 0 - Return False ; return 0 - EndIf -EndFunc ;==>checkDarkElix +; This code was created for public use by BrokenBot.org and falls under the GPLv3 license. +; This code can be incorporated into open source/non-profit projects free of charge and without consent. +; **NOT FOR COMMERCIAL USE** by any project which includes any part of the code in this sub-directory without express written consent of BrokenBot.org +; You **MAY NOT SOLICIT DONATIONS** from any project which includes any part of the code in this sub-directory without express written consent of BrokenBot.org +; +Func checkDarkElix() + _CaptureRegion() + $sendHBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap) + $res = DllCall(@ScriptDir & "\BrokenBot.org\BrokenBot32.dll", "str", "BrokenBotMatchBuilding", "ptr", $sendHBitmap, "int", 13, "int", 3, "int", 1, "int", 1, "int", (IsChecked($chkSpeedBoost) ? (1) : (0))) + _WinAPI_DeleteObject($sendHBitmap) + If IsArray($res) Then + If $res[0] = -1 Then + ; failed to find DE + SetLog(GetLangText("msgNoDEStorage"), $COLOR_RED) + If $DebugMode = 1 Then _GDIPlus_ImageSaveToFile($hBitmap, $dirDebug & "NegDE-" & @HOUR & @MIN & @SEC & ".png") + $DEx = 0 + $DEy = 0 + Return False ; return 0 + ElseIf $res[0] = -2 Then + SetLog(GetLangText("msgLicense"), $COLOR_RED) + Else + $res = StringSplit($res[0], "|", 2) + $DEx = $res[1] + $DEy = $res[2] + If $DebugMode = 1 Then + $hClone = _GDIPlus_BitmapCloneArea($hBitmap, $DEx - 30, $DEy - 30, 60, 60, _GDIPlus_ImageGetPixelFormat($hBitmap)) + $j = 1 + Do + If Not FileExists($dirDebug & "PosDE-x" & $DEx & "y" & $DEy & " (" & $j & ").jpg") Then ExitLoop + $j = $j + 1 + Until $j = 1000 + _GDIPlus_ImageSaveToFile($hClone, $dirDebug & "PosDE-x" & $DEx & "y" & $DEy & " (" & $j & ").jpg") + _GDIPlus_ImageDispose($hClone) + EndIf + Return True + EndIf + Else + SetLog(GetLangText("msgDLLError"), $COLOR_RED) + $DEx = 0 + $DEy = 0 + Return False ; return 0 + EndIf +EndFunc ;==>checkDarkElix diff --git a/BrokenBot.org/functions/ImageSearch/checkTownhall.au3 b/BrokenBot.org/functions/ImageSearch/checkTownhall.au3 index dab41ee..51fd4fd 100644 --- a/BrokenBot.org/functions/ImageSearch/checkTownhall.au3 +++ b/BrokenBot.org/functions/ImageSearch/checkTownhall.au3 @@ -1,46 +1,48 @@ -; This code was created for public use by BrokenBot.org and falls under the GPLv3 license. -; This code can be incorporated into open source/non-profit projects free of charge and without consent. -; **NOT FOR COMMERCIAL USE** by any project which includes any part of the code in this sub-directory without express written consent of BrokenBot.org -; You **MAY NOT SOLICIT DONATIONS** from any project which includes any part of the code in this sub-directory without express written consent of BrokenBot.org -; -Func checkTownhall() - _CaptureRegion() - $sendHBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap) - $res = DllCall(@ScriptDir & "\BrokenBot.org\BrokenBot32.dll", "str", "BrokenBotMatchBuilding", "ptr", $sendHBitmap, "int", 1, "int", 3, "int", 1, "int", 1, "int", (IsChecked($chkSpeedBoost) ? (1) : (0))) - _WinAPI_DeleteObject($sendHBitmap) - If IsArray($res) Then - If $res[0] = -1 Then - ; failed to find TH - If $DebugMode = 1 Then _GDIPlus_ImageSaveToFile($hBitmap, $dirDebug & "NegTH-" & @HOUR & @MIN & @SEC & ".png") - $THx = 0 - $THy = 0 - Return "-" ; return 0 - ElseIf $res[0] = -2 Then - SetLog(GetLangText("msgLicense"), $COLOR_RED) - Else - $res = StringSplit($res[0], "|", 2) - $THx = $res[1] - $THy = $res[2] - If $DebugMode = 1 Then - $hClone = _GDIPlus_BitmapCloneArea($hBitmap, $THx - 30, $THy - 30, 60, 60, _GDIPlus_ImageGetPixelFormat($hBitmap)) - $j = 1 - Do - If Not FileExists($dirDebug & "PosTH-x" & $THx & "y" & $THy & " (" & $j & ").jpg") Then ExitLoop - $j = $j + 1 - Until $j = 1000 - _GDIPlus_ImageSaveToFile($hClone, $dirDebug & "PosTH-x" & $THx & "y" & $THy & " (" & $j & ").jpg") - _GDIPlus_ImageDispose($hClone) - EndIf - If $res[4] < 7 Then - Return $THText[0] - Else - Return $THText[$res[4] - 6] - EndIf - EndIf - Else - SetLog(GetLangText("msgDLLError"), $COLOR_RED) - $THx = 0 - $THy = 0 - Return "-" ; return 0 - EndIf -EndFunc ;==>checkTownhall +; This code was created for public use by BrokenBot.org and falls under the GPLv3 license. +; This code can be incorporated into open source/non-profit projects free of charge and without consent. +; **NOT FOR COMMERCIAL USE** by any project which includes any part of the code in this sub-directory without express written consent of BrokenBot.org +; You **MAY NOT SOLICIT DONATIONS** from any project which includes any part of the code in this sub-directory without express written consent of BrokenBot.org +; +Func checkTownhall() + $res = CallHelper("0 0 860 720 BrokenBotMatchBuilding 1 1 1") + + If $res = $DLLFailed or $res = $DLLTimeout Then + SetLog(GetLangText("msgDLLError"), $COLOR_RED) + $THx = 0 + $THy = 0 + Return "-" ; return 0 + Else + If $res = $DLLNegative Then + ; failed to find TH + If $DebugMode = 1 Then + _CaptureRegion() + _GDIPlus_ImageSaveToFile($hBitmap, $dirDebug & "NegTH-" & @HOUR & @MIN & @SEC & ".png") + EndIf + $THx = 0 + $THy = 0 + Return "-" ; return 0 + ElseIf $res = $DLLLicense Then + SetLog(GetLangText("msgLicense"), $COLOR_RED) + Else + $res = StringSplit($res, "|", 2) + $THx = $res[1] + $THy = $res[2] + If $DebugMode = 1 Then + _CaptureRegion() + $hClone = _GDIPlus_BitmapCloneArea($hBitmap, $THx - 30, $THy - 30, 60, 60, _GDIPlus_ImageGetPixelFormat($hBitmap)) + $j = 1 + Do + If Not FileExists($dirDebug & "PosTH-x" & $THx & "y" & $THy & " (" & $j & ").jpg") Then ExitLoop + $j = $j + 1 + Until $j = 1000 + _GDIPlus_ImageSaveToFile($hClone, $dirDebug & "PosTH-x" & $THx & "y" & $THy & " (" & $j & ").jpg") + _GDIPlus_ImageDispose($hClone) + EndIf + If $res[4] < 7 Then + Return $THText[0] + Else + Return $THText[$res[4] - 6] + EndIf + EndIf + EndIf +EndFunc ;==>checkTownhall diff --git a/BrokenBot.org/functions/Other/CallHelper.au3 b/BrokenBot.org/functions/Other/CallHelper.au3 new file mode 100755 index 0000000..f717aa8 --- /dev/null +++ b/BrokenBot.org/functions/Other/CallHelper.au3 @@ -0,0 +1,37 @@ +Global Const $DLLTimeout = -9 +Global Const $DLLFailed = -4 +Global Const $DLLLicense = -2 +Global Const $DLLNegative = -1 + +Func CallHelper($Command, $Timeout = 30) + RegWrite("HKEY_CURRENT_USER\Software\BrokenBot", "Transfer", "REG_SZ", $DLLTimeout) + + If StringInStr($Command, "BrokenBotRedLineCheck") Then + $FullCommand = '""' & @ScriptDir & "\BrokenBot.org\BrokenBotHelper.exe" & '""' + $FullCommand &= " 1 " + $FullCommand &= (IsChecked($chkBackground) ? ( "1" ) : ( "0")) & " " + $FullCommand &= $Command + ElseIf StringInStr($Command, "BrokenBotReadText") Then + $FullCommand = '""' & @ScriptDir & "\BrokenBot.org\BrokenBotHelper.exe" & '""' + $FullCommand &= " 2 " + $FullCommand &= (IsChecked($chkBackground) ? ( "1" ) : ( "0")) & " " + $FullCommand &= $Command + Else + $FullCommand = '""' & @ScriptDir & "\BrokenBot.org\BrokenBotHelper.exe" & '""' + $FullCommand &= " 3 " + $FullCommand &= (IsChecked($chkBackground) ? ( "1" ) : ( "0")) & " " + $FullCommand &= $Command & " " + $FullCommand &= (IsChecked($chkSpeedBoost) ? ( "1" ) : ( "0" )) + EndIf + + Run(@ComSpec & " /c " & $FullCommand, "", @SW_HIDE) + + $index = 0 + While (RegRead("HKEY_CURRENT_USER\Software\BrokenBot", "Transfer") = $DLLTimeout) and $index < ($Timeout * 100) + Sleep(10) + $index += 1 + WEnd + + $res = StringStripWS(RegRead("HKEY_CURRENT_USER\Software\BrokenBot", "Transfer"), 3) + Return $res +EndFunc \ No newline at end of file diff --git a/BrokenBot.org/functions/Other/GeneralFunctions.au3 b/BrokenBot.org/functions/Other/GeneralFunctions.au3 index 0169129..23aa8ac 100644 --- a/BrokenBot.org/functions/Other/GeneralFunctions.au3 +++ b/BrokenBot.org/functions/Other/GeneralFunctions.au3 @@ -1,132 +1,147 @@ -; This code was created for public use by BrokenBot.org and falls under the GPLv3 license. -; This code can be incorporated into open source/non-profit projects free of charge and without consent. -; **NOT FOR COMMERCIAL USE** by any project which includes any part of the code in this sub-directory without express written consent of BrokenBot.org -; You **MAY NOT SOLICIT DONATIONS** from any project which includes any part of the code in this sub-directory without express written consent of BrokenBot.org -; -;Searches for a village that until meets conditions -Func IsChecked($control) - Return BitAND(GUICtrlRead($control), $GUI_CHECKED) = $GUI_CHECKED -EndFunc ;==>IsChecked - -Func _ScreenShot() - Local $Date = @MDAY & "." & @MON & "." & @YEAR - Local $Time = @HOUR & "." & @MIN & "." & @SEC - _CaptureRegion() - SetLog($dirDebug & "ScreenShot-" & $Date & " at " & $Time & ".png") - _GDIPlus_ImageSaveToFile($hBitmap, $dirDebug & "ScreenShot-" & $Date & " at " & $Time & ".png") -EndFunc ;==>_ScreenShot - -Func _BumpMouse() - If IsChecked($chkStayAlive) Then - If $shift Then - $shift = False - MouseMove(MouseGetPos(0) + 1, MouseGetPos(1)) - Else - $shift = True - MouseMove(MouseGetPos(0) - 1, MouseGetPos(1)) - EndIf - EndIf -EndFunc ;==>_BumpMouse - -Func _WaitForImage($findImage, $resultPosition, ByRef $x, ByRef $y, $Tolerance, $maxDelay = 10) - For $i = 1 To $maxDelay * 20 - $result = _ImageSearch($findImage, $resultPosition, $x, $y, $Tolerance) - If $result = 1 Then Return 1 - If _Sleep(50) Then Return - Next - Return 0 -EndFunc ;==>_WaitForImage - -Func _WaitForImageArea($findImage, $resultPosition, $x1, $y1, $right, $bottom, ByRef $x, ByRef $y, $Tolerance, $maxDelay = 10) - For $i = 1 To $maxDelay * 20 - $result = _ImageSearchArea($findImage, $resultPosition, $x1, $y1, $right, $bottom, $x, $y, $Tolerance) - If $result = 1 Then Return 1 - If _Sleep(50) Then Return - Next - Return 0 -EndFunc ;==>_WaitForImageArea - -Func _WaitForColor($x, $y, $nColor2, $sVari = 5, $maxDelay = 1) - For $i = 1 To $maxDelay * 20 - _CaptureRegion() - If _ColorCheck(_GetPixelColor($x, $y), $nColor2, $sVari) Then - Return True - EndIf - If _Sleep(50) Then Return - Next - Return False -EndFunc ;==>_WaitForColor - -Func _WaitForPixel($iLeft, $iTop, $iRight, $iBottom, $iColor, $iColorVariation, $maxDelay = 10) - For $i = 1 To $maxDelay * 20 - $result = _PixelSearch($iLeft, $iTop, $iRight, $iBottom, $iColor, $iColorVariation) - If IsArray($result) Then Return $result - If _Sleep(50) Then Return - Next - Return False -EndFunc ;==>_WaitForPixel - -Func GetLangText($Key) - $ReturnStr = "" - If IsDeclared("cmbLanguage") Then - $array = _GUICtrlComboBox_GetListArray($cmbLanguage) - $CurrLangSel = $array[_GUICtrlComboBox_GetCurSel($cmbLanguage) + 1] - $ReturnStr = IniRead(@ScriptDir & "\BrokenBot.org\languages\" & $CurrLangSel & ".ini", "general", $Key, "") - If $ReturnStr = "" Then - $ReturnStr = IniRead(@ScriptDir & "\BrokenBot.org\languages\English.ini", "general", $Key, "") - EndIf - Else - $ReturnStr = IniRead(@ScriptDir & "\BrokenBot.org\languages\" & $StartupLanguage & ".ini", "general", $Key, "") - If $ReturnStr = "" Then - $ReturnStr = IniRead(@ScriptDir & "\BrokenBot.org\languages\English.ini", "general", $Key, "") - EndIf - EndIf - Return $ReturnStr -EndFunc ;==>GetLangText - -Func PopulateLanguages() - $searchfile = FileFindFirstFile(@ScriptDir & "\BrokenBot.org\languages\*.ini") - $txtLang = "" - While True - $newfile = FileFindNextFile($searchfile) - If @error Then ExitLoop - $txtLang = $txtLang & StringLeft($newfile, StringLen($newfile) - 4) & "|" - WEnd - FileClose($searchfile) - $txtLang = StringLeft($txtLang, StringLen($txtLang) - 1) - _GUICtrlComboBox_ResetContent($cmbLanguage) - GUICtrlSetData($cmbLanguage, $txtLang) -EndFunc ;==>PopulateLanguages - -Func _Decrypt($sData) - Local $hKey = _Crypt_DeriveKey("DE8D16C2C59B93F3F0682250B", 0x00006610) - Local $sDecrypted = BinaryToString(_Crypt_DecryptData(Binary($sData), $hKey, $CALG_USERKEY)) - _Crypt_DestroyKey($hKey) - Return $sDecrypted -EndFunc ;==>_Decrypt - -Func _Encrypt($sData) - Local $hKey = _Crypt_DeriveKey("DE8D16C2C59B93F3F0682250B", 0x00006610) - Local $bEncrypted = _Crypt_EncryptData($sData, $hKey, $CALG_USERKEY) - _Crypt_DestroyKey($hKey) - Return $bEncrypted -EndFunc ;==>_Encrypt - -Func urlencode($str, $plus = True) - Local $i, $return, $tmp, $exp - $return = "" - $exp = "[a-zA-Z0-9-._~]" - If $plus Then - $str = StringReplace($str, " ", "+") - $exp = "[a-zA-Z0-9-._~+]" - EndIf - For $i = 1 To StringLen($str) - $tmp = StringMid($str, $i, 1) - If StringRegExp($tmp, $exp, 0) = 1 Then - $return &= $tmp - Else - $return &= StringMid(StringRegExpReplace(StringToBinary($tmp, 4), "([0-9A-Fa-f]{2})", "%$1"), 3) - EndIf - Next - Return $return -EndFunc ;==>urlencode +; This code was created for public use by BrokenBot.org and falls under the GPLv3 license. +; This code can be incorporated into open source/non-profit projects free of charge and without consent. +; **NOT FOR COMMERCIAL USE** by any project which includes any part of the code in this sub-directory without express written consent of BrokenBot.org +; You **MAY NOT SOLICIT DONATIONS** from any project which includes any part of the code in this sub-directory without express written consent of BrokenBot.org +; +;Searches for a village that until meets conditions +Func IsChecked($control) + Return BitAND(GUICtrlRead($control), $GUI_CHECKED) = $GUI_CHECKED +EndFunc ;==>IsChecked + +Func _ScreenShot() + Local $Date = @MDAY & "." & @MON & "." & @YEAR + Local $Time = @HOUR & "." & @MIN & "." & @SEC + _CaptureRegion() + SetLog($dirDebug & "ScreenShot-" & $Date & " at " & $Time & ".png") + _GDIPlus_ImageSaveToFile($hBitmap, $dirDebug & "ScreenShot-" & $Date & " at " & $Time & ".png") +EndFunc ;==>_ScreenShot + +Func _BumpMouse() + If IsChecked($chkStayAlive) Then + If $shift Then + $shift = False + MouseMove(MouseGetPos(0) + 1, MouseGetPos(1)) + Else + $shift = True + MouseMove(MouseGetPos(0) - 1, MouseGetPos(1)) + EndIf + EndIf +EndFunc ;==>_BumpMouse + +Func _WaitForImage($findImage, $resultPosition, ByRef $x, ByRef $y, $Tolerance, $maxDelay = 10) + For $i = 1 To $maxDelay * 20 + $result = _ImageSearch($findImage, $resultPosition, $x, $y, $Tolerance) + If $result = 1 Then Return 1 + If _Sleep(50) Then Return + Next + Return 0 +EndFunc ;==>_WaitForImage + +Func _WaitForImageArea($findImage, $resultPosition, $x1, $y1, $right, $bottom, ByRef $x, ByRef $y, $Tolerance, $maxDelay = 10) + For $i = 1 To $maxDelay * 20 + $result = _ImageSearchArea($findImage, $resultPosition, $x1, $y1, $right, $bottom, $x, $y, $Tolerance) + If $result = 1 Then Return 1 + If _Sleep(50) Then Return + Next + Return 0 +EndFunc ;==>_WaitForImageArea + +Func _WaitForColor($x, $y, $nColor2, $sVari = 5, $maxDelay = 1) + For $i = 1 To $maxDelay * 20 + _CaptureRegion() + If _ColorCheck(_GetPixelColor($x, $y), $nColor2, $sVari) Then + Return True + EndIf + If _Sleep(50) Then Return + Next + Return False +EndFunc ;==>_WaitForColor + +Func _WaitForColorArea($left, $top, $width, $height, $nColor2, $sVari = 5, $maxDelay = 1) + For $i = 1 To $maxDelay * 20 + _CaptureRegion() + For $x = $left to ($left + $width - 1) + For $y = $top to ($top + $height - 1) + If _ColorCheck(_GetPixelColor($x, $y), $nColor2, $sVari) Then + Return True + EndIf + Next + Next + If _Sleep(50) Then Return + Next + Return False +EndFunc ;==>_WaitForColor + +Func _WaitForPixel($iLeft, $iTop, $iRight, $iBottom, $iColor, $iColorVariation, $maxDelay = 10) + For $i = 1 To $maxDelay * 20 + $result = _PixelSearch($iLeft, $iTop, $iRight, $iBottom, $iColor, $iColorVariation) + If IsArray($result) Then Return $result + If _Sleep(50) Then Return + Next + Return False +EndFunc ;==>_WaitForPixel + +Func GetLangText($Key) + $ReturnStr = "" + If IsDeclared("cmbLanguage") Then + $array = _GUICtrlComboBox_GetListArray($cmbLanguage) + $CurrLangSel = $array[_GUICtrlComboBox_GetCurSel($cmbLanguage) + 1] + $ReturnStr = IniRead(@ScriptDir & "\BrokenBot.org\languages\" & $CurrLangSel & ".ini", "general", $Key, "") + If $ReturnStr = "" Then + $ReturnStr = IniRead(@ScriptDir & "\BrokenBot.org\languages\English.ini", "general", $Key, "") + EndIf + Else + $ReturnStr = IniRead(@ScriptDir & "\BrokenBot.org\languages\" & $StartupLanguage & ".ini", "general", $Key, "") + If $ReturnStr = "" Then + $ReturnStr = IniRead(@ScriptDir & "\BrokenBot.org\languages\English.ini", "general", $Key, "") + EndIf + EndIf + Return $ReturnStr +EndFunc ;==>GetLangText + +Func PopulateLanguages() + $searchfile = FileFindFirstFile(@ScriptDir & "\BrokenBot.org\languages\*.ini") + $txtLang = "" + While True + $newfile = FileFindNextFile($searchfile) + If @error Then ExitLoop + $txtLang = $txtLang & StringLeft($newfile, StringLen($newfile) - 4) & "|" + WEnd + FileClose($searchfile) + $txtLang = StringLeft($txtLang, StringLen($txtLang) - 1) + _GUICtrlComboBox_ResetContent($cmbLanguage) + GUICtrlSetData($cmbLanguage, $txtLang) +EndFunc ;==>PopulateLanguages + +Func _Decrypt($sData) + Local $hKey = _Crypt_DeriveKey("DE8D16C2C59B93F3F0682250B", 0x00006610) + Local $sDecrypted = BinaryToString(_Crypt_DecryptData(Binary($sData), $hKey, $CALG_USERKEY)) + _Crypt_DestroyKey($hKey) + Return $sDecrypted +EndFunc ;==>_Decrypt + +Func _Encrypt($sData) + Local $hKey = _Crypt_DeriveKey("DE8D16C2C59B93F3F0682250B", 0x00006610) + Local $bEncrypted = _Crypt_EncryptData($sData, $hKey, $CALG_USERKEY) + _Crypt_DestroyKey($hKey) + Return $bEncrypted +EndFunc ;==>_Encrypt + +Func urlencode($str, $plus = True) + Local $i, $return, $tmp, $exp + $return = "" + $exp = "[a-zA-Z0-9-._~]" + If $plus Then + $str = StringReplace($str, " ", "+") + $exp = "[a-zA-Z0-9-._~+]" + EndIf + For $i = 1 To StringLen($str) + $tmp = StringMid($str, $i, 1) + If StringRegExp($tmp, $exp, 0) = 1 Then + $return &= $tmp + Else + $return &= StringMid(StringRegExpReplace(StringToBinary($tmp, 4), "([0-9A-Fa-f]{2})", "%$1"), 3) + EndIf + Next + Return $return +EndFunc ;==>urlencode diff --git a/BrokenBot.org/functions/Other/HSL.au3 b/BrokenBot.org/functions/Other/HSL.au3 index 1d5b988..b7e4b74 100644 --- a/BrokenBot.org/functions/Other/HSL.au3 +++ b/BrokenBot.org/functions/Other/HSL.au3 @@ -1,68 +1,84 @@ -Func _SatSearch($iLeft, $iTop, $iWidth, $iHeight, $satMin, $satMax) - _CaptureRegion($iLeft, $iTop, $iLeft + $iWidth, $iTop + $iHeight) - Local $RGB[3] - For $x = 0 To $iWidth - 1 - For $y = 0 To $iHeight - 1 - $color = _GetPixelColor($x, $y) - $RGB[0] = Dec(StringMid(String($Color), 1, 2)) - $RGB[1] = Dec(StringMid(String($Color), 3, 2)) - $RGB[2] = Dec(StringMid(String($Color), 5, 2)) - $HSL = RGBtoHSL($RGB) - If $HSL[1] > $satMin And $HSL[1] < $satMax Then Return True - Next - Next - Return False -EndFunc ;==>_MultiPixelSearch - - -Func RGBtoHSL($arColors) - Const $MaxHSL = 100 - Const $MaxRGB = 255 - - If UBound($arColors) <> 3 Or UBound($arColors, 0) <> 1 Then Return SetError(1, 0, 0) - - Local $nH, $nS, $nL - Local $nR = Number($arColors[0])/$MaxRGB - Local $nG = Number($arColors[1])/$MaxRGB - Local $nB = Number($arColors[2])/$MaxRGB - - Local $nMax = $nR - If $nMax < $nG Then $nMax = $nG - If $nMax < $nB Then $nMax = $nB - - Local $nMin = $nR - If $nMin > $nG Then $nMin = $nG - If $nMin > $nB Then $nMin = $nB - - Local $nMinMaxSum = ($nMax + $nMin) - Local $nMinMaxDiff = ($nMax - $nMin) - - $nL = $nMinMaxSum/2 - If $nMinMaxDiff = 0 Then - $nH = 0 - $nS = 0 - Else - If $nL < 0.5 Then - $nS = $nMinMaxDiff/$nMinMaxSum - Else - $nS = $nMinMaxDiff/(2 - $nMinMaxSum) - EndIf - - Switch $nMax - Case $nR - $nH = ($nG - $nB)/(6 * $nMinMaxDiff) - Case $nG - $nH = ($nB - $nR)/(6 * $nMinMaxDiff) + 1/3 - Case $nB - $nH = ($nR - $nG)/(6 * $nMinMaxDiff) + 2/3 - EndSwitch - If $nH < 0 Then $nH += 1 - If $nH > 1 Then $nH -= 1 - EndIf - - $arColors[0] = $nH * $MaxHSL - $arColors[1] = $nS * $MaxHSL - $arColors[2] = $nL * $MaxHSL - - Return $arColors -EndFunc +Func _SatSearch($iLeft, $iTop, $iWidth, $iHeight, $satMin, $satMax) + _CaptureRegion($iLeft, $iTop, $iLeft + $iWidth, $iTop + $iHeight) + Local $RGB[3] + For $x = 0 To $iWidth - 1 + For $y = 0 To $iHeight - 1 + $color = _GetPixelColor($x, $y) + $RGB[0] = Dec(StringMid(String($Color), 1, 2)) + $RGB[1] = Dec(StringMid(String($Color), 3, 2)) + $RGB[2] = Dec(StringMid(String($Color), 5, 2)) + $HSL = RGBtoHSL($RGB) + If $HSL[1] > $satMin And $HSL[1] < $satMax Then Return True + Next + Next + Return False +EndFunc ;==>_MultiPixelSearch + +Func _HueSearch($iLeft, $iTop, $iWidth, $iHeight, $hueMin, $hueMax) + _CaptureRegion($iLeft, $iTop, $iLeft + $iWidth, $iTop + $iHeight) + Local $RGB[3] + For $x = 0 To $iWidth - 1 + For $y = 0 To $iHeight - 1 + $color = _GetPixelColor($x, $y) + $RGB[0] = Dec(StringMid(String($Color), 1, 2)) + $RGB[1] = Dec(StringMid(String($Color), 3, 2)) + $RGB[2] = Dec(StringMid(String($Color), 5, 2)) + $HSL = RGBtoHSL($RGB) + If $HSL[0] > $hueMin And $HSL[0] < $hueMax Then Return True + Next + Next + Return False +EndFunc ;==>_MultiPixelSearch + + +Func RGBtoHSL($arColors) + Const $MaxHSL = 100 + Const $MaxRGB = 255 + + If UBound($arColors) <> 3 Or UBound($arColors, 0) <> 1 Then Return SetError(1, 0, 0) + + Local $nH, $nS, $nL + Local $nR = Number($arColors[0])/$MaxRGB + Local $nG = Number($arColors[1])/$MaxRGB + Local $nB = Number($arColors[2])/$MaxRGB + + Local $nMax = $nR + If $nMax < $nG Then $nMax = $nG + If $nMax < $nB Then $nMax = $nB + + Local $nMin = $nR + If $nMin > $nG Then $nMin = $nG + If $nMin > $nB Then $nMin = $nB + + Local $nMinMaxSum = ($nMax + $nMin) + Local $nMinMaxDiff = ($nMax - $nMin) + + $nL = $nMinMaxSum/2 + If $nMinMaxDiff = 0 Then + $nH = 0 + $nS = 0 + Else + If $nL < 0.5 Then + $nS = $nMinMaxDiff/$nMinMaxSum + Else + $nS = $nMinMaxDiff/(2 - $nMinMaxSum) + EndIf + + Switch $nMax + Case $nR + $nH = ($nG - $nB)/(6 * $nMinMaxDiff) + Case $nG + $nH = ($nB - $nR)/(6 * $nMinMaxDiff) + 1/3 + Case $nB + $nH = ($nR - $nG)/(6 * $nMinMaxDiff) + 2/3 + EndSwitch + If $nH < 0 Then $nH += 1 + If $nH > 1 Then $nH -= 1 + EndIf + + $arColors[0] = $nH * $MaxHSL + $arColors[1] = $nS * $MaxHSL + $arColors[2] = $nL * $MaxHSL + + Return $arColors +EndFunc diff --git a/BrokenBot.org/functions/Other/ReadChatLog.au3 b/BrokenBot.org/functions/Other/ReadChatLog.au3 index 31a7eba..19872f5 100644 --- a/BrokenBot.org/functions/Other/ReadChatLog.au3 +++ b/BrokenBot.org/functions/Other/ReadChatLog.au3 @@ -1,226 +1,226 @@ -Global $ChatLog[11] -$ChatLog[0] = "" -$ChatInitialized = False - -; Reads chat log -Func ReadChatLog($initialize = False) - Local $RGB[3] - If Not $initialize Then Setlog(GetLangText("msgReadingChat"), $COLOR_GREEN) - For $i = 1 to 10 - $ChatLog[$i] = "" - Next - - - Click(1, 1) ;Click Away - If _Sleep(200) Then Return - _CaptureRegion() - - If _ColorCheck(_GetPixelColor(331, 330), Hex(0xF0A03B, 6), 20) = False Then Click(19, 349) ;Clicks chat thing - If _Sleep(500) Then Return - - Click(189, 24) ; clicking clan tab - If _Sleep(500) Then Return - - $StillReading = True - $y = 122 - $entrypoint = 10 - _CaptureRegion() - $BitmapData = _GDIPlus_BitmapLockBits($hBitmap, 0, 0, 860, 720, $GDIP_ILMREAD, $GDIP_PXF32RGB) - $Stride = DllStructGetData($BitmapData, "Stride") - $Width = DllStructGetData($BitmapData, "Width") - $Height = DllStructGetData($BitmapData, "Height") - $PixelFormat = DllStructGetData($BitmapData, "PixelFormat") - $Scan0 = DllStructGetData($BitmapData, "Scan0") - While $StillReading - $foundsomething = False - For $x = 33 to 40 - $pixel = DllStructCreate("dword", $Scan0 + $y * $Stride + $x*4) - $letterPixel = DllStructGetData($Pixel, 1) - $Red = BitAND(BitShift($letterPixel, 16), 0xFF) - If $Red > 175 Then - $foundsomething = True - ExitLoop - EndIf - Next - If $foundsomething Then - $Green = BitAND(BitShift($letterPixel, 8), 0xFF) - $Blue = BitAND($letterPixel, 0xFF) - If (Abs($Red - $Green) + Abs($Red - $Blue)) > 8 Then - ; This is a username - ; Look to see if there is a green and white bubble in our way - $maxwidth = 220 - For $highcheck = 0 to 8 - $ymod = Ceiling($highcheck/2) * (2 * (Mod($highcheck, 2) - .5)) - For $wide = 33 to 253 - $pixel = DllStructCreate("dword", $Scan0 + ($y + $ymod) * $Stride + $wide*4) - $bubblePixel = DllStructGetData($Pixel, 1) - If BitAND($bubblePixel, 0xFF) > 180 Then - $maxwidth = $wide - 35 - ExitLoop(2) - EndIf - Next - Next - ; Move to the top of the letter - $topRow = $y - $blankrows = 0 - $adjust = 1 - While $blankrows < 4 - $wasblank = True - For $wide = 33 to $maxwidth + 33 - $pixel = DllStructCreate("dword", $Scan0 + ($y - $adjust) * $Stride + $wide*4) - $linePixel = DllStructGetData($Pixel, 1) - If BitAND(BitShift($linePixel, 16), 0xFF) > 175 Then - $wasblank = False - ExitLoop - EndIf - Next - If $wasblank Then - $blankrows += 1 - Else - $blankrows = 0 - $topRow = $y - $adjust - EndIf - $adjust += 1 - WEnd - ; Find top of next - $lookdown = 671 - For $scan = ($topRow + 20) to 671 - For $x = 33 to 40 - $pixel = DllStructCreate("dword", $Scan0 + $scan * $Stride + $x*4) - $letterPixel = DllStructGetData($Pixel, 1) - $Red = BitAND(BitShift($letterPixel, 16), 0xFF) - If ($Red > 175) Then - $Green = BitAND(BitShift($letterPixel, 8), 0xFF) - $Blue = BitAND($letterPixel, 0xFF) - If (Abs($Red - $Green) + Abs($Red - $Blue)) > 8 Then - $lookdown = $scan - 15 - ExitLoop(2) - EndIf - EndIf - Next - Next - ; Make sure this isn't a troop request - $isdonation = False - For $scan = ($topRow + 20) To $lookdown - $pixel = DllStructCreate("dword", $Scan0 + $scan * $Stride + 476) - $donationPixel = DllStructGetData($Pixel, 1) - $RGB[0] = BitAND(BitShift($donationPixel, 16), 0xFF) - $RGB[1] = BitAND(BitShift($donationPixel, 8), 0xFF) - $RGB[2] = BitAND($donationPixel, 0xFF) - $HSL = RGBtoHSL($RGB) - If $HSL[1] > 50 Then - $isdonation = True - ExitLoop - EndIf - Next - If Not $isdonation Then - ; This is chat text - _GDIPlus_BitmapUnlockBits($hBitmap, $BitmapData) - $ChatString = ReadText(33, $topRow, $maxwidth, $textChatUser) & ":" - _CaptureRegion() - $BitmapData = _GDIPlus_BitmapLockBits($hBitmap, 0, 0, 860, 720, $GDIP_ILMREAD, $GDIP_PXF32RGB) - $Stride = DllStructGetData($BitmapData, "Stride") - $Width = DllStructGetData($BitmapData, "Width") - $Height = DllStructGetData($BitmapData, "Height") - $PixelFormat = DllStructGetData($BitmapData, "PixelFormat") - $Scan0 = DllStructGetData($BitmapData, "Scan0") - - $topRow += 8 - $newlinefound = True - While $newlinefound - $newlinefound = False - $topRow += 13 - For $scan = $topRow to $topRow + 10 - For $x = 34 to 45 - $pixel = DllStructCreate("dword", $Scan0 + $scan * $Stride + $x*4) - $letterPixel = DllStructGetData($Pixel, 1) - $Red = BitAND(BitShift($letterPixel, 16), 0xFF) - If $Red > 230 Then - $newlinefound = True - $topRow = $scan - ExitLoop - EndIf - Next - Next - If $newlinefound Then - ; Find top of text - $blankrows = 0 - $row = $topRow - 1 - While $blankrows < 2 - $wasblank = True - For $wide = 34 to 304 - $pixel = DllStructCreate("dword", $Scan0 + ($row) * $Stride + $wide*4) - $linePixel = DllStructGetData($Pixel, 1) - If BitAND(BitShift($linePixel, 16), 0xFF) > 229 Then - $wasblank = False - ExitLoop - EndIf - Next - If $wasblank Then - $blankrows += 1 - Else - $blankrows = 0 - $topRow = $row - EndIf - $row -= 1 - WEnd - _GDIPlus_BitmapUnlockBits($hBitmap, $BitmapData) - $ChatString &= " " & ReadText(34, $topRow, 270, $textChat) - _CaptureRegion() - $BitmapData = _GDIPlus_BitmapLockBits($hBitmap, 0, 0, 860, 720, $GDIP_ILMREAD, $GDIP_PXF32RGB) - $Stride = DllStructGetData($BitmapData, "Stride") - $Width = DllStructGetData($BitmapData, "Width") - $Height = DllStructGetData($BitmapData, "Height") - $PixelFormat = DllStructGetData($BitmapData, "PixelFormat") - $Scan0 = DllStructGetData($BitmapData, "Scan0") - EndIf - WEnd - If $ChatString = $ChatLog[0] Then - ; This chat message was previously read - $StillReading = False - Else - $ChatLog[$entrypoint] = $ChatString - $entrypoint -= 1 - If $initialize Then - $ChatLog[0] = $ChatLog[10] - $ChatLog[10] = "" - $ChatInitialized = True - $StillReading = False - EndIf - EndIf - $y = $topRow - Else - $y = $lookdown - EndIf - Else - $y += 1 - EndIf - Else - $y += 1 - EndIf - If $entrypoint = 0 or $y >= 600 Then $StillReading = False - WEnd - _GDIPlus_BitmapUnlockBits($hBitmap, $BitmapData) - $NewMessage = False - $PushMessage = "" - For $i = 1 to 10 - If $ChatLog[$i] <> "" Then - Setlog("~~~ " & $ChatLog[$i], $COLOR_GREEN) - $PushMessage &= $ChatLog[$i] & "\n" - $NewMessage = True - EndIf - Next - - If $ChatLog[10] <> "" Then $ChatLog[0] = $ChatLog[10] - - If $PushBulletEnabled = 1 And $PushBulletchatlog = 1 And $NewMessage Then - _Push(GetLangText("pushCL"), $PushMessage) - EndIf - - _CaptureRegion() - If _ColorCheck(_GetPixelColor(331, 330), Hex(0xF0A03B, 6), 20) Then - Click(331, 330) ;Clicks chat thing - If _Sleep(500) Then Return - EndIf - +Global $ChatLog[11] +$ChatLog[0] = "" +$ChatInitialized = False + +; Reads chat log +Func ReadChatLog($initialize = False) + Local $RGB[3] + If Not $initialize Then Setlog(GetLangText("msgReadingChat"), $COLOR_GREEN) + For $i = 1 to 10 + $ChatLog[$i] = "" + Next + + + Click(1, 1) ;Click Away + If _Sleep(200) Then Return + _CaptureRegion() + + If _ColorCheck(_GetPixelColor(331, 330), Hex(0xF0A03B, 6), 20) = False Then Click(19, 349) ;Clicks chat thing + If _Sleep(500) Then Return + + Click(189, 24) ; clicking clan tab + If _Sleep(500) Then Return + + $StillReading = True + $y = 122 + $entrypoint = 10 + _CaptureRegion() + $BitmapData = _GDIPlus_BitmapLockBits($hBitmap, 0, 0, 860, 720, $GDIP_ILMREAD, $GDIP_PXF32RGB) + $Stride = DllStructGetData($BitmapData, "Stride") + $Width = DllStructGetData($BitmapData, "Width") + $Height = DllStructGetData($BitmapData, "Height") + $PixelFormat = DllStructGetData($BitmapData, "PixelFormat") + $Scan0 = DllStructGetData($BitmapData, "Scan0") + While $StillReading + $foundsomething = False + For $x = 33 to 40 + $pixel = DllStructCreate("dword", $Scan0 + $y * $Stride + $x*4) + $letterPixel = DllStructGetData($Pixel, 1) + $Red = BitAND(BitShift($letterPixel, 16), 0xFF) + If $Red > 175 Then + $foundsomething = True + ExitLoop + EndIf + Next + If $foundsomething Then + $Green = BitAND(BitShift($letterPixel, 8), 0xFF) + $Blue = BitAND($letterPixel, 0xFF) + If (Abs($Red - $Green) + Abs($Red - $Blue)) > 8 Then + ; This is a username + ; Look to see if there is a green and white bubble in our way + $maxwidth = 220 + For $highcheck = 0 to 8 + $ymod = Ceiling($highcheck/2) * (2 * (Mod($highcheck, 2) - .5)) + For $wide = 33 to 253 + $pixel = DllStructCreate("dword", $Scan0 + ($y + $ymod) * $Stride + $wide*4) + $bubblePixel = DllStructGetData($Pixel, 1) + If BitAND($bubblePixel, 0xFF) > 180 Then + $maxwidth = $wide - 35 + ExitLoop(2) + EndIf + Next + Next + ; Move to the top of the letter + $topRow = $y + $blankrows = 0 + $adjust = 1 + While $blankrows < 4 + $wasblank = True + For $wide = 33 to $maxwidth + 33 + $pixel = DllStructCreate("dword", $Scan0 + ($y - $adjust) * $Stride + $wide*4) + $linePixel = DllStructGetData($Pixel, 1) + If BitAND(BitShift($linePixel, 16), 0xFF) > 175 Then + $wasblank = False + ExitLoop + EndIf + Next + If $wasblank Then + $blankrows += 1 + Else + $blankrows = 0 + $topRow = $y - $adjust + EndIf + $adjust += 1 + WEnd + ; Find top of next + $lookdown = 671 + For $scan = ($topRow + 20) to 671 + For $x = 33 to 40 + $pixel = DllStructCreate("dword", $Scan0 + $scan * $Stride + $x*4) + $letterPixel = DllStructGetData($Pixel, 1) + $Red = BitAND(BitShift($letterPixel, 16), 0xFF) + If ($Red > 175) Then + $Green = BitAND(BitShift($letterPixel, 8), 0xFF) + $Blue = BitAND($letterPixel, 0xFF) + If (Abs($Red - $Green) + Abs($Red - $Blue)) > 8 Then + $lookdown = $scan - 15 + ExitLoop(2) + EndIf + EndIf + Next + Next + ; Make sure this isn't a troop request + $isdonation = False + For $scan = ($topRow + 20) To $lookdown + $pixel = DllStructCreate("dword", $Scan0 + $scan * $Stride + 476) + $donationPixel = DllStructGetData($Pixel, 1) + $RGB[0] = BitAND(BitShift($donationPixel, 16), 0xFF) + $RGB[1] = BitAND(BitShift($donationPixel, 8), 0xFF) + $RGB[2] = BitAND($donationPixel, 0xFF) + $HSL = RGBtoHSL($RGB) + If $HSL[1] > 50 Then + $isdonation = True + ExitLoop + EndIf + Next + If Not $isdonation Then + ; This is chat text + _GDIPlus_BitmapUnlockBits($hBitmap, $BitmapData) + $ChatString = ReadText(33, $topRow, $maxwidth, $textChatUser) & ":" + _CaptureRegion() + $BitmapData = _GDIPlus_BitmapLockBits($hBitmap, 0, 0, 860, 720, $GDIP_ILMREAD, $GDIP_PXF32RGB) + $Stride = DllStructGetData($BitmapData, "Stride") + $Width = DllStructGetData($BitmapData, "Width") + $Height = DllStructGetData($BitmapData, "Height") + $PixelFormat = DllStructGetData($BitmapData, "PixelFormat") + $Scan0 = DllStructGetData($BitmapData, "Scan0") + + $topRow += 8 + $newlinefound = True + While $newlinefound + $newlinefound = False + $topRow += 13 + For $scan = $topRow to $topRow + 10 + For $x = 34 to 45 + $pixel = DllStructCreate("dword", $Scan0 + $scan * $Stride + $x*4) + $letterPixel = DllStructGetData($Pixel, 1) + $Red = BitAND(BitShift($letterPixel, 16), 0xFF) + If $Red > 230 Then + $newlinefound = True + $topRow = $scan + ExitLoop + EndIf + Next + Next + If $newlinefound Then + ; Find top of text + $blankrows = 0 + $row = $topRow - 1 + While $blankrows < 2 + $wasblank = True + For $wide = 34 to 304 + $pixel = DllStructCreate("dword", $Scan0 + ($row) * $Stride + $wide*4) + $linePixel = DllStructGetData($Pixel, 1) + If BitAND(BitShift($linePixel, 16), 0xFF) > 229 Then + $wasblank = False + ExitLoop + EndIf + Next + If $wasblank Then + $blankrows += 1 + Else + $blankrows = 0 + $topRow = $row + EndIf + $row -= 1 + WEnd + _GDIPlus_BitmapUnlockBits($hBitmap, $BitmapData) + $ChatString &= " " & ReadText(34, $topRow, 270, $textChat) + _CaptureRegion() + $BitmapData = _GDIPlus_BitmapLockBits($hBitmap, 0, 0, 860, 720, $GDIP_ILMREAD, $GDIP_PXF32RGB) + $Stride = DllStructGetData($BitmapData, "Stride") + $Width = DllStructGetData($BitmapData, "Width") + $Height = DllStructGetData($BitmapData, "Height") + $PixelFormat = DllStructGetData($BitmapData, "PixelFormat") + $Scan0 = DllStructGetData($BitmapData, "Scan0") + EndIf + WEnd + If $ChatString = $ChatLog[0] Then + ; This chat message was previously read + $StillReading = False + Else + $ChatLog[$entrypoint] = $ChatString + $entrypoint -= 1 + If $initialize Then + $ChatLog[0] = $ChatLog[10] + $ChatLog[10] = "" + $ChatInitialized = True + $StillReading = False + EndIf + EndIf + $y = $topRow + Else + $y = $lookdown + EndIf + Else + $y += 1 + EndIf + Else + $y += 1 + EndIf + If $entrypoint = 0 or $y >= 600 Then $StillReading = False + WEnd + _GDIPlus_BitmapUnlockBits($hBitmap, $BitmapData) + $NewMessage = False + $PushMessage = "" + For $i = 1 to 10 + If $ChatLog[$i] <> "" Then + Setlog("~~~ " & $ChatLog[$i], $COLOR_GREEN) + $PushMessage &= $ChatLog[$i] & "\n" + $NewMessage = True + EndIf + Next + + If $ChatLog[10] <> "" Then $ChatLog[0] = $ChatLog[10] + + If $PushBulletEnabled = 1 And $PushBulletchatlog = 1 And $NewMessage Then + _Push(GetLangText("pushCL"), $PushMessage) + EndIf + + _CaptureRegion() + If _ColorCheck(_GetPixelColor(331, 330), Hex(0xF0A03B, 6), 20) Then + Click(331, 330) ;Clicks chat thing + If _Sleep(500) Then Return + EndIf + EndFunc \ No newline at end of file diff --git a/BrokenBot.org/functions/Other/ReadText.au3 b/BrokenBot.org/functions/Other/ReadText.au3 index a19406b..7d230c2 100644 --- a/BrokenBot.org/functions/Other/ReadText.au3 +++ b/BrokenBot.org/functions/Other/ReadText.au3 @@ -1,32 +1,17 @@ -Global Enum $textChat = 1, $textMainScreen, $textVillageSearch, $textReturnHome, $textWindows, $textWindowTitles, $textChatUser, $textDeployNumber -Global $textConstants[9][2] = [[0, ""], [10, "chatlog"], [12, "mainscreen"], [12, "villagesearch"], [16, "returnhome"], [10, "smallwindow"], [16, "smallwindowtitle"], [10, "chatuser"], [13, "deploynumber"]] - -Func ReadText($x, $y, $width, $type, $leftaligned = 1, $reversed = 0) - $height = $textConstants[$type][0] - $name = $textConstants[$type][1] -;~ SetLog("Reading text type: " & $name & " at " & $x & ", " & $y & " width: " & $width & " left aligned: " & $leftaligned & " reversed: " & $reversed) - _CaptureRegion() - $hClone = _GDIPlus_BitmapCloneArea($hBitmap, $x, $y, $width, $height, _GDIPlus_ImageGetPixelFormat($hBitmap)) - If @error Then SetLog("Failed to properly clone the text area.") - $hSendHBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hClone) - If @error Then SetLog("Failed to make HBitmap") - $Result = DllCall(@ScriptDir & "\BrokenBot.org\BrokenBot32.dll", "str", "BrokenBotReadText", "ptr", $hSendHBitmap, "int", $type, "int", $leftaligned, "int", $reversed) - If @error Then SetLog("DLL Call failure: " & @error) - _WinAPI_DeleteObject($hSendHBitmap) - If IsArray($Result) Then - If $Result[0] = -1 Then - SetLog(GetLangText("msgDLLError") & " UNKNOWN TEXT TYPE", $COLOR_RED) - Return -1 - ElseIf $Result[0] = -2 Then - SetLog(GetLangText("msgLicense"), $COLOR_RED) - Return -1 - Else -;~ SetLog("Returned data: " & $Result[0]) - Return $Result[0] - EndIf - Else - SetLog(GetLangText("msgDLLError"), $COLOR_RED) - Return -1 - EndIf - -EndFunc +Global Enum $textChat = 1, $textMainScreen, $textVillageSearch, $textReturnHome, $textWindows, $textWindowTitles, $textChatUser, $textDeployNumber +Global $textConstants[9][2] = [[0, ""], [10, "chatlog"], [12, "mainscreen"], [12, "villagesearch"], [16, "returnhome"], [10, "smallwindow"], [16, "smallwindowtitle"], [10, "chatuser"], [13, "deploynumber"]] + +Func ReadText($x, $y, $width, $type, $leftaligned = 1, $reversed = 0) + $height = $textConstants[$type][0] + $name = $textConstants[$type][1] + $Result = CallHelper("0 0 860 720 BrokenBotReadText " & $x & " " & $y & " " & $width & " " & $height & " " & $type & " " & $leftaligned & " " & $reversed, 3) + If $Result = $DLLFailed or $Result = $DLLTimeout or $Result = $DLLNegative Then + SetLog(GetLangText("msgDLLError"), $COLOR_RED) + Return -1 + ElseIf $Result = $DLLLicense Then + SetLog(GetLangText("msgLicense"), $COLOR_RED) + Return -1 + Else + Return $Result + EndIf +EndFunc diff --git a/BrokenBot.org/functions/Other/RedLineMath.au3 b/BrokenBot.org/functions/Other/RedLineMath.au3 index 3514f10..c5750a9 100644 --- a/BrokenBot.org/functions/Other/RedLineMath.au3 +++ b/BrokenBot.org/functions/Other/RedLineMath.au3 @@ -1,176 +1,176 @@ -Func GetPointDist($x, $y, $AimX, $AimY) - ; Finds the distance between somepoint $AimX, $AimY, and the redline outside of it from the perspective of point X, Y - $OrigX = $AimX - $OrigY = $AimY - For $i = 0 To 41 - For $j = 0 To 41 - If ($Grid[$i][$j][2] > 0 And $Grid[$i][$j + 1][2] > 0) Then ; Up and to the right edges - If (($x < $Grid[$i][$j + 1][0]) And ($Grid[$i][$j][0] < $AimX)) Or (($x > $Grid[$i][$j][0]) And ($Grid[$i][$j + 1][0] > $AimX)) Then - If (($y < $Grid[$i][$j][1]) And ($Grid[$i][$j + 1][1] < $AimY)) Or (($y > $Grid[$i][$j + 1][1]) And ($Grid[$i][$j][1] > $AimY)) Then - $A1 = $AimY - $y - $B1 = $x - $AimX - $C1 = ($A1 * $x) + ($B1 * $y) - $A2 = $Grid[$i][$j + 1][1] - $Grid[$i][$j][1] - $B2 = $Grid[$i][$j][0] - $Grid[$i][$j + 1][0] - $C2 = ($A2 * $Grid[$i][$j][0]) + ($B2 * $Grid[$i][$j][1]) - If $A1 * $B2 <> $A2 * $B1 Then - $IntX = ($B2 * $C1 - $B1 * $C2) / ($A1 * $B2 - $A2 * $B1) - If $Grid[$i][$j][0] < $IntX And $IntX < $Grid[$i][$j + 1][0] Then - ; They cross, so lets make intersection the new aimed point - $AimX = ($B2 * $C1 - $B1 * $C2) / ($A1 * $B2 - $A2 * $B1) - $AimY = ($A1 * $C2 - $A2 * $C1) / ($A1 * $B2 - $A2 * $B1) - EndIf - EndIf - EndIf - EndIf - EndIf - If ($Grid[$i][$j][2] > 0 And $Grid[$i + 1][$j][2] > 0) Then ; Down and to the right edges - If (($x < $Grid[$i + 1][$j][0]) And ($Grid[$i][$j][0] < $AimX)) Or (($x > $Grid[$i][$j][0]) And ($Grid[$i + 1][$j][0] > $AimX)) Then - If (($y < $Grid[$i + 1][$j][1]) And ($Grid[$i][$j][1] < $AimY)) Or (($y > $Grid[$i][$j][1]) And ($Grid[$i + 1][$j][1] > $AimY)) Then - $A1 = $AimY - $y - $B1 = $x - $AimX - $C1 = ($A1 * $x) + ($B1 * $y) - $A2 = $Grid[$i + 1][$j][1] - $Grid[$i][$j][1] - $B2 = $Grid[$i][$j][0] - $Grid[$i + 1][$j][0] - $C2 = ($A2 * $Grid[$i][$j][0]) + ($B2 * $Grid[$i][$j][1]) - If $A1 * $B2 <> $A2 * $B1 Then - $IntX = ($B2 * $C1 - $B1 * $C2) / ($A1 * $B2 - $A2 * $B1) - If $Grid[$i][$j][0] < $IntX And $IntX < $Grid[$i + 1][$j][0] Then - ; They cross, so lets make intersection the new aimed point - $AimX = ($B2 * $C1 - $B1 * $C2) / ($A1 * $B2 - $A2 * $B1) - $AimY = ($A1 * $C2 - $A2 * $C1) / ($A1 * $B2 - $A2 * $B1) - EndIf - EndIf - EndIf - EndIf - EndIf - Next - Next - $j = 42 - For $i = 0 To 41 - If ($Grid[$i][$j][2] > 0 And $Grid[$i + 1][$j][2] > 0) Then ; Down and to the right edges - If (($x < $Grid[$i + 1][$j][0]) And ($Grid[$i][$j][0] < $AimX)) Or (($x > $Grid[$i][$j][0]) And ($Grid[$i + 1][$j][0] > $AimX)) Then - If (($y < $Grid[$i + 1][$j][1]) And ($Grid[$i][$j][1] < $AimY)) Or (($y > $Grid[$i][$j][1]) And ($Grid[$i + 1][$j][1] > $AimY)) Then - $A1 = $AimY - $y - $B1 = $x - $AimX - $C1 = ($A1 * $x) + ($B1 * $y) - $A2 = $Grid[$i + 1][$j][1] - $Grid[$i][$j][1] - $B2 = $Grid[$i][$j][0] - $Grid[$i + 1][$j][0] - $C2 = ($A2 * $Grid[$i][$j][0]) + ($B2 * $Grid[$i][$j][1]) - If $A1 * $B2 <> $A2 * $B1 Then - $IntX = ($B2 * $C1 - $B1 * $C2) / ($A1 * $B2 - $A2 * $B1) - If $Grid[$i][$j][0] < $IntX And $IntX < $Grid[$i + 1][$j][0] Then - ; They cross, so lets make intersection the new aimed point - $AimX = ($B2 * $C1 - $B1 * $C2) / ($A1 * $B2 - $A2 * $B1) - $AimY = ($A1 * $C2 - $A2 * $C1) / ($A1 * $B2 - $A2 * $B1) - EndIf - EndIf - EndIf - EndIf - EndIf - Next - $i = 42 - For $j = 0 To 41 - If ($Grid[$i][$j][2] > 0 And $Grid[$i][$j + 1][2] > 0) Then ; Up and to the right edges - If (($x < $Grid[$i][$j + 1][0]) And ($Grid[$i][$j][0] < $AimX)) Or (($x > $Grid[$i][$j][0]) And ($Grid[$i][$j + 1][0] > $AimX)) Then - If (($y < $Grid[$i][$j][1]) And ($Grid[$i][$j + 1][1] < $AimY)) Or (($y > $Grid[$i][$j + 1][1]) And ($Grid[$i][$j][1] > $AimY)) Then - $A1 = $AimY - $y - $B1 = $x - $AimX - $C1 = ($A1 * $x) + ($B1 * $y) - $A2 = $Grid[$i][$j + 1][1] - $Grid[$i][$j][1] - $B2 = $Grid[$i][$j][0] - $Grid[$i][$j + 1][0] - $C2 = ($A2 * $Grid[$i][$j][0]) + ($B2 * $Grid[$i][$j][1]) - If $A1 * $B2 <> $A2 * $B1 Then - $IntX = ($B2 * $C1 - $B1 * $C2) / ($A1 * $B2 - $A2 * $B1) - If $Grid[$i][$j][0] < $IntX And $IntX < $Grid[$i][$j + 1][0] Then - ; They cross, so lets make intersection the new aimed point - $AimX = ($B2 * $C1 - $B1 * $C2) / ($A1 * $B2 - $A2 * $B1) - $AimY = ($A1 * $C2 - $A2 * $C1) / ($A1 * $B2 - $A2 * $B1) - EndIf - EndIf - EndIf - EndIf - EndIf - Next - ; Now we are sitting right on top of the edge so let's calculate how far we are - Local $Result[3] - $Result[0] = ((($AimX - $OrigX) ^ 2) + (($AimY - $OrigY) ^ 2)) ^ 0.5 - $Result[1] = $AimX - $Result[2] = $AimY - Return $Result -EndFunc ;==>GetPointDist - -Func CloseToEdge($CompX, $CompY, $Distance) - $Closest = 860 - For $clock = 0 To 8 - $x = $CompX - $y = $CompY - Switch $clock - Case 0 - $SpotA = FindIntersection($x, $y, $x, $y - 1, $FurthestTopLeft[0][0], $FurthestTopLeft[0][1], $FurthestTopLeft[4][0], $FurthestTopLeft[4][1]) - $SpotB = FindIntersection($x, $y, $x, $y - 1, $FurthestTopRight[0][0], $FurthestTopRight[0][1], $FurthestTopRight[4][0], $FurthestTopRight[4][1]) - If $SpotA[1] > $SpotB[1] Then - $x = $SpotA[0] - $y = $SpotA[1] - Else - $x = $SpotB[0] - $y = $SpotB[1] - EndIf - Case 1 - $SpotA = FindIntersection($x, $y, $x + 1, $y + (($FurthestTopLeft[4][1] - $FurthestTopLeft[0][1]) / ($FurthestTopLeft[4][0] - $FurthestTopLeft[0][0])), $FurthestTopRight[0][0], $FurthestTopRight[0][1], $FurthestTopRight[4][0], $FurthestTopRight[4][1]) - $x = $SpotA[0] - $y = $SpotA[1] - Case 2 - $SpotA = FindIntersection($x, $y, $x + 1, $y, $FurthestBottomRight[0][0], $FurthestBottomRight[0][1], $FurthestBottomRight[4][0], $FurthestBottomRight[4][1]) - $SpotB = FindIntersection($x, $y, $x + 1, $y, $FurthestTopRight[0][0], $FurthestTopRight[0][1], $FurthestTopRight[4][0], $FurthestTopRight[4][1]) - If $SpotA[0] < $SpotB[0] Then - $x = $SpotA[0] - $y = $SpotA[1] - Else - $x = $SpotB[0] - $y = $SpotB[1] - EndIf - Case 3 - $SpotA = FindIntersection($x, $y, $x + 1, $y + (($FurthestTopRight[4][1] - $FurthestTopRight[0][1]) / ($FurthestTopRight[4][0] - $FurthestTopRight[0][0])), $FurthestBottomRight[0][0], $FurthestBottomRight[0][1], $FurthestBottomRight[4][0], $FurthestBottomRight[4][1]) - $x = $SpotA[0] - $y = $SpotA[1] - Case 4 - $SpotA = FindIntersection($x, $y, $x, $y + 1, $FurthestBottomLeft[0][0], $FurthestBottomLeft[0][1], $FurthestBottomLeft[4][0], $FurthestBottomLeft[4][1]) - $SpotB = FindIntersection($x, $y, $x, $y + 1, $FurthestBottomRight[0][0], $FurthestBottomRight[0][1], $FurthestBottomRight[4][0], $FurthestBottomRight[4][1]) - If $SpotA[1] < $SpotB[1] Then - $x = $SpotA[0] - $y = $SpotA[1] - Else - $x = $SpotB[0] - $y = $SpotB[1] - EndIf - Case 5 - $SpotA = FindIntersection($x, $y, $x + 1, $y + (($FurthestTopLeft[4][1] - $FurthestTopLeft[0][1]) / ($FurthestTopLeft[4][0] - $FurthestTopLeft[0][0])), $FurthestBottomLeft[0][0], $FurthestBottomLeft[0][1], $FurthestBottomLeft[4][0], $FurthestBottomLeft[4][1]) - $x = $SpotA[0] - $y = $SpotA[1] - Case 6 - $SpotA = FindIntersection($x, $y, $x - 1, $y, $FurthestTopLeft[0][0], $FurthestTopLeft[0][1], $FurthestTopLeft[4][0], $FurthestTopLeft[4][1]) - $SpotB = FindIntersection($x, $y, $x - 1, $y, $FurthestBottomLeft[0][0], $FurthestBottomLeft[0][1], $FurthestBottomLeft[4][0], $FurthestBottomLeft[4][1]) - If $SpotA[0] > $SpotB[0] Then - $x = $SpotA[0] - $y = $SpotA[1] - Else - $x = $SpotB[0] - $y = $SpotB[1] - EndIf - Case 7 - $SpotA = FindIntersection($x, $y, $x + 1, $y + (($FurthestTopRight[4][1] - $FurthestTopRight[0][1]) / ($FurthestTopRight[4][0] - $FurthestTopRight[0][0])), $FurthestTopLeft[0][0], $FurthestTopLeft[0][1], $FurthestTopLeft[4][0], $FurthestTopLeft[4][1]) - $x = $SpotA[0] - $y = $SpotA[1] - EndSwitch - $DirectionPt = GetPointDist($x, $y, $CompX, $CompY) - If $DirectionPt[0] < $Closest And $DirectionPt[0] > 0 Then - $Closest = $DirectionPt[0] - EndIf - Next - If $Closest < $Distance Then - Return True - Else - Return False - EndIf -EndFunc +Func GetPointDist($x, $y, $AimX, $AimY) + ; Finds the distance between somepoint $AimX, $AimY, and the redline outside of it from the perspective of point X, Y + $OrigX = $AimX + $OrigY = $AimY + For $i = 0 To 41 + For $j = 0 To 41 + If ($Grid[$i][$j][2] > 0 And $Grid[$i][$j + 1][2] > 0) Then ; Up and to the right edges + If (($x < $Grid[$i][$j + 1][0]) And ($Grid[$i][$j][0] < $AimX)) Or (($x > $Grid[$i][$j][0]) And ($Grid[$i][$j + 1][0] > $AimX)) Then + If (($y < $Grid[$i][$j][1]) And ($Grid[$i][$j + 1][1] < $AimY)) Or (($y > $Grid[$i][$j + 1][1]) And ($Grid[$i][$j][1] > $AimY)) Then + $A1 = $AimY - $y + $B1 = $x - $AimX + $C1 = ($A1 * $x) + ($B1 * $y) + $A2 = $Grid[$i][$j + 1][1] - $Grid[$i][$j][1] + $B2 = $Grid[$i][$j][0] - $Grid[$i][$j + 1][0] + $C2 = ($A2 * $Grid[$i][$j][0]) + ($B2 * $Grid[$i][$j][1]) + If $A1 * $B2 <> $A2 * $B1 Then + $IntX = ($B2 * $C1 - $B1 * $C2) / ($A1 * $B2 - $A2 * $B1) + If $Grid[$i][$j][0] < $IntX And $IntX < $Grid[$i][$j + 1][0] Then + ; They cross, so lets make intersection the new aimed point + $AimX = ($B2 * $C1 - $B1 * $C2) / ($A1 * $B2 - $A2 * $B1) + $AimY = ($A1 * $C2 - $A2 * $C1) / ($A1 * $B2 - $A2 * $B1) + EndIf + EndIf + EndIf + EndIf + EndIf + If ($Grid[$i][$j][2] > 0 And $Grid[$i + 1][$j][2] > 0) Then ; Down and to the right edges + If (($x < $Grid[$i + 1][$j][0]) And ($Grid[$i][$j][0] < $AimX)) Or (($x > $Grid[$i][$j][0]) And ($Grid[$i + 1][$j][0] > $AimX)) Then + If (($y < $Grid[$i + 1][$j][1]) And ($Grid[$i][$j][1] < $AimY)) Or (($y > $Grid[$i][$j][1]) And ($Grid[$i + 1][$j][1] > $AimY)) Then + $A1 = $AimY - $y + $B1 = $x - $AimX + $C1 = ($A1 * $x) + ($B1 * $y) + $A2 = $Grid[$i + 1][$j][1] - $Grid[$i][$j][1] + $B2 = $Grid[$i][$j][0] - $Grid[$i + 1][$j][0] + $C2 = ($A2 * $Grid[$i][$j][0]) + ($B2 * $Grid[$i][$j][1]) + If $A1 * $B2 <> $A2 * $B1 Then + $IntX = ($B2 * $C1 - $B1 * $C2) / ($A1 * $B2 - $A2 * $B1) + If $Grid[$i][$j][0] < $IntX And $IntX < $Grid[$i + 1][$j][0] Then + ; They cross, so lets make intersection the new aimed point + $AimX = ($B2 * $C1 - $B1 * $C2) / ($A1 * $B2 - $A2 * $B1) + $AimY = ($A1 * $C2 - $A2 * $C1) / ($A1 * $B2 - $A2 * $B1) + EndIf + EndIf + EndIf + EndIf + EndIf + Next + Next + $j = 42 + For $i = 0 To 41 + If ($Grid[$i][$j][2] > 0 And $Grid[$i + 1][$j][2] > 0) Then ; Down and to the right edges + If (($x < $Grid[$i + 1][$j][0]) And ($Grid[$i][$j][0] < $AimX)) Or (($x > $Grid[$i][$j][0]) And ($Grid[$i + 1][$j][0] > $AimX)) Then + If (($y < $Grid[$i + 1][$j][1]) And ($Grid[$i][$j][1] < $AimY)) Or (($y > $Grid[$i][$j][1]) And ($Grid[$i + 1][$j][1] > $AimY)) Then + $A1 = $AimY - $y + $B1 = $x - $AimX + $C1 = ($A1 * $x) + ($B1 * $y) + $A2 = $Grid[$i + 1][$j][1] - $Grid[$i][$j][1] + $B2 = $Grid[$i][$j][0] - $Grid[$i + 1][$j][0] + $C2 = ($A2 * $Grid[$i][$j][0]) + ($B2 * $Grid[$i][$j][1]) + If $A1 * $B2 <> $A2 * $B1 Then + $IntX = ($B2 * $C1 - $B1 * $C2) / ($A1 * $B2 - $A2 * $B1) + If $Grid[$i][$j][0] < $IntX And $IntX < $Grid[$i + 1][$j][0] Then + ; They cross, so lets make intersection the new aimed point + $AimX = ($B2 * $C1 - $B1 * $C2) / ($A1 * $B2 - $A2 * $B1) + $AimY = ($A1 * $C2 - $A2 * $C1) / ($A1 * $B2 - $A2 * $B1) + EndIf + EndIf + EndIf + EndIf + EndIf + Next + $i = 42 + For $j = 0 To 41 + If ($Grid[$i][$j][2] > 0 And $Grid[$i][$j + 1][2] > 0) Then ; Up and to the right edges + If (($x < $Grid[$i][$j + 1][0]) And ($Grid[$i][$j][0] < $AimX)) Or (($x > $Grid[$i][$j][0]) And ($Grid[$i][$j + 1][0] > $AimX)) Then + If (($y < $Grid[$i][$j][1]) And ($Grid[$i][$j + 1][1] < $AimY)) Or (($y > $Grid[$i][$j + 1][1]) And ($Grid[$i][$j][1] > $AimY)) Then + $A1 = $AimY - $y + $B1 = $x - $AimX + $C1 = ($A1 * $x) + ($B1 * $y) + $A2 = $Grid[$i][$j + 1][1] - $Grid[$i][$j][1] + $B2 = $Grid[$i][$j][0] - $Grid[$i][$j + 1][0] + $C2 = ($A2 * $Grid[$i][$j][0]) + ($B2 * $Grid[$i][$j][1]) + If $A1 * $B2 <> $A2 * $B1 Then + $IntX = ($B2 * $C1 - $B1 * $C2) / ($A1 * $B2 - $A2 * $B1) + If $Grid[$i][$j][0] < $IntX And $IntX < $Grid[$i][$j + 1][0] Then + ; They cross, so lets make intersection the new aimed point + $AimX = ($B2 * $C1 - $B1 * $C2) / ($A1 * $B2 - $A2 * $B1) + $AimY = ($A1 * $C2 - $A2 * $C1) / ($A1 * $B2 - $A2 * $B1) + EndIf + EndIf + EndIf + EndIf + EndIf + Next + ; Now we are sitting right on top of the edge so let's calculate how far we are + Local $Result[3] + $Result[0] = ((($AimX - $OrigX) ^ 2) + (($AimY - $OrigY) ^ 2)) ^ 0.5 + $Result[1] = $AimX + $Result[2] = $AimY + Return $Result +EndFunc ;==>GetPointDist + +Func CloseToEdge($CompX, $CompY, $Distance) + $Closest = 860 + For $clock = 0 To 8 + $x = $CompX + $y = $CompY + Switch $clock + Case 0 + $SpotA = FindIntersection($x, $y, $x, $y - 1, $FurthestTopLeft[0][0], $FurthestTopLeft[0][1], $FurthestTopLeft[4][0], $FurthestTopLeft[4][1]) + $SpotB = FindIntersection($x, $y, $x, $y - 1, $FurthestTopRight[0][0], $FurthestTopRight[0][1], $FurthestTopRight[4][0], $FurthestTopRight[4][1]) + If $SpotA[1] > $SpotB[1] Then + $x = $SpotA[0] + $y = $SpotA[1] + Else + $x = $SpotB[0] + $y = $SpotB[1] + EndIf + Case 1 + $SpotA = FindIntersection($x, $y, $x + 1, $y + (($FurthestTopLeft[4][1] - $FurthestTopLeft[0][1]) / ($FurthestTopLeft[4][0] - $FurthestTopLeft[0][0])), $FurthestTopRight[0][0], $FurthestTopRight[0][1], $FurthestTopRight[4][0], $FurthestTopRight[4][1]) + $x = $SpotA[0] + $y = $SpotA[1] + Case 2 + $SpotA = FindIntersection($x, $y, $x + 1, $y, $FurthestBottomRight[0][0], $FurthestBottomRight[0][1], $FurthestBottomRight[4][0], $FurthestBottomRight[4][1]) + $SpotB = FindIntersection($x, $y, $x + 1, $y, $FurthestTopRight[0][0], $FurthestTopRight[0][1], $FurthestTopRight[4][0], $FurthestTopRight[4][1]) + If $SpotA[0] < $SpotB[0] Then + $x = $SpotA[0] + $y = $SpotA[1] + Else + $x = $SpotB[0] + $y = $SpotB[1] + EndIf + Case 3 + $SpotA = FindIntersection($x, $y, $x + 1, $y + (($FurthestTopRight[4][1] - $FurthestTopRight[0][1]) / ($FurthestTopRight[4][0] - $FurthestTopRight[0][0])), $FurthestBottomRight[0][0], $FurthestBottomRight[0][1], $FurthestBottomRight[4][0], $FurthestBottomRight[4][1]) + $x = $SpotA[0] + $y = $SpotA[1] + Case 4 + $SpotA = FindIntersection($x, $y, $x, $y + 1, $FurthestBottomLeft[0][0], $FurthestBottomLeft[0][1], $FurthestBottomLeft[4][0], $FurthestBottomLeft[4][1]) + $SpotB = FindIntersection($x, $y, $x, $y + 1, $FurthestBottomRight[0][0], $FurthestBottomRight[0][1], $FurthestBottomRight[4][0], $FurthestBottomRight[4][1]) + If $SpotA[1] < $SpotB[1] Then + $x = $SpotA[0] + $y = $SpotA[1] + Else + $x = $SpotB[0] + $y = $SpotB[1] + EndIf + Case 5 + $SpotA = FindIntersection($x, $y, $x + 1, $y + (($FurthestTopLeft[4][1] - $FurthestTopLeft[0][1]) / ($FurthestTopLeft[4][0] - $FurthestTopLeft[0][0])), $FurthestBottomLeft[0][0], $FurthestBottomLeft[0][1], $FurthestBottomLeft[4][0], $FurthestBottomLeft[4][1]) + $x = $SpotA[0] + $y = $SpotA[1] + Case 6 + $SpotA = FindIntersection($x, $y, $x - 1, $y, $FurthestTopLeft[0][0], $FurthestTopLeft[0][1], $FurthestTopLeft[4][0], $FurthestTopLeft[4][1]) + $SpotB = FindIntersection($x, $y, $x - 1, $y, $FurthestBottomLeft[0][0], $FurthestBottomLeft[0][1], $FurthestBottomLeft[4][0], $FurthestBottomLeft[4][1]) + If $SpotA[0] > $SpotB[0] Then + $x = $SpotA[0] + $y = $SpotA[1] + Else + $x = $SpotB[0] + $y = $SpotB[1] + EndIf + Case 7 + $SpotA = FindIntersection($x, $y, $x + 1, $y + (($FurthestTopRight[4][1] - $FurthestTopRight[0][1]) / ($FurthestTopRight[4][0] - $FurthestTopRight[0][0])), $FurthestTopLeft[0][0], $FurthestTopLeft[0][1], $FurthestTopLeft[4][0], $FurthestTopLeft[4][1]) + $x = $SpotA[0] + $y = $SpotA[1] + EndSwitch + $DirectionPt = GetPointDist($x, $y, $CompX, $CompY) + If $DirectionPt[0] < $Closest And $DirectionPt[0] > 0 Then + $Closest = $DirectionPt[0] + EndIf + Next + If $Closest < $Distance Then + Return True + Else + Return False + EndIf +EndFunc diff --git a/BrokenBot.org/functions/Other/StatusCheck.au3 b/BrokenBot.org/functions/Other/StatusCheck.au3 index dd6629d..e67ae9f 100644 --- a/BrokenBot.org/functions/Other/StatusCheck.au3 +++ b/BrokenBot.org/functions/Other/StatusCheck.au3 @@ -1,30 +1,35 @@ -; This code was created for public use by BrokenBot.org and falls under the GPLv3 license. -; This code can be incorporated into open source/non-profit projects free of charge and without consent. -; **NOT FOR COMMERCIAL USE** by any project which includes any part of the code in this sub-directory without express written consent of BrokenBot.org -; You **MAY NOT SOLICIT DONATIONS** from any project which includes any part of the code in this sub-directory without express written consent of BrokenBot.org -; -Func StatusCheck($OnMainScreen = True, $WriteLog = False, $maxDelay = 1) - ; Allows for pauses - ; Checks for main screen if $OnMainScreen=True - ; If unable to find zoomed out main screen after resuming, it will continue looping until such time as it does - ; Returns True if bot no longer running after completion. - - If Pause() Then Return - If $OnMainScreen Then - While Not checkMainScreen($WriteLog, $maxDelay) - If BotStopped(False) Then Return True - SetLog(GetLangText("msgFailedZoomout"), $COLOR_RED) - SetLog(GetLangText("msgWaitMinute"), $COLOR_RED) - If _Sleep(6000) Then Return False - WEnd - If $PauseBot = True And GUICtrlRead($btnPause) = "Pause" Then btnPause() - If $PauseBot = False And GUICtrlRead($btnPause) = "Resume" Then btnPause() - EndIf - If Pause() Then Return - If BotStopped($OnMainScreen) Then - Return True - Else - Return False - EndIf -EndFunc ;==>StatusCheck - +; This code was created for public use by BrokenBot.org and falls under the GPLv3 license. +; This code can be incorporated into open source/non-profit projects free of charge and without consent. +; **NOT FOR COMMERCIAL USE** by any project which includes any part of the code in this sub-directory without express written consent of BrokenBot.org +; You **MAY NOT SOLICIT DONATIONS** from any project which includes any part of the code in this sub-directory without express written consent of BrokenBot.org +; +Func StatusCheck($OnMainScreen = True, $WriteLog = False, $maxDelay = 1) + ; Allows for pauses + ; Checks for main screen if $OnMainScreen=True + ; If unable to find zoomed out main screen after resuming, it will continue looping until such time as it does + ; Returns True if bot no longer running after completion. + If Pause() Then Return + If $OnMainScreen Then + Local $waitCounter = 0 + While Not checkMainScreen($WriteLog, $maxDelay) + If $waitCounter > 5 Then ;5 minutes passed + restartBlueStack() + $waitCounter = 0 + EndIf + If BotStopped(False) Then Return True + SetLog(GetLangText("msgFailedZoomout"), $COLOR_RED) + SetLog(GetLangText("msgWaitMinute"), $COLOR_RED) + If _Sleep(6000) Then Return False + $waitCounter += 1 + WEnd + If $PauseBot = True And GUICtrlRead($btnPause) = "Pause" Then btnPause() + If $PauseBot = False And GUICtrlRead($btnPause) = "Resume" Then btnPause() + EndIf + If Pause() Then Return + If BotStopped($OnMainScreen) Then + Return True + Else + Return False + EndIf +EndFunc ;==>StatusCheck + diff --git a/BrokenBot.org/functions/Other/checkupdate.au3 b/BrokenBot.org/functions/Other/checkupdate.au3 index e370890..63d79f8 100644 --- a/BrokenBot.org/functions/Other/checkupdate.au3 +++ b/BrokenBot.org/functions/Other/checkupdate.au3 @@ -1,160 +1,160 @@ -; #FUNCTION# ;=============================================================================== -; -; Name...........: _ExtractZip -; Description ...: Extracts file/folder from ZIP compressed file -; Syntax.........: _ExtractZip($sZipFile, $sDestinationFolder) -; Parameters ....: $sZipFile - full path to the ZIP file to process -; $sDestinationFolder - folder to extract to. Will be created if it does not exsist exist. -; Return values .: Success - Returns 1 -; - Sets @error to 0 -; Failure - Returns 0 sets @error: -; |1 - Shell Object creation failure -; |2 - Destination folder is unavailable -; |3 - Structure within ZIP file is wrong -; |4 - Specified file/folder to extract not existing -; Author ........: trancexx, modifyed by corgano -; -;========================================================================================== -Func _ExtractZip($sZipFile, $sDestinationFolder, $sFolderStructure = "") - - Local $i - Do - $i += 1 - $sTempZipFolder = @TempDir & "\Temporary Directory " & $i & " for " & StringRegExpReplace($sZipFile, ".*\\", "") - Until Not FileExists($sTempZipFolder) ; this folder will be created during extraction - - Local $oShell = ObjCreate("Shell.Application") - - If Not IsObj($oShell) Then - Return SetError(1, 0, 0) ; highly unlikely but could happen - EndIf - - Local $oDestinationFolder = $oShell.NameSpace($sDestinationFolder) - If Not IsObj($oDestinationFolder) Then - DirCreate($sDestinationFolder) -;~ Return SetError(2, 0, 0) ; unavailable destionation location - EndIf - - Local $oOriginFolder = $oShell.NameSpace($sZipFile & "\" & $sFolderStructure) ; FolderStructure is overstatement because of the available depth - If Not IsObj($oOriginFolder) Then - Return SetError(3, 0, 0) ; unavailable location - EndIf - - Local $oOriginFile = $oOriginFolder.Items();get all items - If Not IsObj($oOriginFile) Then - Return SetError(4, 0, 0) ; no such file in ZIP file - EndIf - - ; copy content of origin to destination - $oDestinationFolder.CopyHere($oOriginFile, 20) ; 20 means 4 and 16, replaces files if asked - - DirRemove($sTempZipFolder, 1) ; clean temp dir - - Return 1 ; All OK! - -EndFunc ;==>_ExtractZip - -; The code below was created for public use by BrokenBot.org and falls under the GPLv3 license. -; This code can be incorporated into open source/non-profit projects free of charge and without consent. -; **NOT FOR COMMERCIAL USE** by any project which includes any part of the code in this sub-directory without express written consent of BrokenBot.org -; You **MAY NOT SOLICIT DONATIONS** from any project which includes any part of the code in this sub-directory without express written consent of BrokenBot.org -; -Func checkupdate() - $hUpdateTimer = TimerInit() - If IsChecked($chkUpdate) Then - Local $sFilePath = @TempDir & "\update.dat" - - Local $UsingBeta = StringInStr($sBotVersion, "BETA") - Local $VersionCompare = StringReplace($sBotVersion, " BETA", "") -;~ Local $hMasterVersion = InetGet("http://www.brokenbot.org/page.php?p=vcheck", $sFilePath, 3) - Local $hMasterVersion = InetGet("https://github.com/codebroken/BrokenBot/blob/master/BrokenBot.au3", $sFilePath, 3) - - If $hMasterVersion = 0 Then - SetLog(GetLangText("msgFailedVersion")) - Else - $hReadFile = FileOpen($sFilePath) - While True - $strReadLine = FileReadLine($hReadFile) - If @error Then ExitLoop - If StringInStr($strReadLine, "$sBotVersion") Then - $split = StringSplit($strReadLine, """, 1) - SetLog(GetLangText("msgVersionOnline") & $split[2]) - If ($VersionCompare < $split[2]) Or ($UsingBeta And $VersionCompare = $split[2]) Then - SetLog(GetLangText("msgUpdateNeeded")) - InetGet("https://raw.githubusercontent.com/codebroken/BrokenBot/master/changelog.md", @TempDir & "\brokenbotchangelog.md", 3) - $strReleaseNotes = "" - $fileopen = FileOpen(@TempDir & "\brokenbotchangelog.md") - If @error Then SetLog(GetLangText("msgFailedVersion")) - FileReadLine($fileopen) - FileReadLine($fileopen) - While True - $line = FileReadLine($fileopen) - If @error Then ExitLoop - If StringLeft($line, 3) = "###" Then - If StringReplace($line, "### v", "") <= $VersionCompare Then - ExitLoop - EndIf - EndIf - If StringStripWS($line, 3) <> "" Then SetLog($line) - $strReleaseNotes = $strReleaseNotes & StringReplace($line, "### ", "") & @CRLF - WEnd - FileClose($fileopen) - FileDelete(@TempDir & "\brokenbotchangelog.md") - If MsgBox($MB_OKCANCEL, GetLangText("boxUpdate"), GetLangText("boxUpdate2") & @CRLF & @CRLF & GetLangText("boxUpdate3") & @CRLF & @CRLF & GetLangText("boxUpdate5") & @CRLF & @CRLF & GetLangText("boxUpdate6") & @CRLF & @CRLF & $strReleaseNotes, 0, $frmBot) = $IDOK Then - SetLog(GetLangText("msgDownloading")) - InetGet("https://github.com/codebroken/BrokenBot/archive/master.zip", @TempDir & "\BrokenBot-master.zip", 3) - If Not FileExists(@TempDir & "\BrokenBot-master.zip") Then - MsgBox(0, "", GetLangText("boxUpdateError")) - Else - SetLog(GetLangText("msgUnzipping")) - If Not FileExists(@TempDir & "\TempUpdateFolder") Then - DirCreate(@TempDir & "\TempUpdateFolder") - EndIf - If _ExtractZip(@TempDir & "\BrokenBot-master.zip", @TempDir & "\TempUpdateFolder") <> 1 Then - MsgBox(0, "", GetLangText("boxUpdateExtract")) - Else - SetLog(GetLangText("msgInstallandRestart")) - DllClose($KernelDLL) - _GDIPlus_Shutdown() - _Crypt_Shutdown() - $fileopen = FileOpen(@TempDir & "\brokenbotupdate.bat", 2) - FileWriteLine($fileopen, 'xcopy "' & @TempDir & '\TempUpdateFolder\BrokenBot-master\*.*" "' & @ScriptDir & '\" /S /E /Y') - FileWriteLine($fileopen, 'del "' & @TempDir & '\TempUpdateFolder\*.*" /S /Q') - FileWriteLine($fileopen, 'del "' & @TempDir & '\BrokenBot-master.zip" /S /Q') - FileWriteLine($fileopen, 'rd "' & @TempDir & '\TempUpdateFolder" /S /Q') - FileWriteLine($fileopen, 'start "" /D "' & @ScriptDir & '\" BrokenBot.exe') - FileClose($fileopen) - _GUICtrlRichEdit_Destroy($txtLog) - Run(@ComSpec & ' /c "' & @TempDir & '\brokenbotupdate.bat"', @SystemDir, @SW_SHOW) - Exit - EndIf - EndIf - EndIf - ElseIf $UsingBeta Then - SetLog(GetLangText("msgRunningBeta")) - ElseIf $VersionCompare > $split[2] Then - SetLog(GetLangText("msgAheadMaster")) - Else - SetLog(GetLangText("msgNoUpdateNeeded")) - EndIf - FileClose($hReadFile) - FileDelete($sFilePath) - Return - EndIf - WEnd - SetLog(GetLangText("msgFailedVersion")) - FileClose($hReadFile) - FileDelete($sFilePath) - EndIf - EndIf -EndFunc ;==>checkupdate - -Func _Dcrypt($sData) - Local $hKey = _Crypt_DeriveKey("DE8D16C2C59B93F3F0682250B", 0x00006610) - Local $sDecrypted = BinaryToString(_Crypt_DecryptData(Binary($sData), $hKey, $CALG_USERKEY)) - _Crypt_DestroyKey($hKey) - Return $sBotVersion -EndFunc ;==>_Decrypt - - - +; #FUNCTION# ;=============================================================================== +; +; Name...........: _ExtractZip +; Description ...: Extracts file/folder from ZIP compressed file +; Syntax.........: _ExtractZip($sZipFile, $sDestinationFolder) +; Parameters ....: $sZipFile - full path to the ZIP file to process +; $sDestinationFolder - folder to extract to. Will be created if it does not exsist exist. +; Return values .: Success - Returns 1 +; - Sets @error to 0 +; Failure - Returns 0 sets @error: +; |1 - Shell Object creation failure +; |2 - Destination folder is unavailable +; |3 - Structure within ZIP file is wrong +; |4 - Specified file/folder to extract not existing +; Author ........: trancexx, modifyed by corgano +; +;========================================================================================== +Func _ExtractZip($sZipFile, $sDestinationFolder, $sFolderStructure = "") + + Local $i + Do + $i += 1 + $sTempZipFolder = @TempDir & "\Temporary Directory " & $i & " for " & StringRegExpReplace($sZipFile, ".*\\", "") + Until Not FileExists($sTempZipFolder) ; this folder will be created during extraction + + Local $oShell = ObjCreate("Shell.Application") + + If Not IsObj($oShell) Then + Return SetError(1, 0, 0) ; highly unlikely but could happen + EndIf + + Local $oDestinationFolder = $oShell.NameSpace($sDestinationFolder) + If Not IsObj($oDestinationFolder) Then + DirCreate($sDestinationFolder) +;~ Return SetError(2, 0, 0) ; unavailable destionation location + EndIf + + Local $oOriginFolder = $oShell.NameSpace($sZipFile & "\" & $sFolderStructure) ; FolderStructure is overstatement because of the available depth + If Not IsObj($oOriginFolder) Then + Return SetError(3, 0, 0) ; unavailable location + EndIf + + Local $oOriginFile = $oOriginFolder.Items();get all items + If Not IsObj($oOriginFile) Then + Return SetError(4, 0, 0) ; no such file in ZIP file + EndIf + + ; copy content of origin to destination + $oDestinationFolder.CopyHere($oOriginFile, 20) ; 20 means 4 and 16, replaces files if asked + + DirRemove($sTempZipFolder, 1) ; clean temp dir + + Return 1 ; All OK! + +EndFunc ;==>_ExtractZip + +; The code below was created for public use by BrokenBot.org and falls under the GPLv3 license. +; This code can be incorporated into open source/non-profit projects free of charge and without consent. +; **NOT FOR COMMERCIAL USE** by any project which includes any part of the code in this sub-directory without express written consent of BrokenBot.org +; You **MAY NOT SOLICIT DONATIONS** from any project which includes any part of the code in this sub-directory without express written consent of BrokenBot.org +; +Func checkupdate() + $hUpdateTimer = TimerInit() + If IsChecked($chkUpdate) Then + Local $sFilePath = @TempDir & "\update.dat" + + Local $UsingBeta = StringInStr($sBotVersion, "BETA") + Local $VersionCompare = StringReplace($sBotVersion, " BETA", "") +;~ Local $hMasterVersion = InetGet("http://www.brokenbot.org/page.php?p=vcheck", $sFilePath, 3) + Local $hMasterVersion = InetGet("https://github.com/codebroken/BrokenBot/blob/master/BrokenBot.au3", $sFilePath, 3) + + If $hMasterVersion = 0 Then + SetLog(GetLangText("msgFailedVersion")) + Else + $hReadFile = FileOpen($sFilePath) + While True + $strReadLine = FileReadLine($hReadFile) + If @error Then ExitLoop + If StringInStr($strReadLine, "$sBotVersion") Then + $split = StringSplit($strReadLine, """, 1) + SetLog(GetLangText("msgVersionOnline") & $split[2]) + If ($VersionCompare < $split[2]) Or ($UsingBeta And $VersionCompare = $split[2]) Then + SetLog(GetLangText("msgUpdateNeeded")) + InetGet("https://raw.githubusercontent.com/codebroken/BrokenBot/master/changelog.md", @TempDir & "\brokenbotchangelog.md", 3) + $strReleaseNotes = "" + $fileopen = FileOpen(@TempDir & "\brokenbotchangelog.md") + If @error Then SetLog(GetLangText("msgFailedVersion")) + FileReadLine($fileopen) + FileReadLine($fileopen) + While True + $line = FileReadLine($fileopen) + If @error Then ExitLoop + If StringLeft($line, 3) = "###" Then + If StringReplace($line, "### v", "") <= $VersionCompare Then + ExitLoop + EndIf + EndIf + If StringStripWS($line, 3) <> "" Then SetLog($line) + $strReleaseNotes = $strReleaseNotes & StringReplace($line, "### ", "") & @CRLF + WEnd + FileClose($fileopen) + FileDelete(@TempDir & "\brokenbotchangelog.md") + If MsgBox($MB_OKCANCEL, GetLangText("boxUpdate"), GetLangText("boxUpdate2") & @CRLF & @CRLF & GetLangText("boxUpdate3") & @CRLF & @CRLF & GetLangText("boxUpdate5") & @CRLF & @CRLF & GetLangText("boxUpdate6") & @CRLF & @CRLF & $strReleaseNotes, 0, $frmBot) = $IDOK Then + SetLog(GetLangText("msgDownloading")) + InetGet("https://github.com/codebroken/BrokenBot/archive/master.zip", @TempDir & "\BrokenBot-master.zip", 3) + If Not FileExists(@TempDir & "\BrokenBot-master.zip") Then + MsgBox(0, "", GetLangText("boxUpdateError")) + Else + SetLog(GetLangText("msgUnzipping")) + If Not FileExists(@TempDir & "\TempUpdateFolder") Then + DirCreate(@TempDir & "\TempUpdateFolder") + EndIf + If _ExtractZip(@TempDir & "\BrokenBot-master.zip", @TempDir & "\TempUpdateFolder") <> 1 Then + MsgBox(0, "", GetLangText("boxUpdateExtract")) + Else + SetLog(GetLangText("msgInstallandRestart")) + DllClose($KernelDLL) + _GDIPlus_Shutdown() + _Crypt_Shutdown() + $fileopen = FileOpen(@TempDir & "\brokenbotupdate.bat", 2) + FileWriteLine($fileopen, 'xcopy "' & @TempDir & '\TempUpdateFolder\BrokenBot-master\*.*" "' & @ScriptDir & '\" /S /E /Y') + FileWriteLine($fileopen, 'del "' & @TempDir & '\TempUpdateFolder\*.*" /S /Q') + FileWriteLine($fileopen, 'del "' & @TempDir & '\BrokenBot-master.zip" /S /Q') + FileWriteLine($fileopen, 'rd "' & @TempDir & '\TempUpdateFolder" /S /Q') + FileWriteLine($fileopen, 'start "" /D "' & @ScriptDir & '\" BrokenBot.exe') + FileClose($fileopen) + _GUICtrlRichEdit_Destroy($txtLog) + Run(@ComSpec & ' /c "' & @TempDir & '\brokenbotupdate.bat"', @SystemDir, @SW_SHOW) + Exit + EndIf + EndIf + EndIf + ElseIf $UsingBeta Then + SetLog(GetLangText("msgRunningBeta")) + ElseIf $VersionCompare > $split[2] Then + SetLog(GetLangText("msgAheadMaster")) + Else + SetLog(GetLangText("msgNoUpdateNeeded")) + EndIf + FileClose($hReadFile) + FileDelete($sFilePath) + Return + EndIf + WEnd + SetLog(GetLangText("msgFailedVersion")) + FileClose($hReadFile) + FileDelete($sFilePath) + EndIf + EndIf +EndFunc ;==>checkupdate + +Func _Dcrypt($sData) + Local $hKey = _Crypt_DeriveKey("DE8D16C2C59B93F3F0682250B", 0x00006610) + Local $sDecrypted = BinaryToString(_Crypt_DecryptData(Binary($sData), $hKey, $CALG_USERKEY)) + _Crypt_DestroyKey($hKey) + Return $sBotVersion +EndFunc ;==>_Decrypt + + + diff --git a/BrokenBot.org/functions/Other/maths.au3 b/BrokenBot.org/functions/Other/maths.au3 index 709a481..b8a4e91 100644 --- a/BrokenBot.org/functions/Other/maths.au3 +++ b/BrokenBot.org/functions/Other/maths.au3 @@ -1,146 +1,146 @@ -Global Const $pi = 4 * ATan(1) - -Func FindIntersection($Ax1, $Ay1, $Ax2, $Ay2, $Bx1, $By1, $Bx2, $By2) - $A1 = $Ay2 - $Ay1 - $B1 = $Ax1 - $Ax2 - $C1 = ($A1 * $Ax1) + ($B1 * $Ay1) - $A2 = $By2 - $By1 - $B2 = $Bx1 - $Bx2 - $C2 = ($A2 * $Bx1) + ($B2 * $By1) - If $A1 * $B2 <> $A2 * $B1 Then - Local $Return[2] - $Return[0] = ($B2 * $C1 - $B1 * $C2) / ($A1 * $B2 - $A2 * $B1) - $Return[1] = ($A1 * $C2 - $A2 * $C1) / ($A1 * $B2 - $A2 * $B1) - Return $Return - Else - Return -1 - EndIf -EndFunc - -Func Max($A, $B) - If $A > $B Then - Return $A - Else - Return $B - EndIf -EndFunc - -Func Min($A, $B) - If $A < $B Then - Return $A - Else - Return $B - EndIf -EndFunc - -Func IsBetween($A, $B, $C) - If $A <= Max($B, $C) And $A >= Min($B, $C) Then Return True - Return False -EndFunc - -Func onSegment($Px, $Py, $Qx, $Qy, $Rx, $Ry) - If $Qx <= Max($Px, $Rx) And $Qx >= Min($Px, $Rx) And $Qy <= Max($Py, $Ry) And $Qy >= Min($Py, $Ry) Then - Return True - Else - Return False - EndIf -EndFunc - -Func Orientation($Px, $Py, $Qx, $Qy, $Rx, $Ry) - $val = ($Qy - $Py) * ($Rx - $Qx) - ($Qx - $Px) * ($Ry - $Qy) - If $val = 0 Then Return 0 - Return ($val > 0) ? (1) : (2) -EndFunc - -Func SegmentIntersect($P1x, $P1y, $P2x, $P2y, $Q1x, $Q1y, $Q2x, $Q2y) - $O1 = Orientation($P1x, $P1y, $P2x, $P2y, $Q1x, $Q1y) - $O2 = Orientation($P1x, $P1y, $P2x, $P2y, $Q2x, $Q2y) - $O3 = Orientation($Q1x, $Q1y, $Q2x, $Q2y, $P1x, $P1y) - $O4 = Orientation($Q1x, $Q1y, $Q2x, $Q2y, $P2x, $P2y) - - If $O1 <> $O2 And $O3 <> $O4 Then Return True - If $O1 = 0 And onSegment($P1x, $P1y, $Q1x, $Q1y, $P2x, $P2y) Then Return True - If $O2 = 0 And onSegment($P1x, $P1y, $Q2x, $Q2y, $P2x, $P2y) Then Return True - If $O3 = 0 And onSegment($Q1x, $Q1y, $P1x, $P1y, $Q2x, $Q2y) Then Return True - If $O4 = 0 And onSegment($Q1x, $Q1y, $P2x, $P2y, $Q2x, $Q2y) Then Return True - - Return False -EndFunc - -Func PolarCoord($PointX, $PointY, $CentX, $CentY) - ; Returns difference between points in radius and radians - Local $ReturnCoord[2] - $xLocation = $PointX - $CentX - $yLocation = $PointY - $CentY - Select - Case $xLocation > 0 And $yLocation >= 0 - $ReturnCoord[1] = ATan($yLocation / $xLocation) - Case $xLocation > 0 And $yLocation < 0 - $ReturnCoord[1] = ATan($yLocation / $xLocation) + 2 * $pi - Case $xLocation < 0 - $ReturnCoord[1] = ATan($yLocation / $xLocation) + $pi - Case $xLocation = 0 And $yLocation > 0 - $ReturnCoord[1] = $pi / 2 - Case $xLocation = 0 And $yLocation < 0 - $ReturnCoord[1] = 3 * $pi / 2 - Case $xLocation = 0 And $yLocation = 0 - $ReturnCoord[1] = 0 - EndSelect - $ReturnCoord[0] = Sqrt($xLocation ^ 2 + $yLocation ^ 2) - Return $ReturnCoord -EndFunc - -Func CartCoord($Radius, $Radians) - ; Returns X, Y coordinates from polar input - Local Const $pi = 4 * ATan(1) - Local $ReturnCoord[2] - $ReturnCoord[0] = $Radius * Cos($Radians) - $ReturnCoord[1] = $Radius * Sin($Radians) - Return $ReturnCoord -EndFunc - -Func ToLeft($Xa, $Ya, $Xb, $Yb, $Xc, $Yc) - ; Returns True if Point defined by Xc, Yc is to the left of a line defined by points Xa, Ya and Xb, Yb - return (($Xb - $Xa)*($Yc - $Ya) - ($Yb - $Ya)*($Xc - $Xa)) > 0 -EndFunc - -Func SmallerAngleBetween($RadianA, $RadianB) - ; First ensure all angles are between 0 and 2pi - While $RadianA < 0 - $RadianA += (2 * $pi) - WEnd - While $RadianA > (2 * $pi) - $RadianA -= (2 * $pi) - WEnd - While $RadianB < 0 - $RadianB += (2 * $pi) - WEnd - While $RadianB > (2 * $pi) - $RadianB -= (2 * $pi) - WEnd - - $Diff = $RadianA - $RadianB - While $Diff < 0 - $Diff += (2 * $pi) - WEnd - While $Diff > (2 * $pi) - $Diff -= (2 * $pi) - WEnd - - If $Diff > $pi Then - $Diff = (2 * $pi) - $Diff - EndIf - Return $Diff - -EndFunc - -Func IsAngleBetween($RadianA, $RadianB, $RadianC) - $AngleMain = SmallerAngleBetween($RadianA, $RadianB) - $AngleCheck1 = SmallerAngleBetween($RadianA, $RadianC) - $AngleCheck2 = SmallerAngleBetween($RadianB, $RadianC) - If $AngleMain > $AngleCheck1 And $AngleMain > $AngleCheck2 Then - Return True - Else - Return False - EndIf -EndFunc +Global Const $pi = 4 * ATan(1) + +Func FindIntersection($Ax1, $Ay1, $Ax2, $Ay2, $Bx1, $By1, $Bx2, $By2) + $A1 = $Ay2 - $Ay1 + $B1 = $Ax1 - $Ax2 + $C1 = ($A1 * $Ax1) + ($B1 * $Ay1) + $A2 = $By2 - $By1 + $B2 = $Bx1 - $Bx2 + $C2 = ($A2 * $Bx1) + ($B2 * $By1) + If $A1 * $B2 <> $A2 * $B1 Then + Local $Return[2] + $Return[0] = ($B2 * $C1 - $B1 * $C2) / ($A1 * $B2 - $A2 * $B1) + $Return[1] = ($A1 * $C2 - $A2 * $C1) / ($A1 * $B2 - $A2 * $B1) + Return $Return + Else + Return -1 + EndIf +EndFunc + +Func Max($A, $B) + If $A > $B Then + Return $A + Else + Return $B + EndIf +EndFunc + +Func Min($A, $B) + If $A < $B Then + Return $A + Else + Return $B + EndIf +EndFunc + +Func IsBetween($A, $B, $C) + If $A <= Max($B, $C) And $A >= Min($B, $C) Then Return True + Return False +EndFunc + +Func onSegment($Px, $Py, $Qx, $Qy, $Rx, $Ry) + If $Qx <= Max($Px, $Rx) And $Qx >= Min($Px, $Rx) And $Qy <= Max($Py, $Ry) And $Qy >= Min($Py, $Ry) Then + Return True + Else + Return False + EndIf +EndFunc + +Func Orientation($Px, $Py, $Qx, $Qy, $Rx, $Ry) + $val = ($Qy - $Py) * ($Rx - $Qx) - ($Qx - $Px) * ($Ry - $Qy) + If $val = 0 Then Return 0 + Return ($val > 0) ? (1) : (2) +EndFunc + +Func SegmentIntersect($P1x, $P1y, $P2x, $P2y, $Q1x, $Q1y, $Q2x, $Q2y) + $O1 = Orientation($P1x, $P1y, $P2x, $P2y, $Q1x, $Q1y) + $O2 = Orientation($P1x, $P1y, $P2x, $P2y, $Q2x, $Q2y) + $O3 = Orientation($Q1x, $Q1y, $Q2x, $Q2y, $P1x, $P1y) + $O4 = Orientation($Q1x, $Q1y, $Q2x, $Q2y, $P2x, $P2y) + + If $O1 <> $O2 And $O3 <> $O4 Then Return True + If $O1 = 0 And onSegment($P1x, $P1y, $Q1x, $Q1y, $P2x, $P2y) Then Return True + If $O2 = 0 And onSegment($P1x, $P1y, $Q2x, $Q2y, $P2x, $P2y) Then Return True + If $O3 = 0 And onSegment($Q1x, $Q1y, $P1x, $P1y, $Q2x, $Q2y) Then Return True + If $O4 = 0 And onSegment($Q1x, $Q1y, $P2x, $P2y, $Q2x, $Q2y) Then Return True + + Return False +EndFunc + +Func PolarCoord($PointX, $PointY, $CentX, $CentY) + ; Returns difference between points in radius and radians + Local $ReturnCoord[2] + $xLocation = $PointX - $CentX + $yLocation = $PointY - $CentY + Select + Case $xLocation > 0 And $yLocation >= 0 + $ReturnCoord[1] = ATan($yLocation / $xLocation) + Case $xLocation > 0 And $yLocation < 0 + $ReturnCoord[1] = ATan($yLocation / $xLocation) + 2 * $pi + Case $xLocation < 0 + $ReturnCoord[1] = ATan($yLocation / $xLocation) + $pi + Case $xLocation = 0 And $yLocation > 0 + $ReturnCoord[1] = $pi / 2 + Case $xLocation = 0 And $yLocation < 0 + $ReturnCoord[1] = 3 * $pi / 2 + Case $xLocation = 0 And $yLocation = 0 + $ReturnCoord[1] = 0 + EndSelect + $ReturnCoord[0] = Sqrt($xLocation ^ 2 + $yLocation ^ 2) + Return $ReturnCoord +EndFunc + +Func CartCoord($Radius, $Radians) + ; Returns X, Y coordinates from polar input + Local Const $pi = 4 * ATan(1) + Local $ReturnCoord[2] + $ReturnCoord[0] = $Radius * Cos($Radians) + $ReturnCoord[1] = $Radius * Sin($Radians) + Return $ReturnCoord +EndFunc + +Func ToLeft($Xa, $Ya, $Xb, $Yb, $Xc, $Yc) + ; Returns True if Point defined by Xc, Yc is to the left of a line defined by points Xa, Ya and Xb, Yb + return (($Xb - $Xa)*($Yc - $Ya) - ($Yb - $Ya)*($Xc - $Xa)) > 0 +EndFunc + +Func SmallerAngleBetween($RadianA, $RadianB) + ; First ensure all angles are between 0 and 2pi + While $RadianA < 0 + $RadianA += (2 * $pi) + WEnd + While $RadianA > (2 * $pi) + $RadianA -= (2 * $pi) + WEnd + While $RadianB < 0 + $RadianB += (2 * $pi) + WEnd + While $RadianB > (2 * $pi) + $RadianB -= (2 * $pi) + WEnd + + $Diff = $RadianA - $RadianB + While $Diff < 0 + $Diff += (2 * $pi) + WEnd + While $Diff > (2 * $pi) + $Diff -= (2 * $pi) + WEnd + + If $Diff > $pi Then + $Diff = (2 * $pi) - $Diff + EndIf + Return $Diff + +EndFunc + +Func IsAngleBetween($RadianA, $RadianB, $RadianC) + $AngleMain = SmallerAngleBetween($RadianA, $RadianB) + $AngleCheck1 = SmallerAngleBetween($RadianA, $RadianC) + $AngleCheck2 = SmallerAngleBetween($RadianB, $RadianC) + If $AngleMain > $AngleCheck1 And $AngleMain > $AngleCheck2 Then + Return True + Else + Return False + EndIf +EndFunc diff --git a/BrokenBot.org/functions/Other/overlay.au3 b/BrokenBot.org/functions/Other/overlay.au3 index b7edbe5..1be8ee6 100644 --- a/BrokenBot.org/functions/Other/overlay.au3 +++ b/BrokenBot.org/functions/Other/overlay.au3 @@ -1,95 +1,95 @@ -Global $frmOverlay -Global $hOverlayGraphics -Global $OverlayVisible = False -Global $GlobalColor - -Func ActivateOverlay() - $OverlayVisible = True - getBSPos() - $frmOverlay = GUICreate("", 860, 720, $BSpos[0], $BSpos[1], 0x84000000, BitOR(0x08000088, $WS_EX_LAYERED)) - GUISetBkColor(0xABCDEF) - _WinAPI_SetLayeredWindowAttributes($frmOverlay, 0xABCDEF, 255) - _WinAPI_SetWindowLong($frmOverlay, -20, BitOR(_WinAPI_GetWindowLong($frmOverlay, -20), 0x00000020)) - GUISetState(@SW_SHOW, $frmOverlay) - - $hOverlayGraphics = _GDIPlus_GraphicsCreateFromHWND($frmOverlay) ;create a graphics object from a window handle -EndFunc ;==>ActivateOverlay - -Func OverlayRect($Left, $Top, $Width, $Height, $Color, $LineWidth, $OnOverlay = True, $OnAttack = True) - $hPenTemp = _GDIPlus_PenCreate($Color, $LineWidth) - If $OverlayVisible And $OnOverlay Then _GDIPlus_GraphicsDrawRect($hOverlayGraphics, $Left, $Top, $Width, $Height, $hPenTemp) - If $BufferAvailable And $OnAttack Then _GDIPlus_GraphicsDrawRect($Buffer, $Left, $Top, $Width, $Height, $hPenTemp) - _GDIPlus_PenDispose($hPenTemp) -EndFunc ;==>OverlayRect - -Func OverlayCircle($CenterX, $CenterY, $Radius, $Color, $LineWidth, $OnOverlay = True, $OnAttack = True) - $hPenTemp = _GDIPlus_PenCreate($Color, $LineWidth) - If $OverlayVisible And $OnOverlay Then _GDIPlus_GraphicsDrawEllipse($hOverlayGraphics, $CenterX - $Radius, $CenterY - $Radius, ($Radius * 2) + 1, ($Radius * 2) + 1, $hPenTemp) - If $BufferAvailable And $OnAttack Then _GDIPlus_GraphicsDrawEllipse($Buffer, $CenterX - $Radius, $CenterY - $Radius, ($Radius * 2) + 1, ($Radius * 2) + 1, $hPenTemp) - _GDIPlus_PenDispose($hPenTemp) -EndFunc ;==>OverlayCircle - -Func OverlayLine($X1, $Y1, $X2, $Y2, $Color, $LineWidth, $OnOverlay = True, $OnAttack = True) - $hPenTemp = _GDIPlus_PenCreate($Color, $LineWidth) - If $OverlayVisible And $OnOverlay Then _GDIPlus_GraphicsDrawLine($hOverlayGraphics, $X1, $Y1, $X2, $Y2, $hPenTemp) - If $BufferAvailable And $OnAttack Then _GDIPlus_GraphicsDrawLine($Buffer, $X1, $Y1, $X2, $Y2, $hPenTemp) - _GDIPlus_PenDispose($hPenTemp) -EndFunc ;==>OverlayLine - -Func OverlayX($Left, $Top, $Width, $Height, $Color, $LineWidth, $OnOverlay = True, $OnAttack = True) - $hPenTemp = _GDIPlus_PenCreate($Color, $LineWidth) - If $OverlayVisible And $OnOverlay Then _GDIPlus_GraphicsDrawLine($hOverlayGraphics, $Left, $Top, $Left + $Width, $Top + $Height, $hPenTemp) - If $OverlayVisible And $OnOverlay Then _GDIPlus_GraphicsDrawLine($hOverlayGraphics, $Left + $Width, $Top, $Left, $Top + $Height, $hPenTemp) - If $BufferAvailable And $OnAttack Then _GDIPlus_GraphicsDrawLine($Buffer, $Left, $Top, $Left + $Width, $Top + $Height, $hPenTemp) - If $BufferAvailable And $OnAttack Then _GDIPlus_GraphicsDrawLine($Buffer, $Left + $Width, $Top, $Left, $Top + $Height, $hPenTemp) - _GDIPlus_PenDispose($hPenTemp) -EndFunc ;==>OverlayX - -Func DeleteOverlay() - _GDIPlus_GraphicsClear($hOverlayGraphics) - _GDIPlus_GraphicsDispose($hOverlayGraphics) - GUIDelete($frmOverlay) - $OverlayVisible = False -EndFunc ;==>DeleteOverlay - -Func CommonColor($iLeft, $iTop, $iWidth, $iHeight) - ; Returns the most common color (close) in a portion of an image - Local $Bins[17576] - For $i = 0 To 17575 - $Bins[$i] = 0 - Next - $BitmapData = _GDIPlus_BitmapLockBits($hBitmap, $iLeft, $iTop, $iWidth, $iHeight, $GDIP_ILMREAD, $GDIP_PXF32RGB) - $Stride = DllStructGetData($BitmapData, "Stride") - $Width = DllStructGetData($BitmapData, "Width") - $Height = DllStructGetData($BitmapData, "Height") - $PixelFormat = DllStructGetData($BitmapData, "PixelFormat") - $Scan0 = DllStructGetData($BitmapData, "Scan0") - For $row = 0 To $Height - 1 - For $col = 0 To $Width - 1 - $pixel = DllStructCreate("dword", $Scan0 + $row * $Stride + $col * 4) - $curPixel = DllStructGetData($pixel, 1) - $Red = BitAND(BitShift($curPixel, 16), 0xFF) - $Green = BitAND(BitShift($curPixel, 8), 0xFF) - $Blue = BitAND($curPixel, 0xFF) - $Bins[(Floor($Red / 10) * 676) + (Floor($Green / 10) * 26) + Floor($Blue / 10)] += 1 - Next - Next - $Highest = 0 - $Loc = 0 - For $i = 0 To 17575 - If $Highest < $Bins[$i] Then - $Highest = $Bins[$i] - $Loc = $i - EndIf - Next - $Red = Floor($Loc / 676) - $Loc -= ($Red * 676) - $Green = Floor($Loc / 26) - $Blue = $Loc - ($Green * 26) - $Red = ($Red * 10) + 5 - $Green = ($Green * 10) + 5 - $Blue = ($Blue * 10) + 5 - _GDIPlus_BitmapUnlockBits($hBitmap, $BitmapData) - Return Execute("0xFF" & String(Hex($Red, 2)) & String(Hex($Green, 2)) & String(Hex($Blue, 2))) - -EndFunc ;==>CommonColor +Global $frmOverlay +Global $hOverlayGraphics +Global $OverlayVisible = False +Global $GlobalColor + +Func ActivateOverlay() + $OverlayVisible = True + getBSPos() + $frmOverlay = GUICreate("", 860, 720, $BSpos[0], $BSpos[1], 0x84000000, BitOR(0x08000088, $WS_EX_LAYERED)) + GUISetBkColor(0xABCDEF) + _WinAPI_SetLayeredWindowAttributes($frmOverlay, 0xABCDEF, 255) + _WinAPI_SetWindowLong($frmOverlay, -20, BitOR(_WinAPI_GetWindowLong($frmOverlay, -20), 0x00000020)) + GUISetState(@SW_SHOW, $frmOverlay) + + $hOverlayGraphics = _GDIPlus_GraphicsCreateFromHWND($frmOverlay) ;create a graphics object from a window handle +EndFunc ;==>ActivateOverlay + +Func OverlayRect($Left, $Top, $Width, $Height, $Color, $LineWidth, $OnOverlay = True, $OnAttack = True) + $hPenTemp = _GDIPlus_PenCreate($Color, $LineWidth) + If $OverlayVisible And $OnOverlay Then _GDIPlus_GraphicsDrawRect($hOverlayGraphics, $Left, $Top, $Width, $Height, $hPenTemp) + If $BufferAvailable And $OnAttack Then _GDIPlus_GraphicsDrawRect($Buffer, $Left, $Top, $Width, $Height, $hPenTemp) + _GDIPlus_PenDispose($hPenTemp) +EndFunc ;==>OverlayRect + +Func OverlayCircle($CenterX, $CenterY, $Radius, $Color, $LineWidth, $OnOverlay = True, $OnAttack = True) + $hPenTemp = _GDIPlus_PenCreate($Color, $LineWidth) + If $OverlayVisible And $OnOverlay Then _GDIPlus_GraphicsDrawEllipse($hOverlayGraphics, $CenterX - $Radius, $CenterY - $Radius, ($Radius * 2) + 1, ($Radius * 2) + 1, $hPenTemp) + If $BufferAvailable And $OnAttack Then _GDIPlus_GraphicsDrawEllipse($Buffer, $CenterX - $Radius, $CenterY - $Radius, ($Radius * 2) + 1, ($Radius * 2) + 1, $hPenTemp) + _GDIPlus_PenDispose($hPenTemp) +EndFunc ;==>OverlayCircle + +Func OverlayLine($X1, $Y1, $X2, $Y2, $Color, $LineWidth, $OnOverlay = True, $OnAttack = True) + $hPenTemp = _GDIPlus_PenCreate($Color, $LineWidth) + If $OverlayVisible And $OnOverlay Then _GDIPlus_GraphicsDrawLine($hOverlayGraphics, $X1, $Y1, $X2, $Y2, $hPenTemp) + If $BufferAvailable And $OnAttack Then _GDIPlus_GraphicsDrawLine($Buffer, $X1, $Y1, $X2, $Y2, $hPenTemp) + _GDIPlus_PenDispose($hPenTemp) +EndFunc ;==>OverlayLine + +Func OverlayX($Left, $Top, $Width, $Height, $Color, $LineWidth, $OnOverlay = True, $OnAttack = True) + $hPenTemp = _GDIPlus_PenCreate($Color, $LineWidth) + If $OverlayVisible And $OnOverlay Then _GDIPlus_GraphicsDrawLine($hOverlayGraphics, $Left, $Top, $Left + $Width, $Top + $Height, $hPenTemp) + If $OverlayVisible And $OnOverlay Then _GDIPlus_GraphicsDrawLine($hOverlayGraphics, $Left + $Width, $Top, $Left, $Top + $Height, $hPenTemp) + If $BufferAvailable And $OnAttack Then _GDIPlus_GraphicsDrawLine($Buffer, $Left, $Top, $Left + $Width, $Top + $Height, $hPenTemp) + If $BufferAvailable And $OnAttack Then _GDIPlus_GraphicsDrawLine($Buffer, $Left + $Width, $Top, $Left, $Top + $Height, $hPenTemp) + _GDIPlus_PenDispose($hPenTemp) +EndFunc ;==>OverlayX + +Func DeleteOverlay() + _GDIPlus_GraphicsClear($hOverlayGraphics) + _GDIPlus_GraphicsDispose($hOverlayGraphics) + GUIDelete($frmOverlay) + $OverlayVisible = False +EndFunc ;==>DeleteOverlay + +Func CommonColor($iLeft, $iTop, $iWidth, $iHeight) + ; Returns the most common color (close) in a portion of an image + Local $Bins[17576] + For $i = 0 To 17575 + $Bins[$i] = 0 + Next + $BitmapData = _GDIPlus_BitmapLockBits($hBitmap, $iLeft, $iTop, $iWidth, $iHeight, $GDIP_ILMREAD, $GDIP_PXF32RGB) + $Stride = DllStructGetData($BitmapData, "Stride") + $Width = DllStructGetData($BitmapData, "Width") + $Height = DllStructGetData($BitmapData, "Height") + $PixelFormat = DllStructGetData($BitmapData, "PixelFormat") + $Scan0 = DllStructGetData($BitmapData, "Scan0") + For $row = 0 To $Height - 1 + For $col = 0 To $Width - 1 + $pixel = DllStructCreate("dword", $Scan0 + $row * $Stride + $col * 4) + $curPixel = DllStructGetData($pixel, 1) + $Red = BitAND(BitShift($curPixel, 16), 0xFF) + $Green = BitAND(BitShift($curPixel, 8), 0xFF) + $Blue = BitAND($curPixel, 0xFF) + $Bins[(Floor($Red / 10) * 676) + (Floor($Green / 10) * 26) + Floor($Blue / 10)] += 1 + Next + Next + $Highest = 0 + $Loc = 0 + For $i = 0 To 17575 + If $Highest < $Bins[$i] Then + $Highest = $Bins[$i] + $Loc = $i + EndIf + Next + $Red = Floor($Loc / 676) + $Loc -= ($Red * 676) + $Green = Floor($Loc / 26) + $Blue = $Loc - ($Green * 26) + $Red = ($Red * 10) + 5 + $Green = ($Green * 10) + 5 + $Blue = ($Blue * 10) + 5 + _GDIPlus_BitmapUnlockBits($hBitmap, $BitmapData) + Return Execute("0xFF" & String(Hex($Red, 2)) & String(Hex($Green, 2)) & String(Hex($Blue, 2))) + +EndFunc ;==>CommonColor diff --git a/BrokenBot.org/functions/Other/statsubmission.au3 b/BrokenBot.org/functions/Other/statsubmission.au3 index 821eecc..7d14238 100644 --- a/BrokenBot.org/functions/Other/statsubmission.au3 +++ b/BrokenBot.org/functions/Other/statsubmission.au3 @@ -1,85 +1,85 @@ -Global $objError = ObjEvent("AutoIt.Error", "HandleError") - -Func HandleError() - $HexNumber = Hex($objError.number, 8) -;~ SetLog("Unknown error: " & $HexNumber) - Return SetError(1, $HexNumber) ; something to check for when this function returns -EndFunc - -Func StatSubmission($Attack = False) - If $Attack Then - If $ValidAuth Then - If (Not $SubmissionMade) Or (TimerDiff($SubmissionTimer) > $AttackSubmitdelay) Then - $Result = DllCall(@ScriptDir & "\BrokenBot.org\BrokenBot32.dll", "str", "BrokenBotEncrypt", "str", String(Round($SubmissionGold/$SubmissionAttacks)), "str", String(Round($SubmissionElixir/$SubmissionAttacks)), "str", String(Round($SubmissionDE/$SubmissionAttacks)), "str", StringStripWS($THLevel, 3), "str", String($TrophyCountOld), "str", $LastAttackTH, "str", $LastAttackDead, "str", _Decrypt(IniRead(@LocalAppDataDir & "\BrokenBot.org.ini", "default", "1", "")), "str", _Decrypt(IniRead(@LocalAppDataDir & "\BrokenBot.org.ini", "default", "2", ""))) - If IsArray($Result) Then - If $Result[0] = -1 Then - SetLog(GetLangText("msgDLLError"), $COLOR_RED) - ElseIf $Result[0] = -2 Then - SetLog(GetLangText("msgLicense"), $COLOR_RED) - Else - Setlog(GetLangText("msgSubmitStats")) - Local $oHTTP = ObjCreate("winhttp.winhttprequest.5.1") - $oHTTP.Open("POST", "http://forum.brokenbot.org/bot_stat_submit.php?a=submit&u=" & _Decrypt(IniRead(@LocalAppDataDir & "\BrokenBot.org.ini", "default", "1", "")) & "&p=" & _Decrypt(IniRead(@LocalAppDataDir & "\BrokenBot.org.ini", "default", "2", "")) & "&s=" & URLEncode($Result[0]), False) - $oHTTP.SetRequestHeader("User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5") - $oHTTP.SetTimeouts(5000,5000,5000,5000) - $oHTTP.Send("") - If @error Then - Setlog(GetLangText("msgSubmitFailed")) - Else - $SubmitResult = $oHTTP.ResponseText() - If StringStripWS($SubmitResult, 3) = "false" Then - Setlog(GetLangText("msgSubmitFailed")) - Else - If Number(StringStripWS($SubmitResult, 3)) > 0 Then $AttackSubmitdelay = Number(StringStripWS($SubmitResult, 3)) * 1000 - Setlog(GetLangText("msgSubmitSuccess")) - $SubmissionGold = 0 - $SubmissionElixir = 0 - $SubmissionDE = 0 - $SubmissionMade = True - $SubmissionAttacks = 0 - $SubmissionTimer = TimerInit() - EndIf - EndIf - EndIf - Else - SetLog(GetLangText("msgDLLError") & " " & $Result, $COLOR_RED) - EndIf - EndIf - - $AvgGold = Round($GoldTotalLoot/(TimerDiff($sTimer)/(1000*60*60))) - $AvgElixir = Round($ElixirTotalLoot/(TimerDiff($sTimer)/(1000*60*60))) - $AvgDark = Round($DarkTotalLoot/(TimerDiff($sTimer)/(1000*60*60))) - $AvgTrophy = Round($TrophyTotalLoot/(TimerDiff($sTimer)/(1000*60*60))) - SetLog(GetLangText("msgHourlyAvg") & " [" & GetLangText("msgGoldinitial") & "]: " & _NumberFormat($AvgGold) & " [" & GetLangText("msgElixirinitial") & "]: " & _NumberFormat($AvgElixir) & _ - " [" & GetLangText("msgDarkElixinitial") & "]: " & _NumberFormat($AvgDark) & " [" & GetLangText("msgTrophyInitial") & "]: " & $AvgTrophy) - EndIf - EndIf - If TimerDiff($SearchTimer) > $SearchSubmitdelay And $SubmissionSearches > 0 Then - $Result = DllCall(@ScriptDir & "\BrokenBot.org\BrokenBot32.dll", "str", "BrokenBotEncrypt", "str", $SubmissionSGold, "str", $SubmissionSElix, "str", $SubmissionSDE, "str", StringStripWS($THLevel, 3), "str", String($TrophyCountOld), "str", $SubmissionSTH, "str", $SubmissionSDead, "str", _Decrypt("0xC90FAC396189B0825D9A117CE30EAB26"), "str", _Dcrypt("0x86D135F84C56834A1515E77A658D98F1")) - If IsArray($Result) Then - If ($Result[0] <> -1) And ($Result[0] <> -2) Then - Local $oHTTP = ObjCreate("winhttp.winhttprequest.5.1") - $oHTTP.Open("POST", "http://forum.brokenbot.org/bot_stat_submit.php?a=submit&u=" & _Decrypt("0xC90FAC396189B0825D9A117CE30EAB26") & "&p=" & _Dcrypt("0x86D135F84C56834A1515E77A658D98F1") & "&s=" & URLEncode($Result[0]), False) - $oHTTP.SetRequestHeader("User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5") - $oHTTP.SetTimeouts(5000,5000,5000,5000) - $oHTTP.Send("") - If @error Then - If $SearchSubmitdelay < (1000 * 30 * 60) Then $SearchSubmitdelay += 300000 - Return - EndIf - $SubmitResult = $oHTTP.ResponseText() - If StringStripWS($SubmitResult, 3) <> "false" Then - If Number(StringStripWS($SubmitResult, 3)) > 0 Then $SearchSubmitdelay = Number(StringStripWS($SubmitResult, 3)) * 1000 - Global $SubmissionSGold = "" - Global $SubmissionSElix = "" - Global $SubmissionSDE = "" - Global $SubmissionSTrophy = "" - Global $SubmissionSTH = "" - Global $SubmissionSDead = "" - $SubmissionSearches = 0 - $SearchTimer = TimerInit() - EndIf - EndIf - EndIf - EndIf +Global $objError = ObjEvent("AutoIt.Error", "HandleError") + +Func HandleError() + $HexNumber = Hex($objError.number, 8) +;~ SetLog("Unknown error: " & $HexNumber) + Return SetError(1, $HexNumber) ; something to check for when this function returns +EndFunc + +Func StatSubmission($Attack = False) + If $Attack Then + If $ValidAuth Then + If (Not $SubmissionMade) Or (TimerDiff($SubmissionTimer) > $AttackSubmitdelay) Then + $Result = DllCall(@ScriptDir & "\BrokenBot.org\BrokenBot32.dll", "str", "BrokenBotEncrypt", "str", String(Round($SubmissionGold/$SubmissionAttacks)), "str", String(Round($SubmissionElixir/$SubmissionAttacks)), "str", String(Round($SubmissionDE/$SubmissionAttacks)), "str", StringStripWS($THLevel, 3), "str", String($TrophyCountOld), "str", $LastAttackTH, "str", $LastAttackDead, "str", _Decrypt(IniRead(@LocalAppDataDir & "\BrokenBot.org.ini", "default", "1", "")), "str", _Decrypt(IniRead(@LocalAppDataDir & "\BrokenBot.org.ini", "default", "2", ""))) + If IsArray($Result) Then + If $Result[0] = -1 Then + SetLog(GetLangText("msgDLLError"), $COLOR_RED) + ElseIf $Result[0] = -2 Then + SetLog(GetLangText("msgLicense"), $COLOR_RED) + Else + Setlog(GetLangText("msgSubmitStats")) + Local $oHTTP = ObjCreate("winhttp.winhttprequest.5.1") + $oHTTP.Open("POST", "http://forum.brokenbot.org/bot_stat_submit.php?a=submit&u=" & _Decrypt(IniRead(@LocalAppDataDir & "\BrokenBot.org.ini", "default", "1", "")) & "&p=" & _Decrypt(IniRead(@LocalAppDataDir & "\BrokenBot.org.ini", "default", "2", "")) & "&s=" & URLEncode($Result[0]), False) + $oHTTP.SetRequestHeader("User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5") + $oHTTP.SetTimeouts(5000,5000,5000,5000) + $oHTTP.Send("") + If @error Then + Setlog(GetLangText("msgSubmitFailed")) + Else + $SubmitResult = $oHTTP.ResponseText() + If StringStripWS($SubmitResult, 3) = "false" Then + Setlog(GetLangText("msgSubmitFailed")) + Else + If Number(StringStripWS($SubmitResult, 3)) > 0 Then $AttackSubmitdelay = Number(StringStripWS($SubmitResult, 3)) * 1000 + Setlog(GetLangText("msgSubmitSuccess")) + $SubmissionGold = 0 + $SubmissionElixir = 0 + $SubmissionDE = 0 + $SubmissionMade = True + $SubmissionAttacks = 0 + $SubmissionTimer = TimerInit() + EndIf + EndIf + EndIf + Else + SetLog(GetLangText("msgDLLError") & " " & $Result, $COLOR_RED) + EndIf + EndIf + + $AvgGold = Round($GoldTotalLoot/(TimerDiff($sTimer)/(1000*60*60))) + $AvgElixir = Round($ElixirTotalLoot/(TimerDiff($sTimer)/(1000*60*60))) + $AvgDark = Round($DarkTotalLoot/(TimerDiff($sTimer)/(1000*60*60))) + $AvgTrophy = Round($TrophyTotalLoot/(TimerDiff($sTimer)/(1000*60*60))) + SetLog(GetLangText("msgHourlyAvg") & " [" & GetLangText("msgGoldinitial") & "]: " & _NumberFormat($AvgGold) & " [" & GetLangText("msgElixirinitial") & "]: " & _NumberFormat($AvgElixir) & _ + " [" & GetLangText("msgDarkElixinitial") & "]: " & _NumberFormat($AvgDark) & " [" & GetLangText("msgTrophyInitial") & "]: " & $AvgTrophy) + EndIf + EndIf + If TimerDiff($SearchTimer) > $SearchSubmitdelay And $SubmissionSearches > 0 Then + $Result = DllCall(@ScriptDir & "\BrokenBot.org\BrokenBot32.dll", "str", "BrokenBotEncrypt", "str", $SubmissionSGold, "str", $SubmissionSElix, "str", $SubmissionSDE, "str", StringStripWS($THLevel, 3), "str", String($TrophyCountOld), "str", $SubmissionSTH, "str", $SubmissionSDead, "str", _Decrypt("0xC90FAC396189B0825D9A117CE30EAB26"), "str", _Dcrypt("0x86D135F84C56834A1515E77A658D98F1")) + If IsArray($Result) Then + If ($Result[0] <> -1) And ($Result[0] <> -2) Then + Local $oHTTP = ObjCreate("winhttp.winhttprequest.5.1") + $oHTTP.Open("POST", "http://forum.brokenbot.org/bot_stat_submit.php?a=submit&u=" & _Decrypt("0xC90FAC396189B0825D9A117CE30EAB26") & "&p=" & _Dcrypt("0x86D135F84C56834A1515E77A658D98F1") & "&s=" & URLEncode($Result[0]), False) + $oHTTP.SetRequestHeader("User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5") + $oHTTP.SetTimeouts(5000,5000,5000,5000) + $oHTTP.Send("") + If @error Then + If $SearchSubmitdelay < (1000 * 30 * 60) Then $SearchSubmitdelay += 300000 + Return + EndIf + $SubmitResult = $oHTTP.ResponseText() + If StringStripWS($SubmitResult, 3) <> "false" Then + If Number(StringStripWS($SubmitResult, 3)) > 0 Then $SearchSubmitdelay = Number(StringStripWS($SubmitResult, 3)) * 1000 + Global $SubmissionSGold = "" + Global $SubmissionSElix = "" + Global $SubmissionSDE = "" + Global $SubmissionSTrophy = "" + Global $SubmissionSTH = "" + Global $SubmissionSDead = "" + $SubmissionSearches = 0 + $SearchTimer = TimerInit() + EndIf + EndIf + EndIf + EndIf EndFunc \ No newline at end of file diff --git a/BrokenBot.org/functions/Strategies/Common/SharedFunctions.au3 b/BrokenBot.org/functions/Strategies/Common/SharedFunctions.au3 new file mode 100755 index 0000000..1266101 --- /dev/null +++ b/BrokenBot.org/functions/Strategies/Common/SharedFunctions.au3 @@ -0,0 +1,126 @@ +; This code was created for public use by BrokenBot.org and falls under the GPLv3 license. +; This code can be incorporated into open source/non-profit projects free of charge and without consent. +; **NOT FOR COMMERCIAL USE** by any project which includes any part of the code in this sub-directory without express written consent of BrokenBot.org +; You **MAY NOT SOLICIT DONATIONS** from any project which includes any part of the code in this sub-directory without express written consent of BrokenBot.org +; +;Function needed by all strategies + + +;Check Out of Sync or Disconnection, if detected, bump speedBump by 0.5 seconds +Func ChkDisconnection($disconnected = False) + _CaptureRegion() + Local $dummyX = 0 + Local $dummyY = 0 + If _ImageSearch(@ScriptDir & "\images\Client.bmp", 1, $dummyX, $dummyY, 50) = 1 Then + If $dummyX > 290 And $dummyX < 310 And $dummyY > 325 And $dummyY < 340 Then + $disconnected = True + $speedBump += 500 + If $speedBump > 5000 Then + $speedBump = 5000 + SetLog("Out of sync! Already searching slowly, not changing anything.", $COLOR_RED) + Else + SetLog("Out of sync! Slowing search speed by 0.5 secs.", $COLOR_RED) + EndIf + EndIf + EndIf + If _ImageSearch(@ScriptDir & "\images\Lost.bmp", 1, $dummyX, $dummyY, 50) = 1 Then + If $dummyX > 320 and $dummyX < 350 and $dummyY > 330 and $dummyY < 350 Then + $disconnected = True + ;Looks like lost connection is not related to search speed, test run without bump + SetLog("Lost Connection!", $COLOR_RED) +;~ $speedBump += 500 +;~ If $speedBump > 5000 Then +;~ $speedBump=5000 +;~ SetLog("Lost Connection! Already searching slowly, not changing anything.", $COLOR_RED) +;~ Else +;~ SetLog("Lost Connection! Slowing search speed by 0.5 secs.", $COLOR_RED) +;~ EndIf + EndIf + EndIf + + If $disconnected = True Then + ;increase disconnect counts + GUICtrlSetData($lblresultsearchdisconnected, GUICtrlRead($lblresultsearchdisconnected) + 1) + If $DebugMode = 1 Then _GDIPlus_ImageSaveToFile($hBitmap, $dirDebug & "DisConnt-" & @HOUR & @MIN & @SEC & ".png") + + If $PushBulletEnabled = 1 and IsChecked($lbldisconnect) Then + Local $iCount = _FileCountLines($sLogPath) + Local $myLines = "" + Local $i + For $i = 1 to 5 + $myLines = $myLines & FileReadLine($sLogPath, ($iCount - 5 + $i)) & "\n" + Next + _Push("Disconnected", "Your bot got disconnected while searching for enemy, total disconnections:" & GUICtrlRead($lblresultsearchdisconnected) & "\n" & _ + GetLangText("pushLast5Lines") & $myLines) + EndIf + EndIf + Return $disconnected +EndFunc + + +Func ChkKingAvailability() + + $KingAvailable = False + $KingUG = False + ClickP($TopLeftClient) ;Click Away + If $KingPos[0] = "" Then + Return False + Else + if _sleep(500) Then Return + Click($KingPos[0], $KingPos[1]) ;Click King Altar + EndIf + + If _Sleep(500) Then Return + _CaptureRegion() + + Local $KingInfoPos = _WaitForPixel(260, 581, 350, 583, Hex(0x4084B8, 6), 5, 2) ;Finds Info button, wait max 2 seconds + If IsArray($KingInfoPos) = False Then + SetLog(GetLangText("msgKAUnavailable"), $COLOR_RED) + Else ;check if king is available for battle + $KingInfoPos = _PixelSearch(510, 589, 585, 591, Hex(0xD13D08, 6), 5) ;Finds Healing button + If IsArray($KingInfoPos) = False Then + $KingInfoPos = _PixelSearch(510, 589, 585, 591, Hex(0xD0EC75, 6), 5) ;Finds Finish now button, when under upgrading + If IsArray($KingInfoPos) Then + $KingUG = True + Else + $KingAvailable = True + EndIf + EndIf + EndIf + Setlog (GetLangText("msgKingAvail") & $KingAvailable) + Return $KingAvailable +EndFunc + +Func ChkQueenAvailability() + + $QueenAvailable = False + $QueenUG = False + + ClickP($TopLeftClient) ;Click Away + If $QueenPos[0] = "" Then + Return False + Else + if _sleep(500) Then Return + Click($QueenPos[0], $QueenPos[1]) ;Click Queen Altar + EndIf + + If _Sleep(500) Then Return + _CaptureRegion() + + Local $QueenInfoPos = _WaitForPixel(260, 581, 350, 583, Hex(0x4084B8, 6), 5, 2) ;Finds Info button, wait max 2 seconds + If IsArray($QueenInfoPos) = False Then + SetLog(GetLangText("msgQAUnavailable"), $COLOR_RED) + Else ;check if king is available for battle + $QueenInfoPos = _PixelSearch(510, 589, 585, 591, Hex(0xD13D08, 6), 5) ;Finds Healing button + If IsArray($QueenInfoPos) = False Then + $QueenInfoPos = _PixelSearch(510, 589, 585, 591, Hex(0xD0EC75, 6), 5) ;Finds Finish now button, when under upgrading + If IsArray($QueenInfoPos) Then + $QueenUG = True + Else + $QueenAvailable = True + EndIf + EndIf + EndIf + Setlog (GetLangText("msgQueenAvail") & $QueenAvailable) + Return $QueenAvailable +EndFunc \ No newline at end of file diff --git a/BrokenBot.org/functions/Strategies/Dummy/Attack.au3 b/BrokenBot.org/functions/Strategies/Dummy/Attack.au3 index d7cbc67..a87b2db 100644 --- a/BrokenBot.org/functions/Strategies/Dummy/Attack.au3 +++ b/BrokenBot.org/functions/Strategies/Dummy/Attack.au3 @@ -1 +1 @@ -; Deploy your troops +; Deploy your troops diff --git a/BrokenBot.org/functions/Strategies/Dummy/Config.au3 b/BrokenBot.org/functions/Strategies/Dummy/Config.au3 index 9c92c90..e4c09c7 100644 --- a/BrokenBot.org/functions/Strategies/Dummy/Config.au3 +++ b/BrokenBot.org/functions/Strategies/Dummy/Config.au3 @@ -1,8 +1,8 @@ -Func Dummy_LoadConfig() - -EndFunc ;==>Dummy_LoadConfig - -Func Dummy_SaveConfig($configFile) - IniWrite($configFile, "plugin", "name", "Dummy") - -EndFunc ;==>Dummy_SaveConfig +Func Dummy_LoadConfig() + +EndFunc ;==>Dummy_LoadConfig + +Func Dummy_SaveConfig($configFile) + IniWrite($configFile, "plugin", "name", "Dummy") + +EndFunc ;==>Dummy_SaveConfig diff --git a/BrokenBot.org/functions/Strategies/Dummy/GUIControl.au3 b/BrokenBot.org/functions/Strategies/Dummy/GUIControl.au3 index b1d642c..44df8c7 100644 --- a/BrokenBot.org/functions/Strategies/Dummy/GUIControl.au3 +++ b/BrokenBot.org/functions/Strategies/Dummy/GUIControl.au3 @@ -1 +1 @@ -; Functions to occur when controls on GUI are interacted with +; Functions to occur when controls on GUI are interacted with diff --git a/BrokenBot.org/functions/Strategies/Dummy/GUIDesign.au3 b/BrokenBot.org/functions/Strategies/Dummy/GUIDesign.au3 index 8923b18..cbe12c5 100644 --- a/BrokenBot.org/functions/Strategies/Dummy/GUIDesign.au3 +++ b/BrokenBot.org/functions/Strategies/Dummy/GUIDesign.au3 @@ -1,31 +1,31 @@ -Func Dummy_LoadGUI() - ; Required prior to making new tabs - $frmAttackConfig = GUICreate("Attack config panel", 410, 410, -1, -1, $WS_BORDER + $WS_POPUP, $WS_EX_MDICHILD, $frmBot) - Opt('GUIResizeMode', 802) - GUISetState(@SW_HIDE, $frmAttackConfig) - _WinMoved(0, 0, 0, 0) - GUISwitch($frmAttackConfig) - - ; $tabStrat = GUICtrlCreateTab(10, 10, 415, 550) - ; - ; - ; - ; GUI goes in here - ; - ; - ; - ; GUICtrlCreateTabItem("") - - ; Load your configuration - Dummy_LoadConfig() - - ; Declare gui-control functions that require WM_COMMAND here - ;Global $PluginEvents[2][3] - ;$PluginEvents[0][0]=1 ; Number of functions - ;$PluginEvents[1][0]=$control ; Control name - ;$PluginEvents[1][1]=1 ; Windows notification code - ;$PluginEvents[1][2]="_Function" ; Function to call ie. Dummy_Function - - ; Return the handle to the default control you want activated - Return $defaultcontrol -EndFunc ;==>Dummy_LoadGUI +Func Dummy_LoadGUI() + ; Required prior to making new tabs + $frmAttackConfig = GUICreate("Attack config panel", 410, 410, -1, -1, $WS_BORDER + $WS_POPUP, $WS_EX_MDICHILD, $frmBot) + Opt('GUIResizeMode', 802) + GUISetState(@SW_HIDE, $frmAttackConfig) + _WinMoved(0, 0, 0, 0) + GUISwitch($frmAttackConfig) + + ; $tabStrat = GUICtrlCreateTab(10, 10, 415, 550) + ; + ; + ; + ; GUI goes in here + ; + ; + ; + ; GUICtrlCreateTabItem("") + + ; Load your configuration + Dummy_LoadConfig() + + ; Declare gui-control functions that require WM_COMMAND here + ;Global $PluginEvents[2][3] + ;$PluginEvents[0][0]=1 ; Number of functions + ;$PluginEvents[1][0]=$control ; Control name + ;$PluginEvents[1][1]=1 ; Windows notification code + ;$PluginEvents[1][2]="_Function" ; Function to call ie. Dummy_Function + + ; Return the handle to the default control you want activated + Return $defaultcontrol +EndFunc ;==>Dummy_LoadGUI diff --git a/BrokenBot.org/functions/Strategies/Dummy/Plugin.au3 b/BrokenBot.org/functions/Strategies/Dummy/Plugin.au3 index 591c9ed..8379911 100644 --- a/BrokenBot.org/functions/Strategies/Dummy/Plugin.au3 +++ b/BrokenBot.org/functions/Strategies/Dummy/Plugin.au3 @@ -1,10 +1,10 @@ -; #include needed functions -; Naming format: PluginName_Function -; Required functions: _LoadGUI, _SaveConfig, _ReadyCheck, _PrepNextBattle, _Search, _PrepareAttack, _Attack - -; Name your strategy -; Format necessary for plugins: -; $StratNames = $StratNames & "|Plugin name" -$StratNames = $StratNames & "|Dummy" - -; Global variables specific to Plugin may be included here +; #include needed functions +; Naming format: PluginName_Function +; Required functions: _LoadGUI, _SaveConfig, _ReadyCheck, _PrepNextBattle, _Search, _PrepareAttack, _Attack + +; Name your strategy +; Format necessary for plugins: +; $StratNames = $StratNames & "|Plugin name" +$StratNames = $StratNames & "|Dummy" + +; Global variables specific to Plugin may be included here diff --git a/BrokenBot.org/functions/Strategies/Dummy/PrepNextBattle.au3 b/BrokenBot.org/functions/Strategies/Dummy/PrepNextBattle.au3 index d02a060..ec15b51 100644 --- a/BrokenBot.org/functions/Strategies/Dummy/PrepNextBattle.au3 +++ b/BrokenBot.org/functions/Strategies/Dummy/PrepNextBattle.au3 @@ -1,2 +1,2 @@ -; This occurs before attacking -; It gives you a chance to fill up barracks with a new round of troops before searching +; This occurs before attacking +; It gives you a chance to fill up barracks with a new round of troops before searching diff --git a/BrokenBot.org/functions/Strategies/Dummy/PrepareAttack.au3 b/BrokenBot.org/functions/Strategies/Dummy/PrepareAttack.au3 index 7dcaa02..39dc875 100644 --- a/BrokenBot.org/functions/Strategies/Dummy/PrepareAttack.au3 +++ b/BrokenBot.org/functions/Strategies/Dummy/PrepareAttack.au3 @@ -1 +1 @@ -; You've already searched and found the base to attack, this just preps for the actual attack +; You've already searched and found the base to attack, this just preps for the actual attack diff --git a/BrokenBot.org/functions/Strategies/Dummy/ReadyCheck.au3 b/BrokenBot.org/functions/Strategies/Dummy/ReadyCheck.au3 index fdae85a..d3eccc4 100644 --- a/BrokenBot.org/functions/Strategies/Dummy/ReadyCheck.au3 +++ b/BrokenBot.org/functions/Strategies/Dummy/ReadyCheck.au3 @@ -1 +1 @@ -; Returns true if you are now ready to attack +; Returns true if you are now ready to attack diff --git a/BrokenBot.org/functions/Strategies/Dummy/Search.au3 b/BrokenBot.org/functions/Strategies/Dummy/Search.au3 index 2dc17a7..0bbe96d 100644 --- a/BrokenBot.org/functions/Strategies/Dummy/Search.au3 +++ b/BrokenBot.org/functions/Strategies/Dummy/Search.au3 @@ -1 +1 @@ -; You are looking for a base to attack +; You are looking for a base to attack diff --git a/BrokenBot.org/functions/Strategies/LoadDefaults.au3 b/BrokenBot.org/functions/Strategies/LoadDefaults.au3 index 516da2b..7ce432c 100644 --- a/BrokenBot.org/functions/Strategies/LoadDefaults.au3 +++ b/BrokenBot.org/functions/Strategies/LoadDefaults.au3 @@ -1,28 +1,28 @@ -; This code was created for public use by BrokenBot.org and falls under the GPLv3 license. -; This code can be incorporated into open source/non-profit projects free of charge and without consent. -; **NOT FOR COMMERCIAL USE** by any project which includes any part of the code in this sub-directory without express written consent of BrokenBot.org -; You **MAY NOT SOLICIT DONATIONS** from any project which includes any part of the code in this sub-directory without express written consent of BrokenBot.org -; -Func _PluginDefaults() - $arStrats = StringSplit($StratNames, "|") - For $i = 1 To $arStrats[0] - $searchfile = FileFindFirstFile($dirStrat & "*.ini") - $found = False - While True - $newfile = FileFindNextFile($searchfile) - If @error Then ExitLoop - $strPlugInRead = IniRead($dirStrat & $newfile, "plugin", "name", "") - If $strPlugInRead = $arStrats[$i] Then - $found = True - ExitLoop - EndIf - WEnd - If Not $found Then - SetLog(GetLangText("msgNoDataFound") & $arStrats[$i] & GetLangText("msgNoDefaults")) - Call($arStrats[$i] & "_LoadGUI") - Call($arStrats[$i] & "_SaveConfig", $dirStrat & $arStrats[$i] & " - default.ini") - GUIDelete($frmAttackConfig) - EndIf - FileClose($searchfile) - Next -EndFunc ;==>_PluginDefaults +; This code was created for public use by BrokenBot.org and falls under the GPLv3 license. +; This code can be incorporated into open source/non-profit projects free of charge and without consent. +; **NOT FOR COMMERCIAL USE** by any project which includes any part of the code in this sub-directory without express written consent of BrokenBot.org +; You **MAY NOT SOLICIT DONATIONS** from any project which includes any part of the code in this sub-directory without express written consent of BrokenBot.org +; +Func _PluginDefaults() + $arStrats = StringSplit($StratNames, "|") + For $i = 1 To $arStrats[0] + $searchfile = FileFindFirstFile($dirStrat & "*.ini") + $found = False + While True + $newfile = FileFindNextFile($searchfile) + If @error Then ExitLoop + $strPlugInRead = IniRead($dirStrat & $newfile, "plugin", "name", "") + If $strPlugInRead = $arStrats[$i] Then + $found = True + ExitLoop + EndIf + WEnd + If Not $found Then + SetLog(GetLangText("msgNoDataFound") & $arStrats[$i] & GetLangText("msgNoDefaults")) + Call($arStrats[$i] & "_LoadGUI") + Call($arStrats[$i] & "_SaveConfig", $dirStrat & $arStrats[$i] & " - default.ini") + GUIDelete($frmAttackConfig) + EndIf + FileClose($searchfile) + Next +EndFunc ;==>_PluginDefaults diff --git a/BrokenBot.org/functions/Strategies/SharedFunction.au3 b/BrokenBot.org/functions/Strategies/SharedFunction.au3 index b61b635..82e58c2 100644 --- a/BrokenBot.org/functions/Strategies/SharedFunction.au3 +++ b/BrokenBot.org/functions/Strategies/SharedFunction.au3 @@ -1,126 +1,126 @@ -; This code was created for public use by BrokenBot.org and falls under the GPLv3 license. -; This code can be incorporated into open source/non-profit projects free of charge and without consent. -; **NOT FOR COMMERCIAL USE** by any project which includes any part of the code in this sub-directory without express written consent of BrokenBot.org -; You **MAY NOT SOLICIT DONATIONS** from any project which includes any part of the code in this sub-directory without express written consent of BrokenBot.org -; -;Function needed by all strategies - - -;Check Out of Sync or Disconnection, if detected, bump speedBump by 0.5 seconds -Func ChkDisconnection($disconnected = False) - _CaptureRegion() - Local $dummyX = 0 - Local $dummyY = 0 - If _ImageSearch(@ScriptDir & "\images\Client.bmp", 1, $dummyX, $dummyY, 50) = 1 Then - If $dummyX > 290 And $dummyX < 310 And $dummyY > 325 And $dummyY < 340 Then - $disconnected = True - $speedBump += 500 - If $speedBump > 5000 Then - $speedBump = 5000 - SetLog("Out of sync! Already searching slowly, not changing anything.", $COLOR_RED) - Else - SetLog("Out of sync! Slowing search speed by 0.5 secs.", $COLOR_RED) - EndIf - EndIf - EndIf - If _ImageSearch(@ScriptDir & "\images\Lost.bmp", 1, $dummyX, $dummyY, 50) = 1 Then - If $dummyX > 320 and $dummyX < 350 and $dummyY > 330 and $dummyY < 350 Then - $disconnected = True - ;Looks like lost connection is not related to search speed, test run without bump - SetLog("Lost Connection!", $COLOR_RED) -;~ $speedBump += 500 -;~ If $speedBump > 5000 Then -;~ $speedBump=5000 -;~ SetLog("Lost Connection! Already searching slowly, not changing anything.", $COLOR_RED) -;~ Else -;~ SetLog("Lost Connection! Slowing search speed by 0.5 secs.", $COLOR_RED) -;~ EndIf - EndIf - EndIf - - If $disconnected = True Then - ;increase disconnect counts - GUICtrlSetData($lblresultsearchdisconnected, GUICtrlRead($lblresultsearchdisconnected) + 1) - If $DebugMode = 1 Then _GDIPlus_ImageSaveToFile($hBitmap, $dirDebug & "DisConnt-" & @HOUR & @MIN & @SEC & ".png") - - If $PushBulletEnabled = 1 and IsChecked($lbldisconnect) Then - Local $iCount = _FileCountLines($sLogPath) - Local $myLines = "" - Local $i - For $i = 1 to 5 - $myLines = $myLines & FileReadLine($sLogPath, ($iCount - 5 + $i)) & "\n" - Next - _Push("Disconnected", "Your bot got disconnected while searching for enemy, total disconnections:" & GUICtrlRead($lblresultsearchdisconnected) & "\n" & _ - "Last 5 lines of log:\n" & $myLines) - EndIf - EndIf - Return $disconnected -EndFunc - - -Func ChkKingAvailability() - - $KingAvailable = False - $KingUG = False - ClickP($TopLeftClient) ;Click Away - If $KingPos[0] = "" Then - Return False - Else - if _sleep(500) Then Return - Click($KingPos[0], $KingPos[1]) ;Click King Altar - EndIf - - If _Sleep(500) Then Return - _CaptureRegion() - - Local $KingInfoPos = _WaitForPixel(260, 581, 350, 583, Hex(0x4084B8, 6), 5, 2) ;Finds Info button, wait max 2 seconds - If IsArray($KingInfoPos) = False Then - SetLog(GetLangText("msgKAUnavailable"), $COLOR_RED) - Else ;check if king is available for battle - $KingInfoPos = _PixelSearch(510, 589, 585, 591, Hex(0xD13D08, 6), 5) ;Finds Healing button - If IsArray($KingInfoPos) = False Then - $KingInfoPos = _PixelSearch(510, 589, 585, 591, Hex(0xD0EC75, 6), 5) ;Finds Finish now button, when under upgrading - If IsArray($KingInfoPos) Then - $KingUG = True - Else - $KingAvailable = True - EndIf - EndIf - EndIf - Setlog (GetLangText("msgKingAvail") & $KingAvailable) - Return $KingAvailable -EndFunc - -Func ChkQueenAvailability() - - $QueenAvailable = False - $QueenUG = False - - ClickP($TopLeftClient) ;Click Away - If $QueenPos[0] = "" Then - Return False - Else - if _sleep(500) Then Return - Click($QueenPos[0], $QueenPos[1]) ;Click Queen Altar - EndIf - - If _Sleep(500) Then Return - _CaptureRegion() - - Local $QueenInfoPos = _WaitForPixel(260, 581, 350, 583, Hex(0x4084B8, 6), 5, 2) ;Finds Info button, wait max 2 seconds - If IsArray($QueenInfoPos) = False Then - SetLog(GetLangText("msgQAUnavailable"), $COLOR_RED) - Else ;check if king is available for battle - $QueenInfoPos = _PixelSearch(510, 589, 585, 591, Hex(0xD13D08, 6), 5) ;Finds Healing button - If IsArray($QueenInfoPos) = False Then - $QueenInfoPos = _PixelSearch(510, 589, 585, 591, Hex(0xD0EC75, 6), 5) ;Finds Finish now button, when under upgrading - If IsArray($QueenInfoPos) Then - $QueenUG = True - Else - $QueenAvailable = True - EndIf - EndIf - EndIf - Setlog (GetLangText("msgQueenAvail") & $QueenAvailable) - Return $QueenAvailable +; This code was created for public use by BrokenBot.org and falls under the GPLv3 license. +; This code can be incorporated into open source/non-profit projects free of charge and without consent. +; **NOT FOR COMMERCIAL USE** by any project which includes any part of the code in this sub-directory without express written consent of BrokenBot.org +; You **MAY NOT SOLICIT DONATIONS** from any project which includes any part of the code in this sub-directory without express written consent of BrokenBot.org +; +;Function needed by all strategies + + +;Check Out of Sync or Disconnection, if detected, bump speedBump by 0.5 seconds +Func ChkDisconnection($disconnected = False) + _CaptureRegion() + Local $dummyX = 0 + Local $dummyY = 0 + If _ImageSearch(@ScriptDir & "\images\Client.bmp", 1, $dummyX, $dummyY, 50) = 1 Then + If $dummyX > 290 And $dummyX < 310 And $dummyY > 325 And $dummyY < 340 Then + $disconnected = True + $speedBump += 500 + If $speedBump > 5000 Then + $speedBump = 5000 + SetLog("Out of sync! Already searching slowly, not changing anything.", $COLOR_RED) + Else + SetLog("Out of sync! Slowing search speed by 0.5 secs.", $COLOR_RED) + EndIf + EndIf + EndIf + If _ImageSearch(@ScriptDir & "\images\Lost.bmp", 1, $dummyX, $dummyY, 50) = 1 Then + If $dummyX > 320 and $dummyX < 350 and $dummyY > 330 and $dummyY < 350 Then + $disconnected = True + ;Looks like lost connection is not related to search speed, test run without bump + SetLog("Lost Connection!", $COLOR_RED) +;~ $speedBump += 500 +;~ If $speedBump > 5000 Then +;~ $speedBump=5000 +;~ SetLog("Lost Connection! Already searching slowly, not changing anything.", $COLOR_RED) +;~ Else +;~ SetLog("Lost Connection! Slowing search speed by 0.5 secs.", $COLOR_RED) +;~ EndIf + EndIf + EndIf + + If $disconnected = True Then + ;increase disconnect counts + GUICtrlSetData($lblresultsearchdisconnected, GUICtrlRead($lblresultsearchdisconnected) + 1) + If $DebugMode = 1 Then _GDIPlus_ImageSaveToFile($hBitmap, $dirDebug & "DisConnt-" & @HOUR & @MIN & @SEC & ".png") + + If $PushBulletEnabled = 1 and IsChecked($lbldisconnect) Then + Local $iCount = _FileCountLines($sLogPath) + Local $myLines = "" + Local $i + For $i = 1 to 5 + $myLines = $myLines & FileReadLine($sLogPath, ($iCount - 5 + $i)) & "\n" + Next + _Push("Disconnected", "Your bot got disconnected while searching for enemy, total disconnections:" & GUICtrlRead($lblresultsearchdisconnected) & "\n" & _ + "Last 5 lines of log:\n" & $myLines) + EndIf + EndIf + Return $disconnected +EndFunc + + +Func ChkKingAvailability() + + $KingAvailable = False + $KingUG = False + ClickP($TopLeftClient) ;Click Away + If $KingPos[0] = "" Then + Return False + Else + if _sleep(500) Then Return + Click($KingPos[0], $KingPos[1]) ;Click King Altar + EndIf + + If _Sleep(500) Then Return + _CaptureRegion() + + Local $KingInfoPos = _WaitForPixel(260, 581, 350, 583, Hex(0x4084B8, 6), 5, 2) ;Finds Info button, wait max 2 seconds + If IsArray($KingInfoPos) = False Then + SetLog(GetLangText("msgKAUnavailable"), $COLOR_RED) + Else ;check if king is available for battle + $KingInfoPos = _PixelSearch(510, 589, 585, 591, Hex(0xD13D08, 6), 5) ;Finds Healing button + If IsArray($KingInfoPos) = False Then + $KingInfoPos = _PixelSearch(510, 589, 585, 591, Hex(0xD0EC75, 6), 5) ;Finds Finish now button, when under upgrading + If IsArray($KingInfoPos) Then + $KingUG = True + Else + $KingAvailable = True + EndIf + EndIf + EndIf + Setlog (GetLangText("msgKingAvail") & $KingAvailable) + Return $KingAvailable +EndFunc + +Func ChkQueenAvailability() + + $QueenAvailable = False + $QueenUG = False + + ClickP($TopLeftClient) ;Click Away + If $QueenPos[0] = "" Then + Return False + Else + if _sleep(500) Then Return + Click($QueenPos[0], $QueenPos[1]) ;Click Queen Altar + EndIf + + If _Sleep(500) Then Return + _CaptureRegion() + + Local $QueenInfoPos = _WaitForPixel(260, 581, 350, 583, Hex(0x4084B8, 6), 5, 2) ;Finds Info button, wait max 2 seconds + If IsArray($QueenInfoPos) = False Then + SetLog(GetLangText("msgQAUnavailable"), $COLOR_RED) + Else ;check if king is available for battle + $QueenInfoPos = _PixelSearch(510, 589, 585, 591, Hex(0xD13D08, 6), 5) ;Finds Healing button + If IsArray($QueenInfoPos) = False Then + $QueenInfoPos = _PixelSearch(510, 589, 585, 591, Hex(0xD0EC75, 6), 5) ;Finds Finish now button, when under upgrading + If IsArray($QueenInfoPos) Then + $QueenUG = True + Else + $QueenAvailable = True + EndIf + EndIf + EndIf + Setlog (GetLangText("msgQueenAvail") & $QueenAvailable) + Return $QueenAvailable EndFunc \ No newline at end of file diff --git a/BrokenBot.org/functions/Strategies/Strategies.au3 b/BrokenBot.org/functions/Strategies/Strategies.au3 index 76d7017..08bd30e 100644 --- a/BrokenBot.org/functions/Strategies/Strategies.au3 +++ b/BrokenBot.org/functions/Strategies/Strategies.au3 @@ -1,8 +1,8 @@ -; This code was created for public use by BrokenBot.org and falls under the GPLv3 license. -; This code can be incorporated into open source/non-profit projects free of charge and without consent. -; **NOT FOR COMMERCIAL USE** by any project which includes any part of the code in this sub-directory without express written consent of BrokenBot.org -; You **MAY NOT SOLICIT DONATIONS** from any project which includes any part of the code in this sub-directory without express written consent of BrokenBot.org -; -; Just need a single line for each attack strategy plugin -;#include "Dummy\Plugin.au3" -#include "SharedFunction.au3" +; This code was created for public use by BrokenBot.org and falls under the GPLv3 license. +; This code can be incorporated into open source/non-profit projects free of charge and without consent. +; **NOT FOR COMMERCIAL USE** by any project which includes any part of the code in this sub-directory without express written consent of BrokenBot.org +; You **MAY NOT SOLICIT DONATIONS** from any project which includes any part of the code in this sub-directory without express written consent of BrokenBot.org +; +; Just need a single line for each attack strategy plugin +;#include "Dummy\Plugin.au3" +#include "Common\SharedFunctions.au3" diff --git a/BrokenBot.org/functions/Village/TroopSize.au3 b/BrokenBot.org/functions/Village/TroopSize.au3 index f9fa11d..24338ed 100644 --- a/BrokenBot.org/functions/Village/TroopSize.au3 +++ b/BrokenBot.org/functions/Village/TroopSize.au3 @@ -1,43 +1,43 @@ -; This code was created for public use by BrokenBot.org and falls under the GPLv3 license. -; This code can be incorporated into open source/non-profit projects free of charge and without consent. -; **NOT FOR COMMERCIAL USE** by any project which includes any part of the code in this sub-directory without express written consent of BrokenBot.org -; You **MAY NOT SOLICIT DONATIONS** from any project which includes any part of the code in this sub-directory without express written consent of BrokenBot.org -; -; Returns the camp size of a given troop - -Func getTroopSize($troop) - Switch $troop - Case 0, "barb", "barbarian", "B", "Ba" - Return 1 - Case 1, "arch", "archer", "Ar", "Arch" - Return 1 - Case 2, "gob", "goblin", "Gob" - Return 1 - Case 3, "giant", "Gi", "G" - Return 5 - Case 4, "Wa", "WB", "wb", "wall breaker" - Return 2 - Case 5, "loon", "balloon", "Loon" - Return 5 - Case 6, "wiz", "wizard" - Return 4 - Case 7, "He", "Heal", "healer" - Return 14 - Case 8, "drag", "dragon" - Return 20 - Case 9, "Pe", "pekka" - Return 25 - Case 10, "min", "minion", "Min" - Return 2 - Case 11, "hog", "hogger", "hog rider", "pigger", "Ho" - Return 5 - Case 12, "valk", "valkyrie", "Val" - Return 1 - Case 13, "Go", "golem" - Return 30 - Case 14, "witch" - Return 12 - Case Else - Return 999 - EndSwitch -EndFunc ;==>getTroopSize +; This code was created for public use by BrokenBot.org and falls under the GPLv3 license. +; This code can be incorporated into open source/non-profit projects free of charge and without consent. +; **NOT FOR COMMERCIAL USE** by any project which includes any part of the code in this sub-directory without express written consent of BrokenBot.org +; You **MAY NOT SOLICIT DONATIONS** from any project which includes any part of the code in this sub-directory without express written consent of BrokenBot.org +; +; Returns the camp size of a given troop + +Func getTroopSize($troop) + Switch $troop + Case 0, "barb", "barbarian", "B", "Ba" + Return 1 + Case 1, "arch", "archer", "Ar", "Arch" + Return 1 + Case 2, "gob", "goblin", "Gob" + Return 1 + Case 3, "giant", "Gi", "G" + Return 5 + Case 4, "Wa", "WB", "wb", "wall breaker" + Return 2 + Case 5, "loon", "balloon", "Loon" + Return 5 + Case 6, "wiz", "wizard" + Return 4 + Case 7, "He", "Heal", "healer" + Return 14 + Case 8, "drag", "dragon" + Return 20 + Case 9, "Pe", "pekka" + Return 25 + Case 10, "min", "minion", "Min" + Return 2 + Case 11, "hog", "hogger", "hog rider", "pigger", "Ho" + Return 5 + Case 12, "valk", "valkyrie", "Val" + Return 1 + Case 13, "Go", "golem" + Return 30 + Case 14, "witch" + Return 12 + Case Else + Return 999 + EndSwitch +EndFunc ;==>getTroopSize diff --git a/BrokenBot.org/functions/Village/clearField.au3 b/BrokenBot.org/functions/Village/clearField.au3 index 58f3e1c..df58476 100644 --- a/BrokenBot.org/functions/Village/clearField.au3 +++ b/BrokenBot.org/functions/Village/clearField.au3 @@ -1,85 +1,78 @@ -; This code was created for public use by BrokenBot.org and falls under the GPLv3 license. -; This code can be incorporated into open source/non-profit projects free of charge and without consent. -; **NOT FOR COMMERCIAL USE** by any project which includes any part of the code in this sub-directory without express written consent of BrokenBot.org -; You **MAY NOT SOLICIT DONATIONS** from any project which includes any part of the code in this sub-directory without express written consent of BrokenBot.org -; -Func clearField() - Local $j, $numObstacle, $numCleared = 0 - If $iClearField = 1 Then - SetLog(GetLangText("msgClearField"), $COLOR_BLUE) - If $FreeBuilder < 1 Then - SetLog(GetLangText("msgNoBuilders"), $COLOR_RED) - Return - EndIf - $hDLL = DllOpen(@ScriptDir & "\BrokenBot.org\BrokenBot32.dll") - _CaptureRegion() - $sendHBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap) - $res = DllCall($hDLL, "str", "BrokenBotMatchObject", "ptr", $sendHBitmap, "int", 25, "int", 3, "int", 5, "int", 4, "int", (IsChecked($chkSpeedBoost) ? (1) : (0))) - _WinAPI_DeleteObject($sendHBitmap) - If IsArray($res) Then - If $res[0] = -1 Then - ; failed to find any obstacles to clear on the field - SetLog(GetLangText("msgNoClearField"), $COLOR_RED) - ElseIf $res[0] = -2 Then - SetLog(GetLangText("msgLicense"), $COLOR_RED) - Else - $expRet = StringSplit($res[0], "|", 2) - $numObstacle = $expRet[0] - If $DebugMode = 1 Then SetLog("Total " & $numObstacle & " Obstacles.") - For $j = 1 To UBound($expRet) - 1 Step 6 - $ObsX = $expRet[$j] - $ObsY = $expRet[$j + 1] - If $ObsX = 0 And $ObsY = 0 Then ExitLoop - If $ObsY < 65 Then - If $DebugMode = 1 Then SetLog("Obstacle unable to be clicked: " & $ObsX & ", " & $ObsY) - ExitLoop - EndIf - If $ObsX < 70 Then - If $DebugMode = 1 Then SetLog("Obstacle unable to be clicked: " & $ObsX & ", " & $ObsY) - ExitLoop - EndIf - _Sleep(300) - Click($ObsX, $ObsY) - _Sleep(1000) - _CaptureRegion() - $sendHBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap) - $resUI = DllCall($hDLL, "str", "BrokenBotMatchButton", "ptr", $sendHBitmap, "int", 110, "int", 3, "int", 1, "int", 3, "int", (IsChecked($chkSpeedBoost) ? (1) : (0))) ; remove icon - _WinAPI_DeleteObject($sendHBitmap) - If IsArray($resUI) Then - If $resUI[0] = -1 Or $resUI[0] = -2 Then ExitLoop - $expUIRet = StringSplit($resUI[0], "|", 2) - If $DebugMode = 1 Then SetLog("Obstacle X:" & $expUIRet[1] & " Y:" & $expUIRet[2]) - _Sleep(300) - Click($expUIRet[1], $expUIRet[2]) - $numCleared += 1 - $UIWait = 0 - Do - _Sleep(300) - _CaptureRegion() - $sendHBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap) - $resUI = DllCall($hDLL, "str", "BrokenBotMatchButton", "ptr", $sendHBitmap, "int", 111, "int", 3, "int", 1, "int", 3, "int", (IsChecked($chkSpeedBoost) ? (1) : (0))) ; cancel build icon - _WinAPI_DeleteObject($sendHBitmap) - $expUIRet = StringSplit($resUI[0], "|", 2) - If $expUIRet[0] = -1 Or $expUIRet[0] = -2 Then ExitLoop - _Sleep(5000) - $UIWait += 1 - Until $UIWait = 12 - Else - DllClose($hDLL) - SetLog(GetLangText("msgDLLError"), $COLOR_RED) - Return False ; return 0 - EndIf - Next - EndIf - Else - DllClose($hDLL) - SetLog(GetLangText("msgDLLError"), $COLOR_RED) - Return False ; return 0 - EndIf - If $numCleared > 0 Then - SetLog(GetLangText("msgClearedField") & $numCleared, $COLOR_BLUE) - EndIf - DllClose($hDLL) - EndIf - Return -EndFunc ;==>clearField +; This code was created for public use by BrokenBot.org and falls under the GPLv3 license. +; This code can be incorporated into open source/non-profit projects free of charge and without consent. +; **NOT FOR COMMERCIAL USE** by any project which includes any part of the code in this sub-directory without express written consent of BrokenBot.org +; You **MAY NOT SOLICIT DONATIONS** from any project which includes any part of the code in this sub-directory without express written consent of BrokenBot.org +; +Func clearField() + Local $j, $numObstacle, $numCleared = 0 + If $iClearField = 1 Then + SetLog(GetLangText("msgClearField"), $COLOR_BLUE) + If $FreeBuilder < 1 Then + SetLog(GetLangText("msgNoBuilders"), $COLOR_RED) + Return + EndIf + + $res = CallHelper("0 0 860 720 BrokenBotMatchObject 25 5 4") + + If $res <> $DLLFailed And $res <> $DLLTimeout Then + If $res = $DLLNegative Then + ; failed to find any obstacles to clear on the field + SetLog(GetLangText("msgNoClearField"), $COLOR_RED) + ElseIf $res = $DLLLicense Then + SetLog(GetLangText("msgLicense"), $COLOR_RED) + Else + $expRet = StringSplit($res, "|", 2) + $numObstacle = $expRet[0] + If $DebugMode = 1 Then SetLog("Total " & $numObstacle & " Obstacles.") + For $j = 1 To UBound($expRet) - 1 Step 6 + $ObsX = $expRet[$j] + $ObsY = $expRet[$j + 1] + If $ObsX = 0 And $ObsY = 0 Then ExitLoop + If $ObsY < 65 Then + If $DebugMode = 1 Then SetLog("Obstacle unable to be clicked: " & $ObsX & ", " & $ObsY) + ExitLoop + EndIf + If $ObsX < 70 Then + If $DebugMode = 1 Then SetLog("Obstacle unable to be clicked: " & $ObsX & ", " & $ObsY) + ExitLoop + EndIf + _Sleep(300) + Click($ObsX, $ObsY) + _Sleep(1000) + + $resUI = CallHelper("0 0 860 720 BrokenBotMatchButton 110 1 3") + + If $resUI <> $DLLFailed And $resUI <> $DLLTimeout Then + If $resUI = -1 Or $resUI = -2 Then ExitLoop + $expUIRet = StringSplit($resUI, "|", 2) + If $DebugMode = 1 Then SetLog("Obstacle X:" & $expUIRet[1] & " Y:" & $expUIRet[2]) + _Sleep(300) + Click($expUIRet[1], $expUIRet[2]) + $numCleared += 1 + $UIWait = 0 + Do + _Sleep(300) + + $resUI = CallHelper("0 0 860 720 BrokenBotMatchButton 111 1 3") + + $expUIRet = StringSplit($resUI, "|", 2) + If $expUIRet[0] = -1 Or $expUIRet[0] = -2 Then ExitLoop + _Sleep(5000) + $UIWait += 1 + Until $UIWait = 12 + Else + SetLog(GetLangText("msgDLLError"), $COLOR_RED) + Return False ; return 0 + EndIf + Next + EndIf + Else + SetLog(GetLangText("msgDLLError"), $COLOR_RED) + Return False ; return 0 + EndIf + If $numCleared > 0 Then + SetLog(GetLangText("msgClearedField") & $numCleared, $COLOR_BLUE) + EndIf + EndIf + Return +EndFunc ;==>clearField diff --git a/BrokenBot.org/functions/Village/collectResources.au3 b/BrokenBot.org/functions/Village/collectResources.au3 index aa7438b..65c68a7 100644 --- a/BrokenBot.org/functions/Village/collectResources.au3 +++ b/BrokenBot.org/functions/Village/collectResources.au3 @@ -1,49 +1,46 @@ -; This code was created for public use by BrokenBot.org and falls under the GPLv3 license. -; This code can be incorporated into open source/non-profit projects free of charge and without consent. -; **NOT FOR COMMERCIAL USE** by any project which includes any part of the code in this sub-directory without express written consent of BrokenBot.org -; You **MAY NOT SOLICIT DONATIONS** from any project which includes any part of the code in this sub-directory without express written consent of BrokenBot.org -; -Func collectResources() - Local $i, $j = 0 - Local $foundResource = False - If $ichkCollect = 1 Then - SetLog(GetLangText("msgCollecting"), $COLOR_BLUE) - Do - _CaptureRegion() - $sendHBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap) - $res = DllCall(@ScriptDir & "\BrokenBot.org\BrokenBot32.dll", "str", "BrokenBotMatchObject", "ptr", $sendHBitmap, "int", 27, "int", 3, "int", 17, "int", 1, "int", (IsChecked($chkSpeedBoost) ? (1) : (0))) - _WinAPI_DeleteObject($sendHBitmap) - If IsArray($res) Then - If $res[0] = -2 Then - SetLog(GetLangText("msgLicense"), $COLOR_RED) - ElseIf $res[0] = -1 And Not $foundResource Then - ; failed to find Resources - SetLog(GetLangText("msgNoResources"), $COLOR_RED) - $ResX = 0 - $ResY = 0 - ExitLoop - Else - $expRet = StringSplit($res[0], "|", 2) - $numBldg = $expRet[0] - For $j = 1 To UBound($expRet) - 1 Step 6 - $ResX = $expRet[$j] - $ResY = $expRet[$j + 1] - If $ResX = 0 And $ResY = 0 Then ExitLoop - If $DebugMode = 1 Then SetLog("Total " & $numBldg & " Resources. X:" & $ResX & " Y:" & $ResY) - Click($ResX, $ResY) - Click(1, 1) - Sleep(300) - Next - $foundResource = True - EndIf - Else - SetLog(GetLangText("msgDLLError"), $COLOR_RED) - $ResX = 0 - $ResY = 0 - Return False ; return 0 - EndIf - $i += 1 - Until $i = 2 - EndIf - Return -EndFunc ;==>collectResources +; This code was created for public use by BrokenBot.org and falls under the GPLv3 license. +; This code can be incorporated into open source/non-profit projects free of charge and without consent. +; **NOT FOR COMMERCIAL USE** by any project which includes any part of the code in this sub-directory without express written consent of BrokenBot.org +; You **MAY NOT SOLICIT DONATIONS** from any project which includes any part of the code in this sub-directory without express written consent of BrokenBot.org +; +Func collectResources() + Local $i, $j = 0 + Local $foundResource = False + If $ichkCollect = 1 Then + SetLog(GetLangText("msgCollecting"), $COLOR_BLUE) + Do + $res = CallHelper("0 0 860 720 BrokenBotMatchObject 27 17 1") + If $res <> $DLLFailed And $res <> $DLLTimeout Then + If $res = $DLLLicense Then + SetLog(GetLangText("msgLicense"), $COLOR_RED) + ElseIf $res = $DLLNegative And Not $foundResource Then + ; failed to find Resources + SetLog(GetLangText("msgNoResources"), $COLOR_RED) + $ResX = 0 + $ResY = 0 + ExitLoop + Else + $expRet = StringSplit($res, "|", 2) + $numBldg = $expRet[0] + For $j = 1 To UBound($expRet) - 1 Step 6 + $ResX = $expRet[$j] + $ResY = $expRet[$j + 1] + If $ResX = 0 And $ResY = 0 Then ExitLoop + If $DebugMode = 1 Then SetLog("Total " & $numBldg & " Resources. X:" & $ResX & " Y:" & $ResY) + Click($ResX, $ResY) + Click(1, 1) + Sleep(300) + Next + $foundResource = True + EndIf + Else + SetLog(GetLangText("msgDLLError"), $COLOR_RED) + $ResX = 0 + $ResY = 0 + Return False ; return 0 + EndIf + $i += 1 + Until $i = 2 + EndIf + Return +EndFunc ;==>collectResources diff --git a/BrokenBot.org/functions/functions.au3 b/BrokenBot.org/functions/functions.au3 index 06e0b6a..0d124fb 100644 --- a/BrokenBot.org/functions/functions.au3 +++ b/BrokenBot.org/functions/functions.au3 @@ -1,29 +1,30 @@ -; This code was created for public use by BrokenBot.org and falls under the GPLv3 license. -; This code can be incorporated into open source/non-profit projects free of charge and without consent. -; **NOT FOR COMMERCIAL USE** by any project which includes any part of the code in this sub-directory without express written consent of BrokenBot.org -; You **MAY NOT SOLICIT DONATIONS** from any project which includes any part of the code in this sub-directory without express written consent of BrokenBot.org -; -#include "GUI\frmAttackConfig.au3" -#include "GUI\frmBugReport.au3" -#include "GUI\WindowFixing.au3" - -#include "ImageSearch\checkDarkElix.au3" -#include "ImageSearch\checkTownhall.au3" - -#include "Other\checkupdate.au3" -#include "Other\GeneralFunctions.au3" -#include "Other\HSL.au3" -#include "Other\maths.au3" -#include "Other\overlay.au3" -#include "Other\RedLineMath.au3" -#include "Other\ReadChatLog.au3" -#include "Other\ReadText.au3" -#include "Other\statsubmission.au3" -#include "Other\StatusCheck.au3" - -#include "Strategies\LoadDefaults.au3" -#include "Strategies\Strategies.au3" - -#include "Village\TroopSize.au3" -#include "Village\collectResources.au3" -#include "Village\clearField.au3" +; This code was created for public use by BrokenBot.org and falls under the GPLv3 license. +; This code can be incorporated into open source/non-profit projects free of charge and without consent. +; **NOT FOR COMMERCIAL USE** by any project which includes any part of the code in this sub-directory without express written consent of BrokenBot.org +; You **MAY NOT SOLICIT DONATIONS** from any project which includes any part of the code in this sub-directory without express written consent of BrokenBot.org +; +#include "GUI\frmAttackConfig.au3" +#include "GUI\frmBugReport.au3" +#include "GUI\WindowFixing.au3" + +#include "ImageSearch\checkDarkElix.au3" +#include "ImageSearch\checkTownhall.au3" + +#include "Other\CallHelper.au3" +#include "Other\checkupdate.au3" +#include "Other\GeneralFunctions.au3" +#include "Other\HSL.au3" +#include "Other\maths.au3" +#include "Other\overlay.au3" +#include "Other\RedLineMath.au3" +#include "Other\ReadChatLog.au3" +#include "Other\ReadText.au3" +#include "Other\statsubmission.au3" +#include "Other\StatusCheck.au3" + +#include "Strategies\LoadDefaults.au3" +#include "Strategies\Strategies.au3" + +#include "Village\TroopSize.au3" +#include "Village\collectResources.au3" +#include "Village\clearField.au3" diff --git a/BrokenBot.org/languages/Belarusian.ini b/BrokenBot.org/languages/Belarusian.ini new file mode 100755 index 0000000..5b5e745 --- /dev/null +++ b/BrokenBot.org/languages/Belarusian.ini @@ -0,0 +1,799 @@ +[general] +troopNameBarbarian = "Âŕđâŕđ" +troopNameArcher = "Ëó÷íčöŕ" +troopNameGiant = "Ăłăŕíň" +troopNameGoblin = "Ăłăŕíň" +troopNameWallBreaker = "Ńňĺíîáîé" +troopNameBalloon = "Ďŕâĺňđŕíű řŕđ" +troopNameWizard = "Ęŕëäóí" +troopNameHealer = "Ëĺęŕđęŕ" +troopNameDragon = "Öěîę" +troopNamePEKKA = "Ď E. K. K. A." +troopNamePlBarbarian = "Âŕđâŕđű" +troopNamePlArcher = "Ëó÷íłöű" +troopNamePlGiant = "Ăłăł" +troopNamePlGoblin = "Ăîáëłíű" +troopNamePlWallBreaker = "Ńňĺíîáîč" +troopNamePlBalloon = "Âîçä. řŕđű" +troopNamePlWizard = "Âĺäçüěŕęł" +troopNamePlHealer = "Çíŕőŕđęł" +troopNamePlDragon = "Öěîęł" +troopNamePlPEKKA = "Ď E. K. K. I." +troopDarkMinion = "Ěłíüĺí" +troopDarkHog = "Âĺđříłę íŕ Ęŕáŕíĺ" +troopDarkValkyrie = "Âŕëüęłđű˙" +troopDarkGolem = "Ăîëĺě" +troopDarkWitch = "Âĺäçüěŕ" +troopDarkLavaHound = "Ď˙ęĺëüíŕ˙ Ăŕí÷ŕę" +troopDarkPlMinion = "Ěłí'ĺíű" +troopDarkPlHog = "Ęŕáŕíű" +troopDarkPlValkyrie = "Âŕëüęłđűł" +troopDarkPlGolem = "Ăîëĺěű" +troopDarkPlWitch = "Âĺäçüěű" +troopDarkPlLavaHound = "Ď˙ęĺëüíű˙ ăîí÷čč" +spellNameLightning = "Ěŕëŕíęŕ" +spellNameHealing = "Âűë˙÷ýííĺ" +spellNameRage = "Ëţňŕńöü" +spellNameJump = "Ńęŕ÷îę" +spellNameFreeze = "Ěŕđîç" +spellNamePoison = "ßä" +spellNameEarthquake = "Çĺěë˙ňđóń" +spellNameHaste = "Ďŕńďĺříŕńöü" +btnStart = "Ńňŕđň" +btnStartInit = "Çŕăđóçęŕ..." +btnStop = "Ńňîď" +btnHide = "Ńőŕâŕöü BS" +btnAtkNow = "Ŕňŕęŕâŕöü" +btnPause = "Ďŕ˘çŕ" +pageGeneral = "Ăŕëî˘íŕ˙" +Controls = "Ęłđŕâŕííĺ" +cmbBotPre = "Đýćűě Âîďűňó|" +cmbBotCommand = "Á˙çäçĺéíŕńöü|Âűęëţ÷ýííĺ PC|Ńîí PC" +cmbBotCommandDefault = "Á˙çäçĺéíŕńöü" +lblPC = "ęŕëł:" +cmbBotCondAdd = "G, E, And DE Full and Max. Trophy|" +cmbBotCond = "G and E Full and Max.Trophy|(G and E) Full or Max.Trophy|(or G E) Full and Max.Trophy|or G E Full or Max.Trophy|Gold and Ýëłęńłđ Full|Gold ŕáî Ýëłęńłđ Full|Gold Ďî˘íű and Max.Trophy|Ýëłęńłđ Full and Max.Trophy|Gold Ďî˘íű or Max.Trophy|Ýëłęńłđ Full or Max.Trophy|Gold Full|Ýëłęńłđ Full|Reach Max. Trophy" +cmbBotCondDefault = "Gold and Ýëłęńłđ Full" +otherSettings = "˛ířű˙ ďŕđŕěĺňđű" +chkNoAttack = "Äîíŕň/Ňđýíłđî˘ęŕ" +chkNoAttackTip = "Ŕäęëţ÷ýííĺ íŕďŕäŕ˘, ňîëüęł çáîđ đýńóđńŕ˘/ňđýíłđî˘ęŕ" +chkDonateOnly = "Äîíŕň" +chkDonateOnlyTip = "Ŕäęëţ÷ýííĺ íŕďŕäࢠł ňđýíłđî˘ęó, ňîëüęł çáîđ đýńóđńŕ˘/äîíŕň" +expMode = "Đýćűě âîďűňó" +expModeTip = "Ŕňŕęóĺ ăîáëčíńęčĺ áŕçű" +lblMaxTrophy = "Ňđŕôĺł:" +lblSnipeBelow = "Ńíŕéďĺđ:" +pageAttackOptions = "Ńňđŕňýăłł" +btnSaveStrat = "Çŕőŕâŕöü ńňđŕňýăłţ ˙ę..." +btnRefresh = "Ŕáíŕâłöü" +AtkSpeed = "Őóňęŕńöü âűńŕäęł âîéńęŕ˘" +lblUnitDelay = "Çŕňđűěęŕ" +lblWaveDelay = "Ęîë-âŕ őâŕëü" +Randomspeedatk = "Ńëó÷. őóňęŕńöü" +lblAttackdelay = "Őóňęŕńöü çŕňđűěęł âîéńęŕ˘, 1 (őóňęŕ˙) = ˙ę áîň, 10 (ďŕâîëüíŕ˙) = ďŕ-÷ŕëŕâĺ÷ű. Đýęŕěĺíäóĺööŕ ńňŕâłöü ďŕâîëüíóţ őóňęŕńöü âűńŕäęł âîéńęŕ˘." +pageDonateSettings = "Äîíŕň/Çŕďűň" +Barbarians = "Âîéńęł 1" +chkDonateAll = "Äîíŕň ˇńłě" +chkDonateAllTip = "Ęëţ÷ŕâű˙ ńëîâű äë˙ äŕíŕňŕ" +txtDonate = "any\r\nreinforcement" +txtDonateBarbariansTip = "Ęëţ÷ŕâű˙ ńëîâű äë˙ äŕíŕňŕ âîéńęࢠ1" +Archers = "Âîéńęł 2" +txtDonateArchersTip = "Ęëţ÷ŕâű˙ ńëîâű äë˙ äŕíŕňŕ âîéńęࢠ2" +Giants = "Âîéńęł 3" +txtDonateGiantsTip = "Ęëţ÷ŕâű˙ ńëîâű äë˙ äŕíŕňŕ âîéńęࢠ3" +chkDonateGiants = "Âęë Âîéńęł 3" +chkDonateGiantsTip = "ęŕëł ëŕńęŕ, Ďđŕâĺđöĺ ęëţ÷ŕâű˙ ńëîâű, ďĺđř ÷űě äîíŕň âîéńęł 3" +chkDonateArchers = "Âęë Âîéńęł 2" +chkDonateArchersTip = "ęŕëł ëŕńęŕ, Ďđŕâĺđöĺ ęëţ÷ŕâű˙ ńëîâű, ďĺđř ÷űě äîíŕň âîéńęł 2" +chkDonateBarbarians = "Âęë Âîéńęł 1" +chkDonateBarbariansTip = "ęŕëł ëŕńęŕ, Ďđŕâĺđöĺ ęëţ÷ŕâű˙ ńëîâű, ďĺđř ÷űě äîíŕň âîéńęł 1" +chkRequest = "Çŕďűňŕöü:" +txtRequestDefault = "óńĺ" +txtRequestTip = "Óâîä çŕďűňó." +chkBlacklist = "× Ńďłń" +chkBlacklistTip = "ęŕëł ëŕńęŕ, Ďđŕâĺđöĺ, ęŕá ďđĺäîňâđŕňčňüäîíŕň, ęŕëł çŕďűň óňđűěëłâŕĺ ńëîâŕ ˘ ďîëĺ ńďđŕâŕ" +chkBlacklistTip2 = "Íĺ áóäçĺ ďđŕöŕâŕöü, ęŕëł âű âűęŕđűńňî˘âŕĺöĺ Äîíŕň ˇńłě." +gtfo = "GTFO" +gtfoTip = "Ęłę ďŕńë˙ äŕíŕňŕ" +pageUpgradeBuilding = "Ďŕë˙ďřýííĺ" +Upgrade = "Ďŕë˙ďřýííĺ Ŕáŕđîíű / Ńőîâłř÷ű / Âŕĺííŕăŕ Ëŕăĺđŕ " +chkUpgrade1 = "Óëó÷ř 1 " +lblUPPosX = "Pos X : " +lblUPPosY = "Pos Y : " +btnLocateUp1 = "Ďŕęŕćűöĺ Áóäűíŕę 1" +chkUpgrade2 = "Óëó÷ř 2 " +btnLocateUp2 = "Ďŕęŕćűöĺ Áóäűíŕę 2" +chkUpgrade3 = "Óëó÷ř 3 " +btnLocateUp3 = "Ďŕęŕćűöĺ Áóäűíŕę 3" +Upgrade2 = "Ďŕë˙ďřýííĺ Ęŕëĺęňŕđű/Ęŕçŕđěű Lv 5 - Ěŕęń" +chkUpgrade4 = "Ďŕë˙ďřýííĺ 4 :" +btnLocateUp4 = "Ďŕęŕćűöĺ Áóäűíŕę 4" +chkUpgrade5 = "Ďŕë˙ďřýííĺ 5 :" +btnLocateUp5 = "Ďŕęŕćűöĺ Áóäűíŕę 5" +chkUpgrade6 = "Ďŕë˙ďřýííĺ 6 :" +btnLocateUp6 = "Ďŕęŕćűöĺ Áóäűíŕę 6" +grpLaboratory = "Ëŕáŕđŕňîđű˙" +chkLab = "Óęëţ÷űöü" +lblLab = "Řňî Ďŕë˙ďřŕöü:" +cmbNothing = "Íł÷îăŕ" +pagenotificationSetting = "Ńýđâłńű" +lblpushbullet = "PushBullet" +pushbullettoken1 = "Account Token:" +lblpushbulletenabled = "Óęëţ÷űöü" +lblpushbulletenabledTip = "Óęëţ÷űöü pushbullet ďŕâĺäŕěëĺíí˙" +lblpushbulletdebug = "Ŕäëŕäęŕ" +lblpushbulletdebugTip = "Ăýňŕ äŕçâîëłöü äŕäŕöü äýňŕëłçŕöűţ ďđű ŕäďđŕ˘öű ôŕéëࢠďđŕç PushBullet" +lblpushbulletremote = "Ęłđŕâŕííĺ" +lblpushbulletremoteTip = "ˇęëţ÷ýííĺ ŕääŕëĺíűő ôóíęöűé pushbullet" +lblpushbulletdelete = "Âűäŕë˙öü ëîăł" +lblpushbulletdeleteTip = "Áóäçĺ âűäŕë˙öü Âŕřű ďŕâĺäŕěëĺííł ďŕ ęíîďöű ďóńę" +lblpushmessage = "Push-Ďŕâĺäŕěëĺíí˙ ˘ âűăë˙äçĺ Ňýęńňó" +lblvillagereport = "˛íôŕ ŕá áŕçĺ" +lblchatlog = "Ëîă ×ŕňŕ" +lblmatchfound = "Çíîéäçĺíŕ áŕçŕ" +lbllastraid = "Ŕňŕęł" +lblfreebuilder = "Áóäŕ˘íłęł" +lbldisconnect = "Ŕäęëţ÷ýííĺ" +lblpushbulletloot = "Ńęđűířîň" +lblpushuser = "ęŕëł ëŕńęŕ, Óâ˙äçłöĺ łě˙ ęŕđűńňŕëüíłęŕ äë˙ ęŕíňđîëţ" +UseJPG = "Ëóňŕé" +UseJPGTip = "Ďđűěŕöî˘âŕöü ńęđűířîň ëóňŕé ˘ ďŕâĺäŕěëĺííł pushbullet" +UseAttackJPG = "Ŕňŕęł" +UseAttackJPGTip = "Ďđűěŕöî˘âŕöü ńęđűířîň ŕňŕęł ˘ ďŕâĺäŕěëĺííł pushbullet" +lblpushbullet2 = "PushBullet Ěíîăîďîëüçîâŕňĺëü" +pushbullettoken2 = "Âű ěîćŕöĺ âűäŕëĺíŕ ęŕíňđŕë˙âŕöü âŕř áîň âűęŕđűńňî˘âŕţ÷ű íŕńňóďíű Ôŕđěŕň ęŕěŕíäű" +pushbullettoken3 = "ęŕëł ëŕńęŕ, Óâ˙äçłöĺ ęŕěŕíäó ˘ Çŕăŕëîâŕę ďŕâĺäŕěëĺíí˙ PushBullet" +pushbullettoken4 = "Bot <ęŕěŕíäŕ> Äçĺ <ęŕěŕíäŕ> ďłńŕöü:" +pushbullettoken5 = "Pause - ďđűďűíłöü áîňŕ" +pushbullettoken6 = "Resume - ŕäíŕâłöü áîňŕ" +pushbullettoken7 = "Stats - ŕäďđŕ˘ë˙öü á˙ăó÷óţ ńňŕňűńňűęó áîňŕ" +pushbullettoken8 = "Logs - ŕäďđŕâłöü á˙ăó÷ű ôŕéë ëîăŕ" +pushbullettoken9 = "Help - ŕäďđŕâłöü ăýňŕ ďŕâĺäŕěëĺííĺ äŕďŕěîăł" +lblBBStats = "Ďŕăë˙äçĺöü ńâŕţ ńňŕňűńňűęó íŕ BrokenBot.org" +lblBBUser = "łě˙:" +tipBBUser = "ęŕëł ëŕńęŕ, Óâ˙äçłöĺ łě˙ ęŕđűńňŕëüíłęŕ íŕ ôîđóěĺ BrokenBot.org" +lblBBPassword = "Ďŕđîëü:" +tipBBPass1 = "Ęŕëł ëŕńęŕ, óâ˙äçłöĺ ďŕđîëü íŕ ôîđóěĺ BrokenBot.org" +tipBBPass2 = "Ăýňű˙ äŕäçĺíű˙ áóäóöü çŕőî˘âŕööŕ ˘ çŕřűôđŕâŕíűě âűăë˙äçĺ ˘ ŕńîáíűě ôŕéëĺ" +tipBBPass3 = "ł âűęŕđűńňî˘âŕĺööŕ ňîëüęł äë˙ ŕäďđŕ˘ęł ńňŕňűńňűöű îíëŕéí" +tipBBPass4 = "~~~ˇÂŔĂÓ~~~" +tipBBPass5 = "Íŕâŕň ęŕëł ăýňŕ çŕőî˘âŕĺööŕ ˘ çŕřűôđŕâŕíűě âűăë˙äçĺ íŕ âŕřűě ęŕěďóňŕđű," +tipBBPass6 = "AutoIT ďŕ ńâŕĺé ńóňíŕńöł íĺá˙ńďĺ÷íű. Ęŕëł ëŕńęŕ, âűęŕđűńňî˘âŕéöĺ ŕďîříł" +tipBBPass7 = "ďŕđîëü äë˙ BrokenBot.org" +tipBBValidCheck = "Íŕöłńíłöĺ, ęŕá ďŕöâĺđäçłöü ńâŕĺ łě˙ ęŕđűńňŕëüíłęŕ / ďŕđîëü" +tipBBValidGood = "Âŕřű˙ óëłęîâű˙ äŕäçĺíű˙ ńŕďđŕ˘äíű˙!" +tipBBValidBad = "Íĺěŕă÷űěŕ ďđŕâĺđűöü łě˙ ęŕđűńňŕëüíłęŕ / ďŕđîëü" +chkBBSendData = "Çŕăđóçłöü ńňŕňűńňűęó äë˙ BrokenBot.org" +tipBBSendData = "Ďđŕâĺđęŕ ăýňŕ˙ áóäçĺ çŕăđóćŕöü ńňŕňűńňűęó: ęîëüęł áŕĺ˘ âű çđŕáłëł äë˙ ńňŕňűńňűęł ńóďîëüíŕńöł" +lblBBRegister = "Đýăłńňđŕöű˙ íŕ BrokenBot" +pageMiscSettings = "Đîçíŕĺ" +Miscs = "Đîçíŕĺ" +lblReconnect = "Ďĺđŕďŕäęëţ÷ýííĺ:" +lblReconnectTip = "Óńňŕë˙âŕöü łíňýđâŕë ďĺđŕďŕäęëţ÷ýííĺ ďđű ďŕäëó÷ýíí˙ łířŕăŕ ďđűëŕäű (Ďđŕöóĺ ňîëüęł íŕ ŕíăĺëüńęŕé âĺđńłł Clash of clans)" +lblReconnectmin = "őâłëłí" +lblSpellCap = "Ęîë-âŕ Çŕăŕâîđŕ˘:" +lblCapacity = "Ĺěłńňŕńöü ëŕăĺđŕ :" +lblUnknownCap = "Ďŕěűëęŕ, íĺâ˙äîěŕ" +chkTrap = "Çŕđŕäęŕ Ďŕńňŕę" +chkTrapTip = "Ŕ˘ňŕěŕňű÷íŕ˙ çŕđŕäęŕ Ďŕńňŕę, Ŕđáŕëĺňࢠł ˛íôĺđíŕ" +lblSearchsp = "Őóňęŕńöü ďîřóęó:" +lblSearchspTip = "Çŕäŕéöĺ őóňęŕńöü ďîřóęó áŕç, ęŕá ěĺíř áűëî ďđŕáëĺě ç ńłíőđŕíłçŕöű˙é ç ńĺđâĺđŕě" +lblSearchspd = "Ńŕâĺň: 0 = Őóňęŕ, 5 = Ďŕâîëüíŕ" +lblReturnh = "Äŕäîěó ďđŕç:" +lblReturnhTip = "Ęŕěďëĺęň çŕňđűěęł ÷ŕńó äë˙ â˙đňŕíí˙ äŕäîěó ďŕä÷ŕń đýéäó" +lblReturndelay = "ńĺęóíä ďŕńë˙ íł˙ęŕăŕ âű˙˘ëĺíí˙ ëóňŕé" +chkWideEdge = "Äáŕéíŕĺ đŕńďŕçíŕííĺ đŕňóřű" +chkClearField = "Ŕ÷űńöłöü Ďîëĺ" +chkClearFieldTip = "Ńďđîáŕ ŕ÷űńöłöü äŕ 5 ęóńňî˘ ł äđý˘ ł ă. ä.." +msgClearField = "Ŕ÷űńňęŕ Ďîë˙ ..." +msgNoClearField = "Íł÷îăŕ íĺ çíîéäçĺíŕ äë˙ ŕ÷űńňęł." +msgClearedField = "Ďĺđŕřęîäű Âű÷űř÷ŕíű˙: " +chkAlertSearch = "Ŕďŕâ˙ř÷ýííĺ" +chkCollect = "Çáłđŕöü Đýńóđńű" +chkTakeLootSS = "Ńęđűířîň Ëóňŕé" +chkTakeTownSS = "Ńęđűířîň âĺńęł" +chkTakeAttackSS = "Ńęđűířîň Ŕňŕęł" +chkTakeAttackSSTip = "Ěŕěĺíňŕëüíű çäűěŕę ŕňŕęł ďŕńë˙ đŕçăîđňâŕíí˙˘ ˘ńłő âîéńęŕ˘" +chkDebug = "˛íôŕ ŕäëŕäęł" +chkDebugTip = "Äŕçâîëłöü đýćűě ŕäëŕäęł äë˙ çŕőî˘âŕíí˙ äŕäçĺíűő" +LocationSettings = "Ďîřóę áóäűíęŕ˘" +btnLocateKingAltar = "Ŕëň. Ęŕđŕë˙" +btnLocateQueenAltar = "Ŕëň. Ęŕđŕëĺâű" +btnLocateDarkBarracks = "Ňĺěí. ęŕçŕđěű" +btnLocateSFactory = "Ôŕáđűęŕ Çŕęë" +btnLocateTownHall = "Đŕňóřŕ" +btnLocateClanCastle = "Ęëŕíŕâű Çŕěŕę" +btnLocateCamp = "Âŕĺí. Ëŕăĺđ" +btnLab = "Ëŕáŕđŕňîđű˙" +btnLocateBarracks = "Ęŕçŕđěű" +pageOtherSettings = "˛ířŕĺ" +Walls = "Ńöĺíű" +chkWalls = "Ŕ˘ňî Ŕáíŕ˘ëĺííĺ" +UseGold = "˛ńď Çîëŕňŕ" +WallMinGold = "Ěłí. Çîëŕňŕ: " +WallMinGoldTip = "Ěłíłěŕëüíű ˘çđîâĺíü çŕőî˘âŕíí˙ çîëŕňŕ äë˙ âűęŕíŕíí˙ ŕáíŕ˘ëĺíí˙ ńöĺí" +UseElixir = "˛ńď Ýëłęńłđ" +WallMinElixir = "Ěłí. Ýëčęń:" +WallMinElixirTip = "Ěłíłěŕëüíű ˘çđîâĺíü çŕőî˘âŕíí˙ ýëłęńłđŕ äë˙ âűęŕíŕíí˙ ŕáíŕ˘ëĺíí˙ ńöĺí" +UseGoldElix = "˛ńď Çîëŕňŕ ł Ýëłęńłđ" +lblWalls = "Óçđîâĺíü ńöĺí:" +lblTolerance = "Ďđű˙đűňýň:" +cmbTolerance = "Default|Íłćýé|Âűřýé" +cmbToleranceDefault = "Default" +btnFindWall = "Ďîřóę ńöĺí" +grpRedLine = "Âű˙˘ëĺííĺ ÷űđâîíŕé ëłíłł" +lblRedLine1 = "×űđâîíŕ˙ ëłíł˙" +sldAccTip = "Őîöü ěŕă÷űěŕ ÷űđâîíű ýęńňđűě ěîăóöü ďŕ˘ńňŕöü áîëüř íĺ ěîćŕ đŕçăŕđíóöü ó ÷űđâîíű ęîëĺđ ďŕâĺäŕěëĺííł." +sldAccTip2 = "Ó łířŕé ęđŕéíŕńöł ĺí đŕçăîđíĺ íŕ ęđŕł ďŕäńňŕâű." +lblRedLine2 = "Ęđŕé áŕçű" +Boosts = "Ďŕńęŕđýííĺ (çŕ ăĺěű)" +lblBoostBarracks = "Ďŕńęŕđýííĺ ęŕçŕđěࢠ:" +chkBoostKing = "Ęŕđîëü" +chkBoostQueen = "Ęŕđŕëĺâŕ" +chkBoostRax1 = "Ęŕçŕđěŕ 1" +chkBoostRax2 = "Ęŕçŕđěŕ 2" +chkBoostRax3 = "Ęŕçŕđěŕ 3" +chkBoostRax4 = "Ęŕçŕđěŕ 4" +chkBoostSpell = "Ôŕáđűęŕ Çŕęë" +chkBoostDB1 = "Öĺěíŕ˙ Ęŕçŕđěŕ 1" +chkBoostDB2 = "Öĺěíŕ˙ Ęŕçŕđěŕ 2" +pageStatsSetting = "Ńňŕňűńňűęŕ" +resourceonstart = "Đýńóđńű äŕ Ńňŕđňó" +lblgoldonstart = "Çîëŕňŕ :" +lblelixironstart = "Ýëłęńłđ :" +lbldeonstart = "×îđíű Ýë:" +lbltrophyonstart = "Ňđŕôĺ˙˘ :" +Currentresource = "˛ířŕ˙ Ńňŕňűńňűęŕ" +lblvillagesattacked = "Ŕňŕęŕâŕíŕĺ :" +lblvillagesskipped = "Ďđŕďóř÷ŕíŕ :" +lblsearchcost = "Âűäŕňęł íŕ ďîřóę :" +lblruntime = "×ŕń ďđŕöű :" +LastLoot = "Áóäűíęŕ˘/ńöĺí ŕáíî˘ëĺíŕ" +lblwallupgrade = "Ńöĺí ŕáíî˘ëĺíŕ :" +CurrentLoot = "Á˙ăó÷ű˙ Đýńóđńű" +lblgoldnow = "Çîëŕňŕ :" +lblelixirnow = "Ýëłęńłđ:" +lbldenow = "×îđíű Ýë:" +lbltrophynow = "Ňđŕôĺ˙˘ :" +totalresource = "Ńóěŕđíű Äŕőîä" +lblgoldgain = "Çîëŕňŕ :" +lblelixirgain = "Ýëłęńłđ :" +lbldegain = "×îđíű Ýëłęńłđ :" +lbltrophygain = "Ňđŕôĺ˙˘ :" +pageConfigLoadSave = "Ęîíôłă" +ConfigLoadSave = "Çŕăđóçłöü/Çŕőŕâŕöü ęîíôłă" +btnLoad = "Çŕăđóçłöü" +btnSave = "Çŕőŕâŕöü" +grpLanguage = "Ěîâó:" +btnBugRep = "Ŕäëŕäęŕ" +grpUpdate = "Ŕ˘ňŕěŕňű÷íŕĺ ŕáíŕ˘ëĺííĺ" +chkUpdate = "Ďđŕâĺđűöü ŕáíŕ˘ëĺíí˙ ďŕńë˙ çŕďóńęó" +grpBluestacks = "BlueStacks" +chkBackground = "Ôîíŕâű đýćűě" +chkBackgroundTip = "Ŕęňűâŕâŕöü Ôîíŕâű Đýćűě" +chkForceBS = "Çŕ˘ńĺäű Îíëŕéí" +chkForceBSTip = "Ďđűěóńîâŕ ŕęňűâŕâŕöü Bluestacks ęŕëł íĺ ěîćŕöĺ çíŕéńöł ˙ăî" +chkStayAlive = "Ěŕíłňîđ" +chkStayAliveTip = "Ďđŕäóőłëłöü ŕäęëţ÷ýííĺ ěŕíłňîđŕ" +statLogDefault = "Ńňŕňóń: íĺďđŕöóţ÷ű" +tiAbout = "Ŕá Ďđŕăđŕěĺ" +tiExit = "Âűéńöł" +pageSearch = "Ďŕđŕěĺňđű Ďîřóęó" +DeadConditions = "Ěĺđňâű˙ áŕçű" +lblDeadConditions = "Ďîřóę áŕç ç Ďî˘íűěł Ęŕëĺęňŕđŕěł" +chkKingAvail = "×ŕęŕííĺ Ęŕđŕë˙" +chkQueenAvail = "×ŕęŕííĺ Ęŕđŕëĺâű" +chkDeadSnipe = "ŇŐ Ńíŕéďĺđ" +chkDeadSnipeTip = "Ęŕëł ăýňű ńö˙ćîę óńňŕë˙âŕíű, áóäçĺ ŕňŕęŕâŕöü ňîëüęł đŕňóřó íĺ çŕëĺćíŕ ŕä íŕńňđîł" +AnyConditions = "Ëţáű˙ áŕçű" +chkActivate = "Ŕęňűâŕöű˙" +lblAnyConditions = "Ďîřóę ďŕ ŕáđŕíűě ˘ěîâŕő" +chkMeetGE = "Ěłí Đýńóđńŕ˘: " +lblMinGold = "Çëű:" +cmbAndOr = "˛|Ŕáî" +cmbAnd = "˛" +lblMinElixir = "Ýëčę:" +chkMeetDE = "Ěłí ×îđíŕăŕ Ý:" +chkMeetTrophy = "Ěłí Ňđŕôĺ˙˘:" +chkMeetTH = "Ěŕęń ŇŐ:" +chkMeetTHO = "ŇŐ Çâîíęó" +chkMeetTHOTip = "Đŕňóřŕ ďŕâłííŕ áűöü íŕ çíĺříłő ęđŕ˙ő áŕçű" +chkSnipe = "Ńíŕéďĺđ" +chkSnipeTip = "Ęŕëł ăýňű ńö˙ćîę óńňŕë˙âŕíű, áóäçĺ ŕňŕęŕâŕöü ňîëüęł đŕňóřó íĺ çŕëĺćíŕ ŕä íŕëŕä" +RedConditions = "ŔâňîŃíčćĺíčĺ óěî˘ ďîřóęó" +lblRedNumOfSerach = "Ęîë-âŕ ďîřóęŕ˘:" +lblRedGoldPercent = "Çíłćýííĺ Çîëŕňŕ(%):" +lblRedElixirPercent = "Çíłćýííĺ Ýëčęń(%):" +lblRedDEPercent = "Çíłćýííĺ ×. Ýëčęń(%):" +lblRedTrophyPercent = "Çíłćýííĺ Ňđŕôĺ˙˘(%):" +lblRedNukePercent = "Çíłćýíí˙ Nuke(%):" +btnSearchMode = "Đýćűě ďîřóęó" +btnSearchModeTip = "Íĺ ŕňŕęóĺ.Řóęŕĺ áŕçó, ˙ęŕ˙ ŕäęŕçâŕĺ óěîâŕě." +pageAttack = "Ěĺňŕä ŕňŕęł" +DeadDeploySettings = "Íŕëŕäŕ Ěĺđňâűő áŕç" +AnyDeploySettings = "Íŕëŕäű Ëţáűő áŕç" +cmbDeployMethods = "Íŕďŕä ç ŕäíŕăî áîęó|Íŕďŕä ç äâóő áŕęî˘|Íŕďŕä ç ňđîő áŕęî˘|Íŕďŕä ç óńłő áŕęî˘ ŕäíîëüęŕâŕ|Çě˙řŕíű đýćűě" +cmbDeployCollectors = "|Íŕďŕäó íŕ ęŕëĺęňŕđű - âűďóńęŕöü óńĺ âîéńęł|Íŕďŕäó íŕ ęŕëĺęňŕđű - ŕáěĺćŕâŕííł âîéńęŕ˘" +cmbDeployDefault = "Íŕďŕä ç óńłő áŕęî˘ ŕäíîëüęŕâŕ" +cmbAlgorithms = "Ëó÷íłöű|Âŕđâŕđű|Ăîáëłíű|Âŕđâŕđű + Ëó÷íłöű|Âŕđâŕđű + Ëó÷íłöű + Ăîáëłíű + Ăłăŕíňű|Âŕđâŕđű + Ëó÷íłöű + Ăłăŕíňű|Âŕđâŕđű + Ëó÷íłöű + Ăîáëłíű|Âŕđâŕđű + Ëó÷íłöű + Ăîáëłíű + Ăłăŕíňű + Ńňĺíîáîč|Âűęŕđűńňî˘âŕöü Ęŕçŕđěű|Âűęŕđűńňî˘âŕöü óńĺ âîéńęł" +cmbAlgorithmsDefault = "Âűęŕđűńňî˘âŕöü óńĺ âîéńęł" +chkUseKing = "Ŕňŕęŕ Ęŕđŕëĺě" +chkUseQueen = "Ŕňŕęŕ Ęŕđŕëĺâŕé" +chkUseClanCastle = "Ŕňŕęŕ âîéńęŕěł ç Ęëŕíŕ" +cmbAttackTH = "Íĺ ŕňŕęŕâŕöü IX|Ŕáěĺćŕâŕíóţ íŕďŕä íŕ IX|Ďî˘íŕĺ íŕďŕä íŕ ŇŐ" +HeroAct = "Ŕęňűâŕöű˙ Çäîëüíŕńö˙˘ Ăĺđî˙" +lblKingSkill = "Ńęłë Ęŕđŕë˙:" +lblKingSkillTip = "Óńňŕëţéöĺ çŕňđűěęó ÷ŕńó äë˙ ńöűëŕé ęŕđŕë˙" +lblQueenSkill = "Ńęłë Ęŕđŕëĺâű:" +lblQueenSkillTip = "Óńňŕëţéöĺ çŕňđűěęó ÷ŕńó äë˙ ńöűëŕé ęŕđŕëĺâű" +pageTroops = "Âîéńęł" +Barracks = "Âîéńęł" +lblBarbarians = "Âŕđâŕđű :" +lblArchers = "Ëó÷íłöű :" +lblGoblins = "Ăîáëłíű :" +lblRaidcap = "Íŕďŕäŕöü ďđű :" +cmbTroopComp = "Ëó÷íłöű|Âŕđâŕđű|Ăîáëłíű|B. Arch|B. A. G. G.|B. A. Giant|B. A. Goblin|B. A. G. G. Wall|Âűęŕđűńňî˘âŕöü ęŕçŕđěű|Ńâŕĺ âîéńęł" +cmbTroopCompDefault = "Âűęŕđűńňî˘âŕöü Ęŕçŕđěű" +OtherTroops = "˛ířű˙ Âîéńęł" +numberOf = "Ęîëüęŕńöü" +BarrackGroup = "Ęŕçŕđěű" +cmbTrainingOnly = " (ňîëüęł Ňđýíłđî˘ęŕ)" +BarrackCTGroup = "Ńâŕĺ âîéńęł 2 / Íĺ ďđŕöóĺ" +lblBarrackBK1 = "Đýřňó" +DarkBarracks = "Öĺěíű˙ Ęŕçŕđěű" +pageSpells = "Çŕăŕâîđű" +lblFactory = "Ôŕáđűęŕ Çŕăŕâîđŕ˘" +chkMakeSpells = "Ŕęňűâŕöű˙" +lblSpellCreate = "Çđŕáłöü:" +cmbSpellCreateTip = "Âűáĺđűöĺ Çŕăŕâîđ ˙ęîĺ ďŕňđŕáóĺööŕ çđŕáłöü" +cmbSpellCreate = "Ěŕëŕíęł|Âűë˙÷ýííł|Ëţňŕńüöł|Ńęŕ÷ęó|Çŕěŕđŕçęł" +cmbSpellCreateDefault = "Ěŕëŕíęł" +lblDEZap = "Ďóńęŕöü Ěŕëŕíęó" +lblDENukeLimit = "Ďóńęŕöü ěŕëŕíęó ęŕëł ĺńöü:" +chkNukeOnly = "Ďóńę ěŕëŕíęł ł ŕäđŕçó ńęîí÷űöü" +chkNukeOnlyTip = "Ęŕëł çŕăŕâîđ ôŕáđűęŕ ďî˘íŕ˙, áóäçĺ ëŕăĺđ, ęŕá óäŕđűöü ł ˘ö˙÷ű DE çŕőî˘âŕíí˙" +chkNukeOnlyWithFullArmy = "Ďîřóę áŕçű ňîëüęł ęŕëł ôŕáđűęŕ ďî˘íŕ˙" +chkNukeAttacking = "Ďóńęŕöü ěŕëŕíęó ďŕńë˙ ŕňŕęł" +chkNukeAttackingTip = "Áóäçĺ ďóńęŕöü ěŕëŕíęł íŕ ńâŕćčíó ÷îđíŕăŕ ýëłęńłđŕ ďŕä÷ŕń íŕďŕäó, ęŕëł ˘ âŕń ĺńöü áîëüř, ÷űě ęîëüęŕńöü çŕăŕâîđࢠíłćýé" +lblSpellNumber = "Ęîë-öü âűęŕđűńňŕíí˙ ěŕëŕíŕę:" +lblDEAccuracy = "Äŕęëŕäíŕńöü íŕí˙ńĺíí˙ DE" +rdoMaybeSkip = "Ěŕă÷űěŕ ďđŕďóńęŕĺ" +rdoMaybeSkipTip = "Ěĺíř íŕäçĺéíű ďîřóę, ŕëĺ íĺ í˙ďđŕâłëüíŕ âűçíŕ÷ŕíŕ řňî-ňî łířŕĺ, ˙ę DE çŕőî˘âŕíí˙" +rdoFalsePositive = "Ěŕă÷űěŕ ďđŕěŕőâŕĺööŕ" +rdoFalsePositiveTip = "Ĺí çáłđŕĺööŕ çíŕéńöł áëłí äý çŕőî˘âŕíí˙, íŕâŕň ęŕëł ăýňŕ ŕçíŕ÷ŕĺ, řňî đűőňŕâŕööŕ řňî-ňî łířŕĺ íŕ ŕâŕđűł" +frmBugReport = "Áŕă-đĺďîđň łíôŕ" +lblInstructions = "Âű ěîćŕöĺ âűęŕđűńňî˘âŕöü íŕńňóďíű˙ äŕäçĺíű˙ äë˙ ŕäďđŕ˘ęł ďűňŕíí˙ íŕ ôîđóě. Ęŕëł ëŕńęŕ, ďđŕâĺđöĺ, ęŕá ďĺđŕęŕíŕööŕ, řňî Âű íĺ đîáłöĺ íîâóţ ňýěó ďŕ ňűě ćŕ ďűňŕííł, őîöü. ×űě ëĺďř ŕďłńŕííĺ ďđŕáëĺěű, ňűě ë˙ă÷ýé ˙ĺ âűďđŕâłöü. Ęŕëł âŕřŕ ďđŕáëĺěŕ çâ˙çŕíŕ˙ ç ÷űňŕííĺě ç ýęđŕíŕ, ňî, ęŕëł ëŕńęŕ, óđó÷íóţ çíŕéńöł äçĺ áîň ˘çíłęŕţöü ďŕěűëęł, âűęŕđűńňî˘âŕéöĺ Ctrl+ALT+řčôň+p, ęŕá çđŕáłöü ńęđűířîň (çŕőî˘âŕĺööŕ ˘ ęŕňŕëîăó ŕäëŕäęł) ł ďîńň, řňî íŕ ôîđóěĺ (ďĺđŕęŕíŕéöĺń˙, řňî âű áëŕęŕâŕöü ŕńŕáłńňóţ łíôŕđěŕöűţ). Âŕř ŕďîříł ÷ŕńîďłń łíôŕđěŕöű˙ ł íŕëŕäű ďđűâĺäçĺíű íłćýé, ęŕëł âŕě ňđýáŕ ńęŕďł˙âŕöü ł ˘ńňŕâłöü ăýňóţ łíôŕđěŕöűţ ˘ âűďóńę." +lblLog = "Ŕďîříł˙ 100 đŕäęî˘ ëîăŕ:" +lblSettings = "Ďŕđŕěĺňđű:" +btnGitHub = "Ôîđóě Ďŕäňđűěęł" +btnCloseBR = "Çŕ÷űíłöü" +heroSkill = "0 = ˇęëţ÷űöü ďđű íłçęłő ÍĐ" +heroSkill2 = ">0 = ˇęëţ÷űöü ďŕńë˙ ęîëüęŕńöł ńĺęóíä" +lblDisconnected = "Ŕäęëţ÷ýíí˙˘ :" +chkSpeedBoost = "Őóňęł đýćűě" +chkSpeedBoostTip = "Âűęŕđűńňî˘âŕĺ áîëüř đýńóđńࢠďđŕöýńŕđŕ, ŕëĺ çíîéäçĺöĺ áóäűíęŕ őóň÷ýé" +msgMissing = "Ŕäńóňíł÷ŕĺ ŕáŕâ˙çęîâű ôŕéë!" +msgMissing1 = "Âŕřŕé ńłńňýěĺ ŕäńóňíł÷ŕĺ íĺŕáőîäíű ôŕéë (MSVCP120.DLL) äë˙ âű˙˘ëĺíí˙ đĺäëŕéí." +msgMissing2 = "Ěîćíŕ ďđŕö˙ăíóöü, ŕëĺ đîáŕň íĺ áóäçĺ ďđŕöŕâŕöü, ˙ę çŕäóěŕíŕ." +msgMissing3 = "Íŕöłńíłöĺ ęíîďęó ÎĘ, ęŕá çŕęđűöü áîňŕ ł íŕęłđî˘âŕööŕ íŕ ńŕéöĺ Microsoft, ęŕá çŕăđóçłöü ŕäďŕâĺäíű ôŕéë." +msgMissing4 = "Ďĺđŕęŕíŕéöĺń˙, řňî âű çŕăđóçłëł 32-áłňíóţ âĺđńłţ, íĺçŕëĺćíŕ ŕä ňŕăî, řňî âŕř ęŕěďóňŕđ 32 ŕáî 64 áłň." +msgMissing5 = "Ęŕëł ďđŕäŕńňŕ˘ë˙ĺööŕ ěŕă÷űěŕńöü, âűáđŕöü ôŕéë: vcredist_x86.exe" +msgMissing6 = "Íŕöłńíłöĺ ęíîďęó Ŕäěĺíŕ, ęŕá ďđŕö˙ăíóöü âűęŕđűńňŕííĺ áîňŕ áĺç ăýňŕé ôóíęöűł." +msgRestartNeeded = "Ŕáđŕíű ěîâó ˘ńňóďłöü ó ńłëó ďŕńë˙ ďĺđŕçŕăđóçęł áîňŕ." +msgExit = "Âűőŕä !!!" +msgFailedVersion = "Íĺ ˘äŕëîń˙ ďđŕâĺđűöü ŕáíî˘ëĺíóţ âĺđńłţ." +msgVersionOnline = "Âĺđńł˙ ďđŕăđŕěű íŕ ńŕéöĺ: " +msgUpdateNeeded = "Ďŕňđŕáóĺööŕ ŕáíŕ˘ëĺííĺ." +msgAheadMaster = "Âű, çäŕĺööŕ, ęŕá áűöü íŕďĺđŕäçĺ ěŕéńňŕđ." +msgRunningBeta = "Âű çŕďóńöłëł áýňŕ-âĺđńłţ ďđŕăđŕěű. Äŕäçĺíŕ˙ âĺđńł˙ ďđŕăđŕěű ňîëüęł äë˙ áýňŕ-ňýńňŕđŕ˘." +msgNoUpdateNeeded = "Ŕáíŕ˘ëĺííĺ íĺ ďŕňđŕáóĺööŕ." +msgFailedZoomout = "Íĺ ŕňđűěŕëŕń˙ ŕňđűěŕöü äîńňóď äŕ íŕëĺćíűě ÷űíŕě ďŕěĺířŕíŕ˙ ăŕëî˘íŕăŕ ýęđŕíŕ!!!" +msgWaitMinute = "Ňđýáŕ ďŕ÷ŕęŕöü 1 őâłëłíó, ęŕá ďŕ˘ňŕđűöü ńďđîáó." +msgNoDataFound = "Äŕäçĺíű˙ íĺ çíîéäçĺíű: " +msgNoDefaults = ", ŕôŕđěëĺííĺ ďŕ çěŕ˘÷ŕííł." +msgBattleFinished = "Áłňâŕ Ńęîí÷ŕíŕ." +msgNoResource = "Íł˙ęŕé đýńóđń íĺ çíîéäçĺíű, íŕçŕä ďđŕç " +msgSeconds = "ńĺęóíä" +msgNoIncome = "Äŕőîä íĺ âű˙˘ëĺíŕ, íŕçŕä ďđŕç " +msgLootChange = "Âű˙˘ë˙ĺööŕ ëóň, ó ÷ŕęŕííł..." +msgReturnHome = "Íŕçŕä Äŕäîěó" +msgTakingLootSS = "Đîáłööŕ ńęđűířîň ëóňŕé" +msgCannotReturn = "Íĺ ěŕăó â˙đíóööŕ äŕäîěó." +msgUpgrading = "Ŕáíŕ˘ëĺííĺ..." +msgNoUpgradeButton = "Íĺ ěŕăó çíŕéńöł ęíîďęó ŕáíŕâłöü, ďđŕďóńöłöü ŕáíŕ˘ëĺíí˙..." +msgNoDEStorage = "Íĺ çíîéäçĺíŕ ńőîâłř÷ŕ öĺěíŕăŕ ýëłęńłđŕ!" +msgWallFound = "Çíŕéřëł ńöĺíű ˘çđîâĺíü " +msgWallNotFound = "Íĺ ěŕăó çíŕéńöł ńöĺíű ˘çđîâĺíü " +msgWallSkipUpgrade = ", Ďđŕďóńöłöü ŕáíŕ˘ëĺííĺ..." +msgWallAt = "ó" +msgWallAdjustTol = ", đýăóë˙âŕöü äîďóńę ł ďŕńďđŕáŕâŕöü çíî˘..." +msgImageSearchNotWork = "Ďŕěűëęŕ: ďîřóę ěŕëţíęࢠíĺ ďđŕöóĺ...(ęŕëł ëŕńęŕ, Ďđŕâĺđöĺ öýëŕńíŕńöü ęîđĺíîé ďŕďęł)" +msgMSTry = "Ńďđŕáóţ çíŕéńöł Ăŕëî˘íű Ýęđŕí" +msgMSLocated = "Ăŕëî˘íű Ýęđŕí çíîéäçĺíű!" +msgMSFailed = "Ďŕěűëęŕ ˘ ďŕě˙ířýííł ěŕřňŕáó" +msgAnotherDev = "ßř÷ý ŕäíî ďđűëŕäŕ ďŕäëó÷ŕíŕĺ, ďŕäęëţ÷űöĺ ˘ " +msgAnotherDevMinutes = " őâłëłí " +msgTakeBreak = "Âĺńęŕ ďŕâłííŕ ŕäďŕ÷űöü, ďŕ÷ŕęŕéöĺ..." +msgWaitMS = "Ó ÷ŕęŕííł ăŕëî˘íŕăŕ ýęđŕíŕ" +msgUnableLoad = "Íĺ ˘äŕĺööŕ çŕăđóçłöü Clash Of Clans, íŕíîâŕ..." +msgZoomingOut = "Ďŕě˙ířýííĺ Ěŕřňŕáó" +msgPBHelpSent = "Âŕř çŕďűň áű˘ ŕňđűěŕíű. Äŕďŕěîăŕ áűëŕ ŕäďđŕ˘ëĺíŕ" +msgPBBotPauseFuture = "Âŕř çŕďűň áű˘ ŕňđűěŕíű. Áîň áóäçĺ ďŕ˘çŕ íŕ ăŕëî˘íűě ýęđŕíĺ" +msgPBNoAction = "Âŕř áîň ďđűďűíĺíű, íł˙ęłő ěĺđ ďđűí˙ňŕ íĺ áűëî" +msgPBResumed = "Âŕř çŕďűň áű˘ ŕňđűěŕíű. Áîň ö˙ďĺđ ŕäíŕ˘ë˙ĺööŕ" +msgPBRunning ="Âŕř áîň âűęîíâŕĺööŕ ˘ äŕäçĺíű ěîěŕíň, íł˙ęłő äçĺ˙íí˙˘ ďđŕäďđűí˙ňŕ íĺ áűëî" +msgPBStats = "Âŕř çŕďűň áű˘ ŕňđűěŕíű. Ńňŕňűńňű÷íű˙ äŕäçĺíű˙ ŕäďđŕâłëŕ" +msgPBLog = "Âŕř çŕďűň áű˘ ŕňđűěŕíű. ×ŕńîďłń ö˙ďĺđ ŕäďđŕ˘ë˙ĺööŕ" +msgPBErrorUpload = "Ĺńöü ďŕěűëęŕ ł ôŕéë íĺ áű˘ çŕăđóćŕíű" +msgPBErrorUploading = "Ďŕěűëęŕ çŕăđóçęł ôŕéëŕ." +msgPBPasteForum = "Âű ěîćŕöĺ ˘ńňŕâłöü ăýňŕ ˘ ôîđóě, ęŕá ěű ěŕăëł ďđŕâĺđűöü, öł ç'˙˘ë˙ĺööŕ ăýňŕ PushBullet ďđŕáëĺěŕ ŕáî ďđŕăđŕěű" +msgAttackingGoblin = "Ŕňŕęóţ÷ű Ăîáëłíŕ" +msgVictory = "Ďĺđŕěîăŕ!" +msgPleaseRestart = "ęŕëł Ëŕńęŕ, ďĺđŕçŕăđóçłöĺ ęŕěďóňŕđ, ęŕá çěĺíű ˘ńňóďłëł ˘ ńłëó." +msgWelcome="~~~~ Ńŕđäý÷íŕ çŕďđŕřŕĺě" +msgRunningOn = " ďđŕöóĺ íŕ " +msgStarting = "Áîň çŕďóńęŕĺööŕ..." +msgNotInGame = "Íĺ ˘ăóëüíł!" +msgStartingBS = "Ńňŕđň BlueStacks" +msgWaitingBS = "Çëó÷ýíüíĺ ç BlueStacks..." +msgBSLoaded = "BlueStacks Çŕăđóćŕíű. " +msgBSLoadSecs = " ńĺęóíä, ęŕá ďŕ÷ŕöü." +msgDirNotFound = "đýć íĺ çíîéäçĺíŕ - " +msgFailDel = "Ďŕäçĺííĺ " +msgBadCall = "Äđýííŕ˙ ńóâ˙çü, íĺâ˙äîěŕ, äçĺ ˘ öýíňđű íŕďŕäó" +msgAnalyzingBase = "Ŕíŕëłç áŕçű..." +msgDone = "Çđîáëĺíŕ!" +msgRestartBarracks = "Ďĺđŕçŕďóńę BlueStack, ęŕá âűďđŕâłöü ďŕěűëęó âű˙˘ëĺíí˙ ęŕçŕđěŕ˘!" +msgLocationX = "Location - X:" +msgWanted = "Ďŕňđŕáóţööŕ:" +msgGot = "Ŕňđűěŕ˘:" +msgVariance = "Äűńďĺđńł˙:" +msgNoNextButton = "Íĺ ˘äŕĺööŕ çíŕéńöł ęíîďęó Äŕëëĺ, ďĺđŕçŕăđóçęŕáîňŕ" +msgMidAttack = "Ďđŕâĺđęŕ đýńóđńࢠ˘íóňđű áŕçű:" +msgSearchingMatch = "˛äçĺ ďîřóę áîţ..." +msgOOSAlreadySlow = "Đŕńńčíőđîíčçŕöč˙! Óćî řóęŕĺöĺ ďŕâîëüíŕ, íĺ çě˙í˙ţ÷ű íł÷îăŕ." +msgOOSSlowingSearch = "Đŕńńčíőđîíčçŕöč˙! Çŕďŕâîëĺííĺ őóňęŕńöł ďîřóęó íŕ 0.5 ńĺę." +msgLCAlreadySlow = "Çíłęŕĺ Ńóâ˙çü! Óćî řóęŕĺöĺ ďŕâîëüíŕ, íĺ çě˙í˙ţ÷ű íł÷îăŕ." +msgLCSlowingSearch = "Çíłęŕĺ Ńóâ˙çü! Çŕďŕâîëĺííĺ őóňęŕńöł ďîřóęó íŕ 0.5 ńĺę." +msgDropping = "Âűńŕäęŕ " +msgWaveOf = " őâŕë˙ " +msgNuking = "~Ďóńę ěŕëŕíęł ˘ ńőîâłř÷ŕ öĺěíŕăŕ ýëłęńłđŕ" +msgAttackingTH = "~Ŕňŕęŕ Đŕňóřű..." +msgSnipeMode = "~Ńíŕéďĺđńęŕ˙ Ńňđŕëüáŕ Đŕňóřű..." +msgSingleSide = "~Ŕňŕęŕ ç ŕäíŕăî áîęó..." +msgTwoSides = "Ŕňŕęŕ ç äâóő áŕęî˘..." +msgThreeSides = "~Ŕňŕęŕ ç 3 áŕęî˘..." +msgAllSides = "~Ŕňŕęŕ ç óńłő áŕęî˘..." +msgMixedMode = "~Çě˙řŕíű đýćűě ŕňŕęł..." +msgCollectorMode = "~Ŕňŕęŕ íŕ ęîëĺęňîđű..." +msgCollectorSave = "~Çŕőî˘âŕţ âîéńęł, ęŕëł ăýňŕ ěŕă÷űěŕ..." +msgLimitedTH = "~Ŕáěĺćŕâŕíŕ˙ ŕňŕęŕ đŕňóřű..." +msgDropLeftover = "~Ńęłä ňű˙, řňî çŕńňŕëłń˙ âîéńęł" +msgActivateKing = "Ŕęňűâŕöű˙ ěŕéńňýđńňâŕ ęŕđŕë˙" +msgActivateQueen = "Ŕęňűâŕöű˙ ěŕéńňýđńňâŕ ęŕđŕëĺâű" +msgFinishedWait = "~Ŕňŕęŕ çŕâĺđřŕíŕ. ×ŕęŕéöĺ ęŕá ńęîí÷ű˘ń˙ áîé." +msgNoSpell = "Çŕăŕâîđű íĺäŕńňóďíű˙!" +msgDroppingCC = "Âűńŕäęŕ Ęëŕíŕâŕăŕ Çŕěęŕ" +msgDroppingKing = "Âűńŕäęŕ ęŕđŕë˙" +msgDroppingQueen = "Âűńŕäęŕ ęŕđŕëĺâű" +msgFindColl = "Âűçíŕ÷ýííĺ ęîëüęŕńöü ęŕëĺęňŕđŕ˘..." +msgFindPos = "Âűçíŕ÷ýííĺ ěĺńöŕçíŕőîäćŕíí˙ ęŕëĺęňŕđࢠçŕ ďëîňŕě..." +msgFindColFailed = "~Íĺ ˘äŕëîń˙ çíŕéńöł çŕ ďëîňŕě ęŕëĺęňŕđű, â˙đňŕţ÷űń˙ äŕ 4 áŕęŕő..." +msgFoundCol = "Çíîéäçĺíŕ ęŕëĺęňŕđű: " +msgRemainCol = "Ęŕëĺęňŕđű çŕ ďëîňŕě: " +msgRemoveCol = "Ęŕëĺęňŕđű ˘íóňđű ďëîňŕ - " +msgColDE = "Ńâłäđŕâłíŕ ×îđíŕăŕ Ýëĺęńčđŕ(îâ)" +msgColElix = "Ýëĺęńčđ Ęŕëĺęňŕđ(ű)" +msgColGM = "Çŕëŕňŕ˙ řŕőňŕ(ű)" +msgAdjustingB = "Ŕ˘ňŕěŕňű÷íŕ đýăóëţţ÷ű âîéńęࢠ: B-" +msgAdjustingA = "%, A-" +msgAdjustingG = "%, G-" +msgCheckingRem = "Ďđŕâĺđęŕ çŕńňŕëłń˙ âîéńęŕ˘" +msgPreparingAtt = "Ďŕäđűőňî˘ęŕ äŕ íŕďŕäó" +msgIgnoring = "--˛ăíŕđŕâŕííĺ " +msgCheckingCamp = "Ďđŕâĺđęŕ Âŕĺííŕăŕ Ëŕăĺđŕ..." +msgCampNA = "Âŕĺííű ëŕăĺđ íĺäŕńňóďíű" +msgTotalCampCap = "Ŕăóëüíŕ˙ Ĺěłńňŕńöü Âîéńęŕ˘: " +msgDontKnow = "Íĺ âĺäŕţ, ˙ę íŕâó÷ŕöü âîéńęł " +msgYet = "yet" +msgTrainingTroops = "Íŕâó÷ŕííĺ Âîéńęŕ˘..." +msgForcesNeededB = Ńłëű ďŕňđýáíű˙: B- +msgForcesNeededA = ", A-" +msgForcesNeededGo = ", Go-" +msgForcesNeededGi = ", Gi-" +msgForcesNeededWB = ", W-" +msgBarrack = "Ęŕçŕđěŕ " +msgNotAvailable = " íĺ çíîéäçĺíŕ˙" +msgTraining = " Ňđýíłđî˘ęŕ " +msgRemaining = " Ďŕęłíóňű : " +msgTotalBuilding = "Ŕăóëüíŕé ęîëüęŕńöł âîéńęŕ˘, áóäűíŕę : " +msgRestartComplete = "Ďĺđŕçŕăđóçęŕ Çŕâĺđřŕíŕ ..." +msgTrainingComp = "Íŕâó÷ŕííĺ ÂîéńęࢠÇŕâĺđřŕíŕ!" +msgTrainingDark = "Íŕâó÷ŕíí˙ Öĺěíűő Âîéńęŕ˘..." +msgDarkBarrack = "Öĺěíŕ˙ Ęŕçŕđěŕ " +msgDarkTroopComplete = "Íŕâó÷ŕíí˙ Öĺěíűő ÂîéńęࢠÇŕâĺđřŕíŕ!" +msgSFUnavailable = "Âŕřŕ Ôŕáđűęŕ çŕăŕâîđࢠíĺäŕńňóďíŕ˙" +msgMakingSpell = "Đîá˙ööŕ çŕăŕâîđű: " +msgUnableCreate = "Íĺěŕă÷űěŕ ńňâŕđűöü çŕăŕâîđű" +msgKAUnavailable = "Ŕëüňŕđü Ęŕđŕë˙ íĺ çíîéäçĺíű!" +msgQAUnavailable = "Ŕëňŕđ Ęŕđŕëĺâű íĺ çíîéäçĺíű!" +msgKingAvail = "Ęŕđîëü äŕńňóďíű:" +msgQueenAvail = "Ęŕđŕëĺâŕ äŕńňóďíŕ˙:" +msgSearchCond = "Óěîâű Ďîřóęó:" +msgWillSaveAll = "Áóäçĺ çŕőŕâŕţöü óńĺ âĺńęł ďđű ďîřóęó" +msgSnipeFound="~~~~~~~ Ńíŕéďĺđńęŕ˙ Áŕçŕ Çíîéäçĺíŕ!~~~~~~~ +msgOutDeadFound="~~~~~~~ Çíîéäçĺíŕ đŕňóřŕ çâîíęó ˘ ěĺđňâŕé áŕçĺ!~~~~~~~" +msgOutLiveFound="~~~~~~~ Çíîéäçĺíŕ đŕňóřŕ çâîíęó ˘ ćűâîé áŕçĺ!~~~~~~~" +msgDeadFound="~~~~~~~ Ěĺđňâŕ˙ áŕçŕ çíîéäçĺíŕ!~~~~~~~" +msgOtherFound="~~~~~~~ Ćűâŕ˙ áŕçŕ çíîéäçĺíŕ!~~~~~~~" +msgZapFound="~~~~~~~ Áŕçŕ äë˙ ęđŕäç˙ćó ÷îđíŕăŕ ýëłęńłđŕ çíîéäçĺíŕ!~~~~~~~" +msgAttackNowClicked="~~~~~~~ Ŕňŕęŕâŕöü Çŕđŕç!~~~~~~~" +msgNoNextReturn = "Íĺ ˘äŕĺööŕ çíŕéńöł ęíîďęó Äŕëëĺ, ďŕńďđŕáŕâŕöü â˙đíóööŕ äŕäîěó..." +msgNoNextRestart = "Íĺ ˘äŕĺööŕ çíŕéńöł ęíîďęó Äŕëëĺ & ęŕďłňóë˙öűł ęíîďęŕ ďĺđŕçŕďóńęó áîňŕ" +msgPushMatch = "Push: Ńóďŕäçĺíí˙˘ Íĺ Çíîéäçĺíŕ" +msgSearchComplete= "===============Ďîřóę âűęŕíŕíű===============" +msgBoostingBarrack = "Ďŕńęŕđýííĺ Ęŕçŕđěű " +msgBoostingDark = "Ďŕńęŕđýííĺ ×îđíűő Ęŕçŕđěࢠ" +msgBoostingKing = "Ë˙÷ýíí˙ Ęŕđŕë˙..." +msgBoostingQueen = "Ë˙÷ýíí˙ Ęŕđŕëĺâű..." +msgBoostingSpell = "Ďŕńęŕđýííĺ Ôŕáđűęł Çŕăŕâîđŕ˘..." +msgBoostRem = "Ďŕńęîđűöü ďŕęłíóňűő : " +msgNotEnoughGem = "Íĺ őŕďŕĺ ăĺěîâ..." +msgBoostComplete = "Ďŕńęŕđýííĺ Âűęŕíŕíŕ..." +msgAlreadyBooster = "Áóäűíŕę óćî Ďŕńęîđŕíŕ" +msgSpellsAlready = "Ôŕáđűęŕ Çŕăŕâîđࢠ˘ćî Ďŕńęîđŕíŕ" +msgBoostingBarracks = "Ďŕńęŕđýííĺ Ęŕçŕđěŕ˘" +msgBoostCompRem = "Ďŕńęŕđýííĺ Çŕâĺđřŕíŕ. Çŕńňŕëîń˙ :" +msgBarracksAlready = "Ęŕçŕđěŕ ˘ćî ďŕńęîđŕíŕ" +msgHaltExp = "Ńďűíłöü ŕňŕęó, ŕęňűâŕâŕöü đýćűě âîďűň..." +msgHaltDonate = "Ńďűíłöü ŕňŕęó, çŕńňŕâŕööŕ ŕíëŕéí ł äîíŕň..." +msgForceShutdown = "Ďđűěóńîâŕĺ çŕâ˙đřýííĺ ďđŕöű ĎĘ..." +msgSleep = "Ďĺđŕőîä ó Ńď˙÷ű đýćűě ĎĘ..." +msgCheckGold = "Ďđŕâĺđęŕ Ęîřň Ŕäíŕăî Ďîřóęó." +msgFailedTH = "Íĺ ŕňđűěŕëŕń˙ çíŕéńöł Đŕňóřó!" +msgTHLevel = "Óçđîâĺíü Đŕňóřű " +msgGoldCPS = ", Ńňîéěîńňü Ďîřóęó: " +msgCheckingSF = "Ďđŕâĺđęŕ Ôŕáđűęł Çŕăŕâîđŕ˘..." +msgSpellFull = "Ôŕáđűęŕ Çŕăŕâîđŕ˘-Ďî˘íŕ˙" +msgCollecting = "Çáîđ đýńóđńŕ˘" +msgDonatingTroops = "Äîíŕň Âîéńęŕ˘..." +msgChatText = "Ňýęńň ×ŕňŕ: " +msgBlacklisted = "Ó ÷îđíűě ńďłńĺ!" +msgUnableToRead = "Íĺ ŕňđűěî˘âŕĺööŕ ďđŕ÷űňŕöü ňýęńň" +msgDonateRules = "ŕőâ˙đŕâŕöü ďđŕâłëű." +msgUnableToDetermine = "Íĺ ˘ ńňŕíĺ âűçíŕ÷űöü ˙ę çđŕáłöü ŕőâ˙đŕâŕííĺ " +msgFinishedDonating = "Äîíŕň Çŕâĺđřŕíű " +msgKicked = " Ęłę!" +msgScrollingDown = "Ďđŕęđóňęŕ ˘íłç" +msgFinishedKicking = "Ńęîí÷ŕíű ęłę" +msgNoDonateButton = "Íĺ ěŕăó çíŕéńöł ęíîďęó äë˙ ŕőâ˙đŕâŕííł" +msgDonating = "Äîíŕň " +msgNo = "Í˙ěŕ " +msgAvailable = " Äŕńňóďíű Äîíŕň." +msgReadingChat = "Ďŕ÷űíŕţ ÷űňŕöü ëîă ÷ŕňŕ" +msgTrophyCount = "Ęîëüęŕńöü Ňđŕôĺ˙˘: " +msgDropTrophies = "Ńęłä Ňđŕôĺ˙˘" +msgDropComplete = "Ńęłä Ňđŕôĺ˙˘ Çŕâĺđřŕíű!" +msgElixirFull = "Ńőîâłř÷ŕ ×îđíŕăŕ Ýëłęńłđŕ Ďĺđŕďî˘íĺíŕ!" +msgElixirFull = "Ńőîâłř÷ŕ Ýëłęńłđŕ Ďĺđŕďî˘íĺíŕ!" +msgGoldFull = "Ńőîâłř÷ŕ Çîëŕňŕ Ďĺđŕďî˘íĺíŕ!" +msgFailedZoomOut = "Ďŕěűëęŕ ďŕě˙ířýíí˙ ěŕřňŕáó" +msgLocatingBarracks = "Ďîřóę Ęŕçŕđěŕ˘..." +msgLocatingComplete = "-Ďîřóę Çŕâĺđřŕíű-" +msgLocBarrack = "-Ęŕçŕđěŕ" +msgLocatingDarkBar = "Ďîřóę Öĺěíűő Ęŕçŕđěŕ˘..." +msgLocDarkBar = "-Öĺěíŕ˙ Ęŕçŕđěŕ" +msgLocArmyCamp = "-Âŕĺííű Ëŕăĺđ +msgLocCC = "-Ęëŕíŕâű çŕěŕę" +msgLocTH = "-Đŕňóřŕ" +msgLocKing = "-Ŕëüňŕđü Ęŕđŕë˙" +msgLocQueen = "-Ŕëňŕđ Ęŕđŕëĺâű" +msgLocBuilding = "-Áóäűíŕę" +msgLocSpellFact = "-Ôŕáđűęŕ Çŕăŕâîđŕ˘" +msgLocLab = "-Ďîřóę Ëŕáŕđŕňîđűł" +msgBeginAttack="====== Ďŕ÷ŕňŕę Ŕňŕęł======" +msgWaitingFull = "~~~×ŕęŕíí˙ ŕđěłł~~~" +msgHeroNotReady = "~~~Ăĺđîł íĺ ăŕňîâű˙~~~" +msgWarningKingUG = "!!!Ďŕď˙đýäćŕíüíĺ!!! Ďŕë˙ďřýííĺ Ęŕđŕë˙ ďđŕö˙ăâŕĺööŕ!" +msgWarningQueenUG = "!!!Ďŕď˙đýäćŕíüíĺ!!! Ďŕë˙ďřýííĺ Ęŕđŕëĺâű ďđŕö˙ăâŕĺööŕ!" +msgTimeIdle = "×ŕń ×ŕęŕíí˙: " +msgTimeIdleHours = " ăŕäçłí " +msgTimeIdleMin = " őâłëłí " +msgTimeIdleSec = "ńĺęóíä" +msgCheckRearm = "Ďđŕâĺđęŕ Ďĺđŕ˘çáđŕĺíí˙ Ďŕńňŕę.." +msgRearmedTraps = "Ďĺđŕçŕđŕäęŕ Ďŕńňŕę" +msgRearmedXBow = "Ďĺđŕçŕđŕäęŕ Ŕđáŕëĺňŕ˘" +msgRearmedInferno = "Ďĺđŕçŕđŕäęŕ ˛íôĺđíŕ" +msgRequesting = "Çŕďűňâŕííł âîéńęł äë˙ Ęëŕíŕâŕăŕ Çŕěęŕ" +msgRequestAlready = "Çŕďűň ˘ćî çđîáëĺíű" +msgCCNotAvail = "Ęëŕíŕâű Çŕěŕę íĺ çíîéäçĺíű" +msgUpgLocNotSet = "Áóäűíŕę ěĺńöŕçíŕőîäćŕííĺ íĺ ˘ńňŕíî˘ëĺíŕ, ďđîďóńę ďŕë˙ďřýíí˙..." +msgNoBuilders = "Í˙ěŕ ńâŕáîäíűő áóäŕ˘íłęî˘" +msgAttemptUpgr = "Ńďđîáŕ ďŕë˙ďřýíí˙ áóäűíęŕ" +msgBuilding = "Áóäűíŕę" +msgUpgradeSuccess = "Ďŕńď˙őîâŕ ďŕëĺďřŕíŕ.." +msgUnchecking = "Íĺ ďđŕâĺđŕíŕ" +msgNotEnoughElix = "Íĺ äŕńňŕňęîâŕ ýëłęńłđŕ, ęŕá çŕâ˙đřűöü ŕáíŕ˘ëĺííĺ, ďŕńďđŕáóé ŕáíŕâłöü ç äŕďŕěîăŕé çîëŕňŕ..." +msgGoldLower = "Çîëŕňŕ ěĺíř, ÷űě Ěłíłěŕëüíŕ˙ çŕëŕňű ęŕěďëĺęň äë˙ ěŕäýđíłçŕöűł, ďđŕďóńöłöü ŕáíŕ˘ëĺííĺ..." +msgNotEnoughGold = "Íĺ äŕńňŕňęîâŕ çîëŕňŕ, ęŕá ŕáíŕâłöü, ďđŕďóńöłöü ŕáíŕ˘ëĺííĺ..." +msgCheckWalls = "Ďđŕâĺđęŕ Ŕáíŕ˘ëĺíí˙ Ńöĺíű..." +msgWallUpGold = "Ŕáíŕ˘ëĺííĺ ńöĺí ç âűęŕđűńňŕííĺě çîëŕňŕ" +msgGoldBelowMin = "Çîëŕňŕ çíŕőîäçłööŕ íłćýé ěłíłěŕëüíŕăŕ çíŕ÷ýíí˙, ďđîďóńę ŕáíŕ˘ëĺíí˙" +msgWallUpElix = "Ŕáíŕ˘ëĺííĺ ńöĺí ç äŕďŕěîăŕé Ýëłęńłđŕ" +msgElixBelowMin = "Ýëłęńłđ íłćýé ěłíłěŕëüíŕăŕ çíŕ÷ýíí˙, ďđîďóńę ŕáíŕ˘ëĺíí˙" +msgWallLowerLvl = "Ńöĺíű íŕ ˘çđî˘íł íłćýé çŕ 8, ďđŕďóńęŕţ÷ű ŕáíŕ˘ëĺíí˙ ç ýëłęńłđŕě" +msgWallElixorLvl = "Íĺ äŕńňŕňęîâŕ ýëłęńłđ ŕáî ńöĺíű íłćýé óđîâí˙8 " +msgWallNoGoldElixir = "Ŕáíŕ˘ëĺííĺ ç çîëŕňŕě íĺ ˘äŕëîń˙, ńďđîáŕ ŕáíŕâłöü ç äŕďŕěîăŕé ýëłęńłđŕ" +msgWallLowGoldElixir = "Çîëŕňŕ ěĺíř, ÷űě ěłíłěŕëüíű˙ íŕëŕäű, ńďđîáŕ ŕáíŕâłöü ńöĺíű ç äŕďŕěîăŕé ýëłęńłđŕ" +msgWallUpDone = "Ďŕë˙ďřýíí˙ Çđîáëĺíŕ !!!" +msgWallNotEnoughGold = "Íĺäŕńňŕňęîâŕ Çîëŕňŕ..." +msgLabLevelTroop = "Óçđîâĺíü Âîéńęࢠ" +msgLabLevelMax = " Ěŕęń. óćî ˘ Âŕřŕé Ëŕáŕđŕňîđűł, Ďđŕďóńöłöü Ŕáíŕ˘ëĺííĺ..." +msgLabSkipped = "Ŕáíŕ˘ëĺííĺ Ëŕáŕđŕňîđíŕé Îďöű˙ Ŕäęëţ÷ŕíŕ˙, Ďđîďóńę Ěŕäýđíłçŕöűł" +msgLabLocNotSet = "Áóäűíŕę Ěĺńöŕçíŕőîäćŕííĺ íĺ ˇńňŕíî˘ëĺíŕ, Ďđîďóńę Ďŕë˙ďřýíí˙..." +msgLabSearching = "Ďîřóę Âîéńęࢠ" +msgLabTroopSearch = "Âîéńęł" +msgLabTroopFound = " ďŕë˙ďřýíí˙..." +msgLabWaiting = "Ŕáíŕ˘ëĺíüíĺ ˘ ďđŕöýńĺ, ÷ŕęŕéöĺ ďŕë˙ďřýíí˙ âîéńęࢠ" +msgLabAfter = "ďŕńë˙ çŕâ˙đřýíí˙ łířűő âîéńęࢠěŕäýđíłçŕâŕíű" +msgLabLowElix = "Íĺ äŕńňŕňęîâŕ ýëłęńłđŕ, ęŕá ďŕëĺďřűöü âîéńęł " +msgLabLowDE = "Íĺ äŕńňŕňęîâŕ ×îđíŕăŕ Ýëłęńłđ äë˙ ďŕë˙ďřýíí˙ âîéńęࢠ" +msgLabUpgrade = "Ďŕë˙ďřýíí˙ âîéńęŕ˘" +msgLabDone = " ó âŕřŕé ëŕáŕđŕňîđűł áűëî çđîáëĺíŕ..." +msgVillageRep = "˛íôŕđěŕöű˙ ŕá Âĺńöű" +msgNumFreeBuild = "Ęîëüęŕńöü ńâŕáîäíűő Áóäŕ˘íłęî˘: " +msgPushFreeBuild = "Push: ńâŕáîäíűő Áóäŕ˘íłę" +msgOpeningBuilder = "Ŕäęđű˘řű ńňŕđîíęó Ďîńňđîčňĺë˙ ÷űňŕöü đýńóđńű.." +msgResources = "Đýńóđńű:" +msgPushVillageRep = "Push: ˛íôŕđěŕöű˙ ŕá Âĺńöű" +msgLastRaidGain = "Ŕďîříł Đýéä Ńŕáđŕíŕ:" +msgLastRaidLoot = "Ŕďîříł Đýéä Ëóň:" +msgHourlyAvg = "Çěĺíŕ Ńđĺäíűő Ďŕăŕäçłííűő Đĺńîđńîâ:" +msgPushLastRaid = "Push: äŕęëŕä ďîńëĺäíîé ŕňŕęł" +msgStopped = "BrokenBot ńďűíł˘ń˙" +msgDonateTrainMode = "~~~Ňîëüęł Äîíŕň / Ňđýíłđŕâŕöü Ŕęňűâŕâŕíŕ~~~" +msgPBDisabled = "PushBullet ŕäęëţ÷ŕíű !!!" +msgDonateMode = "~~~Ňîëüęł Äîíŕň Ŕęňűâŕâŕíŕ~~~" +msgGoblinMode = "~~~Đýćűě âîďűňó (ăîáëłí) Ŕęňűâŕâŕíű~~~" +msgSaved = "Çŕőŕâŕíŕ: " +msgGoldInitial = "G" +msgElixirInitial = "E" +msgDarkElixInitial = "D" +msgTrophyInitial = "T" +msgGemInitial = "GEM" +msgTHInitial = "TH" +msgDeadInitial = "Ěĺđňâŕ˙" +msgDeadBase = "Ěĺđňâŕ˙ Áŕçŕ" +msgDownloading = "Çŕďŕěďî˘ęŕ Ŕáíŕ˘ëĺíí˙..." +msgUnzipping = "Ďŕńď˙őîâŕ! Đŕńďŕęŕâŕííĺ..." +msgInstallandRestart = "Ďŕńď˙őîâŕ! ˇńňŕíî˘ęŕ ł Ďĺđŕçŕďóńę..." +msgAppearsStuck = "Ďŕäîáíŕ íŕ ňîĺ, ěű Çŕňđűěŕëłń˙. Ńęłä ëł÷űëüíłęࢠâîéńęŕ˘." +msgSevereStuck = "Ďŕńňŕ˙ííŕ çŕőđŕńŕţöü. Ďđîńňŕ äçĺéíł÷ŕţ÷ű ňŕę, ˙ę ęŕëł á ó íŕń óń˙ ŕđěł˙ ëŕăĺđ." +msgDLLError = "Dll ďŕěűëęŕ: çäŕđűëŕń˙ íĺřňŕ äđýííŕĺ!" +msgLicense = "BrokenBot.org ďŕěűëęŕ ëłöýíçłł" +msgNoResources = "Íĺ çíŕéřëł đýńóđńࢠäë˙ çáîđó" +msgOverlayNotAllowed = "You don't have background mode checked, so must disable overlay" +msgRoundDoneIncomeWait = "Round done...waiting for income to come to a stop before starting up again" +msgRecheckCollectors = "Ďđŕâĺđęŕ íŕ íŕ˙˘íŕńöü ęŕëĺęňŕđࢠçíî˘" +msgSnipeWaveWait = "Ńíŕéďĺđࢠőâŕë˙ çŕâĺđřŕíŕ. ×ŕęŕííĺ ..." +msgSubmitStats = "Ŕäďđŕ˘ęŕ ńňŕňűńňűęł íŕ BrokenBot.org" +msgSubmitSuccess = "Ŕäďđŕ˘ëĺíŕ!" +msgSubmitFailed = "Ďŕěűëęŕ ŕäďđŕ˘ęł, áóäçĺ ŕäďđŕ˘ëĺíŕ ˘ íŕńňóďíű đŕç..." +msgCollectAttackDone = "Íŕďŕä íŕ ęŕëĺęňŕđű âűęŕíŕíŕ." +msgSnipeAttackDone = "Íŕďŕä íŕ Đŕňóřó âűęŕíŕíŕ." +boxAlreadyRunning = "Áîň óćî Çŕďóř÷ŕíű." +boxCompile1 = "Íĺ çŕďóńęŕöü/ęŕěďłë˙âŕöü ńęđűďň (ő64)! ďŕńďđŕáóéöĺ çŕďóńöłöü/ńęŕěďłë˙âŕöü ńęđűďň (ő86) äë˙ ŕňđűěŕíí˙ ăýňŕăŕ áîňŕ ďđŕöŕâŕöü." +boxCompile2 = "Ęŕëł ăýňŕ ďŕâĺäŕěëĺííĺ ďđŕö˙ăâŕĺ ç'˙˘ë˙ööŕ, ďŕńďđŕáóéöĺ ďĺđŕ˘ńňŕë˙âŕöü ç äŕďŕěîăŕé autoit íîâŕé âĺđńłł." +boxUpdate = "Ďŕňđŕáóĺööŕ ŕáíŕ˘ëĺííĺ!" +boxUpdate2 = "Ĺńüöü íîâŕ˙ âýđńł˙ BrokenBot, äŕńňóďíŕ äë˙ çŕďŕěďî˘ęł." +boxUpdate3 = "Íŕöłńíłöĺ ęíîďęó OK, ł ŕáíŕ˘ëĺíí˙ áóäóöü ŕ˘ňŕěŕňű÷íŕ ˘ńňŕë˙âŕíű˙ ł óćűňű˙." +boxUpdate4 = "" +boxUpdate5 = "Ŕáî íŕöłńíłöĺ ęíîďęó Ŕäěĺíŕ, ęŕá ďđŕďóńöłöü." +boxUpdate6 = "Âîńü řňî âŕě íĺ őŕďŕĺ íŕ:" +boxUpdateError = "Ďŕěűëęŕ çŕăđóçęł ŕáíŕ˘ëĺíí˙!" +boxUpdateExtract = "Ďŕěűëęŕ đŕńďŕęŕâŕíí˙ ŕáíŕ˘ëĺíí˙" +boxRestart = "Ďĺđŕçŕăđóçłöĺ Ęŕěďóňŕđ" +boxRestart2 = "Ďĺđŕçŕăđóçłöĺ ęŕěďóňŕđ, ęŕá çěĺíű ˘ńňóďłëł ˘ ńłëó." +boxRestart3 = "Ęŕëł ˘ âŕřŕăŕ Bluestacks íĺ ďđŕâłëüíű Ďŕěĺđ (860 ő 720), íŕöłńíłöĺ ÎĘ." +boxBarrack1 = "Çíŕéäçłöĺ ďĺđřóţ ęŕçŕđěó" +boxBarrack1b = "Íŕöłńíłöĺ ęíîďęó ďđŕö˙ăíóöü, çŕňűě íŕöłńíłöĺ íŕ âŕřó ďĺđřóţ ęŕçŕđěó. Ŕäěĺíŕ, ęŕëł íĺ äŕńňóďíű." +boxBarrack2 = "Çíŕéäçłöĺ äđóăóţ ęŕçŕđěó" +boxBarrack2b = "Íŕöłńíłöĺ ęíîďęó ďđŕö˙ăíóöü, ŕ çŕňűě íŕ âŕřó äđóăóţ ęŕçŕđěó. Ŕäě˙íłöü, ęŕëł íĺ äŕńňóďíű" +boxBarrack3 = "Çíŕéäçłöĺ ňđýöţţ ęŕçŕđěó" +boxBarrack3b = "Íŕöłńíłöĺ ęíîďęó ďđŕö˙ăíóöü, ŕ çŕňűě íŕ âŕřó ňđýöţţ ęŕçŕđěó. Ŕäě˙íłöü, ęŕëł íĺ äŕńňóďíű." +boxBarrack4 = "Çíŕéäçłöĺ ÷ŕöâĺđňóţ ęŕçŕđěó" +boxBarrack4b = "Íŕöłńíłöĺ ęíîďęó ďđŕö˙ăíóöü, çŕňűě íŕ âŕřó ÷ŕöâĺđňóţ ęŕçŕđěó. Ŕäě˙íłöü, ęŕëł íĺ äŕńňóďíű." +boxDark1 = "Çíŕéäçłöĺ ďĺđřóţ öĺěíóţ ęŕçŕđěó" +boxDark1b = "Íŕöłńíłöĺ ęíîďęó ďđŕö˙ăíóöü, çŕňűě íŕöłńíłöĺ íŕ ńâŕţ ďĺđřóţ öĺěíóţ ęŕçŕđěó. Ŕäě˙íłöü, ęŕëł í˙ěŕ ˘ íŕ˙˘íŕńöł." +boxDark2 = "Çíŕéäçłöĺ äđóăóţ öĺěíóţ ęŕçŕđěó" +boxDark2b = "Íŕöłńíłöĺ ęíîďęó ďđŕö˙ăíóöü, çŕňűě íŕöłńíłöĺ íŕ ńâŕţ äđóăóţ öĺěíóţ ęŕçŕđěó. Ŕäě˙íłöü, ęŕëł í˙ěŕ ˘ íŕ˙˘íŕńöł." +boxCamp = "Çíŕéäçłöĺ Âŕĺííű ëŕăĺđ" +boxCampb = "Íŕöłńíłöĺ OK, çŕňűě íŕöłńíłöĺ íŕ ŕäçłí ç âŕřűő ëŕăĺđŕ˘" +boxCC = "Çíŕéäçłöĺ Ęëŕíŕâű Çŕěŕę" +boxCCb = "Íŕöłńíłöĺ ęíîďęó ÎĘ, çŕňűě íŕöłńíłöĺ ęíîďęó íŕ âŕřűě ęëŕíŕâűě çŕěęó" +boxTH = "Çíŕéäçłöĺ Đŕňóřó" +boxTHb = "Íŕöłńíłöĺ ęíîďęó ÎĘ, çŕňűě íŕöłńíłöĺ íŕ đŕňóřó" +boxKing = "Çíŕéäçłöĺ Ŕëňŕđ Ęŕđŕë˙" +boxKingb = "Íŕöłńíłöĺ ęíîďęó ÎĘ, çŕňűě íŕöłńíłöĺ íŕ ŕëňŕđ Ęŕđŕë˙" +boxQueen = "Çíŕéäçłöĺ Ŕëňŕđ Ęŕđŕëĺâű" +boxQueenb = "Íŕöłńíłöĺ ęíîďęó ÎĘ, çŕňűě íŕöłńíłöĺ íŕ ŕëňŕđ Ęŕđŕëĺâű" +boxUpgrade = "Çíŕéäçłöĺ Áóäűíŕę äë˙ ŕáíŕ˘ëĺíí˙" +boxUpgradeb = "Íŕöłńíłöĺ ęíîďęó ÎĘ, çŕňűě íŕöłńíłöĺ íŕ âŕřŕ áóäűíŕę" +boxFactory = "Çíŕéäçłöĺ Ôŕáđűęó çŕăŕâîđŕ˘" +boxFactoryb = "Íŕöłńíłöĺ ęíîďęó ÎĘ, çŕňűě íŕöłńíłöĺ íŕ âŕřó ôŕáđűęó çŕăŕâîđŕ˘" +boxError = "Ďŕěűëęŕ" +boxErrorb = "ęŕëł Ëŕńęŕ, óâ˙äçłöĺ ďđŕâłëüíŕĺ çíŕ÷ýííĺ" +boxLab = "Çíŕéäçłöĺ Ëŕáŕđŕňîđűţ" +boxLabb = "Íŕöłńíłöĺ ęíîďęó ÎĘ, çŕňűě íŕöłńíłöĺ íŕ ëŕáŕđŕňîđűţ" +boxErrorOpening = "Ďŕěűëęŕ ďđű ŕäęđűööł ôŕéëŕ!" +boxLoadSuccess = "Ęîíôłă çŕăđóćŕíű ďŕńď˙őîâŕ!" +boxSaveFailed = "Ęîíôłă çŕőŕâŕöü íĺ ˘äŕëîń˙!" +boxSaveSuccess = "Ďŕńď˙őîâŕ çŕőŕâŕíŕ á˙ăó÷ŕ˙ ęŕíôłăóđŕöű˙!" +boxInvalidName = "Íĺäŕďóř÷ŕëüíŕĺ ˛ě˙ ôŕéëŕ!" +inpCamp = "Ŕăóëüíŕ˙ Ĺěłńňŕńöü Ëŕăĺđŕ" +inpCampb = "ęŕëł ëŕńęŕ, Óâ˙äçłöĺ Âŕřó ŕăóëüíóţ ĺěłńňŕńöü Âŕĺííŕăŕ Ëŕăĺđŕ" +inpSpell = "Ŕăóëüíŕ˙ Ĺěłńňŕńöü Çŕăŕâîđ" +inpSpellb = "ęŕëł ëŕńęŕ, Óâ˙äçłöĺ Âŕřó ŕăóëüíóţ ĺěłńňŕńöü çŕăŕâîđŕ˘" +inpConfig = "Íîâŕĺ ˛ě˙ Ęîíôłăó" +inpConfigb = "ęŕëł Ëŕńęŕ, óâ˙äçłöĺ íîâŕĺ łě˙ äë˙ âŕřŕé ęŕíôłăóđŕöűł:" +pushHRa = "Ďđîńüáó ŕá Äŕďŕěîçĺ" +pushHRb = "Âű ěîćŕöĺ âűäŕëĺíŕ ęŕíňđŕë˙âŕöü âŕř áîň âűęŕđűńňî˘âŕţ÷ű íŕńňóďíű Ôŕđěŕň ęŕěŕíäű\n\nBot äçĺ is:\n\nPause - pause the bot\nResume - resume the bot\nStats - send bot current statistics\nLogs - send the current log file\nHelp - send this help message\n\nEnter the command in the title of the message" +pushPRa = "Ďđűďűíłöü" +pushPRb = "Âŕř çŕďűň áű˘ ŕňđűěŕíű. Áîň ö˙ďĺđ ďđűďűíĺíŕ˙" +pushPRc = "Âŕř áîň ďđűďűíĺíŕ, íł˙ęłő ěĺđ ďđűí˙ňŕ íĺ áűëî" +pushRRa = "Ŕäíŕâłöü" +pushRRb = "Âŕř çŕďűň áű˘ ŕňđűěŕíű. Áîň ö˙ďĺđ ŕäíŕ˘ë˙ĺööŕ" +pushRRc = "Âŕř áîň âűęîíâŕĺööŕ ˘ äŕäçĺíű ěîěŕíň, íł˙ęłő äçĺ˙íí˙˘ ďđŕäďđűí˙ňŕ íĺ áűëî" +pushStatRa = "Çŕďűň íŕ Ńňŕňűńňűęó" +pushStatRb = "Đýńóđńű äŕ Ńňŕđňó\n-Çîëŕňŕ: " +pushStatRc = "\n-Ýëłęńłđ: " +pushStatRd = "\n-×îđíű Ýëłęńłđ: " +pushStatRe = "\n-Ňđîôĺâ: " +pushStatRf = "\n\ďŇĺęóůčĺ Đýńóđńű \n-Çîëŕňŕ: " +pushStatRg = "\n-Ýëłęńłđ: " +pushStatRh = "\n-×îđíű Ýëłęńłđ: " +pushStatRi = "\n-Ňđŕôĺł: " +pushStatRj = "\n\ďÇäŕíč˙/Ńöĺíű Ŕáíŕâłöü " +pushStatRk = "\n-Ńöĺíű Ŕáíî˘ëĺíŕ: " +pushStatRl = "\n\ďŃóěěŕđíűé Äŕőîä\n-Çîëŕňŕ Ŕňđűěŕíŕ: " +pushStatRm = "\n-Ýëłęńłđŕ ŕňđűěŕíŕ: " +pushStatRn = "\n-×. Ýëłęńłđŕ ŕňđűěŕíŕ: " +pushStatRo = "\n-Ňđŕôĺ˙˘ ŕňđűěŕíŕ: " +pushStatRp = "\n\ďÄđóăŕ˙ Ńňŕňűńňűęŕ\n-Ŕňŕęŕâŕíŕĺ: " +pushStatRq = "\n-Ďđŕďóř÷ŕíŕ: " +pushStatRq1 = "\n-Ŕäęëţ÷ýíí˙˘: " +pushStatRr = "\n-Ęîřň ďîřóęó: " +pushStatRs = "\n-×ŕń ďđŕöű áîňŕ: " +pushDisca = "Ŕäęëţ÷ŕíű" +pushDiscb = "Âŕř áîň áű˘ ŕäęëţ÷ŕíű ďđű ďîřóęó ďđŕöł˘íłęŕ.." +pushMatch = "Áŕçó Çíîéäçĺíŕ!" +pushFB = "Á˙ńďëŕňíű áóäŕ˘íłę" +pushFBb = "Ó âŕń ĺńöü " +pushFBc = "a" +pushFBd = "áóäŕ˘íłę" +pushFBe = "s" +pushFBf = " á˙ńďëŕňíű!" +pushVR = "˛íôŕ ŕá Âĺńöű" +pushCL = "Íîâű˙ Ďŕâĺäŕěëĺííł ˇ ×ŕöĺ" +pushLR = "Ŕňŕęŕ Çŕâĺđřŕíŕ:" +pushLRb = "ŕňđűěŕíŕ: \n[" +pushBS = "Áŕçó Ŕářóęŕëł:" +pushLootA = "Ëóň Äŕńňóďíű:" +pushRestartBlueStack = "Ďĺđŕçŕăđóçęŕ BlueStack" +pushRestartBlueStackMSG = "Bluestack ďđŕöóĺ íĺ íŕëĺćíűě ÷űíŕě, ŕ˘ňŕěŕňű÷íű đýńňŕđň ďđŕăđŕěű!\n" +pushLast5Lines = "Ŕďîříł˙ 5 đŕäęî˘ ëîăŕ:\n" +msgFreeBuilder = "Âŕř ěłíłěŕëüíű ńâŕáîäíű áóäŕ˘íłę(ű) áűëł äŕń˙ăíóňű. Ďđŕďóńöłöü ďŕë˙ďřýíí˙." +msgUpgradeQueen = "Ńďđîáű ŕáíŕ˘ëĺíí˙ Ęŕđŕëĺâű..." +msgNotEnoughDEAQ = "Íĺ äŕńňŕňęîâŕ Öĺěíŕăŕ Ýëłęńłđŕ ęŕá ŕáíŕâłöü Ęŕđŕëĺâó." +msgQueenUpgrading = "Ęŕđŕëĺâŕ ˘ćî ďŕë˙ďřŕĺööŕ." +msgHeroesMaxLvl = "Âŕř ăĺđîé äŕń˙ăíó˘ ěŕęńłěŕëüíŕăŕ ˘çđî˘íţ äŕďóńöłě äë˙ Âŕřŕé Đŕňóřű." +msgQueenUpgraded = "Ęŕđŕëĺâŕ ďŕńď˙őîâŕ ďŕëĺďřŕíŕ..." +msgUpgradeKing = "Ńďđîáű ŕáíŕ˘ëĺíí˙ Ęŕđŕë˙..." +msgNotEnoughDEK = "Íĺ äŕńňŕňęîâŕ Öĺěíŕăŕ Ýëłęńłđŕ äë˙ ŕáíŕ˘ëĺíí˙ Ęŕđŕë˙." +msgKingUpgrading = "Ęŕđîëü ˘ćî ďŕë˙ďřŕĺööŕ." +msgKingUpgraded = "Ęŕđîëü ďŕńď˙őîâŕ ďŕëĺďřŕíű..." +chkUpgradeKing = "Ďŕë˙ďřýíí˙ Ęŕđŕë˙" +chkUpgradeQueen = "Ďŕë˙ďřýíí˙ Ęŕđŕëĺâű" +lblUpgradeHeroes = "Ăĺđîł áóäóöü ďŕë˙ďřýííĺ ęŕëł ˘ âŕń ĺńöü ˙ę ěłíłěóě 2 ńâŕáîäíűő áóäŕ˘íłęî˘." +lblbuilderfree = "Çŕőŕâŕöü Âîëüíŕăŕ Áóäŕ˘íłęŕ:" +lblKeepFreeBuilder = "Çŕőŕâŕöü âîëüíŕăŕ áóäŕ˘íłęŕ äë˙ ŕáíŕ˘ëĺíí˙ ńöĺí ł łířűő áóäűíęŕ˘." \ No newline at end of file diff --git a/BrokenBot.org/languages/Deutsch.ini b/BrokenBot.org/languages/Deutsch.ini new file mode 100755 index 0000000..f45e886 --- /dev/null +++ b/BrokenBot.org/languages/Deutsch.ini @@ -0,0 +1,799 @@ +[general] +troopNameBarbarian = "Barbar" +troopNameArcher = "Bogenschuetze" +troopNameGiant = "Riese" +troopNameGoblin = "Kobold" +troopNameWallBreaker = "Mauer Brecher" +troopNameBalloon = "Ballon" +troopNameWizard = "Magier" +troopNameHealer = "Heiler" +troopNameDragon = "Drache" +troopNamePEKKA = "P.E.K.K.A." +troopNamePlBarbarian = "Barbar" +troopNamePlArcher = "Bogenschuetze" +troopNamePlGiant = "Riese" +troopNamePlGoblin = "Kobold" +troopNamePlWallBreaker = "Mauer Brecher" +troopNamePlBalloon = "Ballon" +troopNamePlWizard = "Magier" +troopNamePlHealer = "Heiler" +troopNamePlDragon = "Drache" +troopNamePlPEKKA = "P.E.K.K.A." +troopDarkMinion = "Lakai" +troopDarkHog = "Schweinereiter" +troopDarkValkyrie = "Valkuere" +troopDarkGolem = "Golem" +troopDarkWitch = "Hexe" +troopDarkLavaHound = "Lavahund" +troopDarkPlMinion = "Lakai" +troopDarkPlHog = "Schweinereiter" +troopDarkPlValkyrie = "Valkuere" +troopDarkPlGolem = "Golem" +troopDarkPlWitch = "Hexe" +troopDarkPlLavaHound = "Lavahund" +spellNameLightning = "Blitzzauber" +spellNameHealing = "Heilungszauber" +spellNameRage = "Wutzauber" +spellNameJump = "Sprungzauber" +spellNameFreeze = "Frostzauber" +spellNamePoison = "Gift" +spellNameEarthquake = "Erdbeben" +spellNameHaste = "Eile" +btnStart = "Start Bot" +btnStartInit = "Startet ..." +btnStop = "Stop Bot" +btnHide = "BS verstecken" +btnAtkNow = "Angriff!" +btnPause = "Pause" +pageGeneral = "Allgemein" +Controls = "Kontroller" +cmbBotPre = "Erfahrung Modus|" +cmbBotCommand = "Angriff stoppen|PC Runterfahren|PC Standby" +cmbBotCommandDefault = "Angriff stoppen" +lblPC = "E :" +cmbBotCondAdd = "G, E Und DE Voll und Max. Pokal|" +cmbBotCond = "G und E Full und Max Pokal|G/E Full und Max Pokal|G oder E Full und Max Pokal|G oder E Full oder Max Pokal|G und E Full|G oder E Full|G Full und Max Pokal|E Full und Max Pokal|G Full oder Max Pokal|E Full oder Max Pokal|Gold Full|Elexir Full|Max Pokal" +cmbBotCondDefault = "G und E Full" +otherSettings = "Andere" +chkNoAttack = "Spenden/Produziere Soldaten" +chkNoAttackTip = "Kein Angriff. Wird Soldaten Produziert und gespendet" +chkDonateOnly = "Spenden Modus" +chkDonateOnlyTip = "Kein Angriff. Wird Soldaten Produziert und gespendet." +expMode = "EXP Modus" +expModeTip = "Angriff Kobold basis" +lblMaxTrophy = "Pokal Auswahl:" +lblSnipeBelow = "Wenn unten:" +pageAttackOptions = "Strategie" +btnSaveStrat = "Speichern" +btnRefresh = "Erneuern" +AtkSpeed = "Soldaten ablege geschwindigkeit" +lblUnitDelay = "Soldaten geschwindigkeit:" +lblWaveDelay = "Wellen geschwindigkeit:" +Randomspeedatk = "Zufällige geschwindigkeit" +lblAttackdelay = "Verzögerungen von Truppen Entfaltungsgeschwindigkeit, 1 (schnell) = wie eine verrückte bot, 10 (langsam) = wie ein langsamer Mensch. Geschwindigkeiten immer randomisiert weniger bot-aussehen." +pageDonateSettings = "Spenden / Anfragen" +Barbarians = "Truppe 1" +chkDonateAll = "Alles Spenden" +chkDonateAllTip = "Spenden ohne zu Überprüfung." +txtDonate = "barbar\r\nspenden" +txtDonateBarbariansTip = "Suchwörter für die Spende Truppe 1" +Archers = "Truppe 2" +txtDonateArchersTip = "Suchwörter für die Spende Truppe 2" +Giants = "Truppe 3" +txtDonateGiantsTip = "Suchwörter für die Spende Truppe 3" +chkDonateGiants = "Spende Truppe 3" +chkDonateGiantsTip = "Überprüfen Sie Stichworte, bevor spenden Truppe 3" +chkDonateArchers = "Spende Truppe 2" +chkDonateArchersTip = "Überprüfen Sie Stichworte, bevor spenden Truppe 2" +chkDonateBarbarians = "Spende Truppe 1" +chkDonateBarbariansTip = "Überprüfen Sie Stichworte, bevor spenden Truppe 1" +chkRequest = "Anfrage :" +txtRequestDefault = "Beliebig" +txtRequestTip = "Anfrage text." +chkBlacklist = "SchwarzeListe" +chkBlacklistTip = "Überprüfen Sie spenden, um zu verhindern, wenn die Anforderung enthält ein Wort in das Feld auf der rechten Seite" +chkBlacklistTip2 = "Wenn alles spenden aktif ist funktioniert es nicht." +gtfo = "GTFO" +gtfoTip = "Kick nach Spende" +pageUpgradeBuilding = "Verbessern" +Upgrade = "Verteidigung verbessern / Lagerung verbessern / Lager verbessern " +chkUpgrade1 = "vebessere 1 :" +lblUPPosX = "X : " +lblUPPosY = "Y : " +btnLocateUp1 = "Finde Gebäude 1" +chkUpgrade2 = "vebessere 2 :" +btnLocateUp2 = "Finde Gebäude 2" +chkUpgrade3 = "vebessere 3 :" +btnLocateUp3 = "Finde Gebäude 3" +Upgrade2 = "Sammler/Kaserne lvl 5 - Max" +chkUpgrade4 = "vebessere 4 :" +btnLocateUp4 = "Bina 4 ü Belirle" +chkUpgrade5 = "vebessere 5 :" +btnLocateUp5 = "Finde Gebäude 5" +chkUpgrade6 = "vebessere 6 :" +btnLocateUp6 = "Finde Gebäude 6" +grpLaboratory = "Labor" +chkLab = "Aktiv" +lblLab = "Welche verbessern :" +cmbNothing = "Nichts" +pagenotificationSetting = "Dienste" +lblpushbullet = "PushBullet" +pushbullettoken1 = "Konto Token :" +lblpushbulletenabled = "aktivieren" +lblpushbulletenabledTip = "Aktiviere pushbullet Benachrichtigung" +lblpushbulletdebug = "Debug" +lblpushbulletdebugTip = "Dies wird Ausführlichkeit auf Protokoll hinzufügen, während das Senden von Dateien via pushbullet" +lblpushbulletremote = "Fernfunktion" +lblpushbulletremoteTip = "Ermöglicht pushbullet Fernfunktion" +lblpushbulletdelete = "Nachricht löschen auf Start" +lblpushbulletdeleteTip = "Ihre Nachrichten auf Start klicken löschen" +lblpushmessage = "Push-Nachrichten als Text" +lblvillagereport = "Stundenbericht" +lblchatlog = "Log senden" +lblmatchfound = "Spieler gefunden" +lbllastraid = "Letzter angriff" +lblfreebuilder = "Kostenlose Erbauer" +lbldisconnect = "Verbindung Unterbrochen" +lblpushbulletloot = "als JPG" +lblpushuser = "Geben Sie hier den Benutzernamen, um benutzerspezifische Informationen und Multi-bot den Griff zu bekommen" +UseJPG = "letzter angriff" +UseJPGTip = "letzte beute bild senden" +UseAttackJPG = "Angriff" +UseAttackJPGTip = "letzte angriff bild senden" +lblpushbullet2 = "Mehr benutzer" +pushbullettoken2 = "Aus der ferne Bot steuern" +pushbullettoken3 = "Geben Sie in den Titel der Nachricht den Befehl:" +pushbullettoken4 = "Bot Wobei ist :" +pushbullettoken5 = "Pause - Bot pausieren" +pushbullettoken6 = "Fortsetzen - Bot fortsetzen" +pushbullettoken7 = "Stats - senden bot aktuelle Statistik" +pushbullettoken8 = "Logs - senden Sie die aktuelle Protokolldatei" +pushbullettoken9 = "Help - diese Hilfemeldung senden" +lblBBStats = "Ihre Beute verlauf auf BrokenBot.org" +lblBBUser = "Benutzername:" +tipBBUser = "Geben Sie Ihren Benutzernamen für die Foren bei BrokenBot.org" +lblBBPassword = "Passwort:" +tipBBPass1 = "Geben Sie Ihren Passwort für die Foren bei BrokenBot.org" +tipBBPass2 = "Diese Daten werden in einer separaten Datei verschlüsselt gespeichert werden" +tipBBPass3 = "und wird nur für die Einreichung der Online-Statistik verwendet" +tipBBPass4 = "~~~WARNUNG~~~" +tipBBPass5 = "Auch wenn dies auf Ihrem PC gespeichert sind verschlüsselt," +tipBBPass6 = "AutoIT ist von Natur aus unsicher. Bitte nutzen Sie eine einzigartige" +tipBBPass7 = "Kennwort für BrokenBot.org" +tipBBValidCheck = "Klicken Sie hier um Ihren Benutzername / Passwort zu bestätigen" +tipBBValidGood = "Ihre Anmeldeinformationen ist gültig!" +tipBBValidBad = "Können Sie Ihren Benutzername / Passwort überprüfen" +chkBBSendData = "Statistiken auf BrokenBot.org hochladen" +tipBBSendData = "Aktivieren dieser Option zeigt Statistiken hochgeladen haben, wieviel Beute für statistiken vorgenommen haben" +lblBBRegister = "Registrieren Sie sich bei BrokenBot.org" +pageMiscSettings = "Sonstiges" +Miscs = "Sonstiges" +lblReconnect = "Wiederverbindung Intervall:" +lblReconnectTip = "Wiederverbindung Intervall, wenn ein anderes Geräte verbunden ist - COC nur englische Version." +lblReconnectmin = "minuten" +lblSpellCap = "Zauber Flaschen kapazität:" +lblCapacity = "Kamp kapazität :" +lblUnknownCap = " Fehler, unbekannt" +chkTrap = "Automatisch fallen aufrüsten" +chkTrapTip = "Auto aufzurüsten für Fallen, Armbrüste & Hölle Türme" +lblSearchsp = "Such geschwindigkeit :" +lblSearchspTip = "Stellen der such Grundgeschwindigkeit, höhere Zahl, wenn mit häufigen Server Sync-Problem" +lblSearchspd = "Tip: 0 = Schnell, 10 = Langsam" +lblReturnh = "Heimkehr Verzögerung:" +lblReturnhTip = "Stellen Verzögerung Zeit für Heimkehr während Überfall" +lblReturndelay = "Sekunden, nachdem kein beute erfasst" +chkWideEdge = "Suchen Sie tiefer innerhalb Rathaus" +chkClearField = "Kläre das Feld Komplett" +chkClearFieldTip = "Versuchen Sie, 5 Büsche und Bäume usw. klären" +msgClearField = "Klären des Feldes ..." +msgNoClearField = "Im Moment gibt es nichts zum klären." +msgClearedField = "Hindernisse geklärt : " +chkAlertSearch = "Base gefunden Alarm" +chkCollect = "sammeln Sie Ressourcen" +chkTakeLootSS = "Nehmen beute Bild" +chkTakeTownSS = "Nimm alle such Bilder" +chkTakeAttackSS = "Nimm Angriff Bild" +chkTakeAttackSSTip = "Schnappschuss von Angriff und alle Bereitstellungen" +chkDebug = "Debug Modus" +chkDebugTip = "Lassen Sie den Debug-Modus, um Daten zu speichern" +LocationSettings = "Finde Gebäude" +btnLocateKingAltar = "King Altar" +btnLocateQueenAltar = "Queen Altar" +btnLocateDarkBarracks = "Dunkle Kaserne" +btnLocateSFactory = "Zauberfabrik." +btnLocateTownHall = "Rathaus" +btnLocateClanCastle = "Clan Burg" +btnLocateCamp = "Armeelager" +btnLab = "Labor" +btnLocateBarracks = "Kaserne" +pageOtherSettings = "Andere" +Walls = "Mauer" +chkWalls = "Auto Wand Upgrade" +UseGold = "nur Gold" +WallMinGold = "Minimum Gold: " +WallMinGoldTip = "Mindestanforderungen für die Gold-Speicher, um die verbesserun durch zu führen" +UseElixir = "nur Elexir" +WallMinElixir = "Minimum Elexir:" +WallMinElixirTip = "Mindestanforderungen für die Elexir-Speicher, um die verbesserun durch zu führen" +UseGoldElix = "Verwenden Gold und dann Elixir" +lblWalls = "Mauer Level:" +lblTolerance = "Tolerans:" +cmbTolerance = "Standard | Niedrigere | Höhere" +cmbToleranceDefault = "Standard" +btnFindWall = "Mauer suchen" +grpRedLine = "Rote Linie Erkennung" +lblRedLine1 = "Möglicherweise in rot" +sldAccTip = "Am möglicherweise rot extreme können Sie mehr Erfahrung kann nicht in rot-Nachrichten bereitstellen." +sldAccTip2 = "Am anderen Ende der Skala wird es am Rand der Basis bereitstellen." +lblRedLine2 = "Rand des Basis" +Boosts = Schub" +lblBoostBarracks = "Schub zeit noch :" +chkBoostKing = "Barbarenkönig" +chkBoostQueen = "Bogenschützen Königin" +chkBoostRax1 = "Kaserne 1" +chkBoostRax2 = "Kaserne 2" +chkBoostRax3 = "Kaserne 3" +chkBoostRax4 = "Kaserne 4" +chkBoostSpell = "Zauberfabrik." +chkBoostDB1 = "Dunkle Kaserne 1" +chkBoostDB2 = "Dunkle Kaserne 2" +pageStatsSetting = "Statistik" +resourceonstart = "Ressourcen beim Start" +lblgoldonstart = "Gold :" +lblelixironstart = "Elexir :" +lbldeonstart = "Dunkle Elexir :" +lbltrophyonstart = "Pokal :" +Currentresource = "Andere statisken" +lblvillagesattacked = "Angegriffen :" +lblvillagesskipped = "Übersprungen :" +lblsearchcost = "Suchen Kosten :" +lblruntime = "Bot Laufzeit :" +LastLoot = "Gebäude / Mauer verbesserung" +lblwallupgrade = "Mauer verbesserung :" +CurrentLoot = "aktuelle Ressourcen" +lblgoldnow = "Gold :" +lblelixirnow = "Elexir :" +lbldenow = "D. Elexir :" +lbltrophynow = "Pokal :" +totalresource = "Gesamtgewinn" +lblgoldgain = "Gold :" +lblelixirgain = "Elexir :" +lbldegain = "D. Elexir :" +lbltrophygain = "Pokal :" +pageConfigLoadSave = "Konfig" +ConfigLoadSave = "Konfig Laden / Speichern" +btnLoad = "Laden" +btnSave = "Speichern" +grpLanguage = "Bot Sprache:" +btnBugRep = "Debug Daten" +grpUpdate = "Auto Update" +chkUpdate = "Überprüfen GitHub Seite für Updates vor Start" +grpBluestacks = "BlueStacks Einstellung" +chkBackground = "Hintergrundmodus" +chkBackgroundTip = "Aktivieren Sie Hintergrundmodus" +chkForceBS = "Immer Aktiv" +chkForceBSTip = "Immer aktivieren Bluestack, wenn nicht in der Lage, ihn zu suchen" +chkStayAlive = "Niemals Schlafen" +chkStayAliveTip = "Verhindere Monitor Schlaf" +statLogDefault = "Status: Leerlauf" +tiAbout = "Über" +tiExit = "Ausgang" +pageSearch = "Such einstellung" +DeadConditions = "Tote Basis bedingungen" +lblDeadConditions = "Suche nach der vollen Sammler Basen und alle gewählten Bedingungen" +chkKingAvail = "Barbarenkönig warten" +chkQueenAvail = Pokal" +chkDeadSnipe = "Schnepfe" +chkDeadSnipeTip = "Wenn aktiviert, wird Außen Rathaus von toten Basis unabhängig von anderen Einstellungen angreifen" +AnyConditions = "Live Basis bedingungen" +chkActivate = "Aktiv" +lblAnyConditions = "Suche für alle Basen und alle gewählten Bedingungen" +chkMeetGE = "min Ressourcen: " +lblMinGold = "Gold:" +cmbAndOr = "und|oder" +cmbAnd = "und" +lblMinElixir = "Elexir:" +chkMeetDE = "Min D.Elexir:" +chkMeetTrophy = "Min Pokal:" +chkMeetTH = "Max RH Level:" +chkMeetTHO = "RH Draußen" +chkMeetTHOTip = "Rathaus muss auf Außenkanten der Basis sein" +chkSnipe = "Pokal" +chkSnipeTip = "Wenn aktiviert, wird Außen Rathaus von Basis unabhängig von anderen Einstellungen angreifen" +RedConditions = "Suchbedingung Reduzierung" +lblRedNumOfSerach = "Rot pro No. Suchbegriffe:" +lblRedGoldPercent = "Gold Reduzierung(%):" +lblRedElixirPercent = "Elexir Reduzierung(%):" +lblRedDEPercent = "Dunkle Elexir Reduzierung(%):" +lblRedTrophyPercent = "Pokal Reduzierung(%):" +lblRedNukePercent = "Nuke Reduzierung(%):" +btnSearchMode = "Such Modus" +btnSearchModeTip = "Nicht anzugreifen. Sucht nach Basis, die Bedingungen erfüllt." +pageAttack = "Angriffsmethode" +DeadDeploySettings = "Tote Basis Einstellungen" +AnyDeploySettings = "Andere Basis Einstellungen" +cmbDeployMethods = "Angriff auf einer einzigen Seite, dringt durch Basis | auf zwei Seiten Angriff, dringt durch Basis | auf drei Seiten Angriff, bekommt äußeren und einige innerhalb der Basis | Angriff auf allen Seiten gleich, erhält die meisten der äußeren Basis | Mixed mode: auf 4 begrenzt Seiten dann auf 1 Seite konzentrieren" +cmbDeployCollectors = "|Angriff Sammler - Bereitstellen aller Truppen | Angriff Sammler - Truppenschoner" +cmbDeployDefault = "Angriff von allen Seiten gleichermaßen, bekommt die meisten äußeren Basis" +cmbAlgorithms = "Bogenschütze | Barbar | Kobold | Barbar + Bogenschütze | Barb + Bogens + Kobold + Riesen | Barb + Bogens + Riesen | Barb. + Bogens. + Kobold | Barb. + Bogens. + Kobold + Riesen + Mauerbrecher | Verwende Kasernen | Verwenden aller Truppen" +cmbAlgorithmsDefault = "Verwenden aller Truppen" +chkUseKing = "Angriff mit Barbarenkönig" +chkUseQueen = "Angriff mit Bogenscützenkönigin" +chkUseClanCastle = "Angriff mit Clan Truppen" +cmbAttackTH = "RH nicht angreifen|Begrenzte RH angriff|RH voll angreifen" +HeroAct = "Held-Aktivierung" +lblKingSkill = "König Geschicklichkeit Aktivierung:" +lblKingSkillTip = "Stellen Verzögerung Zeit für König Geschicklichkeit" +lblQueenSkill = "Königin Geschicklichkeit Aktivierung:" +lblQueenSkillTip = "Stellen Verzögerung Zeit für König Geschicklichkeit" +pageTroops = "Truppe ausbilden" +Barracks = "Truppen" +lblBarbarians = "Barbar :" +lblArchers = "Bogenschütze :" +lblGoblins = "Kobold :" +lblRaidcap = "Truppen kapazität :" +cmbTroopComp = "Bogenschütze|Barbar|Kobold|Barbar,Bogenschütze|B,B,K,R|B,B,R|B,B,K|B,B,K,R,M|Verwende Kaserne|Benutzerdefinierte truppen" +cmbTroopCompDefault = "Verwende Kaserne" +OtherTroops = "Andere Truppen" +numberOf = "Anzahl von" +BarrackGroup = "Kaserne" +cmbTrainingOnly = "nur Ausbilden" +BarrackCTGroup = "Benutzerdefinierte Truppen 2 / nicht Verfügbar" +lblBarrackBK1 = "Rest" +DarkBarracks = "Dunkle Kaserne" +pageSpells = "Zauber" +lblFactory = "Zauberfabrik" +chkMakeSpells = "herstellen" +lblSpellCreate = "diese zauber:" +cmbSpellCreateTip = "Zauber die sie möchten einstellen" +cmbSpellCreate = "Blitz|Heilung|Wut|Sprung|Frost" +cmbSpellCreateDefault = "Blitz" +lblDEZap = "DE Zappen" +lblDENukeLimit = "Zappen mit Zauber, wenn DE größer als:" +chkNukeOnly = "Lassen Sie nur zap Verhalten" +chkNukeOnlyTip = "Wenn Zauber Fabrik voll ist, wird für ein Lager zu suchen und kam auf und führen Sie die DE-Speicher." +chkNukeOnlyWithFullArmy = "Nur Suchbasis für Zappen mit voller Armee" +chkNukeAttacking = "Zap Dunkles Elexir wenn bereits angegriffen" +chkNukeAttackingTip = "Wird DE Speicher zappen während Angriff, wenn Sie mehr als die Anzahl der Zauber unten" +lblSpellNumber = "Anzahl der Zauber benötigt:" +lblDEAccuracy = "Dunkles Elexir Lagerung Genauigkeit" +rdoMaybeSkip = "mögliche skips" +rdoMaybeSkipTip = "Weniger zuverlässig suchen, aber nicht etwas anderes als DE Speicher falsch identifiziert" +rdoFalsePositive = "möglicherweise falsch plaziert" +rdoFalsePositiveTip = "vor sich geht, um eine verdammt DE Lagerung zu finden, auch wenn es bedeutet nuking etwas anderes auf Unfall" +frmBugReport = "Fehlerbericht info" +lblInstructions = "Problem auf dem Forum zu posten. Bitte prüfen, um sicherzustellen, dass Sie nicht einen neuen Thread für das gleiche Problem aber. Je besser die Beschreibung des Problems desto leichter ist es, tatsächlich zu beheben. Wenn Ihr Problem beinhaltet das Lesen am Bildschirm überhaupt, dann bitte manuell zu finden, wo der Bot wird mit einem Fehler, drücken Sie Strg + Alt + Umschalt + P, um einen Screenshot (zu Debug-Verzeichnis gespeichert) zu nehmen und zu schreiben, dass zum Forum sowie (stellen Sie sicher, Sie heraus blockieren Daten). Ihre bisherigen Protokollinformationen und Einstellungen werden unten aufgeführt, wenn Sie kopieren, diese Informationen in das Problem benötigen." +lblLog = "Letzten 100 Protokollzeilen:" +lblSettings = "Einstellung:" +btnGitHub = "Support forum" +btnCloseBR = "schließen" +heroSkill = "0 = Aktivieren Sie bei niedrigen HP" +heroSkill2 = "> 0 = Aktivieren Sie nach der Anzahl der Sekunden" +lblDisconnected = "Verbindung unterbrochen :" +chkSpeedBoost = "Schub" +chkSpeedBoostTip = "Verbraucht mehr CPU, sondern Gebäude schneller zu finden" +msgMissing = "Fehlende erforderliche Datei!" +msgMissing1 = "Ihr System scheint sich eine erforderliche Datei (MSVCP120.DLL) für redline Erkennung zur Arbeit fehlt." +msgMissing2 = "Sie können fortfahren, aber der Bot nicht wie vorgesehen." +msgMissing3 = "Klicken Sie auf OK, um den Bot zu beenden und zu Microsofts Website geleitet, um die entsprechende Datei herunterzuladen." +msgMissing4 = "Stellen Sie sicher, dass Sie die 32-Bit-Version ist 32 oder 64 Bit Ihren Computer herunterladen, unabhängig." +msgMissing5 = "Wenn sie die Option, wählen Sie die Datei: vcredist_x86.exe" +msgMissing6 = "Klicken Sie auf Abbrechen, um weiterhin mit dem Bot ohne diese Funktion." +msgRestartNeeded = "Ihre neu gewählte Sprache wird volle Wirkung nicht, bis Sie neu starten." +msgExit = "Verlassen !!!" +msgFailedVersion = "Fehler beim aktualisierte Version info überprüfen." +msgVersionOnline = "Version des Master-Zweig online: " +msgUpdateNeeded = "Update erforderlich." +msgAheadMaster = "Es scheint, dass ein Kopf der Master sein." +msgRunningBeta = "Sie führen die Beta-Version. Es ist noch nicht veröffentlicht." +msgNoUpdateNeeded = "Keine Aktualisierung erforderlich." +msgFailedZoomout = "Nicht richtig herausgezoomt Hauptbildschirm zugreifen!!!" +msgWaitMinute = "Warten 1 Minute bis Versuch wiederholen." +msgNoDataFound = "Keine Daten gefunden: " +msgNoDefaults = ", mache Standart." +msgBattleFinished = "Angriff fertig." +msgNoResource = "Keine Ressource erkannt, der Rückkehr in : " +msgSeconds = " sekunden" +msgNoIncome = "Nein Einkommen erfasst, der Rückkehr." +msgLootChange = "Loot Änderung erkannt, warten ..." +msgReturnHome = "Wieder zu Hause" +msgTakingLootSS = "Unter Momentaufnahme Ihrer Beute" +msgCannotReturn = "Kann nicht nach Hause zurückkehren." +msgUpgrading = "verbesserung..." +msgNoUpgradeButton = "Können Knopf-Upgrade nicht finden, aktualisieren Weiter ..." +msgNoDEStorage = "Keine dunklen Elixier Speicher wurde gefunden !." +msgWallFound = "gefunden Mauern level " +msgWallNotFound = "Kann Mauern level nicht finden : " +msgWallSkipUpgrade = ", überspringen-Upgrade ..." +msgWallAt = "beim" +msgWallAdjustTol = ", Passen Toleranz und versuchen Sie es erneut ..." +msgImageSearchNotWork = "Fehler: Bildersuche funktioniert nicht " +msgMSTry = "Der Versuch, Hauptbildschirm zu lokalisieren" +msgMSLocated = "Hauptbildschirm gefunden" +msgMSFailed = "Fehler beim verkleinern" +msgAnotherDev = "Ein anderes Gerät angeschlossen, schließen Sie ihn " +msgAnotherDevMinutes = " minuten " +msgTakeBreak = "Dorf muss eine Pause machen, warten Sie bitte ..." +msgWaitMS = "Warten auf Hauptbildschirm" +msgUnableLoad = "Nicht in der Lage Clash Of Clans zu laden, Neustart ..." +msgZoomingOut = "Verkleinern" +msgPBHelpSent = "Ihre Anfrage ist eingegangen. Hilfe wurde gesendet" +msgPBBotPauseFuture = "Ihre Anfrage ist eingegangen. Bot wird am Hauptbildschirm Pausiert" +msgPBNoAction = "Bot ist derzeit angehalten, wurde nichts unternommen" +msgPBResumed = "Ihre Anfrage ist eingegangen. Bot wird jetzt wieder aufgenommen" +msgPBRunning ="Bot derzeit ausgeführt wird, wurde nichts unternommen" +msgPBStats = "Ihre Anfrage ist eingegangen. Statistik geschickt" +msgPBLog = "Ihre Anfrage ist eingegangen. Log ist nun geschickt" +msgPBErrorUpload = "Es ist ein Fehler und Datei wurde nicht hochgeladen" +msgPBErrorUploading = "Fehler aufgetreten Upload-Datei." +msgPBPasteForum = "Sie können dies im Forum einfügen, damit wir prüfen, ob es PushBullet Problem oder Minen" +msgAttackingGoblin = "Angriff Kobold" +msgVictory = "Sieg!" +msgPleaseRestart = "Bitte starten Sie Ihren Computer neu für die aufgebrachten Änderungen wirksam werden." +msgWelcome = "~~~~willkommen zu " +msgRunningOn = " läuft auf: " +msgStarting = "Bot wurde gestartet..." +msgNotInGame = "Ihr seid nicht im spiel!" +msgStartingBS = "BlueStacks wir gestartet" +msgWaitingBS = "BS start steht bevor..." +msgBSLoaded = "BlueStacks wurde gestartet " +msgBSLoadSecs = " sekunden zu beginnen." +msgDirNotFound = "Verzeichnis nicht gefunden - " +msgFailDel = "Nicht zu löschen " +msgBadCall = "Fehlerhafter befehl" +msgAnalyzingBase = "Analysieren Basis..." +msgDone = "fertig!" +msgRestartBarracks = "Ein Neustart Bluestack zu beheben Kaserne ist nicht verfügbar Fehler!" +msgLocationX = "ort- X:" +msgWanted = "gesucht:" +msgGot = "haben:" +msgVariance = "Unterschied:" +msgNoNextButton = "Es kann keine Schaltfläche Weiter, Neustart Bot" +msgMidAttack = "Angriff Ressourcenprüfung:" +msgSearchingMatch = "Auf der Suche nach Spiel ..." +msgOOSAlreadySlow = "Nicht mehr synchronisiert! Bereits auf der Suche langsam, nicht etwas zu ändern.!" +msgOOSSlowingSearch = "Nicht mehr synchronisiert! Verlangsamung Suchgeschwindigkeit um 0,5 Sekunden." +msgLCAlreadySlow = "Verlorene Verbindung! Bereits auf der Suche langsam, nicht etwas zu ändern." +msgLCSlowingSearch = "Verlorene Verbindung! Verlangsamung Suchgeschwindigkeit um 0,5 Sekunden." +msgDropping = "Tropft" +msgWaveOf = " Welle von : " +msgNuking = "~ Zappen die dunkle Elixier Speicher" +msgAttackingTH = "~ Offensiv Rathaus ..." +msgSnipeMode = "~Rathaus wird angegriffen..." +msgSingleSide = "~ Angriff von einer seite ..." +msgTwoSides = "~Angriff von 2 seiten..." +msgThreeSides = "~~Angriff von 3 seiten..." +msgAllSides = "~~Angriff von 4 seiten..." +msgMixedMode = "~~Angriff im mixed modus..." +msgCollectorMode = "~Angriff auf Minen..." +msgCollectorSave = "~Speichern von Truppen, wenn möglich ..." +msgLimitedTH = "~Mit begrenzten Rathaus Angriff ..." +msgDropLeftover = "~Restliche truppen werden abgesetzt" +msgActivateKing = "Barbarenkönig hat volle HP" +msgActivateQueen = "Bogenschützenkönigin hat volle HP" +msgFinishedWait = "~Angrif fertig warte auf beenden" +msgNoSpell = "Zauber nicht vorhanden!" +msgDroppingCC = "Clan truppe wird eingesetzt" +msgDroppingKing = "Barbarenkönig wird eingesetzt" +msgDroppingQueen = "Bogenschützenkönigin wird eingesetzt" +msgFindColl = "Minen werden lokalisiert..." +msgFindPos = "Einsetzt punkte werden lokalisiert..." +msgFindColFailed = "~Draußen sind keine Minen, von allen 4 seiten wird angegriffen..." +msgFoundCol = "Gefundene Minen: " +msgRemainCol = "Draußen gefundene Minen: " +msgRemoveCol = "innen gefundene Minen - " +msgColDE = "Dunkles Elexir Minen" +msgColElix = "Elexir Minen" +msgColGM = "Gold Mine" +msgAdjustingB = "Truppen werden eingestellt : B-" +msgAdjustingA = "%, O-" +msgAdjustingG = "%, G-" +msgCheckingRem = "nicht eingesetzte Truppen werden lokalisiert" +msgPreparingAtt = "Auf angriff vorbereitet" +msgIgnoring = "--ignorieren " +msgCheckingCamp = "Armeelager wird kontroliert..." +msgCampNA = "Armeelager wurde nicht gefunden" +msgTotalCampCap = "Armeelager: " +msgDontKnow = "Truppen Ausbildung vehlerhaft " +msgYet = "noch" +msgTrainingTroops = "Truppen werden ausgebildet..." +msgForcesNeededB = Streitkräfte benötigt: B- +msgForcesNeededA = ", O-" +msgForcesNeededGo = ", Go-" +msgForcesNeededGi = ", Dev-" +msgForcesNeededWB = ", Duv.-" +msgBarrack = "Kaserne: " +msgNotAvailable = " nicht gefunden" +msgTraining = " ausgebildet " +msgRemaining = " Rest : " +msgTotalBuilding = "Truppen Gebäude : " +msgRestartComplete = "Restart Abgeschlossen ..." +msgTrainingComp = "Ausbildung wurde beendet..." +msgTrainingDark = "Dunkles Kaserne Truppen ausgebilden..." +msgDarkBarrack = "Dunkles Kasernev " +msgDarkTroopComplete = "Dunkles Kaserne Truppen sind fertig..." +msgSFUnavailable = "Zauberfabrik nicht gefunden" +msgMakingSpell = "Produziert: " +msgUnableCreate = Zauber wird produziert" +msgKAUnavailable = "Barbarenkönig nicht bereit" +msgQAUnavailable = "Bogenschützenkönigin nicht bereit" +msgKingAvail = "Barbarenkönig verfügbar:" +msgQueenAvail = "Bogenschützenkönigin verfügbar:" +msgSearchCond = "Such kondition:" +msgWillSaveAll = "Werden alle der Städte bei der Suche gespeichern" +msgSnipeFound = "~~~~~~~Basis zu snipe gefunden!~~~~~~~ +msgOutDeadFound = "~~~~~~~Außerhalb Rathuas in toten Basis gefunden!~~~~~~~" +msgOutLiveFound = "~~~~~~~Außerhalb Rathaus in Live Basis Gefunden!~~~~~~~" +msgDeadFound = "~~~~~~~Tote Basis gefunden!~~~~~~~" +msgOtherFound = "~~~~~~~Andere Basis gefunden!~~~~~~~" +msgZapFound = "~~~~~~~Basis zum Zappen gefunden!~~~~~~~" +msgAttackNowClicked = "~~~~~~~Angriff jetzt begonnen!~~~~~~~" +msgNoNextReturn = "Es gibt keine Schaltfläche Weiter, versuchen nach Hause zurückzukehren..." +msgNoNextRestart = "Kann Schaltfläche & Übergabe-Taste nicht finden, Neustarten Bot" +msgPushMatch = "Push: Spiel gefunden" +msgSearchComplete = "===============Suche fertig===============" +msgBoostingBarrack = "Schub Kaserne " +msgBoostingDark = "Schub Dunkle Kaserne " +msgBoostingKing = "Schub Barbarenkönig ..." +msgBoostingQueen = "Schub Bogenschützenkönigin ..." +msgBoostingSpell = "Schub Zauberfabrik ..." +msgBoostRem = "Schub rest : " +msgNotEnoughGem = "Kein Kristall..." +msgBoostComplete = "Schub fertig..." +msgAlreadyBooster = "Gebäude hat schub" +msgSpellsAlready = "Zauberfabrik hat schub" +msgBoostingBarracks = "Kasernen Schub" +msgBoostCompRem = "Schub fertig. Rest :" +msgBarracksAlready = "Kasernen haben Schub" +msgHaltExp = "Kein Angriff, Aktivieren Erfahrung Modus..." +msgHaltDonate = "Kein Angriff. Bleib Online und Spende..." +msgForceShutdown = "PC runterfahren..." +msgSleep = "PC in Standby..." +msgCheckGold = "Gold kosten pro Kampf suche ." +msgFailedTH = "Rathaus nicht gefunden!" +msgTHLevel = "Rathaus Level " +msgGoldCPS = ", Such Kosten: " +msgCheckingSF = "Zauberfabrik wird kontrolliert..." +msgSpellFull = "Zauberfabrik voll" +msgCollecting = "Minen werden gesammelt" +msgDonatingTroops = "Wird gespendet" +msgChatText = "Chat Text: " +msgBlacklisted = "Schwarzeliste!" +msgUnableToRead = "Kann nicht Truppen lesen" +msgDonateRules = "Spenden Regeln" +msgUnableToDetermine = "Kann nicht feststellen, wie Sie spenden " +msgFinishedDonating = "Spenden fertig" +msgKicked = " Kicked!" +msgScrollingDown = "Bildlauf nach unten" +msgFinishedKicking = "Kick fertig" +msgNoDonateButton = "Spenden button konnte nicht finden" +msgDonating = "Spenden: " +msgNo = "Nein" +msgAvailable = " für Spende erhältlich." +msgReadingChat = "Beginnen, Chatlog lesen" +msgTrophyCount = "Pokal Anzahl : " +msgDropTrophies = "Pokal wird abgesetzt" +msgDropComplete = "Pokal abgesetzt" +msgElixirFull = "Dunkles Elixir Speicher voll! +msgElixirFull = "Elexir speicher voll!" +msgGoldFull = "Gold speicher voll!" +msgFailedZoomOut = "Zoom fehler" +msgLocatingBarracks = "Kasernen werden Lokalisiert..." +msgLocatingComplete = "-Lokalisierung fertig-" +msgLocBarrack = "-Kaserne" +msgLocatingDarkBar = "Dunkle Kasernen werden Lokalisiert..." +msgLocDarkBar = "-Dunkle Kaserne" +msgLocArmyCamp = "-Armeelager" +msgLocCC = "-Clan Burg" +msgLocTH = "-Rathaus" +msgLocKing = "-Barbarenkönig" +msgLocQueen = "-Bogenschützenkönigin" +msgLocBuilding = "-Gebäude" +msgLocSpellFact = "-Zauberfabrik" +msgLocLab = "-Labor Lokalisierung" +msgBeginAttack = "======Angrif Startet======" +msgWaitingFull = "~~~Warte auf Armeelager voll~~~" +msgHeroNotReady = "~~~Helden nicht bereit~~~" +msgWarningKingUG = "!!!Warnung!!! Barbarenkönig wird verbessert!" +msgWarningQueenUG = "!!!Warnung!!! Bogenschützenkönigin wird verbessert!" +msgTimeIdle = "Leerlaufzeit: " +msgTimeIdleHours = " stunde " +msgTimeIdleMin = " minute " +msgTimeIdleSec = " sekunden" +msgCheckRearm = "Fallen werden kontrolliert.." +msgRearmedTraps = "Fallen repariert" +msgRearmedXBow = "X-Bogen repariert" +msgRearmedInferno = "Höllentürme repariert" +msgRequesting = "Anfordern Truppen für Clan Burg..." +msgRequestAlready = "Es wurde schon angefordert" +msgCCNotAvail = "Clan Burg nicht gefunden" +msgUpgLocNotSet = "Gebäude wurde Lokalisiert..." +msgNoBuilders = "Bauarbeiter nicht frei" +msgAttemptUpgr = "Gebäude wird versucht zu verbessern" +msgBuilding = "Gebäude" +msgUpgradeSuccess = "Wir verbessert..." +msgUnchecking = "deaktivieren" +msgNotEnoughElix = "Nicht genügend Elexir. Wird mit Gold versucht..." +msgGoldLower = "Aktuelle Gold niedriger als Minimum Gold für die Aktualisierung festgelegt ist, lassen Upgrade..." +msgNotEnoughGold = "Nicht genug Gold, um zu aktualisieren, überspringen Upgrade..." +msgCheckWalls = "Mauer wird verbessert..." +msgWallUpGold = "Wird mit Gold verbessert" +msgGoldBelowMin = "Gold ist niedriger als Minimum-Einstellung, Überspringen Upgrade" +msgWallUpElix = "Upgrade Wände mit Elixir" +msgElixBelowMin = "Elixir ist niedriger als Minimum-Einstellung, Überspringen Upgrade" +msgWallLowerLvl = "Wand level niedriger als 8, das Überspringen Upgrade mit Elixir" +msgWallElixorLvl = "Zu wenig Elixir oder Ihre Wand niedriger als Level 8 " +msgWallNoGoldElixir = "Upgrade mit Gold gescheitert, versuchen Upgrade mit Elixir" +msgWallLowGoldElixir = "Gold ist niedriger als Minimum-Einstellung und versuchen Upgrade Wände mit Elixir" +msgWallUpDone = "Upgrade fertig !!!" +msgWallNotEnoughGold = "Zu wenig Gold..." +msgLabLevelTroop = "Level Truppen" +msgLabLevelMax = " ist bereits in Ihrem Labor max, überspringen Upgrade..." +msgLabSkipped = "Aktualisieren Laboratory Option deaktiviert, Überspringen Upgrade..." +msgLabLocNotSet = "Gebäude Standort nicht festgelegt, Überspringen Upgrade..." +msgLabSearching = "Auf der Suche nach Truppen " +msgLabTroopSearch = "Truppen" +msgLabTroopFound = " gefunden..." +msgLabWaiting = "Upgrade läuft, warten Sie bis Upgrade fertig " +msgLabAfter = " nach Abschluss der anderen Truppen aufgerüstet" +msgLabLowElix = "Zu wenig Elixir, Truppen zu aktualisieren " +msgLabLowDE = "Nicht genug Dunkel Elixir, Truppen zu Upgraden " +msgLabUpgrade = "Upgrade Truppen" +msgLabDone = " in Ihrem Labor durchgeführt..." +msgVillageRep = "Dorf Bericht" +msgNumFreeBuild = "Freier Bauarbeiter: " +msgPushFreeBuild = "Push: Freier Bauarbeiter" +msgOpeningBuilder = "Öffnung Bauarbeiter Seite Ressourcen zu lesen.." +msgResources = "Ressourcen:" +msgPushVillageRep = "Push: Dorf Bericht" +msgLastRaidGain = "Letzter raid Gewinn:" +msgLastRaidLoot = "Letzter Raid Beute:" +msgHourlyAvg = "Durchschnittliche Stunden ändern:" +msgPushLastRaid = "Push: Letzter Raid Bericht" +msgStopped = "BrokenBot hat gestoppt" +msgDonateTrainMode = "~~~Spenden / Ausbildung aktiv~~~" +msgPBDisabled = "PushBullet nicht aktiv !!!" +msgDonateMode = "~~~Spenden modus aktiv~~~" +msgGoblinMode = "~~~Kobold modus aktiv~~~" +msgSaved = "Gespeichert: " +msgGoldInitial = "G" +msgElixirInitial = "E" +msgDarkElixInitial = "Dunkle" +msgTrophyInitial = "Pokal" +msgGemInitial = "Kristall" +msgTHInitial = "RH" +msgDeadInitial = "Tot" +msgDeadBase = "Toter Dorf" +msgDownloading = "Downloading update..." +msgUnzipping = "Successful! Unzipping..." +msgInstallandRestart = "Successful! Installing and restarting..." +msgAppearsStuck = "Wir scheinen geklebt werden. Zurücksetzen Truppen zählt." +msgSevereStuck = "Ständig stecken. Gerade so, als ob wir eine volle Armeelager haben." +msgDLLError = "DLL-Fehler: Etwas Schlimmes passiert!" +msgLicense = "BrokenBot.org Lizenz verletzung erkannt" +msgNoResources = "Keine Ressourcen für die Sammlung gefunden" +msgOverlayNotAllowed = "Sie haben keine Hintergrundmodus überprüft, so muss Overlay deaktivieren" +msgRoundDoneIncomeWait = "Runde gemacht ... warten auf Einkommen, um zum Stehen, bevor Sie wieder kommen" +msgRecheckCollectors = "Prüfen auf Vorhandensein von Sammlern wieder" +msgSnipeWaveWait = "Welle abgeschlossen. warten..." +msgSubmitStats = "Einreichen Statistik bei BrokenBot.org" +msgSubmitSuccess = "Erfolg!" +msgSubmitFailed = "Übermittlung Ausfall wird beim nächsten Mal wieder versucht..." +msgCollectAttackDone = "Kollektor Angriff abgeschlossen." +msgSnipeAttackDone = "Angriff fertig." +boxAlreadyRunning = "Bot läuft." +boxCompile1 = "Laufen nicht / Compile Script (x64)! versuchen, / Compile Script (x86), um immer diese Arbeit bot Run." +boxCompile2 = "Wenn diese Meldung weiterhin angezeigt werden, versuchen, neu installieren AutoIt mit neueren Version." +boxUpdate = "Update erforderlich!" +boxUpdate2 = "Es gibt eine neuere Version von BrokenBot Internetseite." +boxUpdate3 = "Klicken Sie auf OK und aktualisieren Sie werden automatisch installiert und angewendet werden." +boxUpdate4 = "" +boxUpdate5 = "Oder auf Abbrechen, um überspringen." +boxUpdate6 = "Hier ist was Sie verpasst haben:" +boxUpdateError = "Error downloading update!" +boxUpdateExtract = "Error extracting the update" +boxRestart = "PC neustarten" +boxRestart2 = "Starten Sie Ihren Computer neu für die aufgebrachten Änderungen wirksam werden." +boxRestart3 = "Wenn Ihr Bluestacks die richtige Größe (860 x 720), click OK." +boxBarrack1 = "Kaserne 1" +boxBarrack1b = " Für Kaserne 1 Weiter klicken dann Kaserne wählen" +boxBarrack2 = "Kaserne 2" +boxBarrack2b = "Für Kaserne 2 Weiter klicken dann Kaserne wählen" +boxBarrack3 = "Kaserne 3" +boxBarrack3b = "Für Kaserne 3 Weiter klicken dann Kaserne wählen" +boxBarrack4 = "Kaserne 4" +boxBarrack4b = "Für Kaserne 4 Weiter klicken dann Kaserne wählen" +boxDark1 = "Dunkle Kaserne 1" +boxDark1b = "Für Dunkle Kaserne 1 Weiter klicken dann Dunkle Kaserne wählen" +boxDark2 = "Dunkle Kaserne 2" +boxDark2b = "Für Dunkle Kaserne 2 Weiter klicken dann Dunkle Kaserne wählen" +boxCamp = "Armeelager" +boxCampb = "Auf OK dann Armeelager wählen" +boxCC = "Clan Burg" +boxCCb = "Auf OK dann Clan Burg wählen" +boxTH = "Rathaus" +boxTHb = "Auf OK dann Rathaus wählen" +boxKing = "Barbarenkönig" +boxKingb = "Auf OK dann Barbarenkönig wählen" +boxQueen = "Bogenschützenkönigin" +boxQueenb = "Auf OK dann Bogenschützenkönigin wählen" +boxUpgrade = "Gebäude Upgrade" +boxUpgradeb = "Auf OK dann Gebäude wählen den sie Upgraden möchten" +boxFactory = "Zauberfabrik" +boxFactoryb = "Auf OK dann Zauberfabrik wählen" +boxError = "Fehler" +boxErrorb = "Bitte um ein gültigen wert" +boxLab = "Labor" +boxLabb = "Auf OK dann Labor wählen" +boxErrorOpening = "Datei wird geöffnet!" +boxLoadSuccess = "Konfig erfolgreich geladen!" +boxSaveFailed = "Konfig konnte nicht gespeichert werden!" +boxSaveSuccess = "Konfig erfolgreich gespeichert!" +boxInvalidName = "Dateiname falsch!" +inpCamp = "Armeelager Kapazität" +inpCampb = "Geben Sie Ihre Gesamt Truppen Kapazität" +inpSpell = "Zauber Kapazität" +inpSpellb = "Geben Sie Ihre Gesamt Zauber Kapazität" +inpConfig = "Neue Konfig namen" +inpConfigb = "Bitte geben Sie einen neuen Namen für Ihre Konfiguration:" +pushHRa = "Bitte um Hilfe" +pushHRb = "Sie können aus der Ferne zu steuern Ihren Bot mit dem folgenden Befehl Format \ n \ nBot , wo ist: \ n \ nPause - Pause den Bot \ nResume - wieder der Bot \ nStats - senden bot aktuelle Statistik \ nLogs - senden die aktuelle Protokolldatei \ nHilfe - Senden Sie diese Hilfemeldung \ n \ nGeben der Befehl in dem Titel der Nachricht" +pushPRa = "Wunsch auf Pause" +pushPRb = "Ihre Anfrage ist eingegangen. Bot ist nun angehalten" +pushPRc = "Bot ist derzeit angehalten, wurde nichts unternommen" +pushRRa = "Wunsch auf fortsetzen" +pushRRb = "Ihre Anfrage ist eingegangen. Bot wird jetzt wieder aufgenommen" +pushRRc = "Bot derzeit ausgeführt wird, wurde nichts unternommen" +pushStatRa = "Wunsch auf Stats" +pushStatRb = "Resourcen beim Start\n-Gold: " +pushStatRc = "\n-Elixir: " +pushStatRd = "\n-DE: " +pushStatRe = "\n-Pokale: " +pushStatRf = "\n\naktuelle Ressourcen \n-Gold: " +pushStatRg = "\n-Elixir: " +pushStatRh = "\n-DE: " +pushStatRi = "\n-Pokale: " +pushStatRj = "\n\nGebäude/Mauer Upgrade " +pushStatRk = "\n-Mauer Upgrade: " +pushStatRl = "\n\nTotal Gewinn\n-Gold Gain: " +pushStatRm = "\n-Elixir Gewinn: " +pushStatRn = "\n-DE Gewinn: " +pushStatRo = "\n-Pokal Gewinn: " +pushStatRp = "\n\nAndere Stats\n-Angriff: " +pushStatRq = "\n-übersprungenen: " +pushStatRq1 = "\n-Getrennt: " +pushStatRr = "\n-Suchen Kosten: " +pushStatRs = "\n-Bot Laufzeit: " +pushDisca = "Getrennt" +pushDiscb = "Bot habe während der Suche nach feindlichen getrennt.." +pushMatch = "Übereinstimmung gefunden!" +pushFB = "Bauarbeiter" +pushFBb = "Du hast " +pushFBc = "a" +pushFBd = " Bauarbeiter" +pushFBe = "s" +pushFBf = " verfügbar!" +pushVR = "Dorf Bericht" +pushCL = "Neue Chat-Nachrichten" +pushLR = "Letzter Raid Bericht:" +pushLRb = "Gewinn: \n[" +pushBS = "Suche Basis:" +pushLootA = "Beute Verfügbar:" +pushRestartBlueStack = "Neustart BlueStack" +pushRestartBlueStackMSG = "Bluestack scheint nicht richtig funktioniert, auto full starten Sie jetzt!\n" +pushLast5Lines = "Die letzten 5 Zeilen des Protokolls:\n" +msgFreeBuilder = "Ihre Mindest free generator(s) erreicht wurde. Uberspringen upgrades." +msgUpgradeQueen = "Sie Versuchen, ein upgrade Konigin..." +msgNotEnoughDEAQ = "Nicht genug Dunkle Elixier zu Aktualisieren Konigin." +msgQueenUpgrading = "Konigin ist bereits ein Upgrade." +msgHeroesMaxLvl = "Dein held erreicht hat max level zu Ihrem Rathaus." +msgQueenUpgraded = "Konigin erfolgreich aktualisiert wurden,..." +msgUpgradeKing = "Sie Versuchen, ein upgrade Konig..." +msgNotEnoughDEK = "Nicht genug Dunkle Elixier zu Aktualisieren Konig." +msgKingUpgrading = "Konig ist bereits ein Upgrade." +msgKingUpgraded = "Konig erfolgreich aktualisiert wurden,..." +chkUpgradeKing = "Upgrade-Konig" +chkUpgradeQueen = "Upgrade Konigin" +lblUpgradeHeroes = "Helden upgrade, wenn Sie mindestens 2 freie Bauherren." +lblbuilderfree = "Freihalten Builder:" +lblKeepFreeBuilder = "Freihalten Bauherren zu aktualisieren, Wanden und anderen Strukturen." diff --git a/BrokenBot.org/languages/English.ini b/BrokenBot.org/languages/English.ini index 1fa0d0b..8faaa2b 100644 --- a/BrokenBot.org/languages/English.ini +++ b/BrokenBot.org/languages/English.ini @@ -1,774 +1,800 @@ -[general] -troopNameBarbarian = "Barbarian" -troopNameArcher = "Archer" -troopNameGiant = "Giant" -troopNameGoblin = "Goblin" -troopNameWallBreaker = "Wall Breaker" -troopNameBalloon = "Balloon" -troopNameWizard = "Wizard" -troopNameHealer = "Healer" -troopNameDragon = "Dragon" -troopNamePEKKA = "P.E.K.K.A." -troopNamePlBarbarian = "Barbarians" -troopNamePlArcher = "Archers" -troopNamePlGiant = "Giants" -troopNamePlGoblin = "Goblins" -troopNamePlWallBreaker = "Wall Breakers" -troopNamePlBalloon = "Balloons" -troopNamePlWizard = "Wizards" -troopNamePlHealer = "Healers" -troopNamePlDragon = "Dragons" -troopNamePlPEKKA = "P.E.K.K.A.s" -troopDarkMinion = "Minion" -troopDarkHog = "Hog Rider" -troopDarkValkyrie = "Valkyrie" -troopDarkGolem = "Golem" -troopDarkWitch = "Witch" -troopDarkLavaHound = "Lava Hound" -troopDarkPlMinion = "Minions" -troopDarkPlHog = "Hog Riders" -troopDarkPlValkyrie = "Valkyries" -troopDarkPlGolem = "Golems" -troopDarkPlWitch = "Witches" -troopDarkPlLavaHound = "Lava Hounds" -spellNameLightning = "Lightning" -spellNameHealing = "Healing" -spellNameRage = "Rage" -spellNameJump = "Jump" -spellNameFreeze = "Freeze" -btnStart = "Start Bot" -btnStartInit = "Initiating..." -btnStop = "Stop Bot" -btnHide = "Hide BS" -btnAtkNow = "Attack Now" -btnPause = "Pause" -pageGeneral = "General" -Controls = "Controls" -cmbBotCommand = "Halt Attack Mode|Shutdown PC|Sleep PC" -cmbBotCommandDefault = "Halt Attack Mode" -lblPC = "IF :" -cmbBotCond = "G and E Full and Max.Trophy|(G and E) Full or Max.Trophy|(G or E) Full and Max.Trophy|G or E Full or Max.Trophy|Gold and Elixir Full|Gold or Elixir Full|Gold Full and Max.Trophy|Elixir Full and Max.Trophy|Gold Full or Max.Trophy|Elixir Full or Max.Trophy|Gold Full|Elixir Full|Reach Max. Trophy" -cmbBotCondDefault = "Gold and Elixir Full" -otherSettings = "Other Settings" -chkNoAttack = "Donate/Train Only" -chkNoAttackTip = "Disable attacking, only do collections/training/donating" -chkDonateOnly = "Donate Only" -chkDonateOnlyTip = "Disable attacking & training, only do collections/donating" -expMode = "Exp Mode" -expModeTip = "Attack goblin base" -lblMaxTrophy = "Trophy Range:" -lblSnipeBelow = "Snipe if below:" -pageAttackOptions = "Strategies" -btnSaveStrat = "Save current as" -btnRefresh = "Refresh" -AtkSpeed = "Deploy Speed" -lblUnitDelay = "Unit Delay:" -lblWaveDelay = "Wave Delay:" -Randomspeedatk = "Random Speeds" -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." -pageDonateSettings = "Donate/Request" -Barbarians = "Troop 1" -chkDonateAll = "Donate to All" -chkDonateAllTip = "Donate without checking keywords" -txtDonate = "any\r\nreinforcement" -txtDonateBarbariansTip = "Keywords for donating Troop 1" -Archers = "Troop 2" -txtDonateArchersTip = "Keywords for donating Troop 2" -Giants = "Troop 3" -txtDonateGiantsTip = "Keywords for donating Troop 3" -chkDonateGiants = "Donate Troop 3" -chkDonateGiantsTip = "Check keywords before donating Troop 3" -chkDonateArchers = "Donate Troop 2" -chkDonateArchersTip = "Check keywords before donating Troop 2" -chkDonateBarbarians = "Donate Troop 1" -chkDonateBarbariansTip = "Check keywords before donating Troop 1" -chkRequest = "Request for :" -txtRequestDefault = "any" -txtRequestTip = "Request for input." -chkBlacklist = "Blacklist" -chkBlacklistTip = "Check to prevent donating if the request contains a word in the box to the right" -chkBlacklistTip2 = "Will not work if you are using donate to all." -gtfo = "GTFO" -gtfoTip = "Kick after donating" -pageUpgradeBuilding = "Upgrade" -Upgrade = "Upgrade Defenses / Upgrade Storage / Upgrade Camp " -chkUpgrade1 = "Upgrade 1 :" -lblUPPosX = "Pos X : " -lblUPPosY = "Pos Y : " -btnLocateUp1 = "Locate Building 1" -chkUpgrade2 = "Upgrade 2 :" -btnLocateUp2 = "Locate Building 2" -chkUpgrade3 = "Upgrade 3 :" -btnLocateUp3 = "Locate Building 3" -Upgrade2 = "Upgrade Collector/Barrack Lv 5 - Max" -chkUpgrade4 = "Upgrade 4 :" -btnLocateUp4 = "Locate Building 4" -chkUpgrade5 = "Upgrade 5 :" -btnLocateUp5 = "Locate Building 5" -chkUpgrade6 = "Upgrade 6 :" -btnLocateUp6 = "Locate Building 6" -grpLaboratory = "Laboratory" -chkLab = "Enable" -lblLab = "What to upgrade:" -cmbNothing = "Nothing" -pagenotificationSetting = "Services" -lblpushbullet = "PushBullet" -pushbullettoken1 = "Account Token:" -lblpushbulletenabled = "Enable" -lblpushbulletenabledTip = "Enable pushbullet notification" -lblpushbulletdebug = "Debug" -lblpushbulletdebugTip = "This will add verbosity on log while sending files via pushbullet" -lblpushbulletremote = "Remote" -lblpushbulletremoteTip = "Enables pushbullet remote function" -lblpushbulletdelete = "Delete Msg on Start" -lblpushbulletdeleteTip = "Will delete your messages on start button click" -lblpushmessage = "Push Messages As Text" -lblvillagereport = "Hourly Report" -lblchatlog = "Chat Log" -lblmatchfound = "Match Found" -lbllastraid = "Last Raid" -lblfreebuilder = "Free Builder" -lbldisconnect = "Disconnection" -lblpushbulletloot = "As JPG" -lblpushuser = "Enter user name here to get user specific info and multi-bot control" -UseJPG = "Last Raid" -UseJPGTip = "Attach the loot jpg file in push message" -UseAttackJPG = "Attack" -UseAttackJPGTip = "Attach the attack jpg file in push message" -lblpushbullet2 = "PushBullet Multi-user" -pushbullettoken2 = "You can remotely control your bot using the following command format" -pushbullettoken3 = "Enter the command in the title of the message" -pushbullettoken4 = "Bot Where is:" -pushbullettoken5 = "Pause - pause the bot" -pushbullettoken6 = "Resume - resume the bot" -pushbullettoken7 = "Stats - send bot current statistics" -pushbullettoken8 = "Logs - send the current log file" -pushbullettoken9 = "Help - send this help message" -lblBBStats = "See your loot trending on BrokenBot.org" -lblBBUser = "Username:" -tipBBUser = "Enter your username for the forums at BrokenBot.org" -lblBBPassword = "Password:" -tipBBPass1 = "Enter your password for the forums at BrokenBot.org" -tipBBPass2 = "This data will be stored encrypted in a seperate file" -tipBBPass3 = "and is only used for submitting stats online" -tipBBPass4 = "~~~WARNING~~~" -tipBBPass5 = "Even though this is stored encrypted on your PC," -tipBBPass6 = "AutoIT is inherently insecure. Please use a unique" -tipBBPass7 = "password for BrokenBot.org" -tipBBValidCheck = "Click to validate your username/password" -tipBBValidGood = "Your credentials are valid!" -tipBBValidBad = "Unable to verify your username/password" -chkBBSendData = "Upload statistics to BrokenBot.org" -tipBBSendData = "Checking this will upload statistics about how much loot you have made for community statistics" -lblBBRegister = "Register at BrokenBot.org" -pageMiscSettings = "Misc" -Miscs = "Misc" -lblReconnect = "Reconnect Interval:" -lblReconnectTip = "Set reconnect interval when other devices connected - COC English version Only" -lblReconnectmin = "minutes" -lblSpellCap = "Spell factory capacity:" -lblCapacity = "Camp Capacity :" -lblUnknownCap = " Error, unknown" -chkTrap = "Auto Rearm Traps" -chkTrapTip = "Auto rearm for Traps, Crossbows & Inferno Towers" -lblSearchsp = "Search Base Speed:" -lblSearchspTip = "Set search base speed to higher number if having frequent server sync issue" -lblSearchspd = "Tips: 0 = Fast, 10 = Slow" -lblReturnh = "Return Home Delay:" -lblReturnhTip = "Set delay timing for return home during raid" -lblReturndelay = "seconds after no income detected" -chkWideEdge = "Look deeper for inside town hall" -chkClearField = "Clear the Field" -chkClearFieldTip = "Attempt to clear up to 5 bushes and logs etc." -msgClearField = "Clearing the Field..." -msgNoClearField = "Nothing found to clear." -msgClearedField = "Obstacles Cleared: " -chkAlertSearch = "Base Found Alert" -chkCollect = "Collect Resources" -chkTakeLootSS = "Take Loots Image" -chkTakeTownSS = "Take All Towns Image" -chkTakeAttackSS = "Take Attack Image" -chkTakeAttackSSTip = "Snapshot of attack and all deployments" -chkDebug = "Debug Mode" -chkDebugTip = "Allow debug mode to store data" -LocationSettings = "Locate Buildings" -btnLocateKingAltar = "King Altar" -btnLocateQueenAltar = "Queen Altar" -btnLocateDarkBarracks = "D.Barrack" -btnLocateSFactory = "S.Factory" -btnLocateTownHall = "Locate Townhall Manually" -btnLocateClanCastle = "Locate Clan Castle Manually" -btnLocateCamp = "Army Camp" -btnLab = "Laboratory" -btnLocateBarracks = "Locate Barracks Manually" -pageOtherSettings = "Other" -Walls = "Walls" -chkWalls = "Auto Wall Upgrade" -UseGold = "Use Only Gold" -WallMinGold = "Minimum Gold: " -WallMinGoldTip = "Minimum level of Gold storage to perform the upgrade" -UseElixir = "Use Only Elixir" -WallMinElixir = "Minimum Elixir:" -WallMinElixirTip = "Minimum level of Elixir storage to perform the upgrade" -UseGoldElix = "Use Gold and then Elixir" -lblWalls = "Current Wall Level:" -lblTolerance = "Tolerance Level:" -cmbTolerance = "Default|Lower|Higher" -cmbToleranceDefault = "Default" -btnFindWall = "Find Wall" -grpRedLine = "Red line detection" -lblRedLine1 = "Possibly in red" -sldAccTip = "At the possibly red extreme you may experience more cannot deploy in red messages." -sldAccTip2 = "At other extreme it will deploy at edge of base." -lblRedLine2 = "Edge of base" -Boosts = "Boosts" -lblBoostBarracks = "Barracks Boosts left :" -chkBoostKing = "King Altar" -chkBoostQueen = "Queen Altar" -chkBoostRax1 = "Barrack 1" -chkBoostRax2 = "Barrack 2" -chkBoostRax3 = "Barrack 3" -chkBoostRax4 = "Barrack 4" -chkBoostSpell = "Spell Factory" -chkBoostDB1 = "Dark Barrack 1" -chkBoostDB2 = "Dark Barrack 2" -pageStatsSetting = "Stats" -resourceonstart = "Resources at Start" -lblgoldonstart = "Gold at Start :" -lblelixironstart = "Elixir at Start :" -lbldeonstart = "DE at Start :" -lbltrophyonstart = "Trophies at Start :" -Currentresource = "Other Stats" -lblvillagesattacked = "Attacked :" -lblvillagesskipped = "Skipped :" -lblsearchcost = "Search Cost :" -lblruntime = "Bot Run Time :" -LastLoot = "Buildings/Walls Upgrade" -lblwallupgrade = "Wall Upgrade :" -CurrentLoot = "Current Resources" -lblgoldnow = "Gold Now :" -lblelixirnow = "Elixir Now :" -lbldenow = "DE Now :" -lbltrophynow = "Trophies Now :" -totalresource = "Total Gain" -lblgoldgain = "Gold Gain :" -lblelixirgain = "Elixir Gain :" -lbldegain = "DE Gain :" -lbltrophygain = "Trophy Gain :" -pageConfigLoadSave = "Config" -ConfigLoadSave = "Config Load/Save" -btnLoad = "Load" -btnSave = "Save" -grpLanguage = "Language:" -btnBugRep = "Debug Data" -grpUpdate = "Auto Update" -chkUpdate = "Check GitHub site for updates on launch" -grpBluestacks = "BlueStacks" -chkBackground = "Background Mode" -chkBackgroundTip = "Activate Background Mode" -chkForceBS = "Force Active" -chkForceBSTip = "Force activate Bluestack if unable to locate it" -chkStayAlive = "Stay Alive" -chkStayAliveTip = "Prevent monitor sleeping" -statLogDefault = "Status : Idle" -tiAbout = "About" -tiExit = "Exit" -pageSearch = "Search Settings" -DeadConditions = "Dead Base Conditions" -lblDeadConditions = "Search for full collectors bases and ALL selected conditions" -chkKingAvail = "Wait for King" -chkQueenAvail = "Wait for Queen" -chkDeadSnipe = "Snipe" -chkDeadSnipeTip = "If checked, will attack exterior townhall of dead base regardless of other settings" -AnyConditions = "Live Base Conditions" -chkActivate = "Activate" -lblAnyConditions = "Search for any bases and ALL selected conditions" -chkMeetGE = "Min Resources: " -lblMinGold = "Gold:" -cmbAndOr = "And|Or" -cmbAnd = "And" -lblMinElixir = "Elixir:" -chkMeetDE = "Min Dark Elixir:" -chkMeetTrophy = "Min Trophies:" -chkMeetTH = "Max TH Level:" -chkMeetTHO = "TH Outside" -chkMeetTHOTip = "Townhall must be on outer edges of base" -chkSnipe = "Snipe" -chkSnipeTip = "If checked, will attack exterior townhall of 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" -DeadDeploySettings = "Dead Base Deploy Settings" -AnyDeploySettings = "Other Base Deploy Settings" -cmbDeployMethods = "Attack on a single side, penetrates through base|Attack on two sides, penetrates through base|Attack on three sides, gets outer and some inside of base|Attack on all sides equally, gets most of outer base|Mixed mode: limited on 4 sides then focus on 1 side" -cmbDeployCollectors = "|Attack collectors - deploy all troops|Attack collectors - troop saver" -cmbDeployDefault = "Attack on all sides equally, gets most of outer base" -cmbAlgorithms = "Archers|Barbarians|Goblins|Barbarians + Archers|Barb + Arch + Goblin + Giant|Barb + Arch + Giant|Barb + Arch + Goblin|Barb + Arch + Goblin + Giant + Wallbreakers|Use Barracks|Use All Troops" -cmbAlgorithmsDefault = "Use All Troops" -chkUseKing = "Attack with King" -chkUseQueen = "Attack with Queen" -chkUseClanCastle = "Attack with Clan Castle troops" -cmbAttackTH = "Don't attack TH|Limited TH attack|Full TH attack" -HeroAct = "Hero Activation" -lblKingSkill = "King Skill Activation:" -lblKingSkillTip = "Set delay timing for King skill" -lblQueenSkill = "Queen Skill Activation:" -lblQueenSkillTip = "Set delay timing for Queen skill" -pageTroops = "Troop Training" -Barracks = "Troops" -lblBarbarians = "Barbarians :" -lblArchers = "Archers :" -lblGoblins = "Goblins :" -lblRaidcap = "Raid Capacity :" -cmbTroopComp = "Archers|Barbarians|Goblins|B.Arch|B.A.G.G.|B.A.Giant|B.A.Goblin|B.A.G.G.Wall|Use Barracks|Custom Troops" -cmbTroopCompDefault = "Use Barracks" -OtherTroops = "Other Troops" -numberOf = "Number of" -BarrackGroup = "Barracks" -cmbTrainingOnly = " (Training only)" -BarrackCTGroup = "Custom Troop 2 / Not Available" -lblBarrackBK1 = "the rest" -DarkBarracks = "Dark Barracks" -pageSpells = "Spells" -lblFactory = "Spell Factory" -chkMakeSpells = "Make spells" -lblSpellCreate = "Spell to keep full:" -cmbSpellCreateTip = "Set to the spell you want made" -cmbSpellCreate = "Lightning|Healing|Rage|Jump|Freeze" -cmbSpellCreateDefault = "Lightning" -lblDEZap = "DE zapping" -lblDENukeLimit = "Zap with spell if DE greater than:" -chkNukeOnly = "Allow zap only behavior" -chkNukeOnlyTip = "If spell factory is full, will search for a camp to hit and run the DE storage" -chkNukeOnlyWithFullArmy = "Only search base for zapping with full army" -chkNukeAttacking = "Zap DE if already attacking" -chkNukeAttackingTip = "Will zap DE storage during attack if you have more than number of spells below" -lblSpellNumber = "Number of spells needed:" -lblDEAccuracy = "DE Storage Accuracy" -rdoMaybeSkip = "Possible skips" -rdoMaybeSkipTip = "Less reliable search, but won't misidentify something else as DE storage" -rdoFalsePositive = "Possibly mislocated" -rdoFalsePositiveTip = "It's going to find a damn DE storage, even if it means nuking something else on accident" -frmBugReport = "Bug report info" -lblInstructions = "You can use the following data to post an issue on the forum. Please examine to make sure you aren't making a new thread for the same issue though. The better the description of the problem the easier it is to actually fix. If your problem involves reading the screen at all, then please manually find where the bot is having an error, use Ctrl+Alt+Shift+P to take a screenshot (saved to debug directory) and post that to forum as well (make sure you block out identifiable information). Your recent log information and settings are included below if you need to copy and paste this info into the issue." -lblLog = "Last 100 log lines:" -lblSettings = "Settings:" -btnGitHub = "Support forum" -btnCloseBR = "Close" -heroSkill = "0 = Activate at low HP" -heroSkill2 = ">0 = Activate after number of seconds" -lblDisconnected = "Disconnected :" -chkSpeedBoost = "speedBoost" -chkSpeedBoostTip = "Uses more CPU, but will find buildings faster" -msgMissing = "Missing required file!" -msgMissing1 = "Your system appears to be missing a required file (MSVCP120.DLL) for redline detection to work." -msgMissing2 = "You may continue but the bot will not work as intended." -msgMissing3 = "Click OK to exit the bot and be directed to Microsoft's site to download the appropriate file." -msgMissing4 = "Make sure you download the 32 bit version, regardless of your computer being 32 or 64 bit." -msgMissing5 = "When given the option, choose the file: vcredist_x86.exe" -msgMissing6 = "Click Cancel to continue using the bot without this function." -msgRestartNeeded = "Your newly selected language will not take full effect until you restart." -msgExit = "Exiting !!!" -msgFailedVersion = "Failed to check updated version info." -msgVersionOnline = "Version of master branch online: " -msgUpdateNeeded = "Update needed." -msgAheadMaster = "You appear to be ahead of master." -msgRunningBeta = "You are running the beta version. Release not yet published." -msgNoUpdateNeeded = "No update needed." -msgFailedZoomout = "Failed to access properly zoomed out main screen!!!" -msgWaitMinute = "Waiting 1 minute to repeat attempt." -msgNoDataFound = "No data found for: " -msgNoDefaults = ", making defaults." -msgBattleFinished = "Battle Finished." -msgNoResource = "No resource detected, returning in " -msgSeconds = " seconds" -msgNoIncome = "No Income detected, returning." -msgLootChange = "Loot change detected, waiting..." -msgReturnHome = "Returning Home" -msgTakingLootSS = "Taking snapshot of your loot" -msgCannotReturn = "Cannot return home." -msgUpgrading = "Upgrading..." -msgNoUpgradeButton = "Cannot find Button Upgrade, Skip upgrade..." -msgNoDEStorage = "No dark elixir storage was found!" -msgWallFound = "Found Walls level " -msgWallNotFound = "Cannot find Walls level " -msgWallSkipUpgrade = ", Skip upgrade..." -msgWallAt = "at" -msgWallAdjustTol = ", adjust tolerance and try again..." -msgImageSearchNotWork = "Error: Image Search not working..." -msgMSTry = "Trying to locate Main Screen" -msgMSLocated = "Main Screen Located" -msgMSFailed = "Failed to zoom out" -msgAnotherDev = "Another Device has connected, reconnect in " -msgAnotherDevMinutes = " minutes " -msgTakeBreak = "Village must take a break, wait ..." -msgWaitMS = "Waiting for Main Screen" -msgUnableLoad = "Unable to load Clash Of Clans, Restarting..." -msgZoomingOut = "Zooming Out" -msgPBHelpSent = "Your request has been received. Help has been sent" -msgPBBotPauseFuture = "Your request has been received. Bot will pause on main screen" -msgPBNoAction = "Your bot is currently paused, no action was taken" -msgPBResumed = "Your request has been received. Bot is now resumed" -msgPBRunning ="Your bot is currently running, no action was taken" -msgPBStats = "Your request has been received. Statistics sent" -msgPBLog = "Your request has been received. Log is now sent" -msgPBErrorUpload = "There is an error and file was not uploaded" -msgPBErrorUploading = "Error encountered uploading file." -msgPBPasteForum = "You can paste this in the forum so we can check whether it is PushBullet problem or mine" -msgAttackingGoblin = "Attacking goblin" -msgVictory = "Victory!" -msgPleaseRestart = "Please restart your computer for the applied changes to take effect." -msgWelcome = "~~~~Welcome to " -msgRunningOn = " running on " -msgStarting = "Bot is starting..." -msgNotInGame = "Not in Game!" -msgStartingBS = "Starting BlueStacks" -msgWaitingBS = "Waiting for BlueStacks to initiate..." -msgBSLoaded = "BlueStacks Loaded, took " -msgBSLoadSecs = " seconds to begin." -msgDirNotFound = "dir not found - " -msgFailDel = "Fail to del " -msgBadCall = "Bad call, unknown where to center attack" -msgAnalyzingBase = "Analyzing base..." -msgDone = "Done!" -msgRestartBarracks = "Restarting BlueStack to fix Barrack is not available error!" -msgLocationX = "Location- X:" -msgWanted = "Wanted:" -msgGot = "Got:" -msgVariance = "Variance:" -msgNoNextButton = "Cannot locate Next button, Restarting Bot" -msgMidAttack = "Mid-attack resource check:" -msgSearchingMatch = "Searching for match..." -msgOOSAlreadySlow = "Out of sync! Already searching slowly, not changing anything." -msgOOSSlowingSearch = "Out of sync! Slowing search speed by 0.5 secs." -msgLCAlreadySlow = "Lost Connection! Already searching slowly, not changing anything." -msgLCSlowingSearch = "Lost Connection! Slowing search speed by 0.5 secs." -msgDropping = "Dropping " -msgWaveOf = " wave of " -msgNuking = "~Zapping the dark elixir storage" -msgAttackingTH = "~Attacking townhall..." -msgSnipeMode = "~Sniping townhall..." -msgSingleSide = "~Attacking in a single side..." -msgTwoSides = "~Attacking in two sides..." -msgThreeSides = "~Attacking in three sides..." -msgAllSides = "~Attacking in all sides..." -msgMixedMode = "~Mixed mode attacking..." -msgCollectorMode = "~Attacking collectors..." -msgCollectorSave = "~Saving troops if possible..." -msgLimitedTH = "~With limited townhall attack..." -msgDropLeftover = "~Dropping left over troops" -msgActivateKing = "Activate King's power" -msgActivateQueen = "Activate Queen's power" -msgFinishedWait = "~Finished attacking, waiting to finish" -msgNoSpell = "No spell available!" -msgDroppingCC = "Dropping Clan Castle" -msgDroppingKing = "Dropping King" -msgDroppingQueen = "Dropping Queen" -msgFindColl = "Finding location of collectors..." -msgFindPos = "Determining good drop locations..." -msgFindColFailed = "~Unable to find outside collectors, reverting to 4 side attack..." -msgFoundCol = "Found collectors: " -msgRemainCol = "Collectors considered outside: " -msgRemoveCol = "Removing inside collector - " -msgColDE = "Dark elixir drill(s)" -msgColElix = "Elixir collector(s)" -msgColGM = "Gold mine(s)" -msgAdjustingB = "Automatically adjusting troops : B-" -msgAdjustingA = "%, A-" -msgAdjustingG = "%, G-" -msgCheckingRem = "Checking remaining unlaunched troops" -msgPreparingAtt = "Preparing to attack" -msgIgnoring = "--Ignoring " -msgCheckingCamp = "Checking Army Camp..." -msgCampNA = "Your Army Camp is not available" -msgTotalCampCap = "Total Troop Capacity: " -msgDontKnow = "Don't know how to train the troop " -msgYet = " yet" -msgTrainingTroops = "Training Troops..." -msgForcesNeededB = Forces needed: B- -msgForcesNeededA = ", A-" -msgForcesNeededGo = ", Go-" -msgForcesNeededGi = ", Gi-" -msgForcesNeededWB = ", W-" -msgBarrack = "Barrack " -msgNotAvailable = " is not available" -msgTraining = " Training " -msgRemaining = " Remaining : " -msgTotalBuilding = "Total Troops building : " -msgRestartComplete = "Restart Completed ..." -msgTrainingComp = "Training Troops Complete..." -msgTrainingDark = "Training Dark Troops..." -msgDarkBarrack = "Dark Barrack " -msgDarkTroopComplete = "Dark Troop Training Complete..." -msgSFUnavailable = "Your Spell Factory is not available" -msgMakingSpell = "Making spell: " -msgUnableCreate = "Unable to click create spells" -msgKAUnavailable = "King Altar is not available" -msgQAUnavailable = "Queen Altar is not available" -msgKingAvail = "King available:" -msgQueenAvail = "Queen available:" -msgSearchCond = "Search Condition:" -msgWillSaveAll = "Will save all of the towns when searching" -msgSnipeFound = "~~~~~~~Base to Snipe Found!~~~~~~~ -msgOutDeadFound = "~~~~~~~Outside Townhall in Dead Base Found!~~~~~~~" -msgOutLiveFound = "~~~~~~~Outside Townhall in Live Base Found!~~~~~~~" -msgDeadFound = "~~~~~~~Dead Base Found!~~~~~~~" -msgOtherFound = "~~~~~~~Other Base Found!~~~~~~~" -msgZapFound = "~~~~~~~Base to Zap Found!~~~~~~~" -msgAttackNowClicked = "~~~~~~~Attack Now Clicked!~~~~~~~" -msgNoNextReturn = "Cannot locate Next button, try to return home..." -msgNoNextRestart = "Cannot locate Next button & Surrender button, Restarting Bot" -msgPushMatch = "Push: Match Found" -msgSearchComplete = "===============Searching Complete===============" -msgBoostingBarrack = "Boosting Barrack " -msgBoostingDark = "Boosting Dark Barrack " -msgBoostingKing = "Boosting King Altar..." -msgBoostingQueen = "Boosting Queen Altar..." -msgBoostingSpell = "Boosting Spell Factory..." -msgBoostRem = "Boost remaining : " -msgNotEnoughGem = "Not Enough gems..." -msgBoostComplete = "Boost Completed..." -msgAlreadyBooster = "Building is already Boosted" -msgSpellsAlready = "Spells are already Boosted" -msgBoostingBarracks = "Boosting Barracks" -msgBoostCompRem = "Boost completed. Remaining :" -msgBarracksAlready = "Barracks are already Boosted" -msgHaltDonate = "Halt Attack, Stay Online and Donate..." -msgForceShutdown = "Force Shutdown your PC..." -msgSleep = "Sleep your PC..." -msgCheckGold = "Checking Gold Cost Per Search." -msgFailedTH = "Failed to find townhall!" -msgTHLevel = "Townhall Level " -msgGoldCPS = ", Gold Cost Per Search: " -msgCheckingSF = "Checking Spell Factory..." -msgSpellFull = "Spell Factory is full" -msgCollecting = "Collecting Resources" -msgDonatingTroops = "Donating Troops" -msgChatText = "Chat Text: " -msgBlacklisted = "Blacklisted!" -msgUnableToRead = "Unable to read troop" -msgDonateRules = "donate rules." -msgUnableToDetermine = "Unable to determine how to donate " -msgFinishedDonating = "Finished Donating" -msgKicked = " Kicked!" -msgScrollingDown = "Scrolling down" -msgFinishedKicking = "Finished kicking" -msgNoDonateButton = "No donate button exists to click" -msgDonating = "Donating " -msgNo = "No " -msgAvailable = " available for donation." -msgReadingChat = "Starting to read chat log" -msgTrophyCount = "Trophy Count : " -msgDropTrophies = "Dropping Trophies" -msgDropComplete = "Trophy Drop Complete" -msgElixirFull = "Elixir Storages are full!" -msgGoldFull = "Gold Storages are full!" -msgFailedZoomOut = "Failed to zoom out" -msgLocatingBarracks = "Locating Barracks..." -msgLocatingComplete = "-Locating Complete-" -msgLocBarrack = "-Barrack" -msgLocatingDarkBar = "Locating Dark Barracks..." -msgLocDarkBar = "-Dark Barrack" -msgLocArmyCamp = "-ArmyCamp -msgLocCC = "-Clan Castle" -msgLocTH = "-Townhall" -msgLocKing = "-King Altar" -msgLocQueen = "-Queen Altar" -msgLocBuilding = "-Building" -msgLocSpellFact = "-Spell Factory" -msgLocLab = "-Locate Laboratory" -msgBeginAttack = "======Beginning Attack======" -msgWaitingFull = "~~~Waiting for full army~~~" -msgHeroNotReady = "~~~Heroes are not Ready~~~" -msgWarningKingUG = "!!!WARNING!!! King upgrading is in progress!" -msgWarningQueenUG = "!!!WARNING!!! Queen upgrading is in progress!" -msgTimeIdle = "Time Idle: " -msgTimeIdleHours = " hours " -msgTimeIdleMin = " minutes " -msgTimeIdleSec = " seconds" -msgCheckRearm = "Checking if Village needs Rearming.." -msgRearmedTraps = "Rearmed Traps" -msgRearmedXBow = "Reloaded X-Bows" -msgRearmedInferno = "Reloaded Infernos" -msgRequesting = "Requesting for Clan Castle's Troops" -msgRequestAlready = "Request's already been made" -msgCCNotAvail = "Clan Castle not available" -msgUpgLocNotSet = "Building location not set, skipping upgrade..." -msgNoBuilders = "No builders available" -msgAttemptUpgr = "Attempting to upgrade Building" -msgBuilding = "Building" -msgUpgradeSuccess = "successfully upgraded..." -msgUnchecking = "Unchecking" -msgNotEnoughElix = "Not enough Elixir to upgrade, try upgrade using Gold..." -msgGoldLower = "Current Gold is lower than Minimum gold set for upgrading, skip upgrading..." -msgNotEnoughGold = "Not enough Gold to upgrade, skip upgrading..." -msgCheckWalls = "Checking Upgrade Walls..." -msgWallUpGold = "Upgrading walls using Gold" -msgGoldBelowMin = "Gold is lower than Minimum setting, skipping upgrade" -msgWallUpElix = "Upgrading walls using Elixir" -msgElixBelowMin = "Elixir is lower than Minimum setting, skipping upgrade" -msgWallLowerLvl = "Wall level lower than 8, skipping upgrade with Elixir" -msgWallElixorLvl = "Not enough Elixir or your Wall is lower than level 8 " -msgWallNoGoldElixir = "Upgrade with Gold failed, trying upgrade using Elixir" -msgWallLowGoldElixir = "Gold is lower than Minimum setting, trying upgrade walls using Elixir" -msgWallUpDone = "Upgrading Done !!!" -msgWallNotEnoughGold = "Not enough Gold..." -msgLabLevelTroop = "Level troops " -msgLabLevelMax = " is already max in your laboratory, skip upgrading..." -msgLabSkipped = "Upgrade Laboratory option disabled, skipping upgrading" -msgLabLocNotSet = "Building location not set, skipping upgrade..." -msgLabSearching = "Searching for Troops " -msgLabTroopSearch = "Troops " -msgLabTroopFound = " found..." -msgLabWaiting = "Upgrade in progress, wait for upgrading troops " -msgLabAfter = " after completion other troops upgraded" -msgLabLowElix = "Not enough Elixir to upgrade troops " -msgLabLowDE = "Not enough Dark Elixir to upgrade troops " -msgLabUpgrade = "Upgrade troops" -msgLabDone = " in your laboratory has been done..." -msgVillageRep = "Village Report" -msgNumFreeBuild = "Num. of Free Builders: " -msgPushFreeBuild = "Push: Free Builder" -msgOpeningBuilder = "Opening Builder page to read Resources.." -msgResources = "Resources:" -msgPushVillageRep = "Push: Village Report" -msgLastRaidGain = "Last Raid Gain:" -msgLastRaidLoot = "Last Raid Loot:" -msgHourlyAvg = "Average Hourly Change:" -msgPushLastRaid = "Push: Last raid Report" -msgStopped = "BrokenBot has stopped" -msgDonateTrainMode = "~~~Donate / Train Only Activated~~~" -msgPBDisabled = "PushBullet is disabled !!!" -msgDonateMode = "~~~Donate Only Activated~~~" -msgGoblinMode = "~~~Goblin Mode Activated~~~" -msgSaved = "Saved: " -msgGoldInitial = "G" -msgElixirInitial = "E" -msgDarkElixInitial = "D" -msgTrophyInitial = "T" -msgGemInitial = "GEM" -msgTHInitial = "TH" -msgDeadInitial = "Dead" -msgDeadBase = "Deadbase" -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." -msgDLLError = "DLL error: Something bad happened!" -msgLicense = "BrokenBot.org license violation detected" -msgNoResources = "No resources found for collection" -msgOverlayNotAllowed = "You don't have background mode checked, so must disable overlay" -msgRoundDoneIncomeWait = "Round done...waiting for income to come to a stop before starting up again" -msgRecheckCollectors = "Checking for presence of collectors again" -msgSnipeWaveWait = "Sniping wave complete. Waiting..." -msgSubmitStats = "Submitting stats to BrokenBot.org" -msgSubmitSuccess = "Success!" -msgSubmitFailed = "Submission failure, will try again next time..." -msgCollectAttackDone = "Collector attack complete." -msgSnipeAttackDone = "Snipe attack complete." -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." -boxUpdate = "Update needed!" -boxUpdate2 = "There is a newer version of BrokenBot available online." -boxUpdate3 = "Click OK and update will be automatically installed and applied." -boxUpdate4 = "" -boxUpdate5 = "Or click cancel to skip." -boxUpdate6 = "Here is what you are missing out on:" -boxUpdateError = "Error downloading update!" -boxUpdateExtract = "Error extracting the update" -boxRestart = "Restart Computer" -boxRestart2 = "Restart your computer for the applied changes to take effect." -boxRestart3 = "If your BlueStacks is the correct size (860 x 720), click OK." -boxBarrack1 = "Locate first barrack" -boxBarrack1b = "Click Continue then click on your first barrack. Cancel if not available. Try again to start over." -boxBarrack2 = "Locate second barrack" -boxBarrack2b = "Click Continue then click on your second barrack. Cancel if not available. Try again to start over." -boxBarrack3 = "Locate third barrack" -boxBarrack3b = "Click Continue then click on your third barrack. Cancel if not available. Try again to start over." -boxBarrack4 = "Locate fourth barrack" -boxBarrack4b = "Click Continue then click on your fourth barrack. Cancel if not available. Try again to start over." -boxDark1 = "Locate first Dark Barrack" -boxDark1b = "Click Continue then click on your first dark barrack. Cancel if not available. Try again to start over." -boxDark2 = "Locate second Dark Barrack" -boxDark2b = "Click Continue then click on your second dark barrack. Cancel if not available. Try again to start over." -boxCamp = "Locate Camp" -boxCampb = "Click OK then click on one of your camps" -boxCC = "Locate Clan Castle" -boxCCb = "Click OK then click on your Clan Castle" -boxTH = "Locate Townhall" -boxTHb = "Click OK then click on your Townhall" -boxKing = "Locate King Altar" -boxKingb = "Click OK then click on your King Altar" -boxQueen = "Locate Queen Altar" -boxQueenb = "Click OK then click on your Queen Altar" -boxUpgrade = "Locate Upgrade Building" -boxUpgradeb = "Click OK then click on your Building" -boxFactory = "Locate Spell Factory" -boxFactoryb = "Click OK then click on your spell factory" -boxError = "Error" -boxErrorb = "Please input the correct value" -boxLab = "Locate Laboratory" -boxLabb = "Click OK then click on your Building" -boxErrorOpening = "Error opening file!" -boxLoadSuccess = "Config loaded successfully!" -boxSaveFailed = "Config save failed!" -boxSaveSuccess = "Successfully saved the current configuration!" -boxInvalidName = "Invalid filename!" -inpCamp = "Total Camp Capacity" -inpCampb = "Enter Your Total Troop Capacity" -inpSpell = "Total Spell Capacity" -inpSpellb = "Enter Your Total Spell Capacity" -inpConfig = "New config name" -inpConfigb = "Please provide a new name for your configuration:" -pushHRa = "Request for Help" -pushHRb = "You can remotely control your bot using the following command format\n\nBot where is:\n\nPause - pause the bot\nResume - resume the bot\nStats - send bot current statistics\nLogs - send the current log file\nHelp - send this help message\n\nEnter the command in the title of the message" -pushPRa = "Request to Pause" -pushPRb = "Your request has been received. Bot is now paused" -pushPRc = "Your bot is currently paused, no action was taken" -pushRRa = "Request to Resume" -pushRRb = "Your request has been received. Bot is now resumed" -pushRRc = "Your bot is currently running, no action was taken" -pushStatRa = "Request for Stats" -pushStatRb = "Resources at Start\n-Gold: " -pushStatRc = "\n-Elixir: " -pushStatRd = "\n-DE: " -pushStatRe = "\n-Trophies: " -pushStatRf = "\n\nCurrent Resources \n-Gold: " -pushStatRg = "\n-Elixir: " -pushStatRh = "\n-DE: " -pushStatRi = "\n-Trophies: " -pushStatRj = "\n\nBuildings/Walls Upgrade " -pushStatRk = "\n-Wall Upgrade: " -pushStatRl = "\n\nTotal Gain\n-Gold Gain: " -pushStatRm = "\n-Elixir Gain: " -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" -pushDiscb = "Your bot got disconnected while searching for enemy.." -pushMatch = "Match Found!" -pushFB = "Free builder" -pushFBb = "You have " -pushFBc = "a" -pushFBd = " builder" -pushFBe = "s" -pushFBf = " available!" -pushVR = "Village Report" -pushCL = "New Chat Messages" -pushLR = "Last Raid Report:" -pushLRb = "Gain: \n[" -pushBS = "Base Searched:" -pushLootA = "Loot Available:" \ No newline at end of file +[general] +troopNameBarbarian = "Barbarian" +troopNameArcher = "Archer" +troopNameGiant = "Giant" +troopNameGoblin = "Goblin" +troopNameWallBreaker = "Wall Breaker" +troopNameBalloon = "Balloon" +troopNameWizard = "Wizard" +troopNameHealer = "Healer" +troopNameDragon = "Dragon" +troopNamePEKKA = "P.E.K.K.A." +troopNamePlBarbarian = "Barbarians" +troopNamePlArcher = "Archers" +troopNamePlGiant = "Giants" +troopNamePlGoblin = "Goblins" +troopNamePlWallBreaker = "Wall Breakers" +troopNamePlBalloon = "Balloons" +troopNamePlWizard = "Wizards" +troopNamePlHealer = "Healers" +troopNamePlDragon = "Dragons" +troopNamePlPEKKA = "P.E.K.K.A.s" +troopDarkMinion = "Minion" +troopDarkHog = "Hog Rider" +troopDarkValkyrie = "Valkyrie" +troopDarkGolem = "Golem" +troopDarkWitch = "Witch" +troopDarkLavaHound = "Lava Hound" +troopDarkPlMinion = "Minions" +troopDarkPlHog = "Hog Riders" +troopDarkPlValkyrie = "Valkyries" +troopDarkPlGolem = "Golems" +troopDarkPlWitch = "Witches" +troopDarkPlLavaHound = "Lava Hounds" +spellNameLightning = "Lightning" +spellNameHealing = "Healing" +spellNameRage = "Rage" +spellNameJump = "Jump" +spellNameFreeze = "Freeze" +spellNamePoison = "Poison" +spellNameEarthquake = "Earthquake" +spellNameHaste = "Haste" +btnStart = "Start Bot" +btnStartInit = "Initiating..." +btnStop = "Stop Bot" +btnHide = "Hide BS" +btnAtkNow = "Attack Now" +btnPause = "Pause" +pageGeneral = "General" +Controls = "Controls" +cmbBotPre = "Experience Mode|" +cmbBotCommand = "Halt Attack Mode|Shutdown PC|Sleep PC" +cmbBotCommandDefault = "Halt Attack Mode" +lblPC = "IF :" +cmbBotCondAdd = "G, E, And DE Full and Max. Trophy|" +cmbBotCondMore = "(G, E, And DE Full) or Max. Trophy|G, E, And DE Full|G or E or DE Full|Dark Elixir Full|" +cmbBotCond = "G and E Full and Max.Trophy|(G and E) Full or Max.Trophy|(G or E) Full and Max.Trophy|G or E Full or Max.Trophy|Gold and Elixir Full|Gold or Elixir Full|Gold Full and Max.Trophy|Elixir Full and Max.Trophy|Gold Full or Max.Trophy|Elixir Full or Max.Trophy|Gold Full|Elixir Full|Reach Max. Trophy" +cmbBotCondDefault = "Gold and Elixir Full" +otherSettings = "Other Settings" +chkNoAttack = "Donate/Train Only" +chkNoAttackTip = "Disable attacking, only do collections/training/donating" +chkDonateOnly = "Donate Only" +chkDonateOnlyTip = "Disable attacking & training, only do collections/donating" +expMode = "Exp Mode" +expModeTip = "Attack goblin base" +lblMaxTrophy = "Trophy Range:" +lblSnipeBelow = "Snipe if below:" +pageAttackOptions = "Strategies" +btnSaveStrat = "Save current as" +btnRefresh = "Refresh" +AtkSpeed = "Deploy Speed" +lblUnitDelay = "Unit Delay:" +lblWaveDelay = "Wave Delay:" +Randomspeedatk = "Random Speeds" +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." +pageDonateSettings = "Donate/Request" +Barbarians = "Troop 1" +chkDonateAll = "Donate to All" +chkDonateAllTip = "Donate without checking keywords" +txtDonate = "any\r\nreinforcement" +txtDonateBarbariansTip = "Keywords for donating Troop 1" +Archers = "Troop 2" +txtDonateArchersTip = "Keywords for donating Troop 2" +Giants = "Troop 3" +txtDonateGiantsTip = "Keywords for donating Troop 3" +chkDonateGiants = "Donate Troop 3" +chkDonateGiantsTip = "Check keywords before donating Troop 3" +chkDonateArchers = "Donate Troop 2" +chkDonateArchersTip = "Check keywords before donating Troop 2" +chkDonateBarbarians = "Donate Troop 1" +chkDonateBarbariansTip = "Check keywords before donating Troop 1" +chkRequest = "Request for :" +txtRequestDefault = "any" +txtRequestTip = "Request for input." +chkBlacklist = "Blacklist" +chkBlacklistTip = "Check to prevent donating if the request contains a word in the box to the right" +chkBlacklistTip2 = "Will not work if you are using donate to all." +gtfo = "GTFO" +gtfoTip = "Kick after donating" +pageUpgradeBuilding = "Upgrade" +Upgrade = "Upgrade Defenses / Upgrade Storage / Upgrade Camp " +chkUpgrade1 = "Upgrade 1 :" +lblUPPosX = "Pos X : " +lblUPPosY = "Pos Y : " +btnLocateUp1 = "Locate Building 1" +chkUpgrade2 = "Upgrade 2 :" +btnLocateUp2 = "Locate Building 2" +chkUpgrade3 = "Upgrade 3 :" +btnLocateUp3 = "Locate Building 3" +Upgrade2 = "Upgrade Collector/Barrack Lv 5 - Max" +chkUpgrade4 = "Upgrade 4 :" +btnLocateUp4 = "Locate Building 4" +chkUpgrade5 = "Upgrade 5 :" +btnLocateUp5 = "Locate Building 5" +chkUpgrade6 = "Upgrade 6 :" +btnLocateUp6 = "Locate Building 6" +grpLaboratory = "Laboratory" +chkLab = "Enable" +lblLab = "What to upgrade:" +cmbNothing = "Nothing" +pagenotificationSetting = "Services" +lblpushbullet = "PushBullet" +pushbullettoken1 = "Account Token:" +lblpushbulletenabled = "Enable" +lblpushbulletenabledTip = "Enable pushbullet notification" +lblpushbulletdebug = "Debug" +lblpushbulletdebugTip = "This will add verbosity on log while sending files via pushbullet" +lblpushbulletremote = "Remote" +lblpushbulletremoteTip = "Enables pushbullet remote function" +lblpushbulletdelete = "Delete Msg on Start" +lblpushbulletdeleteTip = "Will delete your messages on start button click" +lblpushmessage = "Push Messages As Text" +lblvillagereport = "Hourly Report" +lblchatlog = "Chat Log" +lblmatchfound = "Match Found" +lbllastraid = "Last Raid" +lblfreebuilder = "Free Builder" +lbldisconnect = "Disconnection" +lblpushbulletloot = "As JPG" +lblpushuser = "Enter user name here to get user specific info and multi-bot control" +UseJPG = "Last Raid" +UseJPGTip = "Attach the loot jpg file in push message" +UseAttackJPG = "Attack" +UseAttackJPGTip = "Attach the attack jpg file in push message" +lblpushbullet2 = "PushBullet Multi-user" +pushbullettoken2 = "You can remotely control your bot using the following command format" +pushbullettoken3 = "Enter the command in the title of the message" +pushbullettoken4 = "Bot Where is:" +pushbullettoken5 = "Pause - pause the bot" +pushbullettoken6 = "Resume - resume the bot" +pushbullettoken7 = "Stats - send bot current statistics" +pushbullettoken8 = "Logs - send the current log file" +pushbullettoken9 = "Help - send this help message" +lblBBStats = "See your loot trending on BrokenBot.org" +lblBBUser = "Username:" +tipBBUser = "Enter your username for the forums at BrokenBot.org" +lblBBPassword = "Password:" +tipBBPass1 = "Enter your password for the forums at BrokenBot.org" +tipBBPass2 = "This data will be stored encrypted in a seperate file" +tipBBPass3 = "and is only used for submitting stats online" +tipBBPass4 = "~~~WARNING~~~" +tipBBPass5 = "Even though this is stored encrypted on your PC," +tipBBPass6 = "AutoIT is inherently insecure. Please use a unique" +tipBBPass7 = "password for BrokenBot.org" +tipBBValidCheck = "Click to validate your username/password" +tipBBValidGood = "Your credentials are valid!" +tipBBValidBad = "Unable to verify your username/password" +chkBBSendData = "Upload statistics to BrokenBot.org" +tipBBSendData = "Checking this will upload statistics about how much loot you have made for community statistics" +lblBBRegister = "Register at BrokenBot.org" +pageMiscSettings = "Misc" +Miscs = "Misc" +lblReconnect = "Reconnect Interval:" +lblReconnectTip = "Set reconnect interval when other devices connected - COC English version Only" +lblReconnectmin = "minutes" +lblSpellCap = "Spell factory capacity:" +lblCapacity = "Camp Capacity :" +lblUnknownCap = " Error, unknown" +chkTrap = "Auto Rearm Traps" +chkTrapTip = "Auto rearm for Traps, Crossbows & Inferno Towers" +lblSearchsp = "Search Base Speed:" +lblSearchspTip = "Set search base speed to higher number if having frequent server sync issue" +lblSearchspd = "Tips: 0 = Fast, 10 = Slow" +lblReturnh = "Return Home Delay:" +lblReturnhTip = "Set delay timing for return home during raid" +lblReturndelay = "seconds after no income detected" +chkWideEdge = "Look deeper for inside town hall" +chkClearField = "Clear the Field" +chkClearFieldTip = "Attempt to clear up to 5 bushes and logs etc." +msgClearField = "Clearing the Field..." +msgNoClearField = "Nothing found to clear." +msgClearedField = "Obstacles Cleared: " +chkAlertSearch = "Base Found Alert" +chkCollect = "Collect Resources" +chkTakeLootSS = "Take Loots Image" +chkTakeTownSS = "Take All Towns Image" +chkTakeAttackSS = "Take Attack Image" +chkTakeAttackSSTip = "Snapshot of attack and all deployments" +chkDebug = "Debug Mode" +chkDebugTip = "Allow debug mode to store data" +LocationSettings = "Locate Buildings" +btnLocateKingAltar = "King Altar" +btnLocateQueenAltar = "Queen Altar" +btnLocateDarkBarracks = "D.Barrack" +btnLocateSFactory = "S.Factory" +btnLocateTownHall = "Locate Townhall Manually" +btnLocateClanCastle = "Locate Clan Castle Manually" +btnLocateCamp = "Army Camp" +btnLab = "Laboratory" +btnLocateBarracks = "Locate Barracks Manually" +pageOtherSettings = "Other" +Walls = "Walls" +chkWalls = "Auto Wall Upgrade" +UseGold = "Use Only Gold" +WallMinGold = "Minimum Gold: " +WallMinGoldTip = "Minimum level of Gold storage to perform the upgrade" +UseElixir = "Use Only Elixir" +WallMinElixir = "Minimum Elixir:" +WallMinElixirTip = "Minimum level of Elixir storage to perform the upgrade" +UseGoldElix = "Use Gold and then Elixir" +lblWalls = "Current Wall Level:" +lblTolerance = "Tolerance Level:" +cmbTolerance = "Default|Lower|Higher" +cmbToleranceDefault = "Default" +btnFindWall = "Find Wall" +grpRedLine = "Red line detection" +lblRedLine1 = "Possibly in red" +sldAccTip = "At the possibly red extreme you may experience more cannot deploy in red messages." +sldAccTip2 = "At other extreme it will deploy at edge of base." +lblRedLine2 = "Edge of base" +Boosts = "Boosts" +lblBoostBarracks = "Barracks Boosts left :" +chkBoostKing = "King Altar" +chkBoostQueen = "Queen Altar" +chkBoostRax1 = "Barrack 1" +chkBoostRax2 = "Barrack 2" +chkBoostRax3 = "Barrack 3" +chkBoostRax4 = "Barrack 4" +chkBoostSpell = "Spell Factory" +chkBoostDB1 = "Dark Barrack 1" +chkBoostDB2 = "Dark Barrack 2" +pageStatsSetting = "Stats" +resourceonstart = "Resources at Start" +lblgoldonstart = "Gold at Start :" +lblelixironstart = "Elixir at Start :" +lbldeonstart = "DE at Start :" +lbltrophyonstart = "Trophies at Start :" +Currentresource = "Other Stats" +lblvillagesattacked = "Attacked :" +lblvillagesskipped = "Skipped :" +lblsearchcost = "Search Cost :" +lblruntime = "Bot Run Time :" +LastLoot = "Buildings/Walls Upgrade" +lblwallupgrade = "Wall Upgrade :" +CurrentLoot = "Current Resources" +lblgoldnow = "Gold Now :" +lblelixirnow = "Elixir Now :" +lbldenow = "DE Now :" +lbltrophynow = "Trophies Now :" +totalresource = "Total Gain" +lblgoldgain = "Gold Gain :" +lblelixirgain = "Elixir Gain :" +lbldegain = "DE Gain :" +lbltrophygain = "Trophy Gain :" +pageConfigLoadSave = "Config" +ConfigLoadSave = "Config Load/Save" +btnLoad = "Load" +btnSave = "Save" +grpLanguage = "Language:" +btnBugRep = "Debug Data" +grpUpdate = "Auto Update" +chkUpdate = "Check GitHub site for updates on launch" +grpBluestacks = "BlueStacks" +chkBackground = "Background Mode" +chkBackgroundTip = "Activate Background Mode" +chkForceBS = "Force Active" +chkForceBSTip = "Force activate Bluestack if unable to locate it" +chkStayAlive = "Stay Alive" +chkStayAliveTip = "Prevent monitor sleeping" +statLogDefault = "Status : Idle" +tiAbout = "About" +tiExit = "Exit" +pageSearch = "Search Settings" +DeadConditions = "Dead Base Conditions" +lblDeadConditions = "Search for full collectors bases and ALL selected conditions" +chkKingAvail = "Wait for King" +chkQueenAvail = "Wait for Queen" +chkDeadSnipe = "Snipe" +chkDeadSnipeTip = "If checked, will attack exterior townhall of dead base regardless of other settings" +AnyConditions = "Live Base Conditions" +chkActivate = "Activate" +lblAnyConditions = "Search for any bases and ALL selected conditions" +chkMeetGE = "Min Resources: " +lblMinGold = "Gold:" +cmbAndOr = "And|Or" +cmbAnd = "And" +lblMinElixir = "Elixir:" +chkMeetDE = "Min Dark Elixir:" +chkMeetTrophy = "Min Trophies:" +chkMeetTH = "Max TH Level:" +chkMeetTHO = "TH Outside" +chkMeetTHOTip = "Townhall must be on outer edges of base" +chkSnipe = "Snipe" +chkSnipeTip = "If checked, will attack exterior townhall of 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" +DeadDeploySettings = "Dead Base Deploy Settings" +AnyDeploySettings = "Other Base Deploy Settings" +cmbDeployMethods = "Attack on a single side, penetrates through base|Attack on two sides, penetrates through base|Attack on three sides, gets outer and some inside of base|Attack on all sides equally, gets most of outer base|Mixed mode: limited on 4 sides then focus on 1 side" +cmbDeployCollectors = "|Attack collectors - deploy all troops|Attack collectors - troop saver" +cmbDeployDefault = "Attack on all sides equally, gets most of outer base" +cmbAlgorithms = "Archers|Barbarians|Goblins|Barbarians + Archers|Barb + Arch + Goblin + Giant|Barb + Arch + Giant|Barb + Arch + Goblin|Barb + Arch + Goblin + Giant + Wallbreakers|Use Barracks|Use All Troops" +cmbAlgorithmsDefault = "Use All Troops" +chkUseKing = "Attack with King" +chkUseQueen = "Attack with Queen" +chkUseClanCastle = "Attack with Clan Castle troops" +cmbAttackTH = "Don't attack TH|Limited TH attack|Full TH attack" +HeroAct = "Hero Activation" +lblKingSkill = "King Skill Activation:" +lblKingSkillTip = "Set delay timing for King skill" +lblQueenSkill = "Queen Skill Activation:" +lblQueenSkillTip = "Set delay timing for Queen skill" +pageTroops = "Troop Training" +Barracks = "Troops" +lblBarbarians = "Barbarians :" +lblArchers = "Archers :" +lblGoblins = "Goblins :" +lblRaidcap = "Raid Capacity :" +cmbTroopComp = "Archers|Barbarians|Goblins|B.Arch|B.A.G.G.|B.A.Giant|B.A.Goblin|B.A.G.G.Wall|Use Barracks|Custom Troops" +cmbTroopCompDefault = "Use Barracks" +OtherTroops = "Other Troops" +numberOf = "Number of" +BarrackGroup = "Barracks" +cmbTrainingOnly = " (Training only)" +BarrackCTGroup = "Custom Troop 2 / Not Available" +lblBarrackBK1 = "the rest" +DarkBarracks = "Dark Barracks" +pageSpells = "Spells" +lblFactory = "Spell Factory" +chkMakeSpells = "Make spells" +lblSpellCreate = "Spell to keep full:" +cmbSpellCreateTip = "Set to the spell you want made" +cmbSpellCreate = "Lightning|Healing|Rage|Jump|Freeze" +cmbSpellCreateDefault = "Lightning" +lblDEZap = "DE zapping" +lblDENukeLimit = "Zap with spell if DE greater than:" +chkNukeOnly = "Allow zap only behavior" +chkNukeOnlyTip = "If spell factory is full, will search for a camp to hit and run the DE storage" +chkNukeOnlyWithFullArmy = "Only search base for zapping with full army" +chkNukeAttacking = "Zap DE if already attacking" +chkNukeAttackingTip = "Will zap DE storage during attack if you have more than number of spells below" +lblSpellNumber = "Number of spells needed:" +lblDEAccuracy = "DE Storage Accuracy" +rdoMaybeSkip = "Possible skips" +rdoMaybeSkipTip = "Less reliable search, but won't misidentify something else as DE storage" +rdoFalsePositive = "Possibly mislocated" +rdoFalsePositiveTip = "It's going to find a damn DE storage, even if it means nuking something else on accident" +frmBugReport = "Bug report info" +lblInstructions = "You can use the following data to post an issue on the forum. Please examine to make sure you aren't making a new thread for the same issue though. The better the description of the problem the easier it is to actually fix. If your problem involves reading the screen at all, then please manually find where the bot is having an error, use Ctrl+Alt+Shift+P to take a screenshot (saved to debug directory) and post that to forum as well (make sure you block out identifiable information). Your recent log information and settings are included below if you need to copy and paste this info into the issue." +lblLog = "Last 100 log lines:" +lblSettings = "Settings:" +btnGitHub = "Support forum" +btnCloseBR = "Close" +heroSkill = "0 = Activate at low HP" +heroSkill2 = ">0 = Activate after number of seconds" +lblDisconnected = "Disconnected :" +chkSpeedBoost = "speedBoost" +chkSpeedBoostTip = "Uses more CPU, but will find buildings faster" +msgMissing = "Missing required file!" +msgMissing1 = "Your system appears to be missing a required file (MSVCP120.DLL) for redline detection to work." +msgMissing2 = "You may continue but the bot will not work as intended." +msgMissing3 = "Click OK to exit the bot and be directed to Microsoft's site to download the appropriate file." +msgMissing4 = "Make sure you download the 32 bit version, regardless of your computer being 32 or 64 bit." +msgMissing5 = "When given the option, choose the file: vcredist_x86.exe" +msgMissing6 = "Click Cancel to continue using the bot without this function." +msgRestartNeeded = "Your newly selected language will not take full effect until you restart." +msgExit = "Exiting !!!" +msgFailedVersion = "Failed to check updated version info." +msgVersionOnline = "Version of master branch online: " +msgUpdateNeeded = "Update needed." +msgAheadMaster = "You appear to be ahead of master." +msgRunningBeta = "You are running the beta version. Release not yet published." +msgNoUpdateNeeded = "No update needed." +msgFailedZoomout = "Failed to access properly zoomed out main screen!!!" +msgWaitMinute = "Waiting 1 minute to repeat attempt." +msgNoDataFound = "No data found for: " +msgNoDefaults = ", making defaults." +msgBattleFinished = "Battle Finished." +msgNoResource = "No resource detected, returning in " +msgSeconds = " seconds" +msgNoIncome = "No Income detected, returning." +msgLootChange = "Loot change detected, waiting..." +msgReturnHome = "Returning Home" +msgTakingLootSS = "Taking snapshot of your loot" +msgCannotReturn = "Cannot return home." +msgUpgrading = "Upgrading..." +msgNoUpgradeButton = "Cannot find Button Upgrade, Skip upgrade..." +msgNoDEStorage = "No dark elixir storage was found!" +msgWallFound = "Found Walls level " +msgWallNotFound = "Cannot find Walls level " +msgWallSkipUpgrade = ", Skip upgrade..." +msgWallAt = "at" +msgWallAdjustTol = ", adjust tolerance and try again..." +msgImageSearchNotWork = "Error: Image Search not working..." +msgMSTry = "Trying to locate Main Screen" +msgMSLocated = "Main Screen Located" +msgMSFailed = "Failed to zoom out" +msgAnotherDev = "Another Device has connected, reconnect in " +msgAnotherDevMinutes = " minutes " +msgTakeBreak = "Village must take a break, wait ..." +msgWaitMS = "Waiting for Main Screen" +msgUnableLoad = "Unable to load Clash Of Clans, Restarting..." +msgZoomingOut = "Zooming Out" +msgPBHelpSent = "Your request has been received. Help has been sent" +msgPBBotPauseFuture = "Your request has been received. Bot will pause on main screen" +msgPBNoAction = "Your bot is currently paused, no action was taken" +msgPBResumed = "Your request has been received. Bot is now resumed" +msgPBRunning ="Your bot is currently running, no action was taken" +msgPBStats = "Your request has been received. Statistics sent" +msgPBLog = "Your request has been received. Log is now sent" +msgPBErrorUpload = "There is an error and file was not uploaded" +msgPBErrorUploading = "Error encountered uploading file." +msgPBPasteForum = "You can paste this in the forum so we can check whether it is PushBullet problem or mine" +msgAttackingGoblin = "Attacking goblin" +msgVictory = "Victory!" +msgPleaseRestart = "Please restart your computer for the applied changes to take effect." +msgWelcome = "~~~~Welcome to " +msgRunningOn = " running on " +msgStarting = "Bot is starting..." +msgNotInGame = "Not in Game!" +msgStartingBS = "Starting BlueStacks" +msgWaitingBS = "Waiting for BlueStacks to initiate..." +msgBSLoaded = "BlueStacks Loaded, took " +msgBSLoadSecs = " seconds to begin." +msgDirNotFound = "dir not found - " +msgFailDel = "Fail to del " +msgBadCall = "Bad call, unknown where to center attack" +msgAnalyzingBase = "Analyzing base..." +msgDone = "Done!" +msgRestartBarracks = "Restarting BlueStack to fix Barrack is not available error!" +msgLocationX = "Location- X:" +msgWanted = "Wanted:" +msgGot = "Got:" +msgVariance = "Variance:" +msgNoNextButton = "Cannot locate Next button, Restarting Bot" +msgMidAttack = "Mid-attack resource check:" +msgSearchingMatch = "Searching for match..." +msgOOSAlreadySlow = "Out of sync! Already searching slowly, not changing anything." +msgOOSSlowingSearch = "Out of sync! Slowing search speed by 0.5 secs." +msgLCAlreadySlow = "Lost Connection! Already searching slowly, not changing anything." +msgLCSlowingSearch = "Lost Connection! Slowing search speed by 0.5 secs." +msgDropping = "Dropping " +msgWaveOf = " wave of " +msgNuking = "~Zapping the dark elixir storage" +msgAttackingTH = "~Attacking townhall..." +msgSnipeMode = "~Sniping townhall..." +msgSingleSide = "~Attacking in a single side..." +msgTwoSides = "~Attacking in two sides..." +msgThreeSides = "~Attacking in three sides..." +msgAllSides = "~Attacking in all sides..." +msgMixedMode = "~Mixed mode attacking..." +msgCollectorMode = "~Attacking collectors..." +msgCollectorSave = "~Saving troops if possible..." +msgLimitedTH = "~With limited townhall attack..." +msgDropLeftover = "~Dropping left over troops" +msgActivateKing = "Activate King's power" +msgActivateQueen = "Activate Queen's power" +msgFinishedWait = "~Finished attacking, waiting to finish" +msgNoSpell = "No spell available!" +msgDroppingCC = "Dropping Clan Castle" +msgDroppingKing = "Dropping King" +msgDroppingQueen = "Dropping Queen" +msgFindColl = "Finding location of collectors..." +msgFindPos = "Determining good drop locations..." +msgFindColFailed = "~Unable to find outside collectors, reverting to 4 side attack..." +msgFoundCol = "Found collectors: " +msgRemainCol = "Collectors considered outside: " +msgRemoveCol = "Removing inside collector - " +msgColDE = "Dark elixir drill(s)" +msgColElix = "Elixir collector(s)" +msgColGM = "Gold mine(s)" +msgAdjustingB = "Automatically adjusting troops : B-" +msgAdjustingA = "%, A-" +msgAdjustingG = "%, G-" +msgCheckingRem = "Checking remaining unlaunched troops" +msgPreparingAtt = "Preparing to attack" +msgIgnoring = "--Ignoring " +msgCheckingCamp = "Checking Army Camp..." +msgCampNA = "Your Army Camp is not available" +msgTotalCampCap = "Total Troop Capacity: " +msgDontKnow = "Don't know how to train the troop " +msgYet = " yet" +msgTrainingTroops = "Training Troops..." +msgForcesNeededB = Forces needed: B- +msgForcesNeededA = ", A-" +msgForcesNeededGo = ", Go-" +msgForcesNeededGi = ", Gi-" +msgForcesNeededWB = ", W-" +msgBarrack = "Barrack " +msgNotAvailable = " is not available" +msgTraining = " Training " +msgRemaining = " Remaining : " +msgTotalBuilding = "Total Troops building : " +msgRestartComplete = "Restart Completed ..." +msgTrainingComp = "Training Troops Complete..." +msgTrainingDark = "Training Dark Troops..." +msgDarkBarrack = "Dark Barrack " +msgDarkTroopComplete = "Dark Troop Training Complete..." +msgSFUnavailable = "Your Spell Factory is not available" +msgMakingSpell = "Making spell: " +msgUnableCreate = "Unable to click create spells" +msgKAUnavailable = "King Altar is not available" +msgQAUnavailable = "Queen Altar is not available" +msgKingAvail = "King available:" +msgQueenAvail = "Queen available:" +msgSearchCond = "Search Condition:" +msgWillSaveAll = "Will save all of the towns when searching" +msgSnipeFound = "~~~~~~~Base to Snipe Found!~~~~~~~ +msgOutDeadFound = "~~~~~~~Outside Townhall in Dead Base Found!~~~~~~~" +msgOutLiveFound = "~~~~~~~Outside Townhall in Live Base Found!~~~~~~~" +msgDeadFound = "~~~~~~~Dead Base Found!~~~~~~~" +msgOtherFound = "~~~~~~~Other Base Found!~~~~~~~" +msgZapFound = "~~~~~~~Base to Zap Found!~~~~~~~" +msgAttackNowClicked = "~~~~~~~Attack Now Clicked!~~~~~~~" +msgNoNextReturn = "Cannot locate Next button, try to return home..." +msgNoNextRestart = "Cannot locate Next button & Surrender button, Restarting Bot" +msgPushMatch = "Push: Match Found" +msgSearchComplete = "===============Searching Complete===============" +msgBoostingBarrack = "Boosting Barrack " +msgBoostingDark = "Boosting Dark Barrack " +msgBoostingKing = "Boosting King Altar..." +msgBoostingQueen = "Boosting Queen Altar..." +msgBoostingSpell = "Boosting Spell Factory..." +msgBoostRem = "Boost remaining : " +msgNotEnoughGem = "Not Enough gems..." +msgBoostComplete = "Boost Completed..." +msgAlreadyBooster = "Building is already Boosted" +msgSpellsAlready = "Spells are already Boosted" +msgBoostingBarracks = "Boosting Barracks" +msgBoostCompRem = "Boost completed. Remaining :" +msgBarracksAlready = "Barracks are already Boosted" +msgHaltExp = "Halt Attack, Activate experience mode..." +msgHaltDonate = "Halt Attack, Stay Online and Donate..." +msgForceShutdown = "Force Shutdown your PC..." +msgSleep = "Sleep your PC..." +msgCheckGold = "Checking Gold Cost Per Search." +msgFailedTH = "Failed to find townhall!" +msgTHLevel = "Townhall Level " +msgGoldCPS = ", Gold Cost Per Search: " +msgCheckingSF = "Checking Spell Factory..." +msgSpellFull = "Spell Factory is full" +msgCollecting = "Collecting Resources" +msgDonatingTroops = "Donating Troops" +msgChatText = "Chat Text: " +msgBlacklisted = "Blacklisted!" +msgUnableToRead = "Unable to read troop" +msgDonateRules = "donate rules." +msgUnableToDetermine = "Unable to determine how to donate " +msgFinishedDonating = "Finished Donating" +msgKicked = " Kicked!" +msgScrollingDown = "Scrolling down" +msgFinishedKicking = "Finished kicking" +msgNoDonateButton = "No donate button exists to click" +msgDonating = "Donating " +msgNo = "No " +msgAvailable = " available for donation." +msgReadingChat = "Starting to read chat log" +msgTrophyCount = "Trophy Count : " +msgDropTrophies = "Dropping Trophies" +msgDropComplete = "Trophy Drop Complete" +msgDarkElixirFull = "Dark Elixir Storages are full!" +msgElixirFull = "Elixir Storages are full!" +msgGoldFull = "Gold Storages are full!" +msgFailedZoomOut = "Failed to zoom out" +msgLocatingBarracks = "Locating Barracks..." +msgLocatingComplete = "-Locating Complete-" +msgLocBarrack = "-Barrack" +msgLocatingDarkBar = "Locating Dark Barracks..." +msgLocDarkBar = "-Dark Barrack" +msgLocArmyCamp = "-ArmyCamp +msgLocCC = "-Clan Castle" +msgLocTH = "-Townhall" +msgLocKing = "-King Altar" +msgLocQueen = "-Queen Altar" +msgLocBuilding = "-Building" +msgLocSpellFact = "-Spell Factory" +msgLocLab = "-Locate Laboratory" +msgBeginAttack = "======Beginning Attack======" +msgWaitingFull = "~~~Waiting for full army~~~" +msgHeroNotReady = "~~~Heroes are not Ready~~~" +msgWarningKingUG = "!!!WARNING!!! King upgrading is in progress!" +msgWarningQueenUG = "!!!WARNING!!! Queen upgrading is in progress!" +msgTimeIdle = "Time Idle: " +msgTimeIdleHours = " hours " +msgTimeIdleMin = " minutes " +msgTimeIdleSec = " seconds" +msgCheckRearm = "Checking if Village needs Rearming.." +msgRearmedTraps = "Rearmed Traps" +msgRearmedXBow = "Reloaded X-Bows" +msgRearmedInferno = "Reloaded Infernos" +msgRequesting = "Requesting for Clan Castle's Troops" +msgRequestAlready = "Request's already been made" +msgCCNotAvail = "Clan Castle not available" +msgUpgLocNotSet = "Building location not set, skipping upgrade..." +msgNoBuilders = "No builders available" +msgAttemptUpgr = "Attempting to upgrade Building" +msgBuilding = "Building" +msgUpgradeSuccess = "successfully upgraded..." +msgUnchecking = "Unchecking" +msgNotEnoughElix = "Not enough Elixir to upgrade, try upgrade using Gold..." +msgGoldLower = "Current Gold is lower than Minimum gold set for upgrading, skip upgrading..." +msgNotEnoughGold = "Not enough Gold to upgrade, skip upgrading..." +msgCheckWalls = "Checking Upgrade Walls..." +msgWallUpGold = "Upgrading walls using Gold" +msgGoldBelowMin = "Gold is lower than Minimum setting, skipping upgrade" +msgWallUpElix = "Upgrading walls using Elixir" +msgElixBelowMin = "Elixir is lower than Minimum setting, skipping upgrade" +msgWallLowerLvl = "Wall level lower than 8, skipping upgrade with Elixir" +msgWallElixorLvl = "Not enough Elixir or your Wall is lower than level 8 " +msgWallNoGoldElixir = "Upgrade with Gold failed, trying upgrade using Elixir" +msgWallLowGoldElixir = "Gold is lower than Minimum setting, trying upgrade walls using Elixir" +msgWallUpDone = "Upgrading Done !!!" +msgWallNotEnoughGold = "Not enough Gold..." +msgLabLevelTroop = "Level troops " +msgLabLevelMax = " is already max in your laboratory, skip upgrading..." +msgLabSkipped = "Upgrade Laboratory option disabled, skipping upgrading" +msgLabLocNotSet = "Building location not set, skipping upgrade..." +msgLabSearching = "Searching for Troops " +msgLabTroopSearch = "Troops " +msgLabTroopFound = " found..." +msgLabWaiting = "Upgrade in progress, wait for upgrading troops " +msgLabAfter = " after completion other troops upgraded" +msgLabLowElix = "Not enough Elixir to upgrade troops " +msgLabLowDE = "Not enough Dark Elixir to upgrade troops " +msgLabUpgrade = "Upgrade troops" +msgLabDone = " in your laboratory has been done..." +msgVillageRep = "Village Report" +msgNumFreeBuild = "Num. of Free Builders: " +msgPushFreeBuild = "Push: Free Builder" +msgOpeningBuilder = "Opening Builder page to read Resources.." +msgResources = "Resources:" +msgPushVillageRep = "Push: Village Report" +msgLastRaidGain = "Last Raid Gain:" +msgLastRaidLoot = "Last Raid Loot:" +msgHourlyAvg = "Average Hourly Change:" +msgPushLastRaid = "Push: Last raid Report" +msgStopped = "BrokenBot has stopped" +msgDonateTrainMode = "~~~Donate / Train Only Activated~~~" +msgPBDisabled = "PushBullet is disabled !!!" +msgDonateMode = "~~~Donate Only Activated~~~" +msgGoblinMode = "~~~Goblin Mode Activated~~~" +msgSaved = "Saved: " +msgGoldInitial = "G" +msgElixirInitial = "E" +msgDarkElixInitial = "D" +msgTrophyInitial = "T" +msgGemInitial = "GEM" +msgTHInitial = "TH" +msgDeadInitial = "Dead" +msgDeadBase = "Deadbase" +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." +msgDLLError = "DLL error: Something bad happened!" +msgLicense = "BrokenBot.org license violation detected" +msgNoResources = "No resources found for collection" +msgOverlayNotAllowed = "You don't have background mode checked, so must disable overlay" +msgRoundDoneIncomeWait = "Round done...waiting for income to come to a stop before starting up again" +msgRecheckCollectors = "Checking for presence of collectors again" +msgSnipeWaveWait = "Sniping wave complete. Waiting..." +msgSubmitStats = "Submitting stats to BrokenBot.org" +msgSubmitSuccess = "Success!" +msgSubmitFailed = "Submission failure, will try again next time..." +msgCollectAttackDone = "Collector attack complete." +msgSnipeAttackDone = "Snipe attack complete." +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." +boxUpdate = "Update needed!" +boxUpdate2 = "There is a newer version of BrokenBot available online." +boxUpdate3 = "Click OK and update will be automatically installed and applied." +boxUpdate4 = "" +boxUpdate5 = "Or click cancel to skip." +boxUpdate6 = "Here is what you are missing out on:" +boxUpdateError = "Error downloading update!" +boxUpdateExtract = "Error extracting the update" +boxRestart = "Restart Computer" +boxRestart2 = "Restart your computer for the applied changes to take effect." +boxRestart3 = "If your BlueStacks is the correct size (860 x 720), click OK." +boxBarrack1 = "Locate first barrack" +boxBarrack1b = "Click Continue then click on your first barrack. Cancel if not available. Try again to start over." +boxBarrack2 = "Locate second barrack" +boxBarrack2b = "Click Continue then click on your second barrack. Cancel if not available. Try again to start over." +boxBarrack3 = "Locate third barrack" +boxBarrack3b = "Click Continue then click on your third barrack. Cancel if not available. Try again to start over." +boxBarrack4 = "Locate fourth barrack" +boxBarrack4b = "Click Continue then click on your fourth barrack. Cancel if not available. Try again to start over." +boxDark1 = "Locate first Dark Barrack" +boxDark1b = "Click Continue then click on your first dark barrack. Cancel if not available. Try again to start over." +boxDark2 = "Locate second Dark Barrack" +boxDark2b = "Click Continue then click on your second dark barrack. Cancel if not available. Try again to start over." +boxCamp = "Locate Camp" +boxCampb = "Click OK then click on one of your camps" +boxCC = "Locate Clan Castle" +boxCCb = "Click OK then click on your Clan Castle" +boxTH = "Locate Townhall" +boxTHb = "Click OK then click on your Townhall" +boxKing = "Locate King Altar" +boxKingb = "Click OK then click on your King Altar" +boxQueen = "Locate Queen Altar" +boxQueenb = "Click OK then click on your Queen Altar" +boxUpgrade = "Locate Upgrade Building" +boxUpgradeb = "Click OK then click on your Building" +boxFactory = "Locate Spell Factory" +boxFactoryb = "Click OK then click on your spell factory" +boxError = "Error" +boxErrorb = "Please input the correct value" +boxLab = "Locate Laboratory" +boxLabb = "Click OK then click on your Building" +boxErrorOpening = "Error opening file!" +boxLoadSuccess = "Config loaded successfully!" +boxSaveFailed = "Config save failed!" +boxSaveSuccess = "Successfully saved the current configuration!" +boxInvalidName = "Invalid filename!" +inpCamp = "Total Camp Capacity" +inpCampb = "Enter Your Total Troop Capacity" +inpSpell = "Total Spell Capacity" +inpSpellb = "Enter Your Total Spell Capacity" +inpConfig = "New config name" +inpConfigb = "Please provide a new name for your configuration:" +pushHRa = "Request for Help" +pushHRb = "You can remotely control your bot using the following command format\n\nBot where is:\n\nPause - pause the bot\nResume - resume the bot\nStats - send bot current statistics\nLogs - send the current log file\nHelp - send this help message\n\nEnter the command in the title of the message" +pushPRa = "Request to Pause" +pushPRb = "Your request has been received. Bot is now paused" +pushPRc = "Your bot is currently paused, no action was taken" +pushRRa = "Request to Resume" +pushRRb = "Your request has been received. Bot is now resumed" +pushRRc = "Your bot is currently running, no action was taken" +pushStatRa = "Request for Stats" +pushStatRb = "Resources at Start\n-Gold: " +pushStatRc = "\n-Elixir: " +pushStatRd = "\n-DE: " +pushStatRe = "\n-Trophies: " +pushStatRf = "\n\nCurrent Resources \n-Gold: " +pushStatRg = "\n-Elixir: " +pushStatRh = "\n-DE: " +pushStatRi = "\n-Trophies: " +pushStatRj = "\n\nBuildings/Walls Upgrade " +pushStatRk = "\n-Wall Upgrade: " +pushStatRl = "\n\nTotal Gain\n-Gold Gain: " +pushStatRm = "\n-Elixir Gain: " +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" +pushDiscb = "Your bot got disconnected while searching for enemy.." +pushMatch = "Match Found!" +pushFB = "Free builder" +pushFBb = "You have " +pushFBc = "a" +pushFBd = " builder" +pushFBe = "s" +pushFBf = " available!" +pushVR = "Village Report" +pushCL = "New Chat Messages" +pushLR = "Last Raid Report:" +pushLRb = "Gain: \n[" +pushBS = "Base Searched:" +pushLootA = "Loot Available:" +pushRestartBlueStack = "Restarting BlueStack" +pushRestartBlueStackMSG = "Bluestack seems not working properly, auto full restart now!\n" +pushLast5Lines = "Last 5 lines of log:\n" +msgFreeBuilder = "Your minimum free builder(s) has been reached. Skip upgrades." +msgUpgradeQueen = "Attempting to upgrade Queen..." +msgNotEnoughDEAQ = "Not enough Dark Elixir to Upgrade Queen." +msgQueenUpgrading = "Queen is already upgrading." +msgHeroesMaxLvl = "Your hero has reached max level to your TownHall." +msgQueenUpgraded = "Queen is successfully upgraded..." +msgUpgradeKing = "Attempting to upgrade King..." +msgNotEnoughDEK = "Not enough Dark Elixir to Upgrade King." +msgKingUpgrading = "King is already upgrading." +msgKingUpgraded = "King is successfully upgraded..." +chkUpgradeKing = "Upgrade King" +chkUpgradeQueen = "Upgrade Queen" +lblUpgradeHeroes = "Heroes will upgrade if you have at least 2 free builders." +lblbuilderfree = "Keep Free Builder:" +lblKeepFreeBuilder = "Keep free builders to upgrade walls and other structures." \ No newline at end of file diff --git a/BrokenBot.org/languages/Italiano.ini b/BrokenBot.org/languages/Italiano.ini new file mode 100755 index 0000000..7a57ca5 --- /dev/null +++ b/BrokenBot.org/languages/Italiano.ini @@ -0,0 +1,799 @@ +[general] +troopNameBarbarian = "Barbaro" +troopNameArcher = "Arciere" +troopNameGiant = "Gigante" +troopNameGoblin = "Goblin" +troopNameWallBreaker = "Spaccamuro" +troopNameBalloon = "Mongolfiera" +troopNameWizard = "Mago" +troopNameHealer = "Guaritrice" +troopNameDragon = "Drago" +troopNamePEKKA = "P.E.K.K.A." +troopNamePlBarbarian = "Barbari" +troopNamePlArcher = "Arcieri" +troopNamePlGiant = "Giganti" +troopNamePlGoblin = "Goblin" +troopNamePlWallBreaker = "Spaccamuro" +troopNamePlBalloon = "Mongolfiere" +troopNamePlWizard = "Maghi" +troopNamePlHealer = "Guaritrici" +troopNamePlDragon = "Draghi" +troopNamePlPEKKA = "P.E.K.K.A." +troopDarkMinion = "Sgherro" +troopDarkHog = "Domatore di Cinghiali" +troopDarkValkyrie = "Valchiria" +troopDarkGolem = "Golem" +troopDarkWitch = "Strega" +troopDarkLavaHound = "Mastino Lavico" +troopDarkPlMinion = "Sgherri" +troopDarkPlHog = "Domatori di Cinghiali" +troopDarkPlValkyrie = "Valchirie" +troopDarkPlGolem = "Golem" +troopDarkPlWitch = "Streghe" +troopDarkPlLavaHound = "Mastini Lavici" +spellNameLightning = "Fulmine" +spellNameHealing = "Cura" +spellNameRage = "Furia" +spellNameJump = "Salto" +spellNameFreeze = "Congelamento" +spellNamePoison = "Veleno" +spellNameEarthquake = "Terremoto" +spellNameHaste = "Fretta" +btnStart = "Attiva Bot" +btnStartInit = "Avvio ..." +btnStop = "Ferma Bot" +btnHide = "Nascondi BS" +btnAtkNow = "Attacca Ora" +btnPause = "Pausa" +pageGeneral = "Generali" +Controls = "Controlli" +cmbBotPre = "Experience|" +cmbBotCommand = "Smetti di Attaccare|Spegni il PC|Iberna il PC" +cmbBotCommandDefault = "Smetti di Attaccare" +lblPC = "SE :" +cmbBotCondAdd = "G, E, E DE Piena e Max. Trofeo|" +cmbBotCond = "O e E Pieni e Trofei Massimi|(O e E) Pieni o Trofei Massimi|(O o E) Pieni e Trofei Massimi|O o E Pieni o Trofei Massimi|Oro e Elisir Pieni|Oro o Elisir Pieni|Oro Pieno e Trofei Massimi|Elisir Pieno e Trofei Massimi|Oro Pieno o Trofei Massimi|Elisir Pieno o Trofei Massimi|Oro Pieno|Elisir Pieno|Trofei Massimi" +cmbBotCondDefault = "Oro e Elisir Pieni" +otherSettings = "Altre Impostazioni" +chkNoAttack = "Non Attaccare, soltanto donare/addestrare truppe " +chkNoAttackTip = "Non Attaccare, soltanto donare/addestrare truppe/raccogliere risorse" +chkDonateOnly = "Solo Donare" +chkDonateOnlyTip = "Disabilita attaccare e addestrare truppe, soltanto raccogliere risorse e donare" +expMode = "Modalitŕ Esperienza" +expModeTip = "Attacca fortezze goblin" +lblMaxTrophy = "Fascia di trofei:" +lblSnipeBelow = "Snipe se sotto:" +pageAttackOptions = "Strategie" +btnSaveStrat = "Salva con nome" +btnRefresh = "Ricarica" +AtkSpeed = "Velocitŕ schieramento truppe" +lblUnitDelay = "Dist. Truppe: " +lblWaveDelay = "Dist. Ondate:" +Randomspeedatk = "Distanze Casuali" +lblAttackdelay = "Velocitŕ di schieramento truppe, 1 (veloce) = come un bot pazzo, 10 (lento) = come un uomo lento. Velocitŕ sempre randomizzate per sembrare piů umane." +pageDonateSettings = "Donazioni/Richieste" +Barbarians = "Truppa 1" +chkDonateAll = "Dona a tutti" +chkDonateAllTip = "Dona senza parole chiave" +txtDonate = "qualasiasi truppa" +txtDonateBarbariansTip = "Parole chiave per donare Truppa 1" +Archers = "Truppa 2" +txtDonateArchersTip = "Parole chiave per donare Truppa 2" +Giants = "Truppa 3" +txtDonateGiantsTip = "Parole chiave per donare Truppa 3" +chkDonateGiants = "Dona Truppa 3" +chkDonateGiantsTip = "Controlla parole chiave prima di donare Truppa 3" +chkDonateArchers = "Dona Truppa 2" +chkDonateArchersTip = "Controlla parole chiave prima di donare Truppa 2" +chkDonateBarbarians = "Dona Truppa 1" +chkDonateBarbariansTip = "Controlla parole chiave prima di donare Truppa 1" +chkRequest = "Richiedi :" +txtRequestDefault = "qualsiasi truppa" +txtRequestTip = "Testo delle donazioni" +chkBlacklist = "Lista nera" +chkBlacklistTip = "Controllare per evitare di donare se la richiesta contiene una parola nella casella a destra" +chkBlacklistTip2 = "Non funziona se si utilizza donare a tutti." +gtfo = "GTFO" +gtfoTip = "Espelli dopo aver donato" +pageUpgradeBuilding = "Miglioramenti" +Upgrade = "Migliora Difese / Migliora Depositi / Migliora Accampamenti " +chkUpgrade1 = "Miglioramento 1 :" +lblUPPosX = "Pos X : " +lblUPPosY = "Pos Y : " +btnLocateUp1 = "Localizza Edificio 1" +chkUpgrade2 = "Miglioramento 2 :" +btnLocateUp2 = "Localizza Edificio 2" +chkUpgrade3 = "Miglioramento 3 :" +btnLocateUp3 = "Localizza Edificio 3" +Upgrade2 = "Migliora Miniere/Caserme Lv 5 - Massimo" +chkUpgrade4 = "Miglioramento 4 :" +btnLocateUp4 = "Localizza Edificio 4" +chkUpgrade5 = "Miglioramento 5 :" +btnLocateUp5 = "Localizza Edificio 5" +chkUpgrade6 = "Miglioramento 6 :" +btnLocateUp6 = "Localizza Edificio 6" +grpLaboratory = "Laboratorio" +chkLab = "Attiva" +lblLab = "Cosa Migliorare:" +cmbNothing = "Niente" +pagenotificationSetting = "PushBullet" +lblpushbullet = "PushBullet" +pushbullettoken1 = "Token Account:" +lblpushbulletenabled = "Attiva" +lblpushbulletenabledTip = "Attiva notifiche Pushbullet" +lblpushbulletdebug = "Debug" +lblpushbulletdebugTip = "Questa opzione aggiungerŕ dettagli al log di Pushbullet" +lblpushbulletremote = "Remoto" +lblpushbulletremoteTip = "Attiva funzionalitŕ remote Pushbullet" +lblpushbulletdelete = "Eliminazione Periodica" +lblpushbulletdeleteTip = "Eliminerŕ i messaggi quando viene schiacciato il tasto start" +lblpushmessage = "Manda messaggio come testo" +lblvillagereport = "Rapporto orario villaggio" +lblchatlog = "Log Della Chat" +lblmatchfound = "Base Trovata" +lbllastraid = "Ultimo Attacco" +lblfreebuilder = "Muratore Libero" +lbldisconnect = "Disconnessione" +lblpushbulletloot = "In JPG" +lblpushuser = "Inserisci username per informazioni specifiche e controllo multi-bot" +UseJPG = "Ultimo Attacco" +UseJPGTip = "Allega il file JPG del loot nel push" +UseAttackJPG = "Attacco" +UseAttackJPGTip = "Allega il file JPG dell'attacco nel push" +lblpushbullet2 = "PushBullet Multi-utente" +pushbullettoken2 = "Puoi controllare il bot da remoto usando i seguenti comandi:" +pushbullettoken3 = "Inserisci il comando nell'oggetto del messaggio" +pushbullettoken4 = "Bot Dove č:" +pushbullettoken5 = "Pause - bot in pausa" +pushbullettoken6 = "Resume - il bot riprende" +pushbullettoken7 = "Stats - invia statistiche attuali" +pushbullettoken8 = "Logs - invia il log attuale" +pushbullettoken9 = "Help - invia messaggio di aiuto" +lblBBStats = "Vedere il tuo bottino di tendenza su BrokenBot.org" +lblBBUser = "Nome utente:" +tipBBUser = "Inserisci il tuo nome utente per il forum BrokenBot.org" +lblBBPassword = "Password:" +tipBBPass1 = "Immettere la password per il forum BrokenBot.org" +tipBBPass2 = "Tali dati saranno memorizzati criptati in un separato file" +tipBBPass3 = "e viene utilizzato solo per l'invio di statistiche online" +tipBBPass4 = "~~~AVVISO~~~" +tipBBPass5 = "Anche se questo e memorizzato criptati sul tuo PC," +tipBBPass6 = "AutoIT e intrinsecamente insicuro. Si prega di utilizzare un unico" +tipBBPass7 = "password per BrokenBot.org" +tipBBValidCheck = "Fare clic per convalidare il tuo nome utente/password" +tipBBValidGood = "Le credenziali sono valide!" +tipBBValidBad = "In grado di verificare il tuo nome utente/password" +chkBBSendData = "Le statistiche di caricamento per BrokenBot.org" +tipBBSendData = "Selezionare questa casella per caricare le statistiche su come bottino avete fatto per la comunita statistiche" +lblBBRegister = "Registrarsi al BrokenBot.org" +pageMiscSettings = "Varie" +Miscs = "Varie" +lblReconnect = "Intervallo Riconn.:" +lblReconnectTip = "Imposta tempo di riconnessione dopo connessione di un altro dispositivo - Solo la versione inglese di COC" +lblReconnectmin = "minuti" +lblSpellCap = "Capacitŕ Fabbr. Inc.:" +lblCapacity = "Capacitŕ Accamp.:" +lblUnknownCap = " Errore sconosciuto" +chkTrap = "Riattiva Trappole" +chkTrapTip = "Riattivazione automatica di Trappole, Archi-X e Torri Inferno" +lblSearchsp = "Velocitŕ ricerca basi:" +lblSearchspTip = "Imposta un numero piů alto se hai problemi di disconnessioni" +lblSearchspd = "Suggerimenti: 0 = Veloce, 10 = 15 secondi" +lblReturnh = "Tempo di Ritorno:" +lblReturnhTip = "Secondi dopo cui il bot torna a casa" +lblReturndelay = "secondi dopo che sono finite le risorse" +chkWideEdge = "Cerca municipi piů esposti" +chkClearField = "Sgombrare il Campo" +chkClearFieldTip = "Tentativo di cancellare fino a 5 cespugli e tronchi, ecc." +msgClearField = "Compensazione del Campo di..." +msgNoClearField = "Non abbiamo trovato nulla di chiaro." +msgClearedField = "Ostacoli Cancellato: " +chkAlertSearch = "Alert Base Trov." +chkCollect = "Raccogli Risorse" +chkTakeLootSS = "Screenshot Guadagni" +chkTakeTownSS = "Screenshot di ogni base" +chkTakeAttackSS = "Effettua screenshot attacco" +chkTakeAttackSSTip = "Screenshot a ogni attacco e ogni schieramento" +chkDebug = "Colleziona informazioni di debug" +chkDebugTip = "Abilita raccolta dati di debug" +LocationSettings = "Localizza Costruzioni" +btnLocateKingAltar = "Altare del Re" +btnLocateQueenAltar = "Altare Regina" +btnLocateDarkBarracks = "Caserme Nere" +btnLocateSFactory = "Fabbrica Inc." +btnLocateTownHall = "Localizza Municipio manualmente" +btnLocateClanCastle = "Localizza Cast. Clan manualmente" +btnLocateCamp = "Accampamenti" +btnLab = "Laboratorio" +btnLocateBarracks = "Localizza Caserme Manualmente" +pageOtherSettings = "Altro" +Walls = "Mura" +chkWalls = "Miglioramento Mura" +UseGold = "Usa Solo Oro" +WallMinGold = "Oro Minimo: " +WallMinGoldTip = "Quantitŕ di oro minima per aumentare" +UseElixir = "Usa Solo Elisir" +WallMinElixir = "Elisir Minimo:" +WallMinElixirTip = "Quantitŕ minima di elisir per aumentare" +UseGoldElix = "Usa Oro e in seguito Elisir" +lblWalls = "Livello Mura Attuale:" +lblTolerance = "Livello di Tolleranza:" +cmbTolerance = "Normale|Piů Basso|Piů Alto" +cmbToleranceDefault = "Normale" +btnFindWall = "Trova Mura" +grpRedLine = "Localizzazione Linee Rosse" +lblRedLine1 = "Piů Vicino Possibile" +sldAccTip = "Piů vicino alla linea rossa = piů messaggi di errore." +sldAccTip2 = "Le truppe verranno posizionate agli estremi della base." +lblRedLine2 = "Estremi della Base" +Boosts = "Aumenti Velocitŕ (con gemme)" +lblBoostBarracks = "Aumenti Rimasti Caserme :" +chkBoostKing = "Altare del Re" +chkBoostQueen = "Altare Regina" +chkBoostRax1 = "Caserma 1" +chkBoostRax2 = "Caserma 2" +chkBoostRax3 = "Caserma 3" +chkBoostRax4 = "Caserma 4" +chkBoostSpell = "Fabbrica Incantesimi" +chkBoostDB1 = "Caserma Nera 1" +chkBoostDB2 = "Caserma Nera 2" +pageStatsSetting = "Statistiche" +resourceonstart = "Risorse all'Inizio" +lblgoldonstart = "Oro all'Inizio :" +lblelixironstart = "Elisir all'Inizio :" +lbldeonstart = "Elisir Nero all'Inizio :" +lbltrophyonstart = "Trofei all'Inizio :" +Currentresource = "Altre Statistiche" +lblvillagesattacked = "Attaccati :" +lblvillagesskipped = "Saltati :" +lblsearchcost = "Costo di Ricerca :" +lblruntime = "Bot Aperto Da :" +LastLoot = "Miglioramenti Mura/Edifici" +lblwallupgrade = "Mura Migliorate :" +CurrentLoot = "Risorse Attuali" +lblgoldnow = "Oro Attuale :" +lblelixirnow = "Elisir Attuale :" +lbldenow = "Elisir Nero Attuale :" +lbltrophynow = "Trofei Attuali :" +totalresource = "Guadagno Totale" +lblgoldgain = "Oro Guadagnato :" +lblelixirgain = "Elisir Guadagnato :" +lbldegain = "Elisir Nero Guadagnato :" +lbltrophygain = "Trofei Guadagnati :" +pageConfigLoadSave = "Configurazioni" +ConfigLoadSave = "Carica/Salva Configurazioni" +btnLoad = "Carica" +btnSave = "Salva" +grpLanguage = "Lingua:" +btnBugRep = "Dati di Debug" +grpUpdate = "Aggiornamento Automatico" +chkUpdate = "Controlla Github per Aggiornamenti" +grpBluestacks = "BlueStacks" +chkBackground = "Modalitŕ Nascosta" +chkBackgroundTip = "Attiva Modalitŕ Nascosta" +chkForceBS = "BS Sempre Attivo" +chkForceBSTip = "Obbliga BS a rimanere attivo" +chkStayAlive = "Sempre Acceso" +chkStayAliveTip = "Previene lo spegnimento del monitor" +statLogDefault = "Stato : Inattivo" +tiAbout = "Informazioni" +tiExit = "Esci" +pageSearch = "Impostazioni Ricerca" +DeadConditions = "Impostazioni Basi Inattive" +lblDeadConditions = "Ricerca Estrattori pieni e TUTTE le seguenti condizioni" +chkKingAvail = "Wait for King" +chkQueenAvail = "Wait for Queen" +chkDeadSnipe = "Sniping" +chkDeadSnipeTip = "Se selezionato, attaccherŕ i municipi ESTERNI fregandosene di ogni altra impostazione" +AnyConditions = "Impostazioni Basi Attive" +chkActivate = "Attiva" +lblAnyConditions = "Ricerca TUTTE le seguenti condizioni" +chkMeetGE = "Risorse Minime: " +lblMinGold = "Oro:" +cmbAndOr = "E|O" +cmbAnd = "E" +lblMinElixir = "Elisir:" +chkMeetDE = "Elisir Nero Min.:" +chkMeetTrophy = "Trofei Minimi:" +chkMeetTH = "Municipio Massimo:" +chkMeetTHO = "Muni Esterno" +chkMeetTHOTip = "Il Municipio dev'essere all'estremo della base" +chkSnipe = "Sniping" +chkSnipeTip = "Se selezionato, attaccherŕ i municipi ESTERNI fregandosene di ogni altra impostazione" +RedConditions = "Riduzione Condizioni Ricerca" +lblRedNumOfSerach = "Riduci Ogni:" +lblRedGoldPercent = "Riduzione Oro(%):" +lblRedElixirPercent = "Riduzione Elisir(%):" +lblRedDEPercent = "Riduzione Elisir Nero(%):" +lblRedTrophyPercent = "Riduzione Trofei(%):" +lblRedNukePercent = "Riduzione Nuke(%):" +btnSearchMode = "Modalitŕ Ricerca" +btnSearchModeTip = "Non attacca, ricerca soltanto." +pageAttack = "Metodo di Attacco" +DeadDeploySettings = "Impostazioni Basi Inattive" +AnyDeploySettings = "Impostazioni Altre Basi" +cmbDeployMethods = "Attacca da un singolo lato, penetra|Attacca da due lati, penetra|Attacca da tre lati, distrugge esterno e penetra|Attacca da ogni lato, distrugge maggior parte dell'esterno|Modalitŕ Mista: prima da ogni lato, poi uno solo" +cmbDeployCollectors = "|Attacco collettori di distribuzione di tutte le truppe|Attacco collezionisti - troop saver" +cmbDeployDefault = "Attacca da ogni lato, distrugge maggior parte dell'esterno" +cmbAlgorithms = "Arcieri|Barbari|Goblin|Barbari + Arcieri|Barb + Arc + Goblin + Giganti|Barb + Arc + Giganti|Barb + Arc + Goblin|Barb + Arc + Goblin + Giganti + Spaccamuro|Usa Caserme|Usa OGNI truppa" +cmbAlgorithmsDefault = "Usa Ogni Truppa" +chkUseKing = "Attacca con Re" +chkUseQueen = "Attack con Regina" +chkUseClanCastle = "Attacca con Truppe Clan" +cmbAttackTH = "Non attaccare municipio|Attacco muniicipio limitato|Attacca municipio" +HeroAct = "Attivazione Eroi" +lblKingSkill = "Attivazione Abilitŕ Re:" +lblKingSkillTip = "Tempo dopo cui si attiva l'abilitŕ del Re" +lblQueenSkill = "Attivazione Abilitŕ Regina:" +lblQueenSkillTip = "Tempo dopo cui si attiva l'abilitŕ della Regina" +pageTroops = "Addestramento Truppe" +Barracks = "Truppe" +lblBarbarians = "Barbari :" +lblArchers = "Arcieri :" +lblGoblins = "Goblin :" +lblRaidcap = "Capacitŕ Accampamenti :" +cmbTroopComp = "Arcieri|Barbari|Goblin|Barbari + Arcieri|Barb + Arc + Goblin + Giganti|Barb + Arc + Giganti|Barb + Arc + Goblin|Barb + Arc + Goblin + Giganti + Spaccamuro|Usa Caserme|Usa truppe personali" +cmbTroopCompDefault = "Usa Caserme" +OtherTroops = "Altre Truppe" +numberOf = "Numero di" +BarrackGroup = "Caserme" +cmbTrainingOnly = " (Solo Addestramento)" +BarrackCTGroup = "Truppe Personali 2 / Non Disponibile" +lblBarrackBK1 = "il resto" +DarkBarracks = "Caserme Nere" +pageSpells = "Incantesimi" +lblFactory = "Fabbrica Incantesimi" +chkMakeSpells = "Produci incantesimi" +lblSpellCreate = "Incantesimi da preparare sempre:" +cmbSpellCreateTip = "Scegli incantesimi che vuoi siano preparati" +cmbSpellCreate = "Fulmine|Cura|Furia|Salto|Congelamento" +cmbSpellCreateDefault = "Fulmine" +lblDEZap = "Fulminare Elisir Nero" +lblDENukeLimit = "Fulmina Deposito Nero se contiene piů di:" +chkNukeOnly = "Consenti attachi SOLO con fulmine" +chkNukeOnlyTip = "Se la fabbrica č piena, cercherŕ basi su cui usare fulmini" +chkNukeOnlyWithFullArmy = "Cerca basi da fulminare SOLO con accampamenti pieni" +chkNukeAttacking = "Fulmina Deposito durante un attacco" +chkNukeAttackingTip = "Fulminerŕ il deposito nero se avrai almeno questo numero di incantesimi" +lblSpellNumber = "Numero di Incantesimi necessari:" +lblDEAccuracy = "Precisione Fulmine" +rdoMaybeSkip = "Precisa" +rdoMaybeSkipTip = "Troverŕ meno depositi, ma non sbaglierŕ mai" +rdoFalsePositive = "Meno Precisa" +rdoFalsePositiveTip = "Troverŕ piů depositi, anche se a volte potrebbe fulminare qualcos'altro" +frmBugReport = "Info Segnalazione Bug" +lblInstructions = "Puoi usare questi dati sul forum per segnalare un errore. Perfavore non creare thread doppi. Piů accurata č la descrizione piů č facile risolvere il bug. Se hai un problema riguardante lo schermo del PC, perfavore localizza la schermata e usa Ctrl+Alt+Shift+P per fare uno screenshot (salvato nella cartella di debug) e posta anche quello sul forum (assicurati di nascondere dati che ti potrebbero rendere identificabile). I tuoi log recenti sono qui sotto, se ti servono da copiare in caso di errore." +lblLog = "Ultime 100 linee di log:" +lblSettings = "Impostazioni:" +btnGitHub = "Forum di Supporto" +btnCloseBR = "Chiudi" +heroSkill = "0 = Attiva quando rimane poca vita" +heroSkill2 = ">0 = Attiva dopo un numero di secondi" +lblDisconnected = "Disconnesso :" +chkSpeedBoost = "speedBoost" +chkSpeedBoostTip = "Uses more CPU, but will find buildings faster" +msgMissing = "File richiesto mancante!" +msgMissing1 = "Sembra che nel tuo sistema manchi un file(MSVCP120.DLL) perchč la individuazione delle linee rosse possa funzionare." +msgMissing2 = "Puoi continuare ma il bot non funzionerŕ come dovrebbe." +msgMissing3 = "Clicca OK per chiudere il bot ed essere rediretto al sito di download del file." +msgMissing4 = "Assicurati di scaricare la versione 32 bit, anche se hai un computer 64 bit." +msgMissing5 = "Quanto ne ha avrai l'opzione, seleziona il file: vcredist_x86.exe" +msgMissing6 = "Clicca Cancel per continuare a usare il bot senza questa fuznione." +msgRestartNeeded = "La lingua da te scelta non avrŕ effetto fino al riavvio del programma." +msgExit = "Programma in Chiusura !!!" +msgFailedVersion = "Impossibile trovare informazioni sugli aggiornamenti." +msgVersionOnline = "Versione Pubblica Online: " +msgUpdateNeeded = "Aggiornamento Richiesto." +msgAheadMaster = "Sembra che tu abbia l'ultima versione pubblica." +msgNoUpdateNeeded = "Nessun aggiornamento richiesto." +chkSpeedBoostTip = "Uses more CPU, but will find buildings faster" +msgFailedZoomout = "Impossibile eseguire lo Zoom Out !!!" +msgWaitMinute = "Aspetta 1 minuto per riprovare." +msgNoDataFound = "Nessun dato trovato per: " +msgNoDefaults = ", creando predefiniti." +msgBattleFinished = "Battaglia Finita." +msgNoResource = "Nessuna risorsa trovata, ritorno alla home in " +msgSeconds = " secondi" +msgNoIncome = "Nessun guadagno trovato, ritorno alla home in " +msgLootChange = "Identificato cambiamento di risorse, attendo..." +msgReturnHome = "Ritornando alla Home" +msgTakingLootSS = "Salvo informazioni sul loot" +msgCannotReturn = "Impossibile ritornare alla home." +msgUpgrading = "Migliorando..." +msgNoUpgradeButton = "Impossibile trovare bottone miglioramento, salto..." +msgNoDEStorage = "Non č stato trovato nessun deposito di elisir nero!" +msgWallFound = "Trovate mura livello " +msgWallNotFound = "Impossibilie trovare mura livello " +msgWallSkipUpgrade = ", Salto miglioramento..." +msgWallAt = "al" +msgWallAdjustTol = ", aumenta la tolleranza e riprova..." +msgImageSearchNotWork = "Errore : ricerca immagini non funzionante..." +msgMSTry = "Localizzando Schermata Principale" +msgMSLocated = "Schermata Principale Localizzata" +msgMSFailed = "Impossibile fare Zoom out" +msgAnotherDev = "Un altro dispositivo si č connesso, riconnessione tra " +msgAnotherDevMinutes = " minuti " +msgTakeBreak = "Il villaggio deve riposarsi, aspetta ..." +msgWaitMS = "Attendo Schermata Principale" +msgUnableLoad = "Impossibile caricare Clash of Clans, riavvio..." +msgZoomingOut = "Faccio Zoom Out" +msgPBHelpSent = "La tua richiesta č stata ricevuta. E' stato inviato un messaggio d'aiuto" +msgPBBotPauseFuture = "La tua richiesta č stata ricevuta. Il bot si fermerŕ sulla schermata principale" +msgPBNoAction = "Il bot č in pausa, nessuna azione eseguita" +msgPBResumed = "La tua richiesta č stata ricevuta. Il bot č stato riattivato" +msgPBRunning ="Il bot č attivo, nessuna azione eseguita" +msgPBStats = "La tua richiesta č stata ricevuta. Statistiche inviate" +msgPBLog = "La tua richiesta č stata ricevuta. Log inviato" +msgPBErrorUpload = "A causa di un errore non č stato eseguito l'upload del file" +msgPBErrorUploading = "Errore durante l'upload del file." +msgPBPasteForum = "Puoi incollare questo sul forum cosě sapremo se č un errore di Pushbullet o no" +msgAttackingGoblin = "Attacco basi goblin" +msgVictory = "Vittoria!" +msgPleaseRestart = "Perfavore riavvia il computer per applicare i cambiamenti." +msgWelcome = "~~~~Benvenuto a " +msgRunningOn = " in esecuzione su " +msgStarting = "Il bot si sta avviando..." +msgNotInGame = "Fuori dal gioco!" +msgStartingBS = "Avviando BlueStacks" +msgWaitingBS = "Aspettando l'avvio di Bluestacks..." +msgBSLoaded = "BlueStacks Avviato, ci sono voluti " +msgBSLoadSecs = " secondi." +msgDirNotFound = "cartella non trovata - " +msgFailDel = "Impossibile cancellare " +msgBadCall = "Errore, impossibile individuare punto di attacco" +msgAnalyzingBase = "Analizzando base..." +msgDone = "Fatto!" +msgRestartBarracks = "Riavviando Bluestacks per sistemare errore Caserme!" +msgLocationX = "Posizione- X:" +msgWanted = "Voluto:" +msgGot = "Ottenuto:" +msgVariance = "Variazione:" +msgNoNextButton = "Impossibile localizzare pulsante Avanti, riavvio bot" +msgMidAttack = "Risorse disponibili a metŕ dell'attacco:" +msgSearchingMatch = "Cercando base..." +msgOOSAlreadySlow = "Disconnesso! Velocitŕ di ricerca giŕ bassa, nessun cambiamento." +msgOOSSlowingSearch = "Disconnesso! Velocitŕ di ricerca aumentata di 0.5 secondi." +msgLCAlreadySlow = "Connessione persa! Velocitŕ di ricerca giŕ bassa, nessun cambiamento." +msgLCSlowingSearch = "Connessione persa! Velocitŕ di ricerca aumentata di 0.5 secondi." +msgDropping = "Posizionando " +msgWaveOf = " ondata di " +msgNuking = "~Fulminando deposito di elisir nero" +msgAttackingTH = "~Attaccando Municipio..." +msgSnipeMode = "~Sniping townhall..." +msgSingleSide = "~Attaccando da un solo lato..." +msgTwoSides = "~Attaccando da due lati..." +msgThreeSides = "~Attaccando da tre lati..." +msgAllSides = "~Attaccando da ogni lato..." +msgMixedMode = "~Attaccando in modalitŕ mista..." +msgLimitedTH = "~Attacco limitato al municipio..." +msgCollectorMode = "~In attacco collezionisti..." +msgCollectorSave = "~Risparmio di truppe, se possibile..." +msgDropLeftover = "~Posizionando truppe avanzate" +msgActivateKing = "Attivo abilitŕ del Re" +msgActivateQueen = "Attivo abilitŕ della Regina" +msgFinishedWait = "~Attacco finito, aspetto la fine" +msgNoSpell = "Nessun incantesimo disponibile!" +msgDroppingCC = "Posiziono truppe del clan" +msgDroppingKing = "Posiziono Re" +msgDroppingQueen = "Posiziono Regina" +msgFindColl = "Trovare la posizione di collezionisti..." +msgFindPos = "La determinazione del buono percorsi di discesa..." +msgFindColFailed = "~Impossibile da trovare al di fuori collezionisti, con il ritorno al 4 attacco laterale..." +msgFoundCol = "Trovato collezionisti: " +msgRemainCol = "ollezionisti considerato al di fuori: " +msgRemoveCol = "Rimozione all'interno del collettore - " +msgColDE = "Elisir nero punta(s)" +msgColElix = "Elisir collettore(s)" +msgColGM = "Miniera d'oro(s)" +msgAdjustingB = "Sistemando automaticamente truppe : B-" +msgAdjustingA = "%, A-" +msgAdjustingG = "%, G-" +msgCheckingRem = "Controllando eventuali truppe rimaste" +msgPreparingAtt = "Preparando ad attaccare" +msgIgnoring = "--Ignoro " +msgCheckingCamp = "Controllando Accampamenti..." +msgCampNA = "Il tuo Accampamento non č disponibile" +msgTotalCampCap = "Capacitŕ totale truppe: " +msgDontKnow = "Non riesco ad addestrare la truppa " +msgYet = " ancora" +msgTrainingTroops = "Addestrando Truppe..." +msgForcesNeededB = Truppe Necessarie: B- +msgForcesNeededA = ", A-" +msgForcesNeededGo = ", Go-" +msgForcesNeededGi = ", Gi-" +msgForcesNeededWB = ", W-" +msgBarrack = "La Caserma " +msgNotAvailable = " non č disponibile" +msgTraining = " Addestrando " +msgRemaining = " Rimanente : " +msgTotalBuilding = "Totale truppe in preparazione : " +msgRestartComplete = "Riavvio Completato ..." +msgTrainingComp = "Addestramento Truppe Completato..." +msgTrainingDark = "Addestrando Truppe Nere..." +msgDarkBarrack = "Caserma Nera " +msgDarkTroopComplete = "Completato addestramento truppe nere..." +msgSFUnavailable = "La Fabbrica degli Incantesimi non č disponibile" +msgMakingSpell = "Preparando Incantesimo: " +msgUnableCreate = "Impossibile Creare Incantesimi" +msgKAUnavailable = "Re Altare non e disponibile" +msgQAUnavailable = "Regina Altare non e disponibile" +msgKingAvail = "Re disponibile:" +msgQueenAvail = "Regina disponibile:" +msgSearchCond = "Condizioni di Ricerca:" +msgWillSaveAll = "Salverŕ ogni cittŕ mentre si cerca" +msgSnipeFound = "~~~~~~~Base di Snipe Trovato!~~~~~~~ +msgOutDeadFound = "~~~~~~~Trovate Municipio esterno in base inattiva!~~~~~~~" +msgOutLiveFound = "~~~~~~~Trovato Municipio esterno in base attiva!~~~~~~~" +msgDeadFound = "~~~~~~~Trovata Base Inattiva!~~~~~~~" +msgOtherFound = "~~~~~~~Trovata Base Attiva!~~~~~~~" +msgZapFound = "~~~~~~~Trovata Base su cui usare Fulmine!~~~~~~~" +msgAttackNowClicked = "~~~~~~~"Attacca Ora" Premuto!~~~~~~~" +msgNoNextReturn = "Impossibile localizzare il pulsante Avanti, ritorno alla home..." +msgNoNextRestart = "Impossibile localizzare il pulsante Avanti e quello abbandona, riavvio bot" +msgPushMatch = "Push: Base Trovata" +msgSearchComplete = "===============Ricerca Completata===============" +msgBoostingBarrack = "Velocizzando Caserma " +msgBoostingDark = "Velocizzando Caserma Nera " +msgBoostingKing = "Velocizzando Altare del Re..." +msgBoostingQueen = "Velocizzando Altare della Regina..." +msgBoostingSpell = "Velocizzando Fabbrica Incantesimi..." +msgBoostRem = "Aumenti Velocitŕ rimasti : " +msgNotEnoughGem = "Non hai abbastanza gemme..." +msgBoostComplete = "Aumento Velocitŕ Completato..." +msgAlreadyBooster = "L'Edificio č giŕ Velocizzato" +msgSpellsAlready = "La Fabbrica degli incantesimi č giŕ Velocizzata" +msgBoostingBarracks = "Velocizzando Caserme" +msgBoostCompRem = "Aumento Velocitŕ Completato. Rimanenti :" +msgBarracksAlready = "Caserme giŕ Velocizzate" +msgHaltExp = "Fermare l'Attacco, Attivare esperienza..." +msgHaltDonate = "Attacchi Fermati, sto online e dono..." +msgForceShutdown = "Spegni il tuo PC..." +msgSleep = "Iberna il PC..." +msgCheckGold = "Controllando costo di Ricerca." +msgFailedTH = "Impossibile Localizzare Municipio!" +msgTHLevel = "Livello Municipio " +msgGoldCPS = ", Costo in oro per ricerca: " +msgCheckingSF = "Controllando Fabbrica Incantesimi..." +msgSpellFull = "La Fabbrica degli Incantesimi č Piena" +msgCollecting = "Raccogliendo Risorse" +msgDonatingTroops = "Donando Truppe" +msgChatText = "Testo Messaggio: " +msgBlacklisted = "Nella lista nera!" +msgUnableToRead = "Impossibile Riconoscere Truppa" +msgDonateRules = "regole per donare." +msgUnableToDetermine = "Impossibile determinare come donare " +msgFinishedDonating = "Finito di Donare" +msgKicked = " Cacciato!" +msgScrollingDown = "Scendendo" +msgFinishedKicking = "Finito di Cacciare" +msgNoDonateButton = "Non ci sono bottoni "Dona" da cliccare" +msgDonating = "Donando " +msgNo = "No " +msgAvailable = " disponibili a essere donati/e." +msgReadingChat = "Di iniziare a leggere il log della chat" +msgTrophyCount = "Numero Trofei : " +msgDropTrophies = "Scendendo di Trofei" +msgDropComplete = "Trofei Minimi Raggiunti" +msgElixirFull = "Elisir nero Magazzini sono pieni!" +msgElixirFull = "I Depositi di Elisir sono pieni!" +msgGoldFull = "I Depositi di Oro sono pieni!" +msgFailedZoomOut = "Impossibile fare Zoom Out" +msgLocatingBarracks = "Localizzando Caserme..." +msgLocatingComplete = "-Localizzazione Completata" +msgLocBarrack = "-Caserma" +msgLocatingDarkBar = "Localizzando Caserme Nere..." +msgLocDarkBar = "-Caserme Nera" +msgLocArmyCamp = "-Accampamento +msgLocCC = "-Castello del Clan" +msgLocTH = "-Municipio" +msgLocKing = "-Altare del Re" +msgLocQueen = "-Altare della Regina" +msgLocBuilding = "-Edificio" +msgLocSpellFact = "-Fabbrica degli Incantesimi" +msgLocLab = "-Localizza Laboratorio" +msgBeginAttack = "======Iniziando Attacco======" +msgWaitingFull = "~~~Aspettando di avere tutte le truppe~~~" +msgHeroNotReady = "~~~Gli eroi non sono Pronti~~~" +msgWarningKingUG = "!!!ATTENZIONE!!! Re l'aggiornamento e in corso!" +msgWarningQueenUG = "!!!ATTENZIONE!!! Regina l'aggiornamento e in corso!" +msgTimeIdle = "Tempo di Inattivitŕ: " +msgTimeIdleHours = " ore " +msgTimeIdleMin = " minuti " +msgTimeIdleSec = " secondi" +msgCheckRearm = "Verificando se č necessario riattivare qualcosa.." +msgRearmedTraps = "Trappole Riattivate" +msgRearmedXBow = "Archi-X Ricaricati" +msgRearmedInferno = "Torri Inferno Ricaricate" +msgRequesting = "Richiedendo Truppe del Clan" +msgRequestAlready = "La Richiesta č giŕ stata fatta" +msgCCNotAvail = "Castello del Clan non disponibile" +msgUpgLocNotSet = "Posizione Edificio non specificata, salto miglioramento..." +msgNoBuilders = "Nessun muratore disponibile" +msgAttemptUpgr = "Provando a migliorare edificio" +msgBuilding = "Edificio" +msgUpgradeSuccess = "migliorato con successo..." +msgUnchecking = "Rilasciando" +msgNotEnoughElix = "Non c'č abbastanza elisir, provo a usare oro..." +msgGoldLower = Oro inferiore al livello minimo, salto miglioramento..." +msgNotEnoughGold = "Non c'č abbastanza oro, salto miglioramento..." +msgCheckWalls = "Controllando Miglioramenti Mura..." +msgWallUpGold = "Miglioro Mura con Oro" +msgGoldBelowMin = "Oro inferiore al livello minimo, salto miglioramento" +msgWallUpElix = "Migliorando mura con elisir" +msgElixBelowMin = "Elisir inferiore al livello minimo, salto miglioramento" +msgWallLowerLvl = "Livello mura minore di 8, salto miglioramento con elisir" +msgWallElixorLvl = "Troppo poco elisir o muro inferiore al livello 8 " +msgWallNoGoldElixir = "Impossibile migliorare con oro, provo con elisir" +msgWallLowGoldElixir = "Oro inferiore al livello minimo, provo a usare elisir" +msgWallUpDone = "Miglioramento Effettuato !!!" +msgWallNotEnoughGold = "Troppo Poco Oro..." +msgLabLevelTroop = "Truupe Livello " +msgLabLevelMax = " č giŕ al lievello massimo, salto miglioramento..." +msgLabSkipped = "Miglioramento laboratorio non selezionato, salto" +msgLabLocNotSet = "PosizupgradeHeroes diff --git a/COCBot/GUI Control.au3 b/COCBot/GUI Control.au3 index c106707..021f6b3 100644 --- a/COCBot/GUI Control.au3 +++ b/COCBot/GUI Control.au3 @@ -1,788 +1,788 @@ -Opt("GUIOnEventMode", 1) -Opt("MouseClickDelay", 10) -Opt("MouseClickDownDelay", 10) -Opt("TrayMenuMode", 3) - -_GDIPlus_Startup() -_Crypt_Startup() - -Global Const $64Bit = StringInStr(@OSArch, "64") > 0 -Global Const $DEFAULT_HEIGHT = 720 -Global Const $DEFAULT_WIDTH = 860 -Global $Initiate = 0 -Global Const $REGISTRY_KEY_DIRECTORY = "HKEY_LOCAL_MACHINE\SOFTWARE\BlueStacks\Guests\Android\FrameBuffer\0" - -Func GUIControl($hWind, $iMsg, $wParam, $lParam) - Local $nNotifyCode = BitShift($wParam, 16) - Local $nID = BitAND($wParam, 0x0000FFFF) - Local $hCtrl = $lParam - #forceref $hWind, $iMsg, $wParam, $lParam - - If @error Then Return - If $hWind <> $frmAttackConfig Then - Switch $iMsg - Case 273 - Switch $nID - Case $GUI_EVENT_CLOSE - SetLog(GetLangText("msgExit"), $COLOR_ORANGE) - DllClose($KernelDLL) - _GDIPlus_Shutdown() - _Crypt_Shutdown() - _GUICtrlRichEdit_Destroy($txtLog) - SaveConfig() - Exit - Case $btnStop - btnStop() - Case $btnAtkNow - btnAtkNow() - Case $btnHide - btnHide() - Case $btnPause - btnPause() - Case $chkRequest - chkRequest() - Case $tabMain - tabMain() - Case $chkNoAttack - If IsChecked($chkNoAttack) Then - If IsChecked($lblpushbulletenabled) Then - SetLog(GetLangText("msgPBDisabled"), $COLOR_RED) - EndIf - GUICtrlSetState($chkDonateOnly, $GUI_UNCHECKED) - GUICtrlSetState($expMode, $GUI_UNCHECKED) - GUICtrlSetState($lblpushbulletenabled, $GUI_UNCHECKED) - GUICtrlSetState($lblpushbulletenabled, $GUI_DISABLE) - lblpushbulletenabled() - Else - GUICtrlSetState($lblpushbulletenabled, $GUI_ENABLE) - EndIf - Case $chkDonateOnly - If IsChecked($chkDonateOnly) Then - If IsChecked($lblpushbulletenabled) Then - SetLog(GetLangText("msgPBDisabled"), $COLOR_RED) - EndIf - GUICtrlSetState($chkNoAttack, $GUI_UNCHECKED) - GUICtrlSetState($expMode, $GUI_UNCHECKED) - GUICtrlSetState($lblpushbulletenabled, $GUI_UNCHECKED) - GUICtrlSetState($lblpushbulletenabled, $GUI_DISABLE) - lblpushbulletenabled() - Else - GUICtrlSetState($lblpushbulletenabled, $GUI_ENABLE) - EndIf - Case $expMode - If IsChecked($expMode) Then - If IsChecked($lblpushbulletenabled) Then - SetLog(GetLangText("msgPBDisabled"), $COLOR_RED) - EndIf - GUICtrlSetState($chkNoAttack, $GUI_UNCHECKED) - GUICtrlSetState($chkDonateOnly, $GUI_UNCHECKED) - GUICtrlSetState($lblpushbulletenabled, $GUI_UNCHECKED) - GUICtrlSetState($lblpushbulletenabled, $GUI_DISABLE) - lblpushbulletenabled() - Else - GUICtrlSetState($lblpushbulletenabled, $GUI_ENABLE) - EndIf - Case $chkUpgrade1 - chkUpgrade1() - Case $chkUpgrade2 - chkUpgrade2() - Case $chkUpgrade3 - chkUpgrade3() -;~ Case $chkUpgrade4 -;~ chkUpgrade4() -;~ Case $chkUpgrade5 -;~ chkUpgrade5() -;~ Case $chkUpgrade6 -;~ chkUpgrade6() - Case $UseJPG - UseJPG() - Case $UseAttackJPG - UseAttackJPG() - Case $lblpushbulletenabled - lblpushbulletenabled() - Case $btnGitHub - ShellExecute("http://www.brokenbot.org/page.php?p=support") - Case $btnCloseBR - GUISetState(@SW_ENABLE, $frmBot) - GUISetState(@SW_HIDE, $frmBugReport) - WinActivate($frmBot) - Case $imgLogo - openWebsite() - Case $btnSaveStrat - _btnSaveStrat() - Case $lstStrategies - If $nNotifyCode = 1 Then _lstStrategies() - Case $cmbLanguage - If $nNotifyCode = 1 Then cmbLanguage() - Case $btnBBValidate - _btnBBValidate() - Case $inpBBUser - If GUICtrlRead($inpBBUser) <> $prevBBUser Then - GUICtrlSetData($btnBBValidate, "VALIDATE") - GUICtrlSetBkColor($btnBBValidate, 0xFF0000) -;~ GUICtrlSetImage($btnBBValidate, @ScriptDir & "\images\Resource\unknown.bmp") -;~ GUICtrlSetTip($btnBBValidate, GetLangText("tipBBValidCheck")) - EndIf - Case $inpBBPassword - If GUICtrlRead($inpBBPassword) <> $prevBBPass Then - GUICtrlSetData($btnBBValidate, "VALIDATE") - GUICtrlSetBkColor($btnBBValidate, 0xFF0000) -;~ GUICtrlSetImage($btnBBValidate, @ScriptDir & "\images\Resource\unknown.bmp") -;~ GUICtrlSetTip($btnBBValidate, GetLangText("tipBBValidCheck")) - EndIf - Case $lblBBRegister - lblBBRegister() - Case 10000 - If _GUICtrlTab_GetCurSel($tabMain) = 0 Then - ControlShow("", "", $txtLog) - Else - ControlHide("", "", $txtLog) - EndIf - Case Else - EndSwitch - Case 274 - Switch $wParam - Case 0xf060 - SetLog(GetLangText("msgExit"), $COLOR_ORANGE) - DllClose($KernelDLL) - _GDIPlus_Shutdown() - _Crypt_Shutdown() - _GUICtrlRichEdit_Destroy($txtLog) - SaveConfig() - Exit - EndSwitch - EndSwitch - Else - If IsArray($PluginEvents) Then - For $i = 1 To $PluginEvents[0][0] - If $nID = $PluginEvents[$i][0] And $nNotifyCode = $PluginEvents[$i][1] Then - $strPlugInInUse = IniRead($dirStrat & GUICtrlRead($lstStrategies) & ".ini", "plugin", "name", "") - Call($strPlugInInUse & $PluginEvents[$i][2]) - EndIf - Next - EndIf - EndIf - Return $GUI_RUNDEFMSG -EndFunc ;==>GUIControl - -Func btnStart() - If BitAND(GUICtrlGetState($btnStart), $GUI_SHOW) Then - - GUICtrlSetState($btnStart, $GUI_HIDE) - If IsChecked($chkBackground) Then GUICtrlSetState($btnHide, $GUI_ENABLE) - GUICtrlSetState($btnPause, $GUI_ENABLE) - GUICtrlSetData($btnPause, "Pause") - GUICtrlSetState($btnStop, $GUI_SHOW) - If _GUICtrlTab_GetCurSel($tabMain) = 1 Then - _btnSaveStrat(GUICtrlRead($lstStrategies)) - DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $frmAttackConfig, "int", 500, "long", $slideIn) - GUISetState(@SW_HIDE, $frmAttackConfig) - EndIf - GUICtrlSetState($pageGeneral, $GUI_SHOW) - $FirstAttack = True - ; Set hourly village report timer - $PushBulletvillagereportTimer = TimerInit() - - CreateLogFile() - - SaveConfig() - readConfig() - applyConfig() - - _GUICtrlEdit_SetText($txtLog, "") - - If WinExists($Title) Then - DisableBS($HWnD, $SC_MINIMIZE) - DisableBS($HWnD, $SC_CLOSE) - Initiate() - Else - Open() - EndIf - EndIf -EndFunc ;==>btnStart - -Func btnStop() - If BitAND(GUICtrlGetState($btnStop), $GUI_SHOW) Then - If $OverlayVisible Then DeleteOverlay() - GUICtrlSetData($btnStart, "Stopping...") - GUICtrlSetState($btnStart, $GUI_SHOW) - GUICtrlSetState($btnStart, $GUI_DISABLE) - GUICtrlSetState($btnPause, $GUI_DISABLE) - GUICtrlSetData($btnPause, "Pause") - GUICtrlSetState($btnStop, $GUI_HIDE) - $Raid = 0 - $PauseBot = False - $Running = False - $AttackNow = False - EnableBS($HWnD, $SC_MINIMIZE) - EnableBS($HWnD, $SC_CLOSE) - GUICtrlSetState($btnLocateBarracks, $GUI_ENABLE) - GUICtrlSetState($btnLocateDarkBarracks, $GUI_ENABLE) - GUICtrlSetState($btnLocateSFactory, $GUI_ENABLE) - GUICtrlSetState($btnLocateTownHall, $GUI_ENABLE) - GUICtrlSetState($btnLocateKingAltar, $GUI_ENABLE) - GUICtrlSetState($btnLocateQueenAltar, $GUI_ENABLE) - GUICtrlSetState($btnLocateCamp, $GUI_ENABLE) - GUICtrlSetState($btnFindWall, $GUI_ENABLE) - GUICtrlSetState($chkBackground, $GUI_ENABLE) - GUICtrlSetState($chkNoAttack, $GUI_ENABLE) - GUICtrlSetState($chkDonateOnly, $GUI_ENABLE) - GUICtrlSetState($chkForceBS, $GUI_ENABLE) - GUICtrlSetState($btnLocateClanCastle, $GUI_ENABLE) - GUICtrlSetState($chkBackground, $GUI_ENABLE) - GUICtrlSetState($cmbBoostBarracks, $GUI_ENABLE) - GUICtrlSetState($btnAtkNow, $GUI_DISABLE) - GUICtrlSetState($btnLoad, $GUI_ENABLE) - GUICtrlSetState($btnSave, $GUI_ENABLE) - If _GUICtrlTab_GetCurSel($tabMain) = 1 Then - GUISetState(@SW_HIDE, $frmAttackConfig) - DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $frmAttackConfig, "int", 500, "long", $slideOut) - GUISetState(@SW_SHOW, $frmAttackConfig) - GUICtrlSetState($DefaultTab, $GUI_SHOW) - EndIf - - ;AdlibUnRegister("SetTime") - _BlockInputEx(0, "", "", $HWnD) - - FileClose($hLogFileHandle) - SetLog(GetLangText("msgStopped"), $COLOR_ORANGE) - GUICtrlSetState($btnHide, $GUI_DISABLE) - EndIf -EndFunc ;==>btnStop - -Func btnPause() - If GUICtrlRead($btnPause) = "Pause" Then - If $OverlayVisible Then DeleteOverlay() - GUICtrlSetData($btnPause, "Resume") - If _GUICtrlTab_GetCurSel($tabMain) = 1 Then - GUISetState(@SW_HIDE, $frmAttackConfig) - DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $frmAttackConfig, "int", 500, "long", $slideOut) - GUISetState(@SW_SHOW, $frmAttackConfig) - GUICtrlSetState($DefaultTab, $GUI_SHOW) - EndIf - Else - GUICtrlSetData($btnPause, "Pause") - If _GUICtrlTab_GetCurSel($tabMain) = 1 Then - _btnSaveStrat(GUICtrlRead($lstStrategies)) - DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $frmAttackConfig, "int", 500, "long", $slideIn) - GUISetState(@SW_HIDE, $frmAttackConfig) - EndIf - GUICtrlSetState($pageGeneral, $GUI_SHOW) - EndIf -EndFunc ;==>btnPause - -Func btnAtkNow() - $AttackNow = True - GUICtrlSetState($btnAtkNow, $GUI_DISABLE) -EndFunc ;==>btnAtkNow - -Func btnLocateBarracks() - $Running = True - While 1 - ZoomOut() - LocateBarrack() - ExitLoop - WEnd - $Running = False -EndFunc ;==>btnLocateBarracks - -Func btnLocateDarkBarracks() - $Running = True - While 1 - ZoomOut() - LocateDarkBarrack() - ExitLoop - WEnd - $Running = False -EndFunc ;==>btnLocateDarkBarracks - -Func btnLocateSFactory() - $Running = True - While 1 - ZoomOut() - LocateSpellFactory() - ExitLoop - WEnd - $Running = False -EndFunc ;==>btnLocateSFactory - -Func btnLocateClanCastle() - $Running = True - While 1 - ZoomOut() - LocateClanCastle() - ExitLoop - WEnd - $Running = False -EndFunc ;==>btnLocateClanCastle - -Func btnLocateTownHall() - $Running = True - While 1 - ZoomOut() - LocateTownHall() - ExitLoop - WEnd - $Running = False -EndFunc ;==>btnLocateTownHall - -Func btnLocateKingAltar() - $Running = True - While 1 - ZoomOut() - LocateKingAltar() - ExitLoop - WEnd - $Running = False -EndFunc ;==>btnLocateKingAltar - -Func btnLocateQueenAltar() - $Running = True - While 1 - ZoomOut() - LocateQueenAltar() - ExitLoop - WEnd - $Running = False -EndFunc ;==>btnLocateQueenAltar - -Func btnLocatelist() - $Running = True - ZoomOut() - LocateBuilding() - $Running = False -EndFunc ;==>btnLocatelist -Func btnLocateUp1() - $Running = True - While 1 - ZoomOut() - LocateUpgrade1() - ExitLoop - WEnd - $Running = False -EndFunc ;==>btnLocateUp1 - -Func btnLocateUp2() - $Running = True - While 1 - ZoomOut() - LocateUpgrade2() - ExitLoop - WEnd - $Running = False -EndFunc ;==>btnLocateUp2 - -Func btnLocateUp3() - $Running = True - While 1 - ZoomOut() - LocateUpgrade3() - ExitLoop - WEnd - $Running = False -EndFunc ;==>btnLocateUp3 -Func btnLocateUp4() - $Running = True - While 1 - ZoomOut() - LocateUpgrade4() - ExitLoop - WEnd - $Running = False -EndFunc ;==>btnLocateUp4 - -Func btnLocateUp5() - $Running = True - While 1 - ZoomOut() - LocateUpgrade5() - ExitLoop - WEnd - $Running = False -EndFunc ;==>btnLocateUp5 - -Func btnLocateUp6() - $Running = True - While 1 - ZoomOut() - LocateUpgrade6() - ExitLoop - WEnd - $Running = False -EndFunc ;==>btnLocateUp6 - -Func btnFindWall() - $Running = True - GUICtrlSetState($chkWalls, $GUI_DISABLE) - GUICtrlSetState($UseGold, $GUI_DISABLE) - GUICtrlSetState($UseElixir, $GUI_DISABLE) - GUICtrlSetState($UseGoldElix, $GUI_DISABLE) - While 1 - SaveConfig() - readConfig() - applyConfig() - ZoomOut() - FindWall() - ExitLoop - WEnd - GUICtrlSetState($chkWalls, $GUI_ENABLE) - GUICtrlSetState($UseGold, $GUI_ENABLE) - GUICtrlSetState($UseElixir, $GUI_ENABLE) - GUICtrlSetState($UseGoldElix, $GUI_ENABLE) - $Running = False -EndFunc ;==>btnFindWall - -Func btnLocateCamp() - $Running = True - While 1 - ZoomOut() - Locatecamp() - ExitLoop - WEnd - $Running = False -EndFunc ;==>btnLocateCamp - -Func btnHide() - If $Hide = False Then - GUICtrlSetData($btnHide, "Show BS") - $botPos[0] = WinGetPos($Title)[0] - $botPos[1] = WinGetPos($Title)[1] - WinMove($Title, "", -32000, -32000) - $Hide = True - Else - GUICtrlSetData($btnHide, "Hide BS") - - If $botPos[0] = -32000 Then - WinMove($Title, "", 0, 0) - Else - WinMove($Title, "", $botPos[0], $botPos[1]) - WinActivate($Title) - EndIf - $Hide = False - EndIf -EndFunc ;==>btnHide - -Func chkNoAttack() - If IsChecked($chkNoAttack) Then - $CurrentMode = $modeDonateTrain - SetLog(GetLangText("msgDonateTrainMode"), $COLOR_PURPLE) - ElseIf IsChecked($chkDonateOnly) Then - If IsChecked($lblpushbulletenabled) Then - SetLog(GetLangText("msgPBDisabled"), $COLOR_RED) - EndIf - $CurrentMode = $modeDonate - SetLog(GetLangText("msgDonateMode"), $COLOR_PURPLE) - ElseIf IsChecked($expMode) Then - If IsChecked($lblpushbulletenabled) Then - SetLog(GetLangText("msgPBDisabled"), $COLOR_RED) - EndIf - $CurrentMode = $modeExperience - SetLog(GetLangText("msgGoblinMode"), $COLOR_PURPLE) - Else - $CurrentMode = $modeNormal - EndIf -EndFunc ;==>chkNoAttack - -Func chkRequest() - If IsChecked($chkRequest) Then - $ichkRequest = 1 - GUICtrlSetState($txtRequest, $GUI_ENABLE) - Else - $ichkRequest = 0 - GUICtrlSetState($txtRequest, $GUI_DISABLE) - EndIf -EndFunc ;==>chkRequest - -Func tabMain() - If _GUICtrlTab_GetCurSel($tabMain) <> $prevTab Then GUICtrlSetData($inpBBPassword, "") - If _GUICtrlTab_GetCurSel($tabMain) = 0 Then - ControlShow("", "", $txtLog) - Else - ControlHide("", "", $txtLog) - EndIf - If _GUICtrlTab_GetCurSel($tabMain) = 1 And (BotStopped(False) Or GUICtrlRead($btnPause) = "Resume") Then - GUISetState(@SW_HIDE, $frmAttackConfig) - DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $frmAttackConfig, "int", 500, "long", $slideOut) - GUISetState(@SW_SHOW, $frmAttackConfig) - GUICtrlSetState($DefaultTab, $GUI_SHOW) - ElseIf $prevTab = 1 And (BotStopped(False) Or GUICtrlRead($btnPause) = "Resume") Then - _btnSaveStrat(GUICtrlRead($lstStrategies)) - DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $frmAttackConfig, "int", 500, "long", $slideIn) - GUISetState(@SW_HIDE, $frmAttackConfig) - Else - GUISetState(@SW_HIDE, $frmAttackConfig) - EndIf - $prevTab = _GUICtrlTab_GetCurSel($tabMain) -EndFunc ;==>tabMain - -Func btnLoad($configfile) - Local $sFileOpenDialog = FileOpenDialog("Open config", @ScriptDir & "\", "Config (*.ini;)", $FD_FILEMUSTEXIST) - If @error Then - MsgBox($MB_SYSTEMMODAL, "", GetLangText("boxErrorOpening")) - FileChangeDir(@ScriptDir) - Else - FileChangeDir(@ScriptDir) - $sFileOpenDialog = StringReplace($sFileOpenDialog, "|", @CRLF) - $config = $sFileOpenDialog - readConfig() - applyConfig() - saveConfig() - MsgBox($MB_SYSTEMMODAL, "", GetLangText("boxLoadSuccess") & @CRLF & $sFileOpenDialog) - GUICtrlSetData($lblConfig, getfilename($config)) - EndIf -EndFunc ;==>btnLoad - -Func btnSave($configfile) - Local $sFileSaveDialog = FileSaveDialog("Save current config as..", "::{450D8FBA-AD25-11D0-98A8-0800361B1103}", "Config (*.ini)", $FD_PATHMUSTEXIST) - If @error Then - MsgBox($MB_SYSTEMMODAL, "", GetLangText("boxSaveFailed")) - Else - Local $sFileName = StringTrimLeft($sFileSaveDialog, StringInStr($sFileSaveDialog, "\", $STR_NOCASESENSE, -1)) - - Local $iExtension = StringInStr($sFileName, ".", $STR_NOCASESENSE) - - If $iExtension Then - If Not (StringTrimLeft($sFileName, $iExtension - 1) = ".ini") Then $sFileSaveDialog &= ".ini" - Else - $sFileSaveDialog &= ".ini" - EndIf - $config = $sFileSaveDialog - saveConfig() - MsgBox($MB_SYSTEMMODAL, "", GetLangText("boxSaveSuccess") & @CRLF & $sFileSaveDialog) - GUICtrlSetData($lblConfig, getfilename($config)) - EndIf -EndFunc ;==>btnSave - -Func chkUpgrade1() - If IsChecked($chkUpgrade1) Then - GUICtrlSetState($btnLocateUp1, $GUI_ENABLE) - Else - GUICtrlSetState($btnLocateUp1, $GUI_DISABLE) - EndIf -EndFunc ;==>chkUpgrade1 - -Func chkUpgrade2() - If IsChecked($chkUpgrade2) Then - GUICtrlSetState($btnLocateUp2, $GUI_ENABLE) - Else - GUICtrlSetState($btnLocateUp2, $GUI_DISABLE) - EndIf -EndFunc ;==>chkUpgrade2 - -Func chkUpgrade3() - If IsChecked($chkUpgrade3) Then - GUICtrlSetState($btnLocateUp3, $GUI_ENABLE) - Else - GUICtrlSetState($btnLocateUp3, $GUI_DISABLE) - EndIf -EndFunc ;==>chkUpgrade3 - -Func chkUpgrade4() - If IsChecked($chkUpgrade4) Then - GUICtrlSetState($btnLocateUp4, $GUI_ENABLE) - Else - GUICtrlSetState($btnLocateUp4, $GUI_DISABLE) - EndIf -EndFunc ;==>chkUpgrade4 - -Func chkUpgrade5() - If IsChecked($chkUpgrade5) Then - GUICtrlSetState($btnLocateUp5, $GUI_ENABLE) - Else - GUICtrlSetState($btnLocateUp5, $GUI_DISABLE) - EndIf -EndFunc ;==>chkUpgrade5 - -Func chkUpgrade6() - If IsChecked($chkUpgrade6) Then - GUICtrlSetState($btnLocateUp6, $GUI_ENABLE) - Else - GUICtrlSetState($btnLocateUp6, $GUI_DISABLE) - EndIf -EndFunc ;==>chkUpgrade6 - -Func UseJPG() - If IsChecked($UseJPG) And Not IsChecked($chkTakeLootSS) Then - GUICtrlSetState($chkTakeLootSS, $GUI_CHECKED) - EndIf -EndFunc ;==>UseJPG - -Func UseAttackJPG() - If IsChecked($UseAttackJPG) And Not IsChecked($chkTakeAttackSS) Then - GUICtrlSetState($chkTakeAttackSS, $GUI_CHECKED) - EndIf -EndFunc ;==>UseAttackJPG - -Func lblpushbulletenabled() - If IsChecked($lblpushbulletenabled) Then - GUICtrlSetState($pushbullettokenvalue, $GUI_ENABLE) - GUICtrlSetState($lblpushbulletdebug, $GUI_ENABLE) - GUICtrlSetState($lblpushbulletremote, $GUI_ENABLE) - GUICtrlSetState($lblpushbulletdelete, $GUI_ENABLE) - GUICtrlSetState($lblvillagereport, $GUI_ENABLE) - GUICtrlSetState($lblmatchfound, $GUI_ENABLE) - GUICtrlSetState($lblfreebuilder, $GUI_ENABLE) - GUICtrlSetState($lbldisconnect, $GUI_ENABLE) - GUICtrlSetState($lbllastraid, $GUI_ENABLE) - GUICtrlSetState($UseJPG, $GUI_ENABLE) - Else - GUICtrlSetState($pushbullettokenvalue, $GUI_DISABLE) - GUICtrlSetState($lblpushbulletdebug, $GUI_DISABLE) - GUICtrlSetState($lblpushbulletremote, $GUI_DISABLE) - GUICtrlSetState($lblpushbulletdelete, $GUI_DISABLE) - GUICtrlSetState($lblvillagereport, $GUI_DISABLE) - GUICtrlSetState($lblmatchfound, $GUI_DISABLE) - GUICtrlSetState($lblfreebuilder, $GUI_DISABLE) - GUICtrlSetState($lbldisconnect, $GUI_DISABLE) - GUICtrlSetState($lbllastraid, $GUI_DISABLE) - GUICtrlSetState($UseJPG, $GUI_DISABLE) - EndIf -EndFunc ;==>lblpushbulletenabled - -Func btnBugRep() - $iLines = _GUICtrlRichEdit_GetLineCount($txtLog) - $iLines = $iLines - 100 - If $iLines < 1 Then $iLines = 1 - For $dummy = $iLines To _GUICtrlRichEdit_GetLineCount($txtLog) - If $dummy > $iLines Then - GUICtrlSetData($inpLog, GUICtrlRead($inpLog) & @CRLF & _GUICtrlRichEdit_GetTextInLine($txtLog, $dummy)) - Else - GUICtrlSetData($inpLog, _GUICtrlRichEdit_GetTextInLine($txtLog, $dummy)) - EndIf - Next - - GUICtrlSetData($inpSettings, "Global Settings:") - If FileExists($config) Then - $hConfig = FileOpen($config) - While True - $strNextLine = FileReadLine($hConfig) - If @error Then ExitLoop - If StringInStr($strNextLine, "accounttoken=") Then - $strNextLine = "accounttoken=REDACTED" - EndIf - If StringInStr($strNextLine, "user=") Then - $strNextLine = "user=REDACTED" - EndIf - GUICtrlSetData($inpSettings, GUICtrlRead($inpSettings) & @CRLF & $strNextLine) - WEnd - FileClose($hConfig) - Else - GUICtrlSetData($inpSettings, GUICtrlRead($inpSettings) & @CRLF & "No settings file found") - EndIf - GUICtrlSetData($inpSettings, GUICtrlRead($inpSettings) & @CRLF & @CRLF & "Strategy settings:") - If FileExists($dirStrat & GUICtrlRead($lstStrategies) & ".ini") Then - $hConfig = FileOpen($dirStrat & GUICtrlRead($lstStrategies) & ".ini") - While True - $strNextLine = FileReadLine($hConfig) - If @error Then ExitLoop - GUICtrlSetData($inpSettings, GUICtrlRead($inpSettings) & @CRLF & $strNextLine) - WEnd - FileClose($hConfig) - Else - GUICtrlSetData($inpSettings, GUICtrlRead($inpSettings) & @CRLF & "No strategy settings file found") - EndIf - - GUISetState(@SW_DISABLE, $frmBot) - GUISetState(@SW_SHOW, $frmBugReport) - WinActivate($frmBugReport) - -EndFunc ;==>btnBugRep - -Func openWebsite() - ShellExecute("http://www.brokenbot.org/page.php?p=main") -EndFunc ;==>openWebsite - -Func _btnRefresh() - $searchfile = FileFindFirstFile($dirStrat & "*.ini") - $foundfiles = "" - While True - $newfile = FileFindNextFile($searchfile) - If @error Then ExitLoop - $strPlugInRead = IniRead($dirStrat & $newfile, "plugin", "name", "") - $arStrats = StringSplit($StratNames, "|") - For $i = 1 To $arStrats[0] - If $arStrats[$i] = $strPlugInRead Then - $foundfiles = $foundfiles & StringLeft($newfile, StringLen($newfile) - 4) & "|" - ExitLoop - EndIf - Next - WEnd - FileClose($searchfile) - If StringLen($foundfiles) > 0 Then - $foundfiles = StringLeft($foundfiles, StringLen($foundfiles) - 1) - EndIf - GUICtrlSetData($lstStrategies, "") - GUICtrlSetData($lstStrategies, $foundfiles) -EndFunc ;==>_btnRefresh - -Func _btnSaveStrat($Name = "") - $strPlugInInUse = IniRead($dirStrat & GUICtrlRead($lstStrategies) & ".ini", "plugin", "name", "") - If $Name <> "" Then - SetLOG(GetLangText("msgSaved") & $Name) - Call($strPlugInInUse & "_SaveConfig", $dirStrat & $Name & ".ini") - Else - $strNewName = InputBox(GetLangText("inpConfig"), GetLangText("inpConfigb"), GUICtrlRead($lstStrategies), " M") - If $strNewName <> "" Then - If StringRegExp($strNewName, "^[A-Za-z0-9_ -\.]+$", 0) Then - Call($strPlugInInUse & "_SaveConfig", $dirStrat & $strNewName & ".ini") - SetLOG(GetLangText("msgSaved") & $strNewName) - _btnRefresh() - _GUICtrlListBox_SetCurSel($lstStrategies, _GUICtrlListBox_FindString($lstStrategies, $strNewName)) - Else - MsgBox($MB_ICONERROR, $sBotTitle, GetLangText("boxInvalidName")) - _btnSaveStrat() - EndIf - EndIf - EndIf -EndFunc ;==>_btnSaveStrat - -Func _lstStrategies() - If GUICtrlRead($lstStrategies) <> $prevSelection Then - If $prevSelection <> "" Then _btnSaveStrat($prevSelection) - GUIDelete($frmAttackConfig) - $prevSelection = GUICtrlRead($lstStrategies) - $strPlugInInUse = IniRead($dirStrat & GUICtrlRead($lstStrategies) & ".ini", "plugin", "name", "") - $DefaultTab = Call($strPlugInInUse & "_LoadGUI") - If _GUICtrlTab_GetCurSel($tabMain) = 1 Then GUISetState(@SW_SHOW, $frmAttackConfig) - EndIf -EndFunc ;==>_lstStrategies - -Func btnLab() - LocateLab() -EndFunc ;==>btnLab - -Func cmbLanguage() - $array = _GUICtrlComboBox_GetListArray($cmbLanguage) - If $array[_GUICtrlComboBox_GetCurSel($cmbLanguage) + 1] <> $StartupLanguage Then - MsgBox(0, $array[_GUICtrlComboBox_GetCurSel($cmbLanguage) + 1], GetLangText("msgRestartNeeded")) - $StartupLanguage = $array[_GUICtrlComboBox_GetCurSel($cmbLanguage) + 1] - EndIf -EndFunc ;==>cmbLanguage - -Func _btnBBValidate() - IniWrite(@LocalAppDataDir & "\BrokenBot.org.ini", "default", "1", _Encrypt(GUICtrlRead($inpBBUser))) - IniWrite(@LocalAppDataDir & "\BrokenBot.org.ini", "default", "2", _Encrypt(GUICtrlRead($inpBBPassword))) - Local $oHTTP = ObjCreate("winhttp.winhttprequest.5.1") - $oHTTP.Open("GET", "http://forum.brokenbot.org/bot_stat_submit.php?a=auth&u=" & GUICtrlRead($inpBBUser) & "&p=" & GUICtrlRead($inpBBPassword), False) - $oHTTP.SetRequestHeader("User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5") - $oHTTP.Send("") - $authResult = $oHTTP.ResponseText() - If $authResult = 1 Then - GUICtrlSetData($btnBBValidate, "VALID") - GUICtrlSetBkColor($btnBBValidate, 0x00FF00) -;~ GUICtrlSetImage($btnBBValidate, @ScriptDir & "\images\Resource\good.bmp") - GUICtrlSetTip($btnBBValidate, GetLangText("tipBBValidGood")) - GUICtrlSetData($inpBBPassword, "") - $ValidAuth = True - Else - GUICtrlSetData($btnBBValidate, "INVALID") - GUICtrlSetBkColor($btnBBValidate, 0xFF0000) -;~ GUICtrlSetImage($btnBBValidate, @ScriptDir & "\images\Resource\bad.bmp") - GUICtrlSetTip($btnBBValidate, GetLangText("tipBBValidBad")) - $ValidAuth = False - EndIf -EndFunc ;==>_btnBBValidate - -Func lblBBRegister() - ShellExecute("http://www.brokenbot.org/page.php?p=register") -EndFunc +Opt("GUIOnEventMode", 1) +Opt("MouseClickDelay", 10) +Opt("MouseClickDownDelay", 10) +Opt("TrayMenuMode", 3) + +_GDIPlus_Startup() +_Crypt_Startup() + +Global Const $64Bit = StringInStr(@OSArch, "64") > 0 +Global Const $DEFAULT_HEIGHT = 720 +Global Const $DEFAULT_WIDTH = 860 +Global $Initiate = 0 +Global Const $REGISTRY_KEY_DIRECTORY = "HKEY_LOCAL_MACHINE\SOFTWARE\BlueStacks\Guests\Android\FrameBuffer\0" + +Func GUIControl($hWind, $iMsg, $wParam, $lParam) + Local $nNotifyCode = BitShift($wParam, 16) + Local $nID = BitAND($wParam, 0x0000FFFF) + Local $hCtrl = $lParam + #forceref $hWind, $iMsg, $wParam, $lParam + + If @error Then Return + If $hWind <> $frmAttackConfig Then + Switch $iMsg + Case 273 + Switch $nID + Case $GUI_EVENT_CLOSE + SetLog(GetLangText("msgExit"), $COLOR_ORANGE) + DllClose($KernelDLL) + _GDIPlus_Shutdown() + _Crypt_Shutdown() + _GUICtrlRichEdit_Destroy($txtLog) + SaveConfig() + Exit + Case $btnStop + btnStop() + Case $btnAtkNow + btnAtkNow() + Case $btnHide + btnHide() + Case $btnPause + btnPause() + Case $chkRequest + chkRequest() + Case $tabMain + tabMain() + Case $chkNoAttack + If IsChecked($chkNoAttack) Then + If IsChecked($lblpushbulletenabled) Then + SetLog(GetLangText("msgPBDisabled"), $COLOR_RED) + EndIf + GUICtrlSetState($chkDonateOnly, $GUI_UNCHECKED) + GUICtrlSetState($expMode, $GUI_UNCHECKED) + GUICtrlSetState($lblpushbulletenabled, $GUI_UNCHECKED) + GUICtrlSetState($lblpushbulletenabled, $GUI_DISABLE) + lblpushbulletenabled() + Else + GUICtrlSetState($lblpushbulletenabled, $GUI_ENABLE) + EndIf + Case $chkDonateOnly + If IsChecked($chkDonateOnly) Then + If IsChecked($lblpushbulletenabled) Then + SetLog(GetLangText("msgPBDisabled"), $COLOR_RED) + EndIf + GUICtrlSetState($chkNoAttack, $GUI_UNCHECKED) + GUICtrlSetState($expMode, $GUI_UNCHECKED) + GUICtrlSetState($lblpushbulletenabled, $GUI_UNCHECKED) + GUICtrlSetState($lblpushbulletenabled, $GUI_DISABLE) + lblpushbulletenabled() + Else + GUICtrlSetState($lblpushbulletenabled, $GUI_ENABLE) + EndIf + Case $expMode + If IsChecked($expMode) Then + If IsChecked($lblpushbulletenabled) Then + SetLog(GetLangText("msgPBDisabled"), $COLOR_RED) + EndIf + GUICtrlSetState($chkNoAttack, $GUI_UNCHECKED) + GUICtrlSetState($chkDonateOnly, $GUI_UNCHECKED) + GUICtrlSetState($lblpushbulletenabled, $GUI_UNCHECKED) + GUICtrlSetState($lblpushbulletenabled, $GUI_DISABLE) + lblpushbulletenabled() + Else + GUICtrlSetState($lblpushbulletenabled, $GUI_ENABLE) + EndIf + Case $chkUpgrade1 + chkUpgrade1() + Case $chkUpgrade2 + chkUpgrade2() + Case $chkUpgrade3 + chkUpgrade3() +;~ Case $chkUpgrade4 +;~ chkUpgrade4() +;~ Case $chkUpgrade5 +;~ chkUpgrade5() +;~ Case $chkUpgrade6 +;~ chkUpgrade6() + Case $UseJPG + UseJPG() + Case $UseAttackJPG + UseAttackJPG() + Case $lblpushbulletenabled + lblpushbulletenabled() + Case $btnGitHub + ShellExecute("http://www.brokenbot.org/page.php?p=support") + Case $btnCloseBR + GUISetState(@SW_ENABLE, $frmBot) + GUISetState(@SW_HIDE, $frmBugReport) + WinActivate($frmBot) + Case $imgLogo + openWebsite() + Case $btnSaveStrat + _btnSaveStrat() + Case $lstStrategies + If $nNotifyCode = 1 Then _lstStrategies() + Case $cmbLanguage + If $nNotifyCode = 1 Then cmbLanguage() + Case $btnBBValidate + _btnBBValidate() + Case $inpBBUser + If GUICtrlRead($inpBBUser) <> $prevBBUser Then + GUICtrlSetData($btnBBValidate, "VALIDATE") + GUICtrlSetBkColor($btnBBValidate, 0xFF0000) +;~ GUICtrlSetImage($btnBBValidate, @ScriptDir & "\images\Resource\unknown.bmp") +;~ GUICtrlSetTip($btnBBValidate, GetLangText("tipBBValidCheck")) + EndIf + Case $inpBBPassword + If GUICtrlRead($inpBBPassword) <> $prevBBPass Then + GUICtrlSetData($btnBBValidate, "VALIDATE") + GUICtrlSetBkColor($btnBBValidate, 0xFF0000) +;~ GUICtrlSetImage($btnBBValidate, @ScriptDir & "\images\Resource\unknown.bmp") +;~ GUICtrlSetTip($btnBBValidate, GetLangText("tipBBValidCheck")) + EndIf + Case $lblBBRegister + lblBBRegister() + Case 10000 + If _GUICtrlTab_GetCurSel($tabMain) = 0 Then + ControlShow("", "", $txtLog) + Else + ControlHide("", "", $txtLog) + EndIf + Case Else + EndSwitch + Case 274 + Switch $wParam + Case 0xf060 + SetLog(GetLangText("msgExit"), $COLOR_ORANGE) + DllClose($KernelDLL) + _GDIPlus_Shutdown() + _Crypt_Shutdown() + _GUICtrlRichEdit_Destroy($txtLog) + SaveConfig() + Exit + EndSwitch + EndSwitch + Else + If IsArray($PluginEvents) Then + For $i = 1 To $PluginEvents[0][0] + If $nID = $PluginEvents[$i][0] And $nNotifyCode = $PluginEvents[$i][1] Then + $strPlugInInUse = IniRead($dirStrat & GUICtrlRead($lstStrategies) & ".ini", "plugin", "name", "") + Call($strPlugInInUse & $PluginEvents[$i][2]) + EndIf + Next + EndIf + EndIf + Return $GUI_RUNDEFMSG +EndFunc ;==>GUIControl + +Func btnStart() + If BitAND(GUICtrlGetState($btnStart), $GUI_SHOW) Then + + GUICtrlSetState($btnStart, $GUI_HIDE) + If IsChecked($chkBackground) Then GUICtrlSetState($btnHide, $GUI_ENABLE) + GUICtrlSetState($btnPause, $GUI_ENABLE) + GUICtrlSetData($btnPause, "Pause") + GUICtrlSetState($btnStop, $GUI_SHOW) + If _GUICtrlTab_GetCurSel($tabMain) = 1 Then + _btnSaveStrat(GUICtrlRead($lstStrategies)) + DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $frmAttackConfig, "int", 500, "long", $slideIn) + GUISetState(@SW_HIDE, $frmAttackConfig) + EndIf + GUICtrlSetState($pageGeneral, $GUI_SHOW) + $FirstAttack = True + ; Set hourly village report timer + $PushBulletvillagereportTimer = TimerInit() + + CreateLogFile() + + SaveConfig() + readConfig() + applyConfig() + + _GUICtrlEdit_SetText($txtLog, "") + + If WinExists($Title) Then + DisableBS($HWnD, $SC_MINIMIZE) + DisableBS($HWnD, $SC_CLOSE) + Initiate() + Else + Open() + EndIf + EndIf +EndFunc ;==>btnStart + +Func btnStop() + If BitAND(GUICtrlGetState($btnStop), $GUI_SHOW) Then + If $OverlayVisible Then DeleteOverlay() + GUICtrlSetData($btnStart, "Stopping...") + GUICtrlSetState($btnStart, $GUI_SHOW) + GUICtrlSetState($btnStart, $GUI_DISABLE) + GUICtrlSetState($btnPause, $GUI_DISABLE) + GUICtrlSetData($btnPause, "Pause") + GUICtrlSetState($btnStop, $GUI_HIDE) + $Raid = 0 + $PauseBot = False + $Running = False + $AttackNow = False + EnableBS($HWnD, $SC_MINIMIZE) + EnableBS($HWnD, $SC_CLOSE) + GUICtrlSetState($btnLocateBarracks, $GUI_ENABLE) + GUICtrlSetState($btnLocateDarkBarracks, $GUI_ENABLE) + GUICtrlSetState($btnLocateSFactory, $GUI_ENABLE) + GUICtrlSetState($btnLocateTownHall, $GUI_ENABLE) + GUICtrlSetState($btnLocateKingAltar, $GUI_ENABLE) + GUICtrlSetState($btnLocateQueenAltar, $GUI_ENABLE) + GUICtrlSetState($btnLocateCamp, $GUI_ENABLE) + GUICtrlSetState($btnFindWall, $GUI_ENABLE) + GUICtrlSetState($chkBackground, $GUI_ENABLE) + GUICtrlSetState($chkNoAttack, $GUI_ENABLE) + GUICtrlSetState($chkDonateOnly, $GUI_ENABLE) + GUICtrlSetState($chkForceBS, $GUI_ENABLE) + GUICtrlSetState($btnLocateClanCastle, $GUI_ENABLE) + GUICtrlSetState($chkBackground, $GUI_ENABLE) + GUICtrlSetState($cmbBoostBarracks, $GUI_ENABLE) + GUICtrlSetState($btnAtkNow, $GUI_DISABLE) + GUICtrlSetState($btnLoad, $GUI_ENABLE) + GUICtrlSetState($btnSave, $GUI_ENABLE) + If _GUICtrlTab_GetCurSel($tabMain) = 1 Then + GUISetState(@SW_HIDE, $frmAttackConfig) + DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $frmAttackConfig, "int", 500, "long", $slideOut) + GUISetState(@SW_SHOW, $frmAttackConfig) + GUICtrlSetState($DefaultTab, $GUI_SHOW) + EndIf + + ;AdlibUnRegister("SetTime") + _BlockInputEx(0, "", "", $HWnD) + + FileClose($hLogFileHandle) + SetLog(GetLangText("msgStopped"), $COLOR_ORANGE) + GUICtrlSetState($btnHide, $GUI_DISABLE) + EndIf +EndFunc ;==>btnStop + +Func btnPause() + If GUICtrlRead($btnPause) = "Pause" Then + If $OverlayVisible Then DeleteOverlay() + GUICtrlSetData($btnPause, "Resume") + If _GUICtrlTab_GetCurSel($tabMain) = 1 Then + GUISetState(@SW_HIDE, $frmAttackConfig) + DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $frmAttackConfig, "int", 500, "long", $slideOut) + GUISetState(@SW_SHOW, $frmAttackConfig) + GUICtrlSetState($DefaultTab, $GUI_SHOW) + EndIf + Else + GUICtrlSetData($btnPause, "Pause") + If _GUICtrlTab_GetCurSel($tabMain) = 1 Then + _btnSaveStrat(GUICtrlRead($lstStrategies)) + DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $frmAttackConfig, "int", 500, "long", $slideIn) + GUISetState(@SW_HIDE, $frmAttackConfig) + EndIf + GUICtrlSetState($pageGeneral, $GUI_SHOW) + EndIf +EndFunc ;==>btnPause + +Func btnAtkNow() + $AttackNow = True + GUICtrlSetState($btnAtkNow, $GUI_DISABLE) +EndFunc ;==>btnAtkNow + +Func btnLocateBarracks() + $Running = True + While 1 + ZoomOut() + LocateBarrack() + ExitLoop + WEnd + $Running = False +EndFunc ;==>btnLocateBarracks + +Func btnLocateDarkBarracks() + $Running = True + While 1 + ZoomOut() + LocateDarkBarrack() + ExitLoop + WEnd + $Running = False +EndFunc ;==>btnLocateDarkBarracks + +Func btnLocateSFactory() + $Running = True + While 1 + ZoomOut() + LocateSpellFactory() + ExitLoop + WEnd + $Running = False +EndFunc ;==>btnLocateSFactory + +Func btnLocateClanCastle() + $Running = True + While 1 + ZoomOut() + LocateClanCastle() + ExitLoop + WEnd + $Running = False +EndFunc ;==>btnLocateClanCastle + +Func btnLocateTownHall() + $Running = True + While 1 + ZoomOut() + LocateTownHall() + ExitLoop + WEnd + $Running = False +EndFunc ;==>btnLocateTownHall + +Func btnLocateKingAltar() + $Running = True + While 1 + ZoomOut() + LocateKingAltar() + ExitLoop + WEnd + $Running = False +EndFunc ;==>btnLocateKingAltar + +Func btnLocateQueenAltar() + $Running = True + While 1 + ZoomOut() + LocateQueenAltar() + ExitLoop + WEnd + $Running = False +EndFunc ;==>btnLocateQueenAltar + +Func btnLocatelist() + $Running = True + ZoomOut() + LocateBuilding() + $Running = False +EndFunc ;==>btnLocatelist +Func btnLocateUp1() + $Running = True + While 1 + ZoomOut() + LocateUpgrade1() + ExitLoop + WEnd + $Running = False +EndFunc ;==>btnLocateUp1 + +Func btnLocateUp2() + $Running = True + While 1 + ZoomOut() + LocateUpgrade2() + ExitLoop + WEnd + $Running = False +EndFunc ;==>btnLocateUp2 + +Func btnLocateUp3() + $Running = True + While 1 + ZoomOut() + LocateUpgrade3() + ExitLoop + WEnd + $Running = False +EndFunc ;==>btnLocateUp3 +Func btnLocateUp4() + $Running = True + While 1 + ZoomOut() + LocateUpgrade4() + ExitLoop + WEnd + $Running = False +EndFunc ;==>btnLocateUp4 + +Func btnLocateUp5() + $Running = True + While 1 + ZoomOut() + LocateUpgrade5() + ExitLoop + WEnd + $Running = False +EndFunc ;==>btnLocateUp5 + +Func btnLocateUp6() + $Running = True + While 1 + ZoomOut() + LocateUpgrade6() + ExitLoop + WEnd + $Running = False +EndFunc ;==>btnLocateUp6 + +Func btnFindWall() + $Running = True + GUICtrlSetState($chkWalls, $GUI_DISABLE) + GUICtrlSetState($UseGold, $GUI_DISABLE) + GUICtrlSetState($UseElixir, $GUI_DISABLE) + GUICtrlSetState($UseGoldElix, $GUI_DISABLE) + While 1 + SaveConfig() + readConfig() + applyConfig() + ZoomOut() + FindWall() + ExitLoop + WEnd + GUICtrlSetState($chkWalls, $GUI_ENABLE) + GUICtrlSetState($UseGold, $GUI_ENABLE) + GUICtrlSetState($UseElixir, $GUI_ENABLE) + GUICtrlSetState($UseGoldElix, $GUI_ENABLE) + $Running = False +EndFunc ;==>btnFindWall + +Func btnLocateCamp() + $Running = True + While 1 + ZoomOut() + Locatecamp() + ExitLoop + WEnd + $Running = False +EndFunc ;==>btnLocateCamp + +Func btnHide() + If $Hide = False Then + GUICtrlSetData($btnHide, "Show BS") + $botPos[0] = WinGetPos($Title)[0] + $botPos[1] = WinGetPos($Title)[1] + WinMove($Title, "", -32000, -32000) + $Hide = True + Else + GUICtrlSetData($btnHide, "Hide BS") + + If $botPos[0] = -32000 Then + WinMove($Title, "", 0, 0) + Else + WinMove($Title, "", $botPos[0], $botPos[1]) + WinActivate($Title) + EndIf + $Hide = False + EndIf +EndFunc ;==>btnHide + +Func chkNoAttack() + If IsChecked($chkNoAttack) Then + $CurrentMode = $modeDonateTrain + SetLog(GetLangText("msgDonateTrainMode"), $COLOR_PURPLE) + ElseIf IsChecked($chkDonateOnly) Then + If IsChecked($lblpushbulletenabled) Then + SetLog(GetLangText("msgPBDisabled"), $COLOR_RED) + EndIf + $CurrentMode = $modeDonate + SetLog(GetLangText("msgDonateMode"), $COLOR_PURPLE) + ElseIf IsChecked($expMode) Then + If IsChecked($lblpushbulletenabled) Then + SetLog(GetLangText("msgPBDisabled"), $COLOR_RED) + EndIf + $CurrentMode = $modeExperience + SetLog(GetLangText("msgGoblinMode"), $COLOR_PURPLE) + Else + $CurrentMode = $modeNormal + EndIf +EndFunc ;==>chkNoAttack + +Func chkRequest() + If IsChecked($chkRequest) Then + $ichkRequest = 1 + GUICtrlSetState($txtRequest, $GUI_ENABLE) + Else + $ichkRequest = 0 + GUICtrlSetState($txtRequest, $GUI_DISABLE) + EndIf +EndFunc ;==>chkRequest + +Func tabMain() + If _GUICtrlTab_GetCurSel($tabMain) <> $prevTab Then GUICtrlSetData($inpBBPassword, "") + If _GUICtrlTab_GetCurSel($tabMain) = 0 Then + ControlShow("", "", $txtLog) + Else + ControlHide("", "", $txtLog) + EndIf + If _GUICtrlTab_GetCurSel($tabMain) = 1 And (BotStopped(False) Or GUICtrlRead($btnPause) = "Resume") Then + GUISetState(@SW_HIDE, $frmAttackConfig) + DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $frmAttackConfig, "int", 500, "long", $slideOut) + GUISetState(@SW_SHOW, $frmAttackConfig) + GUICtrlSetState($DefaultTab, $GUI_SHOW) + ElseIf $prevTab = 1 And (BotStopped(False) Or GUICtrlRead($btnPause) = "Resume") Then + _btnSaveStrat(GUICtrlRead($lstStrategies)) + DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $frmAttackConfig, "int", 500, "long", $slideIn) + GUISetState(@SW_HIDE, $frmAttackConfig) + Else + GUISetState(@SW_HIDE, $frmAttackConfig) + EndIf + $prevTab = _GUICtrlTab_GetCurSel($tabMain) +EndFunc ;==>tabMain + +Func btnLoad($configfile) + Local $sFileOpenDialog = FileOpenDialog("Open config", @ScriptDir & "\", "Config (*.ini;)", $FD_FILEMUSTEXIST) + If @error Then + MsgBox($MB_SYSTEMMODAL, "", GetLangText("boxErrorOpening")) + FileChangeDir(@ScriptDir) + Else + FileChangeDir(@ScriptDir) + $sFileOpenDialog = StringReplace($sFileOpenDialog, "|", @CRLF) + $config = $sFileOpenDialog + readConfig() + applyConfig() + saveConfig() + MsgBox($MB_SYSTEMMODAL, "", GetLangText("boxLoadSuccess") & @CRLF & $sFileOpenDialog) + GUICtrlSetData($lblConfig, getfilename($config)) + EndIf +EndFunc ;==>btnLoad + +Func btnSave($configfile) + Local $sFileSaveDialog = FileSaveDialog("Save current config as..", "::{450D8FBA-AD25-11D0-98A8-0800361B1103}", "Config (*.ini)", $FD_PATHMUSTEXIST) + If @error Then + MsgBox($MB_SYSTEMMODAL, "", GetLangText("boxSaveFailed")) + Else + Local $sFileName = StringTrimLeft($sFileSaveDialog, StringInStr($sFileSaveDialog, "\", $STR_NOCASESENSE, -1)) + + Local $iExtension = StringInStr($sFileName, ".", $STR_NOCASESENSE) + + If $iExtension Then + If Not (StringTrimLeft($sFileName, $iExtension - 1) = ".ini") Then $sFileSaveDialog &= ".ini" + Else + $sFileSaveDialog &= ".ini" + EndIf + $config = $sFileSaveDialog + saveConfig() + MsgBox($MB_SYSTEMMODAL, "", GetLangText("boxSaveSuccess") & @CRLF & $sFileSaveDialog) + GUICtrlSetData($lblConfig, getfilename($config)) + EndIf +EndFunc ;==>btnSave + +Func chkUpgrade1() + If IsChecked($chkUpgrade1) Then + GUICtrlSetState($btnLocateUp1, $GUI_ENABLE) + Else + GUICtrlSetState($btnLocateUp1, $GUI_DISABLE) + EndIf +EndFunc ;==>chkUpgrade1 + +Func chkUpgrade2() + If IsChecked($chkUpgrade2) Then + GUICtrlSetState($btnLocateUp2, $GUI_ENABLE) + Else + GUICtrlSetState($btnLocateUp2, $GUI_DISABLE) + EndIf +EndFunc ;==>chkUpgrade2 + +Func chkUpgrade3() + If IsChecked($chkUpgrade3) Then + GUICtrlSetState($btnLocateUp3, $GUI_ENABLE) + Else + GUICtrlSetState($btnLocateUp3, $GUI_DISABLE) + EndIf +EndFunc ;==>chkUpgrade3 + +Func chkUpgrade4() + If IsChecked($chkUpgrade4) Then + GUICtrlSetState($btnLocateUp4, $GUI_ENABLE) + Else + GUICtrlSetState($btnLocateUp4, $GUI_DISABLE) + EndIf +EndFunc ;==>chkUpgrade4 + +Func chkUpgrade5() + If IsChecked($chkUpgrade5) Then + GUICtrlSetState($btnLocateUp5, $GUI_ENABLE) + Else + GUICtrlSetState($btnLocateUp5, $GUI_DISABLE) + EndIf +EndFunc ;==>chkUpgrade5 + +Func chkUpgrade6() + If IsChecked($chkUpgrade6) Then + GUICtrlSetState($btnLocateUp6, $GUI_ENABLE) + Else + GUICtrlSetState($btnLocateUp6, $GUI_DISABLE) + EndIf +EndFunc ;==>chkUpgrade6 + +Func UseJPG() + If IsChecked($UseJPG) And Not IsChecked($chkTakeLootSS) Then + GUICtrlSetState($chkTakeLootSS, $GUI_CHECKED) + EndIf +EndFunc ;==>UseJPG + +Func UseAttackJPG() + If IsChecked($UseAttackJPG) And Not IsChecked($chkTakeAttackSS) Then + GUICtrlSetState($chkTakeAttackSS, $GUI_CHECKED) + EndIf +EndFunc ;==>UseAttackJPG + +Func lblpushbulletenabled() + If IsChecked($lblpushbulletenabled) Then + GUICtrlSetState($pushbullettokenvalue, $GUI_ENABLE) + GUICtrlSetState($lblpushbulletdebug, $GUI_ENABLE) + GUICtrlSetState($lblpushbulletremote, $GUI_ENABLE) + GUICtrlSetState($lblpushbulletdelete, $GUI_ENABLE) + GUICtrlSetState($lblvillagereport, $GUI_ENABLE) + GUICtrlSetState($lblmatchfound, $GUI_ENABLE) + GUICtrlSetState($lblfreebuilder, $GUI_ENABLE) + GUICtrlSetState($lbldisconnect, $GUI_ENABLE) + GUICtrlSetState($lbllastraid, $GUI_ENABLE) + GUICtrlSetState($UseJPG, $GUI_ENABLE) + Else + GUICtrlSetState($pushbullettokenvalue, $GUI_DISABLE) + GUICtrlSetState($lblpushbulletdebug, $GUI_DISABLE) + GUICtrlSetState($lblpushbulletremote, $GUI_DISABLE) + GUICtrlSetState($lblpushbulletdelete, $GUI_DISABLE) + GUICtrlSetState($lblvillagereport, $GUI_DISABLE) + GUICtrlSetState($lblmatchfound, $GUI_DISABLE) + GUICtrlSetState($lblfreebuilder, $GUI_DISABLE) + GUICtrlSetState($lbldisconnect, $GUI_DISABLE) + GUICtrlSetState($lbllastraid, $GUI_DISABLE) + GUICtrlSetState($UseJPG, $GUI_DISABLE) + EndIf +EndFunc ;==>lblpushbulletenabled + +Func btnBugRep() + $iLines = _GUICtrlRichEdit_GetLineCount($txtLog) + $iLines = $iLines - 100 + If $iLines < 1 Then $iLines = 1 + For $dummy = $iLines To _GUICtrlRichEdit_GetLineCount($txtLog) + If $dummy > $iLines Then + GUICtrlSetData($inpLog, GUICtrlRead($inpLog) & @CRLF & _GUICtrlRichEdit_GetTextInLine($txtLog, $dummy)) + Else + GUICtrlSetData($inpLog, _GUICtrlRichEdit_GetTextInLine($txtLog, $dummy)) + EndIf + Next + + GUICtrlSetData($inpSettings, "Global Settings:") + If FileExists($config) Then + $hConfig = FileOpen($config) + While True + $strNextLine = FileReadLine($hConfig) + If @error Then ExitLoop + If StringInStr($strNextLine, "accounttoken=") Then + $strNextLine = "accounttoken=REDACTED" + EndIf + If StringInStr($strNextLine, "user=") Then + $strNextLine = "user=REDACTED" + EndIf + GUICtrlSetData($inpSettings, GUICtrlRead($inpSettings) & @CRLF & $strNextLine) + WEnd + FileClose($hConfig) + Else + GUICtrlSetData($inpSettings, GUICtrlRead($inpSettings) & @CRLF & "No settings file found") + EndIf + GUICtrlSetData($inpSettings, GUICtrlRead($inpSettings) & @CRLF & @CRLF & "Strategy settings:") + If FileExists($dirStrat & GUICtrlRead($lstStrategies) & ".ini") Then + $hConfig = FileOpen($dirStrat & GUICtrlRead($lstStrategies) & ".ini") + While True + $strNextLine = FileReadLine($hConfig) + If @error Then ExitLoop + GUICtrlSetData($inpSettings, GUICtrlRead($inpSettings) & @CRLF & $strNextLine) + WEnd + FileClose($hConfig) + Else + GUICtrlSetData($inpSettings, GUICtrlRead($inpSettings) & @CRLF & "No strategy settings file found") + EndIf + + GUISetState(@SW_DISABLE, $frmBot) + GUISetState(@SW_SHOW, $frmBugReport) + WinActivate($frmBugReport) + +EndFunc ;==>btnBugRep + +Func openWebsite() + ShellExecute("http://www.brokenbot.org/page.php?p=main") +EndFunc ;==>openWebsite + +Func _btnRefresh() + $searchfile = FileFindFirstFile($dirStrat & "*.ini") + $foundfiles = "" + While True + $newfile = FileFindNextFile($searchfile) + If @error Then ExitLoop + $strPlugInRead = IniRead($dirStrat & $newfile, "plugin", "name", "") + $arStrats = StringSplit($StratNames, "|") + For $i = 1 To $arStrats[0] + If $arStrats[$i] = $strPlugInRead Then + $foundfiles = $foundfiles & StringLeft($newfile, StringLen($newfile) - 4) & "|" + ExitLoop + EndIf + Next + WEnd + FileClose($searchfile) + If StringLen($foundfiles) > 0 Then + $foundfiles = StringLeft($foundfiles, StringLen($foundfiles) - 1) + EndIf + GUICtrlSetData($lstStrategies, "") + GUICtrlSetData($lstStrategies, $foundfiles) +EndFunc ;==>_btnRefresh + +Func _btnSaveStrat($Name = "") + $strPlugInInUse = IniRead($dirStrat & GUICtrlRead($lstStrategies) & ".ini", "plugin", "name", "") + If $Name <> "" Then + SetLOG(GetLangText("msgSaved") & $Name) + Call($strPlugInInUse & "_SaveConfig", $dirStrat & $Name & ".ini") + Else + $strNewName = InputBox(GetLangText("inpConfig"), GetLangText("inpConfigb"), GUICtrlRead($lstStrategies), " M") + If $strNewName <> "" Then + If StringRegExp($strNewName, "^[A-Za-z0-9_ -\.]+$", 0) Then + Call($strPlugInInUse & "_SaveConfig", $dirStrat & $strNewName & ".ini") + SetLOG(GetLangText("msgSaved") & $strNewName) + _btnRefresh() + _GUICtrlListBox_SetCurSel($lstStrategies, _GUICtrlListBox_FindString($lstStrategies, $strNewName)) + Else + MsgBox($MB_ICONERROR, $sBotTitle, GetLangText("boxInvalidName")) + _btnSaveStrat() + EndIf + EndIf + EndIf +EndFunc ;==>_btnSaveStrat + +Func _lstStrategies() + If GUICtrlRead($lstStrategies) <> $prevSelection Then + If $prevSelection <> "" Then _btnSaveStrat($prevSelection) + GUIDelete($frmAttackConfig) + $prevSelection = GUICtrlRead($lstStrategies) + $strPlugInInUse = IniRead($dirStrat & GUICtrlRead($lstStrategies) & ".ini", "plugin", "name", "") + $DefaultTab = Call($strPlugInInUse & "_LoadGUI") + If _GUICtrlTab_GetCurSel($tabMain) = 1 Then GUISetState(@SW_SHOW, $frmAttackConfig) + EndIf +EndFunc ;==>_lstStrategies + +Func btnLab() + LocateLab() +EndFunc ;==>btnLab + +Func cmbLanguage() + $array = _GUICtrlComboBox_GetListArray($cmbLanguage) + If $array[_GUICtrlComboBox_GetCurSel($cmbLanguage) + 1] <> $StartupLanguage Then + MsgBox(0, $array[_GUICtrlComboBox_GetCurSel($cmbLanguage) + 1], GetLangText("msgRestartNeeded")) + $StartupLanguage = $array[_GUICtrlComboBox_GetCurSel($cmbLanguage) + 1] + EndIf +EndFunc ;==>cmbLanguage + +Func _btnBBValidate() + IniWrite(@LocalAppDataDir & "\BrokenBot.org.ini", "default", "1", _Encrypt(GUICtrlRead($inpBBUser))) + IniWrite(@LocalAppDataDir & "\BrokenBot.org.ini", "default", "2", _Encrypt(GUICtrlRead($inpBBPassword))) + Local $oHTTP = ObjCreate("winhttp.winhttprequest.5.1") + $oHTTP.Open("GET", "http://forum.brokenbot.org/bot_stat_submit.php?a=auth&u=" & GUICtrlRead($inpBBUser) & "&p=" & GUICtrlRead($inpBBPassword), False) + $oHTTP.SetRequestHeader("User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5") + $oHTTP.Send("") + $authResult = $oHTTP.ResponseText() + If $authResult = 1 Then + GUICtrlSetData($btnBBValidate, "VALID") + GUICtrlSetBkColor($btnBBValidate, 0x00FF00) +;~ GUICtrlSetImage($btnBBValidate, @ScriptDir & "\images\Resource\good.bmp") + GUICtrlSetTip($btnBBValidate, GetLangText("tipBBValidGood")) + GUICtrlSetData($inpBBPassword, "") + $ValidAuth = True + Else + GUICtrlSetData($btnBBValidate, "INVALID") + GUICtrlSetBkColor($btnBBValidate, 0xFF0000) +;~ GUICtrlSetImage($btnBBValidate, @ScriptDir & "\images\Resource\bad.bmp") + GUICtrlSetTip($btnBBValidate, GetLangText("tipBBValidBad")) + $ValidAuth = False + EndIf +EndFunc ;==>_btnBBValidate + +Func lblBBRegister() + ShellExecute("http://www.brokenbot.org/page.php?p=register") +EndFunc diff --git a/COCBot/GUI Design.au3 b/COCBot/GUI Design.au3 index 4480d77..e832e57 100644 --- a/COCBot/GUI Design.au3 +++ b/COCBot/GUI Design.au3 @@ -1,518 +1,528 @@ -$frmBot = GUICreate($sBotTitle, 417, 545, 207, 158) - -; --------------------------------------------------------------------------------------------------------------------- -; On all tabs --------------------------------------------------------------------------------------------------------- -; --------------------------------------------------------------------------------------------------------------------- -; BrokenBot.org -GUISetIcon(@ScriptDir & "BrokenBot.org\images\icons\brokenbot.ico") -TraySetIcon(@ScriptDir & "BrokenBot.org\images\icons\brokenbot.ico") -$imgLogo = GUICtrlCreatePic("BrokenBot.org\images\misc\brokenbot_logo.jpg", 8, 405, 401, 112) -GUICtrlSetCursor($imgLogo, 0) -; End BrokenBot.org -$btnStart = GUICtrlCreateButton(GetLangText("btnStartInit"), 20, 365, 75, 25) -GUICtrlSetOnEvent(-1, "btnStart") -GUICtrlSetBkColor($btnStart, 0xFF7E00) -GUICtrlSetState($btnStart, $GUI_DISABLE) -$btnStop = GUICtrlCreateButton(GetLangText("btnStop"), 20, 365, 75, 25) -GUICtrlSetOnEvent(-1, "btnStop") -GUICtrlSetState(-1, $GUI_HIDE) -GUICtrlSetBkColor($btnStop, 0xFF7E00) -$btnHide = GUICtrlCreateButton(GetLangText("btnHide"), 100, 365, 75, 25) -GUICtrlSetOnEvent(-1, "btnHide") -GUICtrlSetState($btnHide, $GUI_DISABLE) -$btnAtkNow = GUICtrlCreateButton(GetLangText("btnAtkNow"), 190, 365, 115, 25) -GUICtrlSetOnEvent(-1, "btnAtkNow") -GUICtrlSetState(-1, $GUI_DISABLE) -$btnPause = GUICtrlCreateButton(GetLangText("btnPause"), 320, 365, 75, 25) -GUICtrlSetOnEvent(-1, "btnPause") -GUICtrlSetState($btnPause, $GUI_DISABLE) - -$tabMain = GUICtrlCreateTab(8, 0, 403, 403, $TCS_MULTILINE) -GUICtrlSetOnEvent(-1, "tabMain") - -; --------------------------------------------------------------------------------------------------------------------- -; General Tab --------------------------------------------------------------------------------------------------------- -; --------------------------------------------------------------------------------------------------------------------- -$pageGeneral = GUICtrlCreateTabItem(GetLangText("pageGeneral")) -$txtLog = _GUICtrlRichEdit_Create($frmBot, "", 16, 45, 385, 200, BitOR($ES_MULTILINE, $ES_READONLY, $WS_VSCROLL, $WS_HSCROLL, 8912)) -$Controls = GUICtrlCreateGroup(GetLangText("Controls"), 15, 245, 385, 41) -$chkBotStop = GUICtrlCreateCheckbox("", 37, 264, 16, 16) -$cmbBotCommand = GUICtrlCreateCombo("", 60, 260, 110, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) -GUICtrlSetData(-1, GetLangText("cmbBotCommand"), GetLangText("cmbBotCommandDefault")) -$lblPC = GUICtrlCreateLabel(GetLangText("lblPC"), 178, 264, 25, 17) -$cmbBotCond = GUICtrlCreateCombo("", 198, 260, 163, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) -GUICtrlSetData(-1, GetLangText("cmbBotCond"), GetLangText("cmbBotCondDefault")) -GUICtrlCreateGroup("", -99, -99, 1, 1) - -$otherSettings = GUICtrlCreateGroup(GetLangText("otherSettings"), 15, 290, 385, 66) -$chkNoAttack = GUICtrlCreateCheckbox(GetLangText("chkNoAttack"), 24, 307, 105, 17) -GUICtrlSetBkColor($chkNoAttack, $COLOR_WHITE) -GUICtrlSetOnEvent(-1, "chkNoAttack") -GUICtrlSetState(-1, $GUI_UNCHECKED) -GUICtrlSetTip(-1, GetLangText("chkNoAttackTip")) -$chkDonateOnly = GUICtrlCreateCheckbox(GetLangText("chkDonateOnly"), 140, 307, 80, 17) -GUICtrlSetBkColor($chkDonateOnly, $COLOR_WHITE) -GUICtrlSetOnEvent(-1, "chkNoAttack") -GUICtrlSetState(-1, $GUI_UNCHECKED) -GUICtrlSetTip(-1, GetLangText("chkDonateOnlyTip")) -$expMode = GUICtrlCreateCheckbox(GetLangText("expMode"), 24, 330, 80, 17) -GUICtrlSetBkColor($chkDonateOnly, $COLOR_WHITE) -GUICtrlSetOnEvent(-1, "chkNoAttack") -GUICtrlSetState(-1, $GUI_UNCHECKED) -GUICtrlSetTip(-1, GetLangText("expModeTip")) - -$lblMaxTrophy = GUICtrlCreateLabel(GetLangText("lblMaxTrophy"), 232, 308, 75, 17) -$txtMinimumTrophy = GUICtrlCreateInput("1000", 311, 308, 32, 16, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER)) -GUICtrlSetLimit(-1, 4) -$lblMaxTrophy2 = GUICtrlCreateLabel("-", 349, 308, 5, 17) -$txtMaxTrophy = GUICtrlCreateInput("9999", 360, 308, 32, 16, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER)) -GUICtrlSetLimit(-1, 4) -$lblSnipeBelow = GUICtrlCreateLabel(GetLangText("lblSnipeBelow"), 232, 331, 75, 17) -$txtSnipeBelow = GUICtrlCreateInput("0", 360, 331, 32, 16, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER)) -GUICtrlSetLimit(-1, 4) - -; --------------------------------------------------------------------------------------------------------------------- -; Strategies ---------------------------------------------------------------------------------------------------------- -; --------------------------------------------------------------------------------------------------------------------- -$pageAttackOptions = GUICtrlCreateTabItem(GetLangText("pageAttackOptions")) -$lstStrategies = GUICtrlCreateList("", 20, 50, 375, 200) -$btnSaveStrat = GUICtrlCreateButton(GetLangText("btnSaveStrat"), 20, 240, 185, 20) -$btnRefresh = GUICtrlCreateButton(GetLangText("btnRefresh"), 210, 240, 185, 20) -$AtkSpeed = GUICtrlCreateGroup(GetLangText("AtkSpeed"), 15, 275, 385, 79) -$lblUnitDelay = GUICtrlCreateLabel(GetLangText("lblUnitDelay"), 30, 292, 75, 17) -$cmbUnitDelay = GUICtrlCreateCombo("", 90, 289, 50, 17, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) -$delaystring = "1" -For $i = 2 To 20 - $delaystring &= "|" & String($i) -Next -GUICtrlSetData(-1, $delaystring, "5") -$lblWaveDelay = GUICtrlCreateLabel(GetLangText("lblWaveDelay"), 155, 292, 75, 17) -$cmbWaveDelay = GUICtrlCreateCombo("", 225, 289, 50, 17, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) -GUICtrlSetData(-1, $delaystring, "5") -$lblAttackdelay = GUICtrlCreateLabel(GetLangText("lblAttackdelay"), 35, 315, 350, 67, $SS_CENTER) -GUICtrlCreateGroup("", -99, -99, 1, 1) - - -; --------------------------------------------------------------------------------------------------------------------- -; Donate -------------------------------------------------------------------------------------------------------------- -; --------------------------------------------------------------------------------------------------------------------- -$pageDonateSettings = GUICtrlCreateTabItem(GetLangText("pageDonateSettings")) -$cmbDonateList = GetLangText("troopNamePlBarbarian") & "|" & GetLangText("troopNamePlArcher") & "|" & GetLangText("troopNamePlGiant") & "|" & GetLangText("troopNamePlGoblin") & "|" & GetLangText("troopNamePlWallBreaker") & "|" & GetLangText("troopNamePlBalloon") & "|" & GetLangText("troopNamePlWizard") & "|" & GetLangText("troopNamePlHealer") & "|" & GetLangText("troopNamePlDragon") & "|" & GetLangText("troopNamePlPEKKA") & "|" & GetLangText("troopDarkPlMinion") & "|" & GetLangText("troopDarkPlHog") & "|" & GetLangText("troopDarkPlValkyrie") & "|" & GetLangText("troopDarkPlGolem") & "|" & GetLangText("troopDarkPlWitch") & "|" & GetLangText("troopDarkPlLavaHound") -$Donation = GUICtrlCreateGroup("", 15, 36, 385, 325) -$Barbarians = GUICtrlCreateGroup(GetLangText("Barbarians"), 20, 70, 120, 185) -$chkDonateAllBarbarians = GUICtrlCreateCheckbox(GetLangText("chkDonateAll"), 30, 95, 97, 17) -GUICtrlSetTip(-1, GetLangText("chkDonateAllTip")) -$cmbDonateBarbarians = GUICtrlCreateCombo("", 25, 120, 85, 20, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) -GUICtrlSetData(-1, $cmbDonateList, GetLangText("troopNamePlBarbarian")) -$NoOfBarbarians = GUICtrlCreateInput("5", 115, 120, 20, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER)) -GUICtrlSetLimit(-1, 1) -$txtDonateBarbarians = GUICtrlCreateEdit("", 25, 145, 110, 104, BitOR($ES_WANTRETURN, $WS_VSCROLL, $WS_HSCROLL)) -GUICtrlSetData(-1, StringFormat(GetLangText("txtDonate"))) -GUICtrlSetTip(-1, GetLangText("txtDonateBarbariansTip")) -GUICtrlCreateGroup("", -99, -99, 1, 1) -$Archers = GUICtrlCreateGroup(GetLangText("Archers"), 148, 70, 120, 185) -$chkDonateAllArchers = GUICtrlCreateCheckbox(GetLangText("chkDonateAll"), 155, 95, 97, 17) -GUICtrlSetTip(-1, GetLangText("chkDonateAllTip")) -$cmbDonateArchers = GUICtrlCreateCombo("", 153, 120, 85, 20, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) -GUICtrlSetData(-1, $cmbDonateList, GetLangText("troopNamePlArcher")) -$NoOfArchers = GUICtrlCreateInput("5", 243, 120, 20, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER)) -GUICtrlSetLimit(-1, 1) -$txtDonateArchers = GUICtrlCreateEdit("", 153, 145, 110, 104, BitOR($ES_WANTRETURN, $WS_VSCROLL, $WS_HSCROLL)) -GUICtrlSetData(-1, StringFormat(GetLangText("txtDonate"))) -GUICtrlSetTip(-1, GetLangText("txtDonateArchersTip")) -GUICtrlCreateGroup("", -99, -99, 1, 1) -$Giants = GUICtrlCreateGroup(GetLangText("Giants"), 275, 70, 120, 185) -$chkDonateAllGiants = GUICtrlCreateCheckbox(GetLangText("chkDonateAll"), 285, 95, 97, 17) -GUICtrlSetTip(-1, GetLangText("chkDonateAllTip")) -$cmbDonateGiants = GUICtrlCreateCombo("", 280, 120, 85, 20, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) -GUICtrlSetData(-1, $cmbDonateList, GetLangText("troopNamePlGiant")) -$NoOfGiants = GUICtrlCreateInput("5", 370, 120, 20, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER)) -GUICtrlSetLimit(-1, 1) -$txtDonateGiants = GUICtrlCreateEdit("", 280, 145, 110, 104, BitOR($ES_WANTRETURN, $WS_VSCROLL, $WS_HSCROLL)) -GUICtrlSetData(-1, StringFormat(GetLangText("txtDonate"))) -GUICtrlSetTip(-1, GetLangText("txtDonateGiantsTip")) -GUICtrlCreateGroup("", -99, -99, 1, 1) -$chkDonateGiants = GUICtrlCreateCheckbox(GetLangText("chkDonateGiants"), 275, 255, 97, 17) -GUICtrlSetTip(-1, GetLangText("chkDonateGiantsTip")) -GUICtrlSetState(-1, $GUI_CHECKED) -$chkDonateArchers = GUICtrlCreateCheckbox(GetLangText("chkDonateArchers"), 149, 255, 97, 17) -GUICtrlSetTip(-1, GetLangText("chkDonateArchersTip")) -GUICtrlSetState(-1, $GUI_CHECKED) -$chkDonateBarbarians = GUICtrlCreateCheckbox(GetLangText("chkDonateBarbarians"), 20, 255, 112, 17) -GUICtrlSetTip(-1, GetLangText("chkDonateBarbariansTip")) -GUICtrlSetState(-1, $GUI_CHECKED) -$chkBlacklist = GUICtrlCreateCheckbox(GetLangText("chkBlacklist"), 20, 285, 70, 17) -GUICtrlSetTip(-1, GetLangText("chkBlacklistTip") & @CRLF & GetLangText("chkBlacklistTip2")) -GUICtrlSetState(-1, $GUI_UNCHECKED) -$txtBlacklist = GUICtrlCreateEdit("", 93, 285, 300, 65, BitOR($ES_WANTRETURN, $WS_VSCROLL, $WS_HSCROLL)) -$chkRequest = GUICtrlCreateCheckbox(GetLangText("chkRequest"), 30, 45, 82, 17) -GUICtrlSetState(-1, $GUI_CHECKED) -GUICtrlSetOnEvent(-1, "chkRequest") -$txtRequest = GUICtrlCreateInput(GetLangText("txtRequestDefault"), 115, 45, 200, 21) -GUICtrlSetTip(-1, GetLangText("txtRequestTip")) -GUICtrlCreateGroup("", -99, -99, 1, 1) -$gtfo = GUICtrlCreateCheckbox(GetLangText("gtfo"), 330, 47, 50, 17) -GUICtrlSetTip(-1, GetLangText("gtfoTip")) - -; --------------------------------------------------------------------------------------------------------------------- -; Upgrade ------------------------------------------------------------------------------------------------------------- -; --------------------------------------------------------------------------------------------------------------------- -$pageUpgradeBuilding = GUICtrlCreateTabItem(GetLangText("pageUpgradeBuilding")) -$Upgrade = GUICtrlCreateGroup(GetLangText("Upgrade"), 20, 40, 375, 120) -$chkUpgrade1 = GUICtrlCreateCheckbox(GetLangText("chkUpgrade1"), 30, 65, 80, 17) -$lblUP1PosX = GUICtrlCreateLabel(GetLangText("lblUPPosX"), 112, 66, 40, 17) -$txtUpgradeX1 = GUICtrlCreateInput("", 152, 64, 31, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER, $ES_READONLY)) -$lblUP1PosY = GUICtrlCreateLabel(GetLangText("lblUPPosY"), 195, 66, 40, 17) -$txtUpgradeY1 = GUICtrlCreateInput("", 235, 64, 31, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER, $ES_READONLY)) -$btnLocateUp1 = GUICtrlCreateButton(GetLangText("btnLocateUp1"), 285, 64, 100, 21) -GUICtrlSetOnEvent(-1, "btnLocateUp1") -GUICtrlSetState(-1, $GUI_DISABLE) -$chkUpgrade2 = GUICtrlCreateCheckbox(GetLangText("chkUpgrade2"), 30, 93, 80, 17) -$lblUP2PosX = GUICtrlCreateLabel(GetLangText("lblUPPosX"), 112, 95, 40, 17) -$txtUpgradeX2 = GUICtrlCreateInput("", 152, 90, 31, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER, $ES_READONLY)) -$lblUP2PosY = GUICtrlCreateLabel(GetLangText("lblUPPosY"), 195, 95, 40, 17) -$txtUpgradeY2 = GUICtrlCreateInput("", 235, 90, 31, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER, $ES_READONLY)) -$btnLocateUp2 = GUICtrlCreateButton(GetLangText("btnLocateUp2"), 285, 90, 100, 21) -GUICtrlSetOnEvent(-1, "btnLocateUp2") -GUICtrlSetState(-1, $GUI_DISABLE) -$chkUpgrade3 = GUICtrlCreateCheckbox(GetLangText("chkUpgrade3"), 30, 123, 80, 17) -$lblUP2PosX = GUICtrlCreateLabel(GetLangText("lblUPPosX"), 112, 125, 40, 17) -$txtUpgradeX3 = GUICtrlCreateInput("", 152, 120, 31, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER, $ES_READONLY)) -$lblUP2PosY = GUICtrlCreateLabel(GetLangText("lblUPPosY"), 195, 125, 40, 17) -$txtUpgradeY3 = GUICtrlCreateInput("", 235, 120, 31, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER, $ES_READONLY)) -$btnLocateUp3 = GUICtrlCreateButton(GetLangText("btnLocateUp3"), 285, 120, 100, 21) -GUICtrlSetOnEvent(-1, "btnLocateUp3") -GUICtrlSetState(-1, $GUI_DISABLE) -GUICtrlCreateGroup("", -99, -99, 1, 1) - -;~ $Upgrade2 = GUICtrlCreateGroup(GetLangText("Upgrade2"), 20, 165, 375, 125) -;~ $chkUpgrade4 = GUICtrlCreateCheckbox(GetLangText("chkUpgrade4"), 30, 192, 80, 17) -;~ $lblUP4PosX = GUICtrlCreateLabel(GetLangText("lblUPPosX"), 112, 194, 40, 17) -;~ $txtUpgradeX4 = GUICtrlCreateInput("", 152, 189, 31, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER, $ES_READONLY)) -;~ $lblUP4PosY = GUICtrlCreateLabel(GetLangText("lblUPPosY"), 195, 194, 40, 17) -;~ $txtUpgradeY4 = GUICtrlCreateInput("", 235, 189, 31, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER, $ES_READONLY)) -;~ $btnLocateUp4 = GUICtrlCreateButton(GetLangText("btnLocateUp4"), 285, 189, 100, 21) -;~ GUICtrlSetOnEvent(-1, "btnLocateUp4") -;~ GUICtrlSetState(-1, $GUI_DISABLE) -;~ $chkUpgrade5 = GUICtrlCreateCheckbox(GetLangText("chkUpgrade5"), 30, 222, 80, 17) -;~ $lblUP5PosX = GUICtrlCreateLabel(GetLangText("lblUPPosX"), 112, 224, 40, 17) -;~ $txtUpgradeX5 = GUICtrlCreateInput("", 152, 219, 31, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER, $ES_READONLY)) -;~ $lblUP5PosY = GUICtrlCreateLabel(GetLangText("lblUPPosY"), 195, 224, 40, 17) -;~ $txtUpgradeY5 = GUICtrlCreateInput("", 235, 219, 31, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER, $ES_READONLY)) -;~ $btnLocateUp5 = GUICtrlCreateButton(GetLangText("btnLocateUp5"), 285, 219, 100, 21) -;~ GUICtrlSetOnEvent(-1, "btnLocateUp5") -;~ GUICtrlSetState(-1, $GUI_DISABLE) -;~ $chkUpgrade6 = GUICtrlCreateCheckbox(GetLangText("chkUpgrade6"), 30, 252, 80, 17) -;~ $lblUP6PosX = GUICtrlCreateLabel(GetLangText("lblUPPosX"), 112, 254, 40, 17) -;~ $txtUpgradeX6 = GUICtrlCreateInput("", 152, 249, 31, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER, $ES_READONLY)) -;~ $lblUP6PosY = GUICtrlCreateLabel(GetLangText("lblUPPosY"), 195, 254, 40, 17) -;~ $txtUpgradeY6 = GUICtrlCreateInput("", 235, 249, 31, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER, $ES_READONLY)) -;~ $btnLocateUp6 = GUICtrlCreateButton(GetLangText("btnLocateUp6"), 285, 249, 100, 21) -;~ GUICtrlSetOnEvent(-1, "btnLocateUp6") -;~ GUICtrlSetState(-1, $GUI_DISABLE) -;~ GUICtrlCreateGroup("", -99, -99, 1, 1) - -$grpLaboratory = GUICtrlCreateGroup(GetLangText("grpLaboratory"), 20, 295, 375, 55) -$chkLab = GUICtrlCreateCheckbox(GetLangText("chkLab"), 30, 320, 100, 17) -GUICtrlCreateLabel(GetLangText("lblLab"), 185, 320, 100, 17) -$cmbLabList = GetLangText("troopNamePlBarbarian") & "|" & GetLangText("troopNamePlArcher") & "|" & GetLangText("troopNamePlGiant") & "|" & GetLangText("troopNamePlGoblin") & "|" & GetLangText("troopNamePlWallBreaker") & "|" & GetLangText("troopNamePlBalloon") & "|" & GetLangText("troopNamePlWizard") & "|" & GetLangText("troopNamePlHealer") & "|" & GetLangText("troopNamePlDragon") & "|" & GetLangText("troopNamePlPEKKA") & "|" & GetLangText("spellNameLightning") & "|" & GetLangText("spellNameHealing") & "|" & GetLangText("spellNameRage") & "|" & GetLangText("spellNameJump") & "|" & GetLangText("spellNameFreeze") & "|" & GetLangText("troopDarkPlMinion") & "|" & GetLangText("troopDarkPlHog") & "|" & GetLangText("troopDarkPlValkyrie") & "|" & GetLangText("troopDarkPlGolem") & "|" & GetLangText("troopDarkPlWitch") & "|" & GetLangText("troopDarkPlLavaHound") & "|" & GetLangText("cmbNothing") -$cmbLaboratory = GUICtrlCreateCombo("", 285, 317, 100, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) -GUICtrlSetData(-1, $cmbLabList, GetLangText("troopNamePlBarbarian")) -GUICtrlCreateGroup("", -99, -99, 1, 1) - -; --------------------------------------------------------------------------------------------------------------------- -; Services ------------------------------------------------------------------------------------------------------------ -; --------------------------------------------------------------------------------------------------------------------- -$pagenotificationSetting = GUICtrlCreateTabItem(GetLangText("pagenotificationSetting")) -$lblpushbullet = GUICtrlCreateGroup(GetLangText("lblpushbullet"), 20, 40, 370, 220) -$pushbullettoken1 = GUICtrlCreateLabel(GetLangText("pushbullettoken1"), 30, 90, 80, 17, $SS_CENTER) -$pushbullettokenvalue = GUICtrlCreateInput("", 120, 90, 260, 17) -$lblpushbulletenabled = GUICtrlCreateCheckbox(GetLangText("lblpushbulletenabled"), 30, 65, 60, 17) -GUICtrlSetTip(-1, GetLangText("lblpushbulletenabledTip")) -$lblpushbulletdebug = GUICtrlCreateCheckbox(GetLangText("lblpushbulletdebug"), 100, 65, 60, 17) -GUICtrlSetTip(-1, GetLangText("lblpushbulletdebugTip")) -$lblpushbulletremote = GUICtrlCreateCheckbox(GetLangText("lblpushbulletremote"), 170, 65, 60, 17) -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")) -$lblpushbulletdelete = GUICtrlCreateCheckbox(GetLangText("lblpushbulletdelete"), 240, 65, 120, 17) -GUICtrlSetTip(-1, GetLangText("lblpushbulletdeleteTip")) - -$lblpushmessage = GUICtrlCreateGroup(GetLangText("lblpushmessage"), 30, 115, 200, 88) -$lbldisconnect = GUICtrlCreateCheckbox(GetLangText("lbldisconnect"), 40, 140, 95, 17) -$lblmatchfound = GUICtrlCreateCheckbox(GetLangText("lblmatchfound"), 40, 160, 95, 17) -$lbllastraid = GUICtrlCreateCheckbox(GetLangText("lbllastraid"), 140, 140, 80, 17) -$lblfreebuilder = GUICtrlCreateCheckbox(GetLangText("lblfreebuilder"), 140, 160, 80, 17) -$lblvillagereport = GUICtrlCreateCheckbox(GetLangText("lblvillagereport"), 40, 180, 95, 17) -$lblchatlog = GUICtrlCreateCheckbox(GetLangText("lblchatlog"), 140, 180, 80, 17) - -$lblpushbulletloot = GUICtrlCreateGroup(GetLangText("lblpushbulletloot"), 240, 115, 140, 88) -$UseJPG = GUICtrlCreateCheckbox(GetLangText("UseJPG"), 260, 135, 60, 17) -GUICtrlSetTip(-1, GetLangText("UseJPGTip")) -$UseAttackJPG = GUICtrlCreateCheckbox(GetLangText("UseAttackJPG"), 260, 155, 60, 17) -GUICtrlSetTip(-1, GetLangText("UseAttackJPGTip")) - -$lblpushUser = GUICtrlCreateLabel(GetLangText("lblpushuser"), 30, 210, 350, 20) -$inppushUser = GUICtrlCreateInput("", 30, 230, 150, 20) - -$lblStats = GUICtrlCreateGroup(GetLangText("lblBBStats"), 20, 270, 370, 85) -$lblBBUser = GUICtrlCreateLabel(GetLangText("lblBBUser"), 30, 293, 60, 20) -GUICtrlSetTip(-1, GetLangText("tipBBUser")) -$inpBBUser = GUICtrlCreateInput("", 90, 290, 90, 20) -GUICtrlSetTip(-1, GetLangText("tipBBUser")) -$lblBBPassword = GUICtrlCreateLabel(GetLangText("lblBBPassword"), 30, 323, 60, 20) -GUICtrlSetTip(-1, GetLangText("tipBBPass1") & @CRLF & @CRLF & GetLangText("tipBBPass2") & @CRLF & GetLangText("tipBBPass3") & @CRLF & @CRLF & GetLangText("tipBBPass4") & @CRLF & GetLangText("tipBBPass5") & @CRLF & GetLangText("tipBBPass6") & @CRLF & GetLangText("tipBBPass7")) -$inpBBPassword = GUICtrlCreateInput("", 90, 320, 90, 20, BitOR($ES_LEFT, $ES_AUTOHSCROLL, $ES_PASSWORD)) -GUICtrlSetTip(-1, GetLangText("tipBBPass1") & @CRLF & @CRLF & GetLangText("tipBBPass2") & @CRLF & GetLangText("tipBBPass3") & @CRLF & @CRLF & GetLangText("tipBBPass4") & @CRLF & GetLangText("tipBBPass5") & @CRLF & GetLangText("tipBBPass6") & @CRLF & GetLangText("tipBBPass7")) -$btnBBValidate = GUICtrlCreateButton("", 305, 290, 70, 20) -GUICtrlSetColor($btnBBValidate, 0xFFFFFF) -$prevBBUser = (IniRead(@LocalAppDataDir & "\BrokenBot.org.ini", "default", "1", "") = "") ? ("") : (_Decrypt(IniRead(@LocalAppDataDir & "\BrokenBot.org.ini", "default", "1", ""))) -GUICtrlSetData($inpBBUser, $prevBBUser) -$prevBBPass = "" - -;~ GUICtrlSetTip($btnBBValidate, GetLangText("tipBBValidCheck")) -;~ $chkBBSendData = GUICtrlCreateCheckbox(GetLangText("chkBBSendData"), 30, 320, 175, 20) -;~ GUICtrlSetTip($chkBBSendData, GetLangText("tipBBSendData")) - -$lblBBRegister = GUICtrlCreateLabel(GetLangText("lblBBRegister"), 230, 323, 150, 20) -GUICtrlSetColor($lblBBRegister, 0x0000FF) -GUICtrlSetCursor($lblBBRegister, 0) - -; --------------------------------------------------------------------------------------------------------------------- -; Misc ---------------------------------------------------------------------------------------------------------------- -; --------------------------------------------------------------------------------------------------------------------- -$pageMiscSettings = GUICtrlCreateTabItem(GetLangText("pageMiscSettings")) -$Miscs = GUICtrlCreateGroup(GetLangText("Miscs"), 20, 40, 375, 215) -$lblReconnect = GUICtrlCreateLabel(GetLangText("lblReconnect"), 30, 65, 100, 17) -GUICtrlSetTip(-1, GetLangText("lblReconnectTip")) -$txtReconnect = GUICtrlCreateInput("2", 130, 60, 31, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER)) -GUICtrlSetLimit(-1, 2) -$lblReconnectmin = GUICtrlCreateLabel(GetLangText("lblReconnectmin"), 165, 65, 100, 17) -$lblSpellCap = GUICtrlCreateLabel(GetLangText("lblSpellCap"), 217, 118, 120, 17) -$txtSpellCap = GUICtrlCreateInput("3", 335, 115, 50, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER)) - -$chkTrap = GUICtrlCreateCheckbox(GetLangText("chkTrap"), 270, 65, 110, 17) -GUICtrlSetState(-1, $GUI_CHECKED) -GUICtrlSetTip(-1, GetLangText("chkTrapTip")) - -$lblSearchsp = GUICtrlCreateLabel(GetLangText("lblSearchsp"), 30, 92, 100, 17) -GUICtrlSetTip(-1, GetLangText("lblSearchspTip")) -$cmbSearchsp = GUICtrlCreateCombo("", 130, 87, 45, 21, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) -GUICtrlSetData(-1, "0|1|2|3|4|5|6|7|8|9|10", "0") ; Search Base Speed -$lblSearchspd = GUICtrlCreateLabel(GetLangText("lblSearchspd"), 182, 92, 200, 17) - -$lblReturnh = GUICtrlCreateLabel(GetLangText("lblReturnh"), 30, 146, 100, 17) -GUICtrlSetTip(-1, GetLangText("lblReturnhTip")) -$txtReturnh = GUICtrlCreateInput("10", 130, 141, 31, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER)) -GUICtrlSetLimit(-1, 2) -$lblReturndelay = GUICtrlCreateLabel(GetLangText("lblReturndelay"), 165, 146, 200, 17) - -$chkWideEdge = GUICtrlCreateCheckbox(GetLangText("chkWideEdge"), 30, 180, 177, 17) -$chkClearField = GUICtrlCreateCheckbox(GetLangText("chkClearField"), 253, 180, 100, 17) -GUICtrlSetTip(-1, GetLangText("chkClearFieldTip")) - -$chkAlertSearch = GUICtrlCreateCheckbox(GetLangText("chkAlertSearch"), 30, 205, 100, 17) -$chkCollect = GUICtrlCreateCheckbox(GetLangText("chkCollect"), 30, 230, 110, 17) -GUICtrlSetState(-1, $GUI_CHECKED) -$chkTakeLootSS = GUICtrlCreateCheckbox(GetLangText("chkTakeLootSS"), 140, 205, 110, 17) -GUICtrlSetState(-1, $GUI_CHECKED) -$chkTakeTownSS = GUICtrlCreateCheckbox(GetLangText("chkTakeTownSS"), 253, 205, 141, 17) -$chkTakeAttackSS = GUICtrlCreateCheckbox(GetLangText("chkTakeAttackSS"), 140, 230, 110, 17) -GUICtrlSetTip(-1, GetLangText("chkTakeAttackSSTip")) -$chkDebug = GUICtrlCreateCheckbox(GetLangText("chkDebug"), 253, 230, 141, 17) -GUICtrlSetTip(-1, GetLangText("chkDebugTip")) -;~ If @Compiled Then GUICtrlSetState($chkDebug, $GUI_HIDE) - -$LocationSettings = GUICtrlCreateGroup(GetLangText("LocationSettings"), 20, 255, 375, 100) -$btnLocateKingAltar = GUICtrlCreateButton(GetLangText("btnLocateKingAltar"), 32, 270, 83, 25) -GUICtrlSetOnEvent(-1, "btnLocateKingAltar") -$btnLocateQueenAltar = GUICtrlCreateButton(GetLangText("btnLocateQueenAltar"), 118, 270, 83, 25) -GUICtrlSetOnEvent(-1, "btnLocateQueenAltar") -$btnLocateDarkBarracks = GUICtrlCreateButton(GetLangText("btnLocateDarkBarracks"), 213, 270, 83, 25) -GUICtrlSetOnEvent(-1, "btnLocateDarkBarracks") -$btnLocateSFactory = GUICtrlCreateButton(GetLangText("btnLocateSFactory"), 299, 270, 83, 25) -GUICtrlSetOnEvent(-1, "btnLocateSFactory") -$btnLocateTownHall = GUICtrlCreateButton(GetLangText("btnLocateTownHall"), 32, 297, 170, 25) -GUICtrlSetOnEvent(-1, "btnLocateTownHall") -$btnLocateClanCastle = GUICtrlCreateButton(GetLangText("btnLocateClanCastle"), 32, 324, 170, 25) -GUICtrlSetOnEvent(-1, "btnLocateClanCastle") -$btnLocateCamp = GUICtrlCreateButton(GetLangText("btnLocateCamp"), 213, 297, 83, 25) -GUICtrlSetOnEvent(-1, "btnLocateCamp") -$btnLab = GUICtrlCreateButton(GetLangText("btnLab"), 299, 297, 83, 25) -GUICtrlSetOnEvent(-1, "btnLab") -$btnLocateBarracks = GUICtrlCreateButton(GetLangText("btnLocateBarracks"), 213, 324, 170, 25) -GUICtrlSetOnEvent(-1, "btnLocateBarracks") -GUICtrlCreateGroup("", -99, -99, 1, 1) - -; --------------------------------------------------------------------------------------------------------------------- -; Other --------------------------------------------------------------------------------------------------------------- -; --------------------------------------------------------------------------------------------------------------------- -$pageOtherSettings = GUICtrlCreateTabItem(GetLangText("pageOtherSettings")) -$Walls = GUICtrlCreateGroup(GetLangText("Walls"), 20, 40, 375, 125) -$chkWalls = GUICtrlCreateCheckbox(GetLangText("chkWalls"), 30, 62, 110, 17) -$UseGold = GUICtrlCreateRadio(GetLangText("UseGold"), 40, 87, 115, 17) -$WallMinGold = GUICtrlCreateLabel(GetLangText("WallMinGold"), 220, 92, 76, 17) -GUICtrlSetTip(-1, GetLangText("WallMinGoldTip")) -$txtWallMinGold = GUICtrlCreateInput("1300000", 325, 87, 61, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER)) -GUICtrlSetLimit(-1, 7) -$UseElixir = GUICtrlCreateRadio(GetLangText("UseElixir"), 40, 112, 115, 17) -$WallMinElixir = GUICtrlCreateLabel(GetLangText("WallMinElixir"), 220, 117, 72, 17) -GUICtrlSetTip(-1, GetLangText("WallMinElixirTip")) -$txtWallMinElixir = GUICtrlCreateInput("1300000", 325, 112, 61, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER)) -GUICtrlSetLimit(-1, 7) -$UseGoldElix = GUICtrlCreateRadio(GetLangText("UseGoldElix"), 40, 137, 150, 17) -$lblWalls = GUICtrlCreateLabel(GetLangText("lblWalls"), 220, 64, 100, 17) -$cmbWalls = GUICtrlCreateCombo("", 325, 60, 40, 21, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) -GUICtrlSetData(-1, "4|5|6|7|8|9|10", "4") - -$lblTolerance = GUICtrlCreateLabel(GetLangText("lblTolerance"), 220, 142, 80, 17) -$cmbTolerance = GUICtrlCreateCombo("", 325, 137, 60, 17, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) -GUICtrlSetData(-1, GetLangText("cmbTolerance"), GetLangText("cmbToleranceDefault")) -$btnFindWall = GUICtrlCreateButton(GetLangText("btnFindWall"), 145, 60, 63, 21) -GUICtrlSetOnEvent(-1, "btnFindWall") -GUICtrlCreateGroup("", -99, -99, 1, 1) - -GUICtrlCreateGroup(GetLangText("grpRedLine"), 20, 200, 375, 50) -GUICtrlCreateLabel(GetLangText("lblRedLine1"), 30, 220, 83, 17) -$sldAcc = GUICtrlCreateSlider(113, 215, 195, 25, $TBS_NOTICKS) -GUICtrlSetLimit($sldAcc, 100, 0) -GUICtrlSetBkColor($sldAcc, $COLOR_WHITE) -GUICtrlSetTip($sldAcc, GetLangText("sldAccTip") & @CRLF & GetLangText("sldAccTip2")) -GUICtrlCreateLabel(GetLangText("lblRedLine2"), 320, 220, 118, 17) -GUICtrlCreateGroup("", -99, -99, 1, 1) - -$Boosts = GUICtrlCreateGroup(GetLangText("Boosts"), 20, 255, 375, 100) -$lblBoostBarracks = GUICtrlCreateLabel(GetLangText("lblBoostBarracks"), 30, 275, 100, 17) -$cmbBoostBarracks = GUICtrlCreateCombo("", 150, 271, 35, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) -GUICtrlSetData(-1, "0|1|2|3|4|5", "0") -$chkBoostKing = GUICtrlCreateCheckbox(GetLangText("chkBoostKing"), 30, 300, 65, 17) -$chkBoostQueen = GUICtrlCreateCheckbox(GetLangText("chkBoostQueen"), 115, 300, 75, 17) -$chkBoostRax1 = GUICtrlCreateCheckbox(GetLangText("chkBoostRax1"), 200, 275, 65, 17) -$chkBoostRax2 = GUICtrlCreateCheckbox(GetLangText("chkBoostRax2"), 200, 300, 65, 17) -$chkBoostRax3 = GUICtrlCreateCheckbox(GetLangText("chkBoostRax3"), 285, 275, 65, 17) -$chkBoostRax4 = GUICtrlCreateCheckbox(GetLangText("chkBoostRax4"), 285, 300, 65, 17) -$chkBoostSpell = GUICtrlCreateCheckbox(GetLangText("chkBoostSpell"), 30, 325, 90, 17) -$chkBoostDB1 = GUICtrlCreateCheckbox(GetLangText("chkBoostDB1"), 140, 325, 90, 17) -$chkBoostDB2 = GUICtrlCreateCheckbox(GetLangText("chkBoostDB2"), 250, 325, 90, 17) -GUICtrlCreateGroup("", -99, -99, 1, 1) - -; --------------------------------------------------------------------------------------------------------------------- -; Stats --------------------------------------------------------------------------------------------------------------- -; --------------------------------------------------------------------------------------------------------------------- -$pageStatsSetting = GUICtrlCreateTabItem(GetLangText("pageStatsSetting")) -$resourceonstart = GUICtrlCreateGroup(GetLangText("resourceonstart"), 20, 40, 185, 120) -$lblgoldonstart = GUICtrlCreateLabel(GetLangText("lblgoldonstart"), 50, 68, 65, 17) -$lblresultgoldtstart = GUICtrlCreateLabel("0", 128, 68, 60, 17, $SS_RIGHT) -GUICtrlCreatePic(@ScriptDir & "\images\Resource\Gold.jpg", 30, 68, 15, 15) -$lblelixironstart = GUICtrlCreateLabel(GetLangText("lblelixironstart"), 50, 88, 65, 17) -$lblresultelixirstart = GUICtrlCreateLabel("0", 128, 88, 60, 17, $SS_RIGHT) -GUICtrlCreatePic(@ScriptDir & "\images\Resource\Elixir.jpg", 30, 88, 15, 15) -$lbldeonstart = GUICtrlCreateLabel(GetLangText("lbldeonstart"), 50, 108, 60, 17) -$lblresultdestart = GUICtrlCreateLabel("0", 128, 108, 60, 17, $SS_RIGHT) -GUICtrlCreatePic(@ScriptDir & "\images\Resource\Dark.jpg", 30, 108, 15, 15) -$lbltrophyonstart = GUICtrlCreateLabel(GetLangText("lbltrophyonstart"), 50, 128, 100, 17) -$lblresulttrophystart = GUICtrlCreateLabel("0", 128, 128, 60, 17, $SS_RIGHT) -GUICtrlCreatePic(@ScriptDir & "\images\Resource\Trophy.jpg", 30, 128, 15, 15) -GUICtrlCreateGroup("", -99, -99, 1, 1) - -$Currentresource = GUICtrlCreateGroup(GetLangText("Currentresource"), 210, 40, 185, 120) -$lblvillagesattacked = GUICtrlCreateLabel(GetLangText("lblvillagesattacked"), 220, 68, 100, 17) -$lblresultvillagesattacked = GUICtrlCreateLabel("0", 318, 68, 60, 17, $SS_RIGHT) -$lblvillagesskipped = GUICtrlCreateLabel(GetLangText("lblvillagesskipped"), 220, 83, 100, 17) -$lblresultvillagesskipped = GUICtrlCreateLabel("0", 318, 83, 60, 17, $SS_RIGHT) -$lblsearchdisconnected = GUICtrlCreateLabel(GetLangText("lblDisconnected"), 220, 98, 100, 17) -$lblresultsearchdisconnected = GUICtrlCreateLabel("0", 318, 98, 60, 17, $SS_RIGHT) -$lblsearchcost = GUICtrlCreateLabel(GetLangText("lblsearchcost"), 220, 113, 100, 17) -$lblresultsearchcost = GUICtrlCreateLabel("0", 318, 113, 60, 17, $SS_RIGHT) -$lblruntime = GUICtrlCreateLabel(GetLangText("lblruntime"), 220, 128, 100, 17) -$lblresultruntime = GUICtrlCreateLabel("00:00:00", 318, 128, 60, 17, $SS_RIGHT) -GUICtrlCreateGroup("", -99, -99, 1, 1) - -$LastLoot = GUICtrlCreateGroup(GetLangText("LastLoot"), 20, 160, 375, 70) -$lblwallupgrade = GUICtrlCreateLabel(GetLangText("lblwallupgrade"), 50, 185, 100, 17) -$lblwallupgradecount = GUICtrlCreateLabel("0", 128, 185, 60, 17, $SS_RIGHT) -GUICtrlCreatePic(@ScriptDir & "\images\Resource\Wall.jpg", 30, 186, 15, 15) -GUICtrlCreateGroup("", -99, -99, 1, 1) - -$CurrentLoot = GUICtrlCreateGroup(GetLangText("CurrentLoot"), 20, 230, 185, 110) -$lblgoldnow = GUICtrlCreateLabel(GetLangText("lblgoldnow"), 50, 253, 60, 17) -$lblresultgoldnow = GUICtrlCreateLabel("0", 128, 253, 60, 17, $SS_RIGHT) -GUICtrlCreatePic(@ScriptDir & "\images\Resource\Gold.jpg", 30, 253, 15, 15) -$lblelixirnow = GUICtrlCreateLabel(GetLangText("lblelixirnow"), 50, 273, 60, 17) -$lblresultelixirnow = GUICtrlCreateLabel("0", 128, 273, 60, 17, $SS_RIGHT) -GUICtrlCreatePic(@ScriptDir & "\images\Resource\Elixir.jpg", 30, 273, 15, 15) -$lbldenow = GUICtrlCreateLabel(GetLangText("lbldenow"), 50, 293, 60, 17) -$lblresultdenow = GUICtrlCreateLabel("0", 128, 293, 60, 17, $SS_RIGHT) -GUICtrlCreatePic(@ScriptDir & "\images\Resource\Dark.jpg", 30, 293, 15, 15) -$lbltrophynow = GUICtrlCreateLabel(GetLangText("lbltrophynow"), 50, 313, 100, 17) -$lblresulttrophynow = GUICtrlCreateLabel("0", 128, 313, 60, 17, $SS_RIGHT) -GUICtrlCreatePic(@ScriptDir & "\images\Resource\Trophy.jpg", 30, 313, 15, 15) -GUICtrlCreateGroup("", -99, -99, 1, 1) - -$totalresource = GUICtrlCreateGroup(GetLangText("totalresource"), 210, 230, 185, 110) -$lblgoldgain = GUICtrlCreateLabel(GetLangText("lblgoldgain"), 250, 253, 100, 17) -$lblresultgoldgain = GUICtrlCreateLabel("0", 318, 253, 60, 17, $SS_RIGHT) -GUICtrlCreatePic(@ScriptDir & "\images\Resource\Gold.jpg", 230, 253, 15, 15) -$lblelixirgain = GUICtrlCreateLabel(GetLangText("lblelixirgain"), 250, 273, 100, 17) -$lblresultelixirgain = GUICtrlCreateLabel("0", 318, 273, 60, 17, $SS_RIGHT) -GUICtrlCreatePic(@ScriptDir & "\images\Resource\Elixir.jpg", 230, 273, 15, 15) -$lbldegain = GUICtrlCreateLabel(GetLangText("lbldegain"), 250, 293, 100, 17) -$lblresultdegain = GUICtrlCreateLabel("0", 318, 293, 60, 17, $SS_RIGHT) -GUICtrlCreatePic(@ScriptDir & "\images\Resource\Dark.jpg", 230, 293, 15, 15) -$lbltrophygain = GUICtrlCreateLabel(GetLangText("lbltrophygain"), 250, 313, 100, 17) -$lblresulttrophygain = GUICtrlCreateLabel("0", 318, 313, 60, 17, $SS_RIGHT) -GUICtrlCreatePic(@ScriptDir & "\images\Resource\Trophy.jpg", 230, 313, 15, 15) -GUICtrlCreateGroup("", -99, -99, 1, 1) - -; --------------------------------------------------------------------------------------------------------------------- -; Configuration ------------------------------------------------------------------------------------------------------- -; --------------------------------------------------------------------------------------------------------------------- -$pageConfigLoadSave = GUICtrlCreateTabItem(GetLangText("pageConfigLoadSave")) -$ConfigLoadSave = GUICtrlCreateGroup(GetLangText("ConfigLoadSave"), 20, 40, 375, 65) -$btnLoad = GUICtrlCreateButton(GetLangText("btnLoad"), 180, 64, 97, 25) -GUICtrlSetOnEvent(-1, "btnLoad") -$btnSave = GUICtrlCreateButton(GetLangText("btnSave"), 280, 64, 97, 25) -GUICtrlSetOnEvent(-1, "btnSave") -$lblConfig = GUICtrlCreateLabel(getfilename($config), 40, 70, 112, 17) -GUICtrlCreateGroup("", -99, -99, 1, 1) - -$grpLanguage = GUICtrlCreateGroup(GetLangText("grpLanguage"), 20, 110, 375, 50) -$cmbLanguage = GUICtrlCreateCombo("", 30, 130, 347, 20, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) -PopulateLanguages() -_GUICtrlComboBox_SetCurSel($cmbLanguage, _GUICtrlComboBox_FindStringExact($cmbLanguage, $StartupLanguage)) - -$chkSpeedBoost = GUICtrlCreateCheckbox(GetLangText("chkSpeedBoost"), 40, 170, 100, 15) -GUICtrlSetTip(-1, GetLangText("chkSpeedBoostTip")) - -$grpUpdate = GUICtrlCreateGroup(GetLangText("grpUpdate"), 20, 225, 375, 60) -$chkUpdate = GUICtrlCreateCheckbox(GetLangText("chkUpdate"), 40, 250, 225, 15) -GUICtrlSetBkColor($chkUpdate, $COLOR_WHITE) -GUICtrlSetState(-1, $GUI_UNCHECKED) -$btnBugRep = GUICtrlCreateButton(GetLangText("btnBugRep"), 300, 250, 75, 20) -GUICtrlSetOnEvent(-1, "btnBugRep") - -$grpBluestacks = GUICtrlCreateGroup(GetLangText("grpBluestacks"), 20, 295, 375, 60) -$chkBackground = GUICtrlCreateCheckbox(GetLangText("chkBackground"), 40, 320, 105, 15) -GUICtrlSetBkColor($chkBackground, $COLOR_WHITE) -GUICtrlSetState(-1, $GUI_UNCHECKED) -GUICtrlSetTip(-1, GetLangText("chkBackgroundTip")) -$chkForceBS = GUICtrlCreateCheckbox(GetLangText("chkForceBS"), 175, 320, 105, 15) -GUICtrlSetBkColor($chkForceBS, $COLOR_WHITE) -GUICtrlSetOnEvent(-1, "chkForceBS") -GUICtrlSetState(-1, $GUI_UNCHECKED) -GUICtrlSetTip(-1, GetLangText("chkForceBSTip")) -$chkStayAlive = GUICtrlCreateCheckbox(GetLangText("chkStayAlive"), 290, 320, 75, 15) -GUICtrlSetBkColor($chkStayAlive, $COLOR_WHITE) -GUICtrlSetState(-1, $GUI_UNCHECKED) -GUICtrlSetTip(-1, GetLangText("chkStayAliveTip")) -GUICtrlCreateGroup("", -99, -99, 1, 1) - -GUICtrlCreateTabItem("") - -; --------------------------------------------------------------------------------------------------------------------- -; Status Bar ---------------------------------------------------------------------------------------------------------- -; --------------------------------------------------------------------------------------------------------------------- -$statLog = _GUICtrlStatusBar_Create($frmBot) -_GUICtrlStatusBar_SetSimple($statLog) -_GUICtrlStatusBar_SetText($statLog, GetLangText("statLogDefault")) -$tiAbout = TrayCreateItem(GetLangText("tiAbout")) -TrayCreateItem("") -$tiExit = TrayCreateItem(GetLangText("tiExit")) +$frmBot = GUICreate($sBotTitle, 417, 545, 207, 158) + +; --------------------------------------------------------------------------------------------------------------------- +; On all tabs --------------------------------------------------------------------------------------------------------- +; --------------------------------------------------------------------------------------------------------------------- +; BrokenBot.org +GUISetIcon(@ScriptDir & "BrokenBot.org\images\icons\brokenbot.ico") +TraySetIcon(@ScriptDir & "BrokenBot.org\images\icons\brokenbot.ico") +$imgLogo = GUICtrlCreatePic("BrokenBot.org\images\misc\brokenbot_logo.jpg", 8, 405, 401, 112) +GUICtrlSetCursor($imgLogo, 0) +; End BrokenBot.org +$btnStart = GUICtrlCreateButton(GetLangText("btnStartInit"), 20, 365, 75, 25) +GUICtrlSetOnEvent(-1, "btnStart") +GUICtrlSetBkColor($btnStart, 0xFF7E00) +GUICtrlSetState($btnStart, $GUI_DISABLE) +$btnStop = GUICtrlCreateButton(GetLangText("btnStop"), 20, 365, 75, 25) +GUICtrlSetOnEvent(-1, "btnStop") +GUICtrlSetState(-1, $GUI_HIDE) +GUICtrlSetBkColor($btnStop, 0xFF7E00) +$btnHide = GUICtrlCreateButton(GetLangText("btnHide"), 100, 365, 75, 25) +GUICtrlSetOnEvent(-1, "btnHide") +GUICtrlSetState($btnHide, $GUI_DISABLE) +$btnAtkNow = GUICtrlCreateButton(GetLangText("btnAtkNow"), 190, 365, 115, 25) +GUICtrlSetOnEvent(-1, "btnAtkNow") +GUICtrlSetState(-1, $GUI_DISABLE) +$btnPause = GUICtrlCreateButton(GetLangText("btnPause"), 320, 365, 75, 25) +GUICtrlSetOnEvent(-1, "btnPause") +GUICtrlSetState($btnPause, $GUI_DISABLE) + +$tabMain = GUICtrlCreateTab(8, 0, 403, 403, $TCS_MULTILINE) +GUICtrlSetOnEvent(-1, "tabMain") + +; --------------------------------------------------------------------------------------------------------------------- +; General Tab --------------------------------------------------------------------------------------------------------- +; --------------------------------------------------------------------------------------------------------------------- +$pageGeneral = GUICtrlCreateTabItem(GetLangText("pageGeneral")) +$txtLog = _GUICtrlRichEdit_Create($frmBot, "", 16, 45, 385, 200, BitOR($ES_MULTILINE, $ES_READONLY, $WS_VSCROLL, $WS_HSCROLL, 8912)) +$Controls = GUICtrlCreateGroup(GetLangText("Controls"), 15, 245, 385, 41) +$chkBotStop = GUICtrlCreateCheckbox("", 37, 264, 16, 16) +$cmbBotCommand = GUICtrlCreateCombo("", 60, 260, 110, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) +GUICtrlSetData(-1, GetLangText("cmbBotPre") & GetLangText("cmbBotCommand"), GetLangText("cmbBotCommandDefault")) +$lblPC = GUICtrlCreateLabel(GetLangText("lblPC"), 178, 264, 25, 17) +$cmbBotCond = GUICtrlCreateCombo("", 198, 260, 163, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) +GUICtrlSetData(-1, GetLangText("cmbBotCondAdd") & GetLangText("cmbBotCondMore") & GetLangText("cmbBotCond"), GetLangText("cmbBotCondDefault")) +GUICtrlCreateGroup("", -99, -99, 1, 1) + +$otherSettings = GUICtrlCreateGroup(GetLangText("otherSettings"), 15, 290, 385, 66) +$chkNoAttack = GUICtrlCreateCheckbox(GetLangText("chkNoAttack"), 24, 307, 105, 17) +GUICtrlSetBkColor($chkNoAttack, $COLOR_WHITE) +GUICtrlSetOnEvent(-1, "chkNoAttack") +GUICtrlSetState(-1, $GUI_UNCHECKED) +GUICtrlSetTip(-1, GetLangText("chkNoAttackTip")) +$chkDonateOnly = GUICtrlCreateCheckbox(GetLangText("chkDonateOnly"), 140, 307, 80, 17) +GUICtrlSetBkColor($chkDonateOnly, $COLOR_WHITE) +GUICtrlSetOnEvent(-1, "chkNoAttack") +GUICtrlSetState(-1, $GUI_UNCHECKED) +GUICtrlSetTip(-1, GetLangText("chkDonateOnlyTip")) +$expMode = GUICtrlCreateCheckbox(GetLangText("expMode"), 24, 330, 80, 17) +GUICtrlSetBkColor($chkDonateOnly, $COLOR_WHITE) +GUICtrlSetOnEvent(-1, "chkNoAttack") +GUICtrlSetState(-1, $GUI_UNCHECKED) +GUICtrlSetTip(-1, GetLangText("expModeTip")) + +$lblMaxTrophy = GUICtrlCreateLabel(GetLangText("lblMaxTrophy"), 232, 308, 75, 17) +$txtMinimumTrophy = GUICtrlCreateInput("1000", 311, 308, 32, 16, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER)) +GUICtrlSetLimit(-1, 4) +$lblMaxTrophy2 = GUICtrlCreateLabel("-", 349, 308, 5, 17) +$txtMaxTrophy = GUICtrlCreateInput("9999", 360, 308, 32, 16, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER)) +GUICtrlSetLimit(-1, 4) +$lblSnipeBelow = GUICtrlCreateLabel(GetLangText("lblSnipeBelow"), 232, 331, 75, 17) +$txtSnipeBelow = GUICtrlCreateInput("0", 360, 331, 32, 16, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER)) +GUICtrlSetLimit(-1, 4) + +; --------------------------------------------------------------------------------------------------------------------- +; Strategies ---------------------------------------------------------------------------------------------------------- +; --------------------------------------------------------------------------------------------------------------------- +$pageAttackOptions = GUICtrlCreateTabItem(GetLangText("pageAttackOptions")) +$lstStrategies = GUICtrlCreateList("", 20, 50, 375, 200) +$btnSaveStrat = GUICtrlCreateButton(GetLangText("btnSaveStrat"), 20, 240, 185, 20) +$btnRefresh = GUICtrlCreateButton(GetLangText("btnRefresh"), 210, 240, 185, 20) +$AtkSpeed = GUICtrlCreateGroup(GetLangText("AtkSpeed"), 15, 275, 385, 79) +$lblUnitDelay = GUICtrlCreateLabel(GetLangText("lblUnitDelay"), 30, 292, 75, 17) +$cmbUnitDelay = GUICtrlCreateCombo("", 90, 289, 50, 17, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) +$delaystring = "1" +For $i = 2 To 20 + $delaystring &= "|" & String($i) +Next +GUICtrlSetData(-1, $delaystring, "5") +$lblWaveDelay = GUICtrlCreateLabel(GetLangText("lblWaveDelay"), 155, 292, 75, 17) +$cmbWaveDelay = GUICtrlCreateCombo("", 225, 289, 50, 17, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) +GUICtrlSetData(-1, $delaystring, "5") +$lblAttackdelay = GUICtrlCreateLabel(GetLangText("lblAttackdelay"), 35, 315, 350, 67, $SS_CENTER) +GUICtrlCreateGroup("", -99, -99, 1, 1) + + +; --------------------------------------------------------------------------------------------------------------------- +; Donate -------------------------------------------------------------------------------------------------------------- +; --------------------------------------------------------------------------------------------------------------------- +$pageDonateSettings = GUICtrlCreateTabItem(GetLangText("pageDonateSettings")) +$cmbDonateList = GetLangText("troopNamePlBarbarian") & "|" & GetLangText("troopNamePlArcher") & "|" & GetLangText("troopNamePlGiant") & "|" & GetLangText("troopNamePlGoblin") & "|" & GetLangText("troopNamePlWallBreaker") & "|" & GetLangText("troopNamePlBalloon") & "|" & GetLangText("troopNamePlWizard") & "|" & GetLangText("troopNamePlHealer") & "|" & GetLangText("troopNamePlDragon") & "|" & GetLangText("troopNamePlPEKKA") & "|" & GetLangText("troopDarkPlMinion") & "|" & GetLangText("troopDarkPlHog") & "|" & GetLangText("troopDarkPlValkyrie") & "|" & GetLangText("troopDarkPlGolem") & "|" & GetLangText("troopDarkPlWitch") & "|" & GetLangText("troopDarkPlLavaHound") +$Donation = GUICtrlCreateGroup("", 15, 36, 385, 325) +$Barbarians = GUICtrlCreateGroup(GetLangText("Barbarians"), 20, 70, 120, 185) +$chkDonateAllBarbarians = GUICtrlCreateCheckbox(GetLangText("chkDonateAll"), 30, 95, 97, 17) +GUICtrlSetTip(-1, GetLangText("chkDonateAllTip")) +$cmbDonateBarbarians = GUICtrlCreateCombo("", 25, 120, 85, 20, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) +GUICtrlSetData(-1, $cmbDonateList, GetLangText("troopNamePlBarbarian")) +$NoOfBarbarians = GUICtrlCreateInput("5", 115, 120, 20, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER)) +GUICtrlSetLimit(-1, 1) +$txtDonateBarbarians = GUICtrlCreateEdit("", 25, 145, 110, 104, BitOR($ES_WANTRETURN, $WS_VSCROLL, $WS_HSCROLL)) +GUICtrlSetData(-1, StringFormat(GetLangText("txtDonate"))) +GUICtrlSetTip(-1, GetLangText("txtDonateBarbariansTip")) +GUICtrlCreateGroup("", -99, -99, 1, 1) +$Archers = GUICtrlCreateGroup(GetLangText("Archers"), 148, 70, 120, 185) +$chkDonateAllArchers = GUICtrlCreateCheckbox(GetLangText("chkDonateAll"), 155, 95, 97, 17) +GUICtrlSetTip(-1, GetLangText("chkDonateAllTip")) +$cmbDonateArchers = GUICtrlCreateCombo("", 153, 120, 85, 20, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) +GUICtrlSetData(-1, $cmbDonateList, GetLangText("troopNamePlArcher")) +$NoOfArchers = GUICtrlCreateInput("5", 243, 120, 20, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER)) +GUICtrlSetLimit(-1, 1) +$txtDonateArchers = GUICtrlCreateEdit("", 153, 145, 110, 104, BitOR($ES_WANTRETURN, $WS_VSCROLL, $WS_HSCROLL)) +GUICtrlSetData(-1, StringFormat(GetLangText("txtDonate"))) +GUICtrlSetTip(-1, GetLangText("txtDonateArchersTip")) +GUICtrlCreateGroup("", -99, -99, 1, 1) +$Giants = GUICtrlCreateGroup(GetLangText("Giants"), 275, 70, 120, 185) +$chkDonateAllGiants = GUICtrlCreateCheckbox(GetLangText("chkDonateAll"), 285, 95, 97, 17) +GUICtrlSetTip(-1, GetLangText("chkDonateAllTip")) +$cmbDonateGiants = GUICtrlCreateCombo("", 280, 120, 85, 20, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) +GUICtrlSetData(-1, $cmbDonateList, GetLangText("troopNamePlGiant")) +$NoOfGiants = GUICtrlCreateInput("5", 370, 120, 20, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER)) +GUICtrlSetLimit(-1, 1) +$txtDonateGiants = GUICtrlCreateEdit("", 280, 145, 110, 104, BitOR($ES_WANTRETURN, $WS_VSCROLL, $WS_HSCROLL)) +GUICtrlSetData(-1, StringFormat(GetLangText("txtDonate"))) +GUICtrlSetTip(-1, GetLangText("txtDonateGiantsTip")) +GUICtrlCreateGroup("", -99, -99, 1, 1) +$chkDonateGiants = GUICtrlCreateCheckbox(GetLangText("chkDonateGiants"), 275, 255, 97, 17) +GUICtrlSetTip(-1, GetLangText("chkDonateGiantsTip")) +GUICtrlSetState(-1, $GUI_CHECKED) +$chkDonateArchers = GUICtrlCreateCheckbox(GetLangText("chkDonateArchers"), 149, 255, 97, 17) +GUICtrlSetTip(-1, GetLangText("chkDonateArchersTip")) +GUICtrlSetState(-1, $GUI_CHECKED) +$chkDonateBarbarians = GUICtrlCreateCheckbox(GetLangText("chkDonateBarbarians"), 20, 255, 112, 17) +GUICtrlSetTip(-1, GetLangText("chkDonateBarbariansTip")) +GUICtrlSetState(-1, $GUI_CHECKED) +$chkBlacklist = GUICtrlCreateCheckbox(GetLangText("chkBlacklist"), 20, 285, 70, 17) +GUICtrlSetTip(-1, GetLangText("chkBlacklistTip") & @CRLF & GetLangText("chkBlacklistTip2")) +GUICtrlSetState(-1, $GUI_UNCHECKED) +$txtBlacklist = GUICtrlCreateEdit("", 93, 285, 300, 65, BitOR($ES_WANTRETURN, $WS_VSCROLL, $WS_HSCROLL)) +$chkRequest = GUICtrlCreateCheckbox(GetLangText("chkRequest"), 30, 45, 82, 17) +GUICtrlSetState(-1, $GUI_CHECKED) +GUICtrlSetOnEvent(-1, "chkRequest") +$txtRequest = GUICtrlCreateInput(GetLangText("txtRequestDefault"), 115, 45, 200, 21) +GUICtrlSetTip(-1, GetLangText("txtRequestTip")) +GUICtrlCreateGroup("", -99, -99, 1, 1) +$gtfo = GUICtrlCreateCheckbox(GetLangText("gtfo"), 330, 47, 50, 17) +GUICtrlSetTip(-1, GetLangText("gtfoTip")) + +; --------------------------------------------------------------------------------------------------------------------- +; Upgrade ------------------------------------------------------------------------------------------------------------- +; --------------------------------------------------------------------------------------------------------------------- +$pageUpgradeBuilding = GUICtrlCreateTabItem(GetLangText("pageUpgradeBuilding")) +$Upgrade = GUICtrlCreateGroup(GetLangText("Upgrade"), 20, 40, 375, 120) +$chkUpgrade1 = GUICtrlCreateCheckbox(GetLangText("chkUpgrade1"), 30, 65, 80, 17) +$lblUP1PosX = GUICtrlCreateLabel(GetLangText("lblUPPosX"), 112, 66, 40, 17) +$txtUpgradeX1 = GUICtrlCreateInput("", 152, 64, 31, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER, $ES_READONLY)) +$lblUP1PosY = GUICtrlCreateLabel(GetLangText("lblUPPosY"), 195, 66, 40, 17) +$txtUpgradeY1 = GUICtrlCreateInput("", 235, 64, 31, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER, $ES_READONLY)) +$btnLocateUp1 = GUICtrlCreateButton(GetLangText("btnLocateUp1"), 285, 64, 100, 21) +GUICtrlSetOnEvent(-1, "btnLocateUp1") +GUICtrlSetState(-1, $GUI_DISABLE) +$chkUpgrade2 = GUICtrlCreateCheckbox(GetLangText("chkUpgrade2"), 30, 93, 80, 17) +$lblUP2PosX = GUICtrlCreateLabel(GetLangText("lblUPPosX"), 112, 95, 40, 17) +$txtUpgradeX2 = GUICtrlCreateInput("", 152, 90, 31, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER, $ES_READONLY)) +$lblUP2PosY = GUICtrlCreateLabel(GetLangText("lblUPPosY"), 195, 95, 40, 17) +$txtUpgradeY2 = GUICtrlCreateInput("", 235, 90, 31, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER, $ES_READONLY)) +$btnLocateUp2 = GUICtrlCreateButton(GetLangText("btnLocateUp2"), 285, 90, 100, 21) +GUICtrlSetOnEvent(-1, "btnLocateUp2") +GUICtrlSetState(-1, $GUI_DISABLE) +$chkUpgrade3 = GUICtrlCreateCheckbox(GetLangText("chkUpgrade3"), 30, 123, 80, 17) +$lblUP2PosX = GUICtrlCreateLabel(GetLangText("lblUPPosX"), 112, 125, 40, 17) +$txtUpgradeX3 = GUICtrlCreateInput("", 152, 120, 31, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER, $ES_READONLY)) +$lblUP2PosY = GUICtrlCreateLabel(GetLangText("lblUPPosY"), 195, 125, 40, 17) +$txtUpgradeY3 = GUICtrlCreateInput("", 235, 120, 31, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER, $ES_READONLY)) +$btnLocateUp3 = GUICtrlCreateButton(GetLangText("btnLocateUp3"), 285, 120, 100, 21) +GUICtrlSetOnEvent(-1, "btnLocateUp3") +GUICtrlSetState(-1, $GUI_DISABLE) +GUICtrlCreateGroup("", -99, -99, 1, 1) + +$chkUpgradeKing = GUICtrlCreateCheckbox(GetLangText("chkUpgradeKing"), 30, 170, 80, 17) ;==> upgrade king +GUICtrlSetTip(-1, GetLangText("lblUpgradeHeroes")) +$chkUpgradeQueen = GUICtrlCreateCheckbox(GetLangText("chkUpgradeQueen"), 130, 170, 95, 17) ;==> upgrade queen +GUICtrlSetTip(-1, GetLangText("lblUpgradeHeroes")) + +$lblbuilderfree = GUICtrlCreateLabel(GetLangText("lblbuilderfree"), 245, 172, 95, 17) ;==>FreeBuilderBox +$txtKeepFreeBuilder = GUICtrlCreateInput("1", 340, 168, 20, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER)) +GUICtrlSetTip(-1, GetLangText("lblKeepFreeBuilder")) + + +;~ $Upgrade2 = GUICtrlCreateGroup(GetLangText("Upgrade2"), 20, 165, 375, 125) +;~ $chkUpgrade4 = GUICtrlCreateCheckbox(GetLangText("chkUpgrade4"), 30, 192, 80, 17) +;~ $lblUP4PosX = GUICtrlCreateLabel(GetLangText("lblUPPosX"), 112, 194, 40, 17) +;~ $txtUpgradeX4 = GUICtrlCreateInput("", 152, 189, 31, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER, $ES_READONLY)) +;~ $lblUP4PosY = GUICtrlCreateLabel(GetLangText("lblUPPosY"), 195, 194, 40, 17) +;~ $txtUpgradeY4 = GUICtrlCreateInput("", 235, 189, 31, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER, $ES_READONLY)) +;~ $btnLocateUp4 = GUICtrlCreateButton(GetLangText("btnLocateUp4"), 285, 189, 100, 21) +;~ GUICtrlSetOnEvent(-1, "btnLocateUp4") +;~ GUICtrlSetState(-1, $GUI_DISABLE) +;~ $chkUpgrade5 = GUICtrlCreateCheckbox(GetLangText("chkUpgrade5"), 30, 222, 80, 17) +;~ $lblUP5PosX = GUICtrlCreateLabel(GetLangText("lblUPPosX"), 112, 224, 40, 17) +;~ $txtUpgradeX5 = GUICtrlCreateInput("", 152, 219, 31, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER, $ES_READONLY)) +;~ $lblUP5PosY = GUICtrlCreateLabel(GetLangText("lblUPPosY"), 195, 224, 40, 17) +;~ $txtUpgradeY5 = GUICtrlCreateInput("", 235, 219, 31, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER, $ES_READONLY)) +;~ $btnLocateUp5 = GUICtrlCreateButton(GetLangText("btnLocateUp5"), 285, 219, 100, 21) +;~ GUICtrlSetOnEvent(-1, "btnLocateUp5") +;~ GUICtrlSetState(-1, $GUI_DISABLE) +;~ $chkUpgrade6 = GUICtrlCreateCheckbox(GetLangText("chkUpgrade6"), 30, 252, 80, 17) +;~ $lblUP6PosX = GUICtrlCreateLabel(GetLangText("lblUPPosX"), 112, 254, 40, 17) +;~ $txtUpgradeX6 = GUICtrlCreateInput("", 152, 249, 31, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER, $ES_READONLY)) +;~ $lblUP6PosY = GUICtrlCreateLabel(GetLangText("lblUPPosY"), 195, 254, 40, 17) +;~ $txtUpgradeY6 = GUICtrlCreateInput("", 235, 249, 31, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER, $ES_READONLY)) +;~ $btnLocateUp6 = GUICtrlCreateButton(GetLangText("btnLocateUp6"), 285, 249, 100, 21) +;~ GUICtrlSetOnEvent(-1, "btnLocateUp6") +;~ GUICtrlSetState(-1, $GUI_DISABLE) +;~ GUICtrlCreateGroup("", -99, -99, 1, 1) + +$grpLaboratory = GUICtrlCreateGroup(GetLangText("grpLaboratory"), 20, 295, 375, 55) +$chkLab = GUICtrlCreateCheckbox(GetLangText("chkLab"), 30, 320, 100, 17) +GUICtrlCreateLabel(GetLangText("lblLab"), 185, 320, 100, 17) +$cmbLabList = GetLangText("troopNamePlBarbarian") & "|" & GetLangText("troopNamePlArcher") & "|" & GetLangText("troopNamePlGiant") & "|" & GetLangText("troopNamePlGoblin") & "|" & GetLangText("troopNamePlWallBreaker") & "|" & GetLangText("troopNamePlBalloon") & "|" & GetLangText("troopNamePlWizard") & "|" & GetLangText("troopNamePlHealer") & "|" & GetLangText("troopNamePlDragon") & "|" & GetLangText("troopNamePlPEKKA") & "|" & GetLangText("spellNameLightning") & "|" & GetLangText("spellNameHealing") & "|" & GetLangText("spellNameRage") & "|" & GetLangText("spellNameJump") & "|" & GetLangText("spellNameFreeze") & "|" & GetLangText("spellNamePoison") & "|" & GetLangText("spellNameEarthquake") & "|" & GetLangText("spellNameHaste") & "|" & GetLangText("troopDarkPlMinion") & "|" & GetLangText("troopDarkPlHog") & "|" & GetLangText("troopDarkPlValkyrie") & "|" & GetLangText("troopDarkPlGolem") & "|" & GetLangText("troopDarkPlWitch") & "|" & GetLangText("troopDarkPlLavaHound") & "|" & GetLangText("cmbNothing") +$cmbLaboratory = GUICtrlCreateCombo("", 285, 317, 100, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) +GUICtrlSetData(-1, $cmbLabList, GetLangText("troopNamePlBarbarian")) +GUICtrlCreateGroup("", -99, -99, 1, 1) + +; --------------------------------------------------------------------------------------------------------------------- +; Services ------------------------------------------------------------------------------------------------------------ +; --------------------------------------------------------------------------------------------------------------------- +$pagenotificationSetting = GUICtrlCreateTabItem(GetLangText("pagenotificationSetting")) +$lblpushbullet = GUICtrlCreateGroup(GetLangText("lblpushbullet"), 20, 40, 370, 220) +$pushbullettoken1 = GUICtrlCreateLabel(GetLangText("pushbullettoken1"), 30, 90, 80, 17, $SS_CENTER) +$pushbullettokenvalue = GUICtrlCreateInput("", 120, 90, 260, 17) +$lblpushbulletenabled = GUICtrlCreateCheckbox(GetLangText("lblpushbulletenabled"), 30, 65, 60, 17) +GUICtrlSetTip(-1, GetLangText("lblpushbulletenabledTip")) +$lblpushbulletdebug = GUICtrlCreateCheckbox(GetLangText("lblpushbulletdebug"), 100, 65, 60, 17) +GUICtrlSetTip(-1, GetLangText("lblpushbulletdebugTip")) +$lblpushbulletremote = GUICtrlCreateCheckbox(GetLangText("lblpushbulletremote"), 170, 65, 60, 17) +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")) +$lblpushbulletdelete = GUICtrlCreateCheckbox(GetLangText("lblpushbulletdelete"), 240, 65, 120, 17) +GUICtrlSetTip(-1, GetLangText("lblpushbulletdeleteTip")) + +$lblpushmessage = GUICtrlCreateGroup(GetLangText("lblpushmessage"), 30, 115, 200, 88) +$lbldisconnect = GUICtrlCreateCheckbox(GetLangText("lbldisconnect"), 40, 140, 95, 17) +$lblmatchfound = GUICtrlCreateCheckbox(GetLangText("lblmatchfound"), 40, 160, 95, 17) +$lbllastraid = GUICtrlCreateCheckbox(GetLangText("lbllastraid"), 140, 140, 80, 17) +$lblfreebuilder = GUICtrlCreateCheckbox(GetLangText("lblfreebuilder"), 140, 160, 80, 17) +$lblvillagereport = GUICtrlCreateCheckbox(GetLangText("lblvillagereport"), 40, 180, 95, 17) +$lblchatlog = GUICtrlCreateCheckbox(GetLangText("lblchatlog"), 140, 180, 80, 17) + +$lblpushbulletloot = GUICtrlCreateGroup(GetLangText("lblpushbulletloot"), 240, 115, 140, 88) +$UseJPG = GUICtrlCreateCheckbox(GetLangText("UseJPG"), 260, 135, 60, 17) +GUICtrlSetTip(-1, GetLangText("UseJPGTip")) +$UseAttackJPG = GUICtrlCreateCheckbox(GetLangText("UseAttackJPG"), 260, 155, 60, 17) +GUICtrlSetTip(-1, GetLangText("UseAttackJPGTip")) + +$lblpushUser = GUICtrlCreateLabel(GetLangText("lblpushuser"), 30, 210, 350, 20) +$inppushUser = GUICtrlCreateInput("", 30, 230, 150, 20) + +$lblStats = GUICtrlCreateGroup(GetLangText("lblBBStats"), 20, 270, 370, 85) +$lblBBUser = GUICtrlCreateLabel(GetLangText("lblBBUser"), 30, 293, 60, 20) +GUICtrlSetTip(-1, GetLangText("tipBBUser")) +$inpBBUser = GUICtrlCreateInput("", 90, 290, 90, 20) +GUICtrlSetTip(-1, GetLangText("tipBBUser")) +$lblBBPassword = GUICtrlCreateLabel(GetLangText("lblBBPassword"), 30, 323, 60, 20) +GUICtrlSetTip(-1, GetLangText("tipBBPass1") & @CRLF & @CRLF & GetLangText("tipBBPass2") & @CRLF & GetLangText("tipBBPass3") & @CRLF & @CRLF & GetLangText("tipBBPass4") & @CRLF & GetLangText("tipBBPass5") & @CRLF & GetLangText("tipBBPass6") & @CRLF & GetLangText("tipBBPass7")) +$inpBBPassword = GUICtrlCreateInput("", 90, 320, 90, 20, BitOR($ES_LEFT, $ES_AUTOHSCROLL, $ES_PASSWORD)) +GUICtrlSetTip(-1, GetLangText("tipBBPass1") & @CRLF & @CRLF & GetLangText("tipBBPass2") & @CRLF & GetLangText("tipBBPass3") & @CRLF & @CRLF & GetLangText("tipBBPass4") & @CRLF & GetLangText("tipBBPass5") & @CRLF & GetLangText("tipBBPass6") & @CRLF & GetLangText("tipBBPass7")) +$btnBBValidate = GUICtrlCreateButton("", 305, 290, 70, 20) +GUICtrlSetColor($btnBBValidate, 0xFFFFFF) +$prevBBUser = (IniRead(@LocalAppDataDir & "\BrokenBot.org.ini", "default", "1", "") = "") ? ("") : (_Decrypt(IniRead(@LocalAppDataDir & "\BrokenBot.org.ini", "default", "1", ""))) +GUICtrlSetData($inpBBUser, $prevBBUser) +$prevBBPass = "" + +;~ GUICtrlSetTip($btnBBValidate, GetLangText("tipBBValidCheck")) +;~ $chkBBSendData = GUICtrlCreateCheckbox(GetLangText("chkBBSendData"), 30, 320, 175, 20) +;~ GUICtrlSetTip($chkBBSendData, GetLangText("tipBBSendData")) + +$lblBBRegister = GUICtrlCreateLabel(GetLangText("lblBBRegister"), 230, 323, 150, 20) +GUICtrlSetColor($lblBBRegister, 0x0000FF) +GUICtrlSetCursor($lblBBRegister, 0) + +; --------------------------------------------------------------------------------------------------------------------- +; Misc ---------------------------------------------------------------------------------------------------------------- +; --------------------------------------------------------------------------------------------------------------------- +$pageMiscSettings = GUICtrlCreateTabItem(GetLangText("pageMiscSettings")) +$Miscs = GUICtrlCreateGroup(GetLangText("Miscs"), 20, 40, 375, 215) +$lblReconnect = GUICtrlCreateLabel(GetLangText("lblReconnect"), 30, 65, 100, 17) +GUICtrlSetTip(-1, GetLangText("lblReconnectTip")) +$txtReconnect = GUICtrlCreateInput("2", 130, 60, 31, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER)) +GUICtrlSetLimit(-1, 2) +$lblReconnectmin = GUICtrlCreateLabel(GetLangText("lblReconnectmin"), 165, 65, 100, 17) +$lblSpellCap = GUICtrlCreateLabel(GetLangText("lblSpellCap"), 217, 118, 120, 17) +$txtSpellCap = GUICtrlCreateInput("3", 335, 115, 50, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER)) + +$chkTrap = GUICtrlCreateCheckbox(GetLangText("chkTrap"), 270, 65, 110, 17) +GUICtrlSetState(-1, $GUI_CHECKED) +GUICtrlSetTip(-1, GetLangText("chkTrapTip")) + +$lblSearchsp = GUICtrlCreateLabel(GetLangText("lblSearchsp"), 30, 92, 100, 17) +GUICtrlSetTip(-1, GetLangText("lblSearchspTip")) +$cmbSearchsp = GUICtrlCreateCombo("", 130, 87, 45, 21, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) +GUICtrlSetData(-1, "0|1|2|3|4|5|6|7|8|9|10", "0") ; Search Base Speed +$lblSearchspd = GUICtrlCreateLabel(GetLangText("lblSearchspd"), 182, 92, 200, 17) + +$lblReturnh = GUICtrlCreateLabel(GetLangText("lblReturnh"), 30, 146, 100, 17) +GUICtrlSetTip(-1, GetLangText("lblReturnhTip")) +$txtReturnh = GUICtrlCreateInput("10", 130, 141, 31, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER)) +GUICtrlSetLimit(-1, 2) +$lblReturndelay = GUICtrlCreateLabel(GetLangText("lblReturndelay"), 165, 146, 200, 17) + +$chkWideEdge = GUICtrlCreateCheckbox(GetLangText("chkWideEdge"), 30, 180, 177, 17) +$chkClearField = GUICtrlCreateCheckbox(GetLangText("chkClearField"), 253, 180, 100, 17) +GUICtrlSetTip(-1, GetLangText("chkClearFieldTip")) + +$chkAlertSearch = GUICtrlCreateCheckbox(GetLangText("chkAlertSearch"), 30, 205, 100, 17) +$chkCollect = GUICtrlCreateCheckbox(GetLangText("chkCollect"), 30, 230, 110, 17) +GUICtrlSetState(-1, $GUI_CHECKED) +$chkTakeLootSS = GUICtrlCreateCheckbox(GetLangText("chkTakeLootSS"), 140, 205, 110, 17) +GUICtrlSetState(-1, $GUI_CHECKED) +$chkTakeTownSS = GUICtrlCreateCheckbox(GetLangText("chkTakeTownSS"), 253, 205, 141, 17) +$chkTakeAttackSS = GUICtrlCreateCheckbox(GetLangText("chkTakeAttackSS"), 140, 230, 110, 17) +GUICtrlSetTip(-1, GetLangText("chkTakeAttackSSTip")) +$chkDebug = GUICtrlCreateCheckbox(GetLangText("chkDebug"), 253, 230, 141, 17) +GUICtrlSetTip(-1, GetLangText("chkDebugTip")) +;~ If @Compiled Then GUICtrlSetState($chkDebug, $GUI_HIDE) + +$LocationSettings = GUICtrlCreateGroup(GetLangText("LocationSettings"), 20, 255, 375, 100) +$btnLocateKingAltar = GUICtrlCreateButton(GetLangText("btnLocateKingAltar"), 32, 270, 83, 25) +GUICtrlSetOnEvent(-1, "btnLocateKingAltar") +$btnLocateQueenAltar = GUICtrlCreateButton(GetLangText("btnLocateQueenAltar"), 118, 270, 83, 25) +GUICtrlSetOnEvent(-1, "btnLocateQueenAltar") +$btnLocateDarkBarracks = GUICtrlCreateButton(GetLangText("btnLocateDarkBarracks"), 213, 270, 83, 25) +GUICtrlSetOnEvent(-1, "btnLocateDarkBarracks") +$btnLocateSFactory = GUICtrlCreateButton(GetLangText("btnLocateSFactory"), 299, 270, 83, 25) +GUICtrlSetOnEvent(-1, "btnLocateSFactory") +$btnLocateTownHall = GUICtrlCreateButton(GetLangText("btnLocateTownHall"), 32, 297, 170, 25) +GUICtrlSetOnEvent(-1, "btnLocateTownHall") +$btnLocateClanCastle = GUICtrlCreateButton(GetLangText("btnLocateClanCastle"), 32, 324, 170, 25) +GUICtrlSetOnEvent(-1, "btnLocateClanCastle") +$btnLocateCamp = GUICtrlCreateButton(GetLangText("btnLocateCamp"), 213, 297, 83, 25) +GUICtrlSetOnEvent(-1, "btnLocateCamp") +$btnLab = GUICtrlCreateButton(GetLangText("btnLab"), 299, 297, 83, 25) +GUICtrlSetOnEvent(-1, "btnLab") +$btnLocateBarracks = GUICtrlCreateButton(GetLangText("btnLocateBarracks"), 213, 324, 170, 25) +GUICtrlSetOnEvent(-1, "btnLocateBarracks") +GUICtrlCreateGroup("", -99, -99, 1, 1) + +; --------------------------------------------------------------------------------------------------------------------- +; Other --------------------------------------------------------------------------------------------------------------- +; --------------------------------------------------------------------------------------------------------------------- +$pageOtherSettings = GUICtrlCreateTabItem(GetLangText("pageOtherSettings")) +$Walls = GUICtrlCreateGroup(GetLangText("Walls"), 20, 40, 375, 125) +$chkWalls = GUICtrlCreateCheckbox(GetLangText("chkWalls"), 30, 62, 110, 17) +$UseGold = GUICtrlCreateRadio(GetLangText("UseGold"), 40, 87, 115, 17) +$WallMinGold = GUICtrlCreateLabel(GetLangText("WallMinGold"), 220, 92, 76, 17) +GUICtrlSetTip(-1, GetLangText("WallMinGoldTip")) +$txtWallMinGold = GUICtrlCreateInput("1300000", 325, 87, 61, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER)) +GUICtrlSetLimit(-1, 7) +$UseElixir = GUICtrlCreateRadio(GetLangText("UseElixir"), 40, 112, 115, 17) +$WallMinElixir = GUICtrlCreateLabel(GetLangText("WallMinElixir"), 220, 117, 72, 17) +GUICtrlSetTip(-1, GetLangText("WallMinElixirTip")) +$txtWallMinElixir = GUICtrlCreateInput("1300000", 325, 112, 61, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER)) +GUICtrlSetLimit(-1, 7) +$UseGoldElix = GUICtrlCreateRadio(GetLangText("UseGoldElix"), 40, 137, 150, 17) +$lblWalls = GUICtrlCreateLabel(GetLangText("lblWalls"), 220, 64, 100, 17) +$cmbWalls = GUICtrlCreateCombo("", 325, 60, 40, 21, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) +GUICtrlSetData(-1, "4|5|6|7|8|9|10", "4") + +$lblTolerance = GUICtrlCreateLabel(GetLangText("lblTolerance"), 220, 142, 80, 17) +$cmbTolerance = GUICtrlCreateCombo("", 325, 137, 60, 17, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) +GUICtrlSetData(-1, GetLangText("cmbTolerance"), GetLangText("cmbToleranceDefault")) +$btnFindWall = GUICtrlCreateButton(GetLangText("btnFindWall"), 145, 60, 63, 21) +GUICtrlSetOnEvent(-1, "btnFindWall") +GUICtrlCreateGroup("", -99, -99, 1, 1) + +GUICtrlCreateGroup(GetLangText("grpRedLine"), 20, 200, 375, 50) +GUICtrlCreateLabel(GetLangText("lblRedLine1"), 30, 220, 83, 17) +$sldAcc = GUICtrlCreateSlider(113, 215, 195, 25, $TBS_NOTICKS) +GUICtrlSetLimit($sldAcc, 100, 0) +GUICtrlSetBkColor($sldAcc, $COLOR_WHITE) +GUICtrlSetTip($sldAcc, GetLangText("sldAccTip") & @CRLF & GetLangText("sldAccTip2")) +GUICtrlCreateLabel(GetLangText("lblRedLine2"), 320, 220, 118, 17) +GUICtrlCreateGroup("", -99, -99, 1, 1) + +$Boosts = GUICtrlCreateGroup(GetLangText("Boosts"), 20, 255, 375, 100) +$lblBoostBarracks = GUICtrlCreateLabel(GetLangText("lblBoostBarracks"), 30, 275, 100, 17) +$cmbBoostBarracks = GUICtrlCreateCombo("", 150, 271, 35, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) +GUICtrlSetData(-1, "0|1|2|3|4|5", "0") +$chkBoostKing = GUICtrlCreateCheckbox(GetLangText("chkBoostKing"), 30, 300, 65, 17) +$chkBoostQueen = GUICtrlCreateCheckbox(GetLangText("chkBoostQueen"), 115, 300, 75, 17) +$chkBoostRax1 = GUICtrlCreateCheckbox(GetLangText("chkBoostRax1"), 200, 275, 65, 17) +$chkBoostRax2 = GUICtrlCreateCheckbox(GetLangText("chkBoostRax2"), 200, 300, 65, 17) +$chkBoostRax3 = GUICtrlCreateCheckbox(GetLangText("chkBoostRax3"), 285, 275, 65, 17) +$chkBoostRax4 = GUICtrlCreateCheckbox(GetLangText("chkBoostRax4"), 285, 300, 65, 17) +$chkBoostSpell = GUICtrlCreateCheckbox(GetLangText("chkBoostSpell"), 30, 325, 90, 17) +$chkBoostDB1 = GUICtrlCreateCheckbox(GetLangText("chkBoostDB1"), 140, 325, 90, 17) +$chkBoostDB2 = GUICtrlCreateCheckbox(GetLangText("chkBoostDB2"), 250, 325, 90, 17) +GUICtrlCreateGroup("", -99, -99, 1, 1) + +; --------------------------------------------------------------------------------------------------------------------- +; Stats --------------------------------------------------------------------------------------------------------------- +; --------------------------------------------------------------------------------------------------------------------- +$pageStatsSetting = GUICtrlCreateTabItem(GetLangText("pageStatsSetting")) +$resourceonstart = GUICtrlCreateGroup(GetLangText("resourceonstart"), 20, 40, 185, 120) +$lblgoldonstart = GUICtrlCreateLabel(GetLangText("lblgoldonstart"), 50, 68, 65, 17) +$lblresultgoldtstart = GUICtrlCreateLabel("0", 128, 68, 60, 17, $SS_RIGHT) +GUICtrlCreatePic(@ScriptDir & "\images\Resource\Gold.jpg", 30, 68, 15, 15) +$lblelixironstart = GUICtrlCreateLabel(GetLangText("lblelixironstart"), 50, 88, 65, 17) +$lblresultelixirstart = GUICtrlCreateLabel("0", 128, 88, 60, 17, $SS_RIGHT) +GUICtrlCreatePic(@ScriptDir & "\images\Resource\Elixir.jpg", 30, 88, 15, 15) +$lbldeonstart = GUICtrlCreateLabel(GetLangText("lbldeonstart"), 50, 108, 60, 17) +$lblresultdestart = GUICtrlCreateLabel("0", 128, 108, 60, 17, $SS_RIGHT) +GUICtrlCreatePic(@ScriptDir & "\images\Resource\Dark.jpg", 30, 108, 15, 15) +$lbltrophyonstart = GUICtrlCreateLabel(GetLangText("lbltrophyonstart"), 50, 128, 100, 17) +$lblresulttrophystart = GUICtrlCreateLabel("0", 128, 128, 60, 17, $SS_RIGHT) +GUICtrlCreatePic(@ScriptDir & "\images\Resource\Trophy.jpg", 30, 128, 15, 15) +GUICtrlCreateGroup("", -99, -99, 1, 1) + +$Currentresource = GUICtrlCreateGroup(GetLangText("Currentresource"), 210, 40, 185, 120) +$lblvillagesattacked = GUICtrlCreateLabel(GetLangText("lblvillagesattacked"), 220, 68, 100, 17) +$lblresultvillagesattacked = GUICtrlCreateLabel("0", 318, 68, 60, 17, $SS_RIGHT) +$lblvillagesskipped = GUICtrlCreateLabel(GetLangText("lblvillagesskipped"), 220, 83, 100, 17) +$lblresultvillagesskipped = GUICtrlCreateLabel("0", 318, 83, 60, 17, $SS_RIGHT) +$lblsearchdisconnected = GUICtrlCreateLabel(GetLangText("lblDisconnected"), 220, 98, 100, 17) +$lblresultsearchdisconnected = GUICtrlCreateLabel("0", 318, 98, 60, 17, $SS_RIGHT) +$lblsearchcost = GUICtrlCreateLabel(GetLangText("lblsearchcost"), 220, 113, 100, 17) +$lblresultsearchcost = GUICtrlCreateLabel("0", 318, 113, 60, 17, $SS_RIGHT) +$lblruntime = GUICtrlCreateLabel(GetLangText("lblruntime"), 220, 128, 100, 17) +$lblresultruntime = GUICtrlCreateLabel("00:00:00", 318, 128, 60, 17, $SS_RIGHT) +GUICtrlCreateGroup("", -99, -99, 1, 1) + +$LastLoot = GUICtrlCreateGroup(GetLangText("LastLoot"), 20, 160, 375, 70) +$lblwallupgrade = GUICtrlCreateLabel(GetLangText("lblwallupgrade"), 50, 185, 100, 17) +$lblwallupgradecount = GUICtrlCreateLabel("0", 128, 185, 60, 17, $SS_RIGHT) +GUICtrlCreatePic(@ScriptDir & "\images\Resource\Wall.jpg", 30, 186, 15, 15) +GUICtrlCreateGroup("", -99, -99, 1, 1) + +$CurrentLoot = GUICtrlCreateGroup(GetLangText("CurrentLoot"), 20, 230, 185, 110) +$lblgoldnow = GUICtrlCreateLabel(GetLangText("lblgoldnow"), 50, 253, 60, 17) +$lblresultgoldnow = GUICtrlCreateLabel("0", 128, 253, 60, 17, $SS_RIGHT) +GUICtrlCreatePic(@ScriptDir & "\images\Resource\Gold.jpg", 30, 253, 15, 15) +$lblelixirnow = GUICtrlCreateLabel(GetLangText("lblelixirnow"), 50, 273, 60, 17) +$lblresultelixirnow = GUICtrlCreateLabel("0", 128, 273, 60, 17, $SS_RIGHT) +GUICtrlCreatePic(@ScriptDir & "\images\Resource\Elixir.jpg", 30, 273, 15, 15) +$lbldenow = GUICtrlCreateLabel(GetLangText("lbldenow"), 50, 293, 60, 17) +$lblresultdenow = GUICtrlCreateLabel("0", 128, 293, 60, 17, $SS_RIGHT) +GUICtrlCreatePic(@ScriptDir & "\images\Resource\Dark.jpg", 30, 293, 15, 15) +$lbltrophynow = GUICtrlCreateLabel(GetLangText("lbltrophynow"), 50, 313, 100, 17) +$lblresulttrophynow = GUICtrlCreateLabel("0", 128, 313, 60, 17, $SS_RIGHT) +GUICtrlCreatePic(@ScriptDir & "\images\Resource\Trophy.jpg", 30, 313, 15, 15) +GUICtrlCreateGroup("", -99, -99, 1, 1) + +$totalresource = GUICtrlCreateGroup(GetLangText("totalresource"), 210, 230, 185, 110) +$lblgoldgain = GUICtrlCreateLabel(GetLangText("lblgoldgain"), 250, 253, 100, 17) +$lblresultgoldgain = GUICtrlCreateLabel("0", 318, 253, 60, 17, $SS_RIGHT) +GUICtrlCreatePic(@ScriptDir & "\images\Resource\Gold.jpg", 230, 253, 15, 15) +$lblelixirgain = GUICtrlCreateLabel(GetLangText("lblelixirgain"), 250, 273, 100, 17) +$lblresultelixirgain = GUICtrlCreateLabel("0", 318, 273, 60, 17, $SS_RIGHT) +GUICtrlCreatePic(@ScriptDir & "\images\Resource\Elixir.jpg", 230, 273, 15, 15) +$lbldegain = GUICtrlCreateLabel(GetLangText("lbldegain"), 250, 293, 100, 17) +$lblresultdegain = GUICtrlCreateLabel("0", 318, 293, 60, 17, $SS_RIGHT) +GUICtrlCreatePic(@ScriptDir & "\images\Resource\Dark.jpg", 230, 293, 15, 15) +$lbltrophygain = GUICtrlCreateLabel(GetLangText("lbltrophygain"), 250, 313, 100, 17) +$lblresulttrophygain = GUICtrlCreateLabel("0", 318, 313, 60, 17, $SS_RIGHT) +GUICtrlCreatePic(@ScriptDir & "\images\Resource\Trophy.jpg", 230, 313, 15, 15) +GUICtrlCreateGroup("", -99, -99, 1, 1) + +; --------------------------------------------------------------------------------------------------------------------- +; Configuration ------------------------------------------------------------------------------------------------------- +; --------------------------------------------------------------------------------------------------------------------- +$pageConfigLoadSave = GUICtrlCreateTabItem(GetLangText("pageConfigLoadSave")) +$ConfigLoadSave = GUICtrlCreateGroup(GetLangText("ConfigLoadSave"), 20, 40, 375, 65) +$btnLoad = GUICtrlCreateButton(GetLangText("btnLoad"), 180, 64, 97, 25) +GUICtrlSetOnEvent(-1, "btnLoad") +$btnSave = GUICtrlCreateButton(GetLangText("btnSave"), 280, 64, 97, 25) +GUICtrlSetOnEvent(-1, "btnSave") +$lblConfig = GUICtrlCreateLabel(getfilename($config), 40, 70, 112, 17) +GUICtrlCreateGroup("", -99, -99, 1, 1) + +$grpLanguage = GUICtrlCreateGroup(GetLangText("grpLanguage"), 20, 110, 375, 50) +$cmbLanguage = GUICtrlCreateCombo("", 30, 130, 347, 20, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) +PopulateLanguages() +_GUICtrlComboBox_SetCurSel($cmbLanguage, _GUICtrlComboBox_FindStringExact($cmbLanguage, $StartupLanguage)) + +$chkSpeedBoost = GUICtrlCreateCheckbox(GetLangText("chkSpeedBoost"), 40, 170, 100, 15) +GUICtrlSetTip(-1, GetLangText("chkSpeedBoostTip")) + +$grpUpdate = GUICtrlCreateGroup(GetLangText("grpUpdate"), 20, 225, 375, 60) +$chkUpdate = GUICtrlCreateCheckbox(GetLangText("chkUpdate"), 40, 250, 225, 15) +GUICtrlSetBkColor($chkUpdate, $COLOR_WHITE) +GUICtrlSetState(-1, $GUI_UNCHECKED) +$btnBugRep = GUICtrlCreateButton(GetLangText("btnBugRep"), 300, 250, 75, 20) +GUICtrlSetOnEvent(-1, "btnBugRep") + +$grpBluestacks = GUICtrlCreateGroup(GetLangText("grpBluestacks"), 20, 295, 375, 60) +$chkBackground = GUICtrlCreateCheckbox(GetLangText("chkBackground"), 40, 320, 105, 15) +GUICtrlSetBkColor($chkBackground, $COLOR_WHITE) +GUICtrlSetState(-1, $GUI_UNCHECKED) +GUICtrlSetTip(-1, GetLangText("chkBackgroundTip")) +$chkForceBS = GUICtrlCreateCheckbox(GetLangText("chkForceBS"), 175, 320, 105, 15) +GUICtrlSetBkColor($chkForceBS, $COLOR_WHITE) +GUICtrlSetOnEvent(-1, "chkForceBS") +GUICtrlSetState(-1, $GUI_UNCHECKED) +GUICtrlSetTip(-1, GetLangText("chkForceBSTip")) +$chkStayAlive = GUICtrlCreateCheckbox(GetLangText("chkStayAlive"), 290, 320, 75, 15) +GUICtrlSetBkColor($chkStayAlive, $COLOR_WHITE) +GUICtrlSetState(-1, $GUI_UNCHECKED) +GUICtrlSetTip(-1, GetLangText("chkStayAliveTip")) +GUICtrlCreateGroup("", -99, -99, 1, 1) + +GUICtrlCreateTabItem("") + +; --------------------------------------------------------------------------------------------------------------------- +; Status Bar ---------------------------------------------------------------------------------------------------------- +; --------------------------------------------------------------------------------------------------------------------- +$statLog = _GUICtrlStatusBar_Create($frmBot) +_GUICtrlStatusBar_SetSimple($statLog) +_GUICtrlStatusBar_SetText($statLog, GetLangText("statLogDefault")) +$tiAbout = TrayCreateItem(GetLangText("tiAbout")) +TrayCreateItem("") +$tiExit = TrayCreateItem(GetLangText("tiExit")) diff --git a/COCBot/Global Variables.au3 b/COCBot/Global Variables.au3 index bae968d..5c1937d 100644 --- a/COCBot/Global Variables.au3 +++ b/COCBot/Global Variables.au3 @@ -1,400 +1,382 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -Global $KernelDLL = DllOpen("kernel32.dll") - -Global Const $COLOR_ORANGE = 0xFFA500 - -Global $Compiled -If @Compiled Then - $Compiled = "Executable" -Else - $Compiled = "Au3 Script" -EndIf - -Global $hBitmap; Image for pixel functions -Global $hHBitmap; Handle Image for pixel functions -Global $hAttackBitmap -Global $BufferAvailable = False - -Global $Title = "BlueStacks App Player" ; Name of the Window -Global $HWnD = WinGetHandle($Title) ;Handle for Bluestacks window - -Global $config = @ScriptDir & "\config\default.ini" -Global $dirLogs = @ScriptDir & "\logs\" -Global $dirLoots = @ScriptDir & "\Loots\" -Global $dirAttack = @ScriptDir & "\Attacks\" -Global $dirDebug = @ScriptDir & "\Debug\" -Global $dirAllTowns = @ScriptDir & "\AllTowns\" -Global $dirConfigs = @ScriptDir & "\config\" -Global $dirStrat = @ScriptDir & "\strategies\" - -Global $sLogPath ; `Will create a new log file every time the start button is pressed -Global $hLogFileHandle -Global $Restart = False -Global $Running = False -Global $AttackNow = False -Global $AlertBaseFound = False -Global $TakeLootSnapShot = True -Global $TakeAllTownSnapShot = False -Global $FasterExit - -Global $SubmissionMade = False -Global $SubmissionTimer = TimerInit() -Global $SearchTimer = TimerInit() -Global $SubmissionGold -Global $SubmissionGold = 0, $SubmissionElixir = 0, $SubmissionDE = 0 -Global $SubmissionAttacks = 0 -Global $SubmissionSearches = 0 -Global $SubmissionSGold = "" -Global $SubmissionSElix = "" -Global $SubmissionSDE = "" -Global $SubmissionSTrophy = "" -Global $SubmissionSTH = "" -Global $SubmissionSDead = "" -Global $SearchSubmitdelay = (1000 * 60 * 5) -Global $AttackSubmitdelay = (1000 * 60 * 15) -Global $LastAttackTH -Global $LastAttackDead -Global $TrophyCountOld - -Global $ValidAuth = False -Global $THLevel - -Global $TakeAttackSnapShot = 0 -Global $DebugMode = 0 -Global $shift -Global $ReqText -Global $brerror[4] -$brerror[0] = False -$brerror[1] = False -$brerror[2] = False -$brerror[3] = False -$needzoomout = False - -Global $iCollectCounter = 0 ; Collect counter, when reaches $COLLECTATCOUNT, it will collect -Global $COLLECTATCOUNT = 8 ; Run Collect() after this amount of times before actually collect -;--------------------------------------------------------------------------------------------------- -Global $BSpos[2] ; Inside BlueStacks positions relative to the screen -;--------------------------------------------------------------------------------------------------- -;Search Settings -Global $FixTrain = False -Global $Tolerance1 = 80 -Global $THx = 0, $THy = 0 -Global $DEx = 0, $DEy = 0 -Global $THText[5] ; Text of each Townhall level -$THText[0] = "4-6" -$THText[1] = "7" -$THText[2] = "8" -$THText[3] = "9" -$THText[4] = "10" -Global $SearchCount = 0 ;Number of searches -Global $SearchFailed = False ; Last search failed or not -Global $THaddtiles, $THside, $THi -Global $StratNames = "" -Global $prevSelection = "" -Global $DefaultTab = 0 -Global $prevBBUser, $prevBBPass - -Global $speedBump = 0 -Global $hTimerClickNext, $fdiffReadGold - -Global $prevTab = 0 -Global $slideOut = 0 -Global $slideIn = 0 - -;Troop types, from 0 ~ 19 so far -Global Enum $eBarbarian, $eArcher, $eGiant, $eGoblin, $eWallbreaker, _ - $eBalloon, $eWizard, $eHealer, $eDragon, $ePekka, _ - $eMinion, $eHog, $eValkyrie, $eGolem, $eWitch, _ - $eLavaHound, _ - $eKing, $eQueen, $eCastle, $eLSpell - -;Attack Settings -; Shift outer corners 1 pixel for more random drop space -Global $TopLeft[5][2] = [[78, 280], [169, 204], [233, 161], [295, 114], [367, 65]] -Global $TopRight[5][2] = [[481, 62], [541, 103], [590, 145], [656, 189], [780, 277]] -Global $BottomLeft[5][2] = [[78, 343], [141, 390], [209, 447], [275, 493], [338, 540]] -Global $BottomRight[5][2] = [[524, 538], [596, 485], [655, 441], [716, 394], [780, 345]] -Global $FurthestTopLeft[5][2] = [[28, 314], [0, 0], [0, 0], [0, 0], [430, 9]] -Global $FurthestTopRight[5][2] = [[430, 9], [0, 0], [0, 0], [0, 0], [820, 313]] -Global $FurthestBottomLeft[5][2] = [[28, 314], [0, 0], [0, 0], [0, 0], [440, 612]] -Global $FurthestBottomRight[5][2] = [[440, 612], [0, 0], [0, 0], [0, 0], [820, 313]] -Global $Edges[4] = [$BottomRight, $TopLeft, $BottomLeft, $TopRight] -Global $BaseCenter[2] - -Global $atkTroops[9][2] ;9 Slots of troops - Name, Amount -Global $THLoc -Global $THquadrant - -Global $Buffer -Global $pBarbarian, $pArcher, $pGoblin, $pGiant, $pWallB, $pLightning, $pKing, $pQueen, $pCC - -Global $King, $Queen, $CC, $Barb, $Arch, $Minion, $Hog, $Valkyrie -Global $LeftTHx, $RightTHx, $BottomTHy, $TopTHy -Global $AtkTroopTH -Global $GetTHLoc - -Global $hWaveTimer = TimerInit() -Global $hUpdateTimer = TimerInit() - -Global $PluginEvents - -;Misc Settings -Global $itxtReconnect -Global $itxtReturnh -Global $icmbSearchsp -Global $ichkTrap -Global $itxtKingSkill ;Delay before activating King Skill -Global $itxtQueenSkill ;Delay before activating Queen Skill -Global $WideEdge, $chkWideEdge -Global $iClearField, $chkClearField -Global $ichkAvoidEdge, $chkAvoidEdge -Global $chkCollect, $ichkCollect -Global $icmbUnitDelay -Global $icmbWaveDelay -Global $iRandomspeedatk - -;Boosts Settings -Global $BoostAll -Global $remainingBoosts = 0 ; remaining boost to active during session -Global $boostsEnabled = 1 ; is this function enabled -Global $chkBoostKing -Global $chkBoostQueen -Global $chkBoostRax1 -Global $chkBoostRax2 -Global $chkBoostRax3 -Global $chkBoostRax4 -Global $chkBoostSpell -Global $chkBoostDB1 -Global $chkBoostDB2 - -;Donate Settings -Global $CCPos[2] = [-1, -1] ;Position of clan castle - -Global $ichkRequest = 0 ;Checkbox for Request box -Global $itxtRequest = "" ;Request textbox - -Global $ichkDonateAllBarbarians = 0 -Global $ichkDonateBarbarians = 0 -Global $itxtDonateBarbarians = "" - -Global $ichkDonateAllArchers = 0 -Global $ichkDonateArchers = 0 -Global $itxtDonateArchers = "" - -Global $ichkDonateAllGiants = 0 -Global $ichkDonateGiants = 0 -Global $itxtDonateGiants = "" - -Global $itxtcampCap = 0 -Global $itxtspellCap -Global $CurBarb -Global $CurArch -Global $CurGiant -Global $CurGoblin -Global $CurWB -Global $ArmyComp -Global $TownHallPos[2] = [-1, -1] ;Position of TownHall -Global $barrackPos[4][2] ;Positions of each barracks -Global $barrackTroop[10] ;Barrack troop set -Global $ArmyPos[2] -Global $SpellPos[2] -Global $KingPos[2] = ["", ""] -Global $QueenPos[2] = ["", ""] -Global $BuildPos1[2] -Global $BuildPos2[2] -Global $BuildPos3[2] - -;Other Settings -Global $CurMinion, $CurHog, $CurValkyrie -Global $ichkWalls -Global $icmbWalls -Global $iUseStorage -Global $itxtWallMinGold -Global $itxtWallMinElixir -Global $icmbTolerance -Global $itxtReconnect -Global $DarkBarrackPos[2][2] -Global $DarkBarrackTroop[2] -Global $iTimeTroops = 0 -Global $iTimeGiant = 120 -Global $iTimeWall = 120 -Global $iTimeArch = 25 -Global $iTimeGoblin = 35 -Global $iTimeBarba = 20 - -;upgrade Settings -Global $ichkUpgrade1 -Global $ichkUpgrade2 -Global $ichkUpgrade3 -Global $ichkUpgrade4 -Global $ichkUpgrade5 -Global $ichkUpgrade6 -Global $itxtUpgradeX1 -Global $itxtUpgradeY1 -Global $itxtUpgradeX2 -Global $itxtUpgradeY2 -Global $itxtUpgradeX3 -Global $itxtUpgradeY3 -Global $itxtUpgradeX4 -Global $itxtUpgradeY4 -Global $itxtUpgradeX5 -Global $itxtUpgradeY5 -Global $itxtUpgradeX6 -Global $itxtUpgradeY6 - -Global $txtSpellCap - -;General Settings -Global $botPos[2] ; Position of bot used for Hide function -Global $frmBotPosX ; Position X of the GUI -Global $frmBotPosY ; Position Y of the GUI -Global $Hide = False ; If hidden or not - -Global $firstrun = True -Global $btnBugRep - -Global Enum $modeDonateTrain, $modeDonate, $modeExperience, $modeNormal = 9 -Global $CurrentMode = $modeNormal -Global $ichkBotStop, $icmbBotCommand, $icmbBotCond, $icmbHoursStop -Global $MeetCondStop = False -Global $UseTimeStop = -1 -Global $TimeToStop = -1 - -Global $itxtMinTrophy ; Trophy after drop -Global $itxtMaxTrophy ; Max trophy before drop trophy -Global $ichkForceBS = 0 -Global $ichkNoAttack = 0, $ichkDonateOnly = 0 -Global $collectorPos[17][2] ;Positions of each collectors - -Global $break = @ScriptDir & "\images\break.bmp" -Global $device = @ScriptDir & "\images\device.bmp" - -Global $GoldCount = 0, $ElixirCount = 0, $DarkCount = 0, $GemCount = 0, $FreeBuilder = 0 -Global $GoldGained = 0, $ElixirGained = 0, $DarkGained = 0, $TrophyGained = 0 -Global $GoldCountOld = 0, $ElixirCountOld = 0, $DarkCountOld = 0, $TrophyOld = 0 -Global $GoldTotalLoot = 0, $ElixirTotalLoot = 0, $DarkTotalLoot = 0, $TrophyTotalLoot = 0 -Global $WallUpgrade = 0 -Global $resArmy = 0 -Global $FirstAttack = True -Global $CurTrophy = 0 -Global $sTimer, $hour, $min, $sec -Global $CurCamp, $TotalCamp = 0 -Global $itxtcampCap = 0 -Global $NoLeague -Global $FirstStart = True -Global $MidAttack = False -Global $Checkrearm = True -Global $FirstDarkTrain = True - - -;PushBullet -Global $PushBulletEnabled = 0 -Global $PushBullettoken = "" -Global $PushBullettype = 0 -Global $PushBulletattacktype = 0 -Global $FileName = "" -Global $PushBulletvillagereport = 0 -Global $PushBulletchatlog = 0 -Global $PushBulletvillagereportTimer -Global $PushBulletvillagereportInterval = 3600000 ; an hour -Global $PushBulletmatchfound = 0 -Global $PushBulletlastraid = 0 -Global $PushBullettotalgain = 0 -Global $PushBulletdebug = 0 -Global $PushBulletremote = 0 -Global $PushBulletdelete = 0 -Global $PushBulletfreebuilder = 0 -Global $PushBulletdisconnection = 0 -Global $sLogFileName -Global $Raid = 0 -Global $buildernotified = False - -;GoldCostPerSearch -Global $SearchCost = 0 - -;King & Queen Status -Global $KingAvailable = False -Global $QueenAvailable = False -Global $KingUG = False -Global $QueenUG = False - -;Remote Control -Global $sTimerRC -Global $PauseBot = False - -;Match found -Global $MatchFoundText = "" - -;Last Raid -Global $LastRaidGold = 0 -Global $LastRaidElixir = 0 -Global $LastRaidDarkElixir = 0 -Global $LastRaidTrophy = 0 -;UpTroops -Global $ichkLab -Global $icmbLaboratory -Global $itxtLabX = -1 -Global $itxtLabY = -1 -Global $UpBar2X = 175 -Global $UpBar2Y = 379 -Global $UpArchX = 180 -Global $UpArchY = 468 -Global $GiantsX = 307 -Global $GiantsY = 361 -Global $WBreakerX = 373 -Global $WBreakerY = 373 -Global $WizardX = 489 -Global $WizardY = 323 -Global $UpHealX = 515 -Global $UpHealY = 431 -Global $UpDragonX = 591 -Global $UpDragonY = 388 -Global $UpPekkaX = 612 -Global $UpPekkaY = 479 -Global $SpellHealX = 527 -Global $SpellHealY = 381 -Global $SpellLightningX = 549 -Global $SpellLightningY = 461 -Global $SpellRageX = 650 -Global $SpellRageY = 372 -Global $LabPos[2] - -Global $FontSize - -;Used in Strategies -Global $MinDeadGold -Global $MinDeadElixir -Global $MinDeadDark -Global $MinDeadTrophy -Global $MaxDeadTH -Global $MinGold -Global $MinElixir -Global $MinDark -Global $MinTrophy -Global $MaxTH -Global $iNukeLimit +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +Global $KernelDLL = DllOpen("kernel32.dll") + +Global Const $COLOR_ORANGE = 0xFFA500 + +Global $Compiled +If @Compiled Then + $Compiled = "Executable" +Else + $Compiled = "Au3 Script" +EndIf + +Global $hBitmap; Image for pixel functions +Global $hHBitmap; Handle Image for pixel functions +Global $hAttackBitmap +Global $BufferAvailable = False + +Global $Title = "BlueStacks App Player" ; Name of the Window +Global $HWnD = WinGetHandle($Title) ;Handle for Bluestacks window + +Global $config = @ScriptDir & "\config\default.ini" +Global $dirLogs = @ScriptDir & "\logs\" +Global $dirLoots = @ScriptDir & "\Loots\" +Global $dirAttack = @ScriptDir & "\Attacks\" +Global $dirDebug = @ScriptDir & "\Debug\" +Global $dirAllTowns = @ScriptDir & "\AllTowns\" +Global $dirConfigs = @ScriptDir & "\config\" +Global $dirStrat = @ScriptDir & "\strategies\" + +Global $sLogPath ; `Will create a new log file every time the start button is pressed +Global $hLogFileHandle +Global $Restart = False +Global $Running = False +Global $AttackNow = False +Global $AlertBaseFound = False +Global $TakeLootSnapShot = True +Global $TakeAllTownSnapShot = False +Global $FasterExit + +Global $SubmissionMade = False +Global $SubmissionTimer = TimerInit() +Global $SearchTimer = TimerInit() +Global $SubmissionGold +Global $SubmissionGold = 0, $SubmissionElixir = 0, $SubmissionDE = 0 +Global $SubmissionAttacks = 0 +Global $SubmissionSearches = 0 +Global $SubmissionSGold = "" +Global $SubmissionSElix = "" +Global $SubmissionSDE = "" +Global $SubmissionSTrophy = "" +Global $SubmissionSTH = "" +Global $SubmissionSDead = "" +Global $SearchSubmitdelay = (1000 * 60 * 5) +Global $AttackSubmitdelay = (1000 * 60 * 15) +Global $LastAttackTH +Global $LastAttackDead +Global $TrophyCountOld + +Global $ValidAuth = False +Global $THLevel + +Global $TakeAttackSnapShot = 0 +Global $DebugMode = 0 +Global $shift +Global $ReqText +Global $brerror[4] +$brerror[0] = False +$brerror[1] = False +$brerror[2] = False +$brerror[3] = False +$needzoomout = False + +Global $iCollectCounter = 0 ; Collect counter, when reaches $COLLECTATCOUNT, it will collect +Global $COLLECTATCOUNT = 8 ; Run Collect() after this amount of times before actually collect +;--------------------------------------------------------------------------------------------------- +Global $BSpos[2] ; Inside BlueStacks positions relative to the screen +;--------------------------------------------------------------------------------------------------- +;Search Settings +Global $FixTrain = False +Global $Tolerance1 = 80 +Global $THx = 0, $THy = 0 +Global $DEx = 0, $DEy = 0 +Global $THText[5] ; Text of each Townhall level +$THText[0] = "4-6" +$THText[1] = "7" +$THText[2] = "8" +$THText[3] = "9" +$THText[4] = "10" +Global $SearchCount = 0 ;Number of searches +Global $SearchFailed = False ; Last search failed or not +Global $THaddtiles, $THside, $THi +Global $StratNames = "" +Global $prevSelection = "" +Global $DefaultTab = 0 +Global $prevBBUser, $prevBBPass + +Global $speedBump = 0 +Global $hTimerClickNext, $fdiffReadGold + +Global $prevTab = 0 +Global $slideOut = 0 +Global $slideIn = 0 + +;Troop types, from 0 ~ 19 so far +Global Enum $eBarbarian, $eArcher, $eGiant, $eGoblin, $eWallbreaker, _ + $eBalloon, $eWizard, $eHealer, $eDragon, $ePekka, _ + $eMinion, $eHog, $eValkyrie, $eGolem, $eWitch, _ + $eLavaHound, _ + $eKing, $eQueen, $eCastle, $eLSpell + +;Attack Settings +; Shift outer corners 1 pixel for more random drop space +Global $TopLeft[5][2] = [[78, 280], [169, 204], [233, 161], [295, 114], [367, 65]] +Global $TopRight[5][2] = [[481, 62], [541, 103], [590, 145], [656, 189], [780, 277]] +Global $BottomLeft[5][2] = [[78, 343], [141, 390], [209, 447], [275, 493], [363, 560]] +Global $BottomRight[5][2] = [[510, 560], [596, 485], [655, 441], [716, 394], [780, 345]] +Global $FurthestTopLeft[5][2] = [[28, 314], [0, 0], [0, 0], [0, 0], [430, 9]] +Global $FurthestTopRight[5][2] = [[430, 9], [0, 0], [0, 0], [0, 0], [820, 313]] +Global $FurthestBottomLeft[5][2] = [[28, 314], [0, 0], [0, 0], [0, 0], [440, 612]] +Global $FurthestBottomRight[5][2] = [[440, 612], [0, 0], [0, 0], [0, 0], [820, 313]] +Global $Edges[4] = [$BottomRight, $TopLeft, $BottomLeft, $TopRight] +Global $BaseCenter[2] + +Global $atkTroops[9][2] ;9 Slots of troops - Name, Amount +Global $THLoc +Global $THquadrant + +Global $Buffer +Global $pBarbarian, $pArcher, $pGoblin, $pGiant, $pWallB, $pLightning, $pKing, $pQueen, $pCC + +Global $King, $Queen, $CC, $Barb, $Arch, $Minion, $Hog, $Valkyrie +Global $LeftTHx, $RightTHx, $BottomTHy, $TopTHy +Global $AtkTroopTH +Global $GetTHLoc + +Global $hWaveTimer = TimerInit() +Global $hUpdateTimer = TimerInit() + +Global $PluginEvents + +;Misc Settings +Global $itxtReconnect +Global $itxtReturnh +Global $icmbSearchsp +Global $ichkTrap +Global $itxtKingSkill ;Delay before activating King Skill +Global $itxtQueenSkill ;Delay before activating Queen Skill +Global $WideEdge, $chkWideEdge +Global $iClearField, $chkClearField +Global $ichkAvoidEdge, $chkAvoidEdge +Global $chkCollect, $ichkCollect +Global $icmbUnitDelay +Global $icmbWaveDelay +Global $iRandomspeedatk + +;Boosts Settings +Global $BoostAll +Global $remainingBoosts = 0 ; remaining boost to active during session +Global $boostsEnabled = 1 ; is this function enabled +Global $chkBoostKing +Global $chkBoostQueen +Global $chkBoostRax1 +Global $chkBoostRax2 +Global $chkBoostRax3 +Global $chkBoostRax4 +Global $chkBoostSpell +Global $chkBoostDB1 +Global $chkBoostDB2 + +;Donate Settings +Global $CCPos[2] = [-1, -1] ;Position of clan castle + +Global $ichkRequest = 0 ;Checkbox for Request box +Global $itxtRequest = "" ;Request textbox + +Global $ichkDonateAllBarbarians = 0 +Global $ichkDonateBarbarians = 0 +Global $itxtDonateBarbarians = "" + +Global $ichkDonateAllArchers = 0 +Global $ichkDonateArchers = 0 +Global $itxtDonateArchers = "" + +Global $ichkDonateAllGiants = 0 +Global $ichkDonateGiants = 0 +Global $itxtDonateGiants = "" + +Global $itxtcampCap = 0 +Global $itxtspellCap +Global $CurBarb +Global $CurArch +Global $CurGiant +Global $CurGoblin +Global $CurWB +Global $ArmyComp +Global $TownHallPos[2] = [-1, -1] ;Position of TownHall +Global $barrackPos[4][2] ;Positions of each barracks +Global $barrackTroop[10] ;Barrack troop set +Global $ArmyPos[2] +Global $SpellPos[2] +Global $KingPos[2] = ["", ""] +Global $QueenPos[2] = ["", ""] +Global $BuildPos1[2] +Global $BuildPos2[2] +Global $BuildPos3[2] + +;Other Settings +Global $CurMinion, $CurHog, $CurValkyrie +Global $ichkWalls +Global $icmbWalls +Global $iUseStorage +Global $itxtWallMinGold +Global $itxtWallMinElixir +Global $icmbTolerance +Global $itxtReconnect +Global $DarkBarrackPos[2][2] +Global $DarkBarrackTroop[2] +Global $DarkBarrackTroopNext[2] +Global $iTimeTroops = 0 +Global $iTimeGiant = 120 +Global $iTimeWall = 120 +Global $iTimeArch = 25 +Global $iTimeGoblin = 35 +Global $iTimeBarba = 20 + +;upgrade Settings +Global $ichkUpgrade1 +Global $ichkUpgrade2 +Global $ichkUpgrade3 +Global $ichkUpgrade4 +Global $ichkUpgrade5 +Global $ichkUpgrade6 +Global $itxtUpgradeX1 +Global $itxtUpgradeY1 +Global $itxtUpgradeX2 +Global $itxtUpgradeY2 +Global $itxtUpgradeX3 +Global $itxtUpgradeY3 +Global $itxtUpgradeX4 +Global $itxtUpgradeY4 +Global $itxtUpgradeX5 +Global $itxtUpgradeY5 +Global $itxtUpgradeX6 +Global $itxtUpgradeY6 + +Global $txtSpellCap + +;General Settings +Global $botPos[2] ; Position of bot used for Hide function +Global $frmBotPosX ; Position X of the GUI +Global $frmBotPosY ; Position Y of the GUI +Global $Hide = False ; If hidden or not + +Global $firstrun = True +Global $btnBugRep + +Global Enum $modeDonateTrain, $modeDonate, $modeExperience, $modeNormal = 9 +Global $CurrentMode = $modeNormal +Global $ichkBotStop, $icmbBotCommand, $icmbBotCond, $icmbHoursStop +Global $MeetCondStop = False +Global $UseTimeStop = -1 +Global $TimeToStop = -1 + +Global $itxtMinTrophy ; Trophy after drop +Global $itxtMaxTrophy ; Max trophy before drop trophy +Global $ichkForceBS = 0 +Global $ichkNoAttack = 0, $ichkDonateOnly = 0 +Global $collectorPos[17][2] ;Positions of each collectors + +Global $break = @ScriptDir & "\images\break.bmp" +Global $device = @ScriptDir & "\images\device.bmp" + +Global $GoldCount = 0, $ElixirCount = 0, $DarkCount = 0, $GemCount = 0, $FreeBuilder = 0 +Global $GoldGained = 0, $ElixirGained = 0, $DarkGained = 0, $TrophyGained = 0 +Global $GoldCountOld = 0, $ElixirCountOld = 0, $DarkCountOld = 0, $TrophyOld = 0 +Global $GoldTotalLoot = 0, $ElixirTotalLoot = 0, $DarkTotalLoot = 0, $TrophyTotalLoot = 0 +Global $WallUpgrade = 0 +Global $resArmy = 0 +Global $FirstAttack = True +Global $CurTrophy = 0 +Global $sTimer, $hour, $min, $sec +Global $CurCamp, $TotalCamp = 0 +Global $itxtcampCap = 0 +Global $NoLeague +Global $FirstStart = True +Global $MidAttack = False +Global $Checkrearm = True +Global $FirstDarkTrain = True + + +;PushBullet +Global $PushBulletEnabled = 0 +Global $PushBullettoken = "" +Global $PushBullettype = 0 +Global $PushBulletattacktype = 0 +Global $FileName = "" +Global $PushBulletvillagereport = 0 +Global $PushBulletchatlog = 0 +Global $PushBulletvillagereportTimer +Global $PushBulletvillagereportInterval = 3600000 ; an hour +Global $PushBulletmatchfound = 0 +Global $PushBulletlastraid = 0 +Global $PushBullettotalgain = 0 +Global $PushBulletdebug = 0 +Global $PushBulletremote = 0 +Global $PushBulletdelete = 0 +Global $PushBulletfreebuilder = 0 +Global $PushBulletdisconnection = 0 +Global $sLogFileName +Global $Raid = 0 +Global $buildernotified = False + +;GoldCostPerSearch +Global $SearchCost = 0 + +;King & Queen Status +Global $KingAvailable = False +Global $QueenAvailable = False +Global $KingUG = False +Global $QueenUG = False + +;Remote Control +Global $sTimerRC +Global $PauseBot = False + +;Match found +Global $MatchFoundText = "" + +;Last Raid +Global $LastRaidGold = 0 +Global $LastRaidElixir = 0 +Global $LastRaidDarkElixir = 0 +Global $LastRaidTrophy = 0 +;UpTroops +Global $ichkLab +Global $icmbLaboratory +Global $itxtLabX = -1 +Global $itxtLabY = -1 +Global $LabPos[2] + +Global $FontSize + +;Used in Strategies +Global $MinDeadGold +Global $MinDeadElixir +Global $MinDeadDark +Global $MinDeadTrophy +Global $MaxDeadTH +Global $MinGold +Global $MinElixir +Global $MinDark +Global $MinTrophy +Global $MaxTH +Global $iNukeLimit + +Global $ichkUpgradeKing, $ichkUpgradeQueen +Global $itxtKeepFreeBuilder \ No newline at end of file diff --git a/COCBot/functions/Attack/GoldElixirChange.au3 b/COCBot/functions/Attack/GoldElixirChange.au3 index ddde584..7d44935 100644 --- a/COCBot/functions/Attack/GoldElixirChange.au3 +++ b/COCBot/functions/Attack/GoldElixirChange.au3 @@ -1,58 +1,58 @@ -;========================================================================== -; Function name: GoldElixirChange -; Authored by: -; Edited by: Samota, -; -; Description: Checks if the gold/elixir changes values within 20 seconds, Returns True if changed. Also -; checks every 5 seconds if gold/elixir = "", meaning battle is over. If either condition is met, return -; false. -; Now also check Dark Elixir -; -; Notes: If all troops are used, the battle will end when they are all dead, the timer runs out, or the -; base has been 3-starred. When the battle ends, it is detected within 5 seconds, otherwise it takes up -; to 20 seconds. -; -;========================================================================== -Func GoldElixirChange() - Local $Gold1, $Gold2 - Local $Elixir1, $Elixir2 - Local $Dark1, $Dark2 - Local $ExitOkay = False - Local $FirstTime = True - $ExitTimer = TimerInit() - $Gold1 = ReadText(50, 70, 150, $textVillageSearch) - $Elixir1 = ReadText(50, 99, 150, $textVillageSearch) - $Dark1 = ReadText(50, 128, 80, $textVillageSearch) - - $NoResources = False - - While True - $Gold2 = ReadText(50, 70, 150, $textVillageSearch) - $Elixir2 = ReadText(50, 99, 150, $textVillageSearch) - $Dark2 = ReadText(50, 128, 80, $textVillageSearch) - If ($Gold1 <> $Gold2 Or $Elixir1 <> $Elixir2 Or $Dark1 <> $Dark2) Then - If TimerDiff($ExitTimer)/1000 > ($itxtReturnh/2) Then - SetLog(GetLangText("msgLootChange"), $COLOR_GREEN) - EndIf - If Not $NoResources Then $ExitTimer = TimerInit() - $Gold1 = ReadText(50, 70, 150, $textVillageSearch) - $Elixir1 = ReadText(50, 99, 150, $textVillageSearch) - $Dark1 = ReadText(50, 128, 80, $textVillageSearch) - ElseIf TimerDiff($ExitTimer)/1000 > $itxtReturnh Then - If Not $NoResources Then SetLog(GetLangText("msgNoIncome"), $COLOR_GREEN) - Return - ElseIf ($Gold2 = "" And $Elixir2 = "" And $Dark2 = "") Then - SetLog(GetLangText("msgBattleFinished"), $COLOR_GREEN) - Return - ElseIf ($Gold2 = 0 And $Elixir2 = 0 And ((getTrophy(51, 66 + 90) = "") ? (True) : ($Dark2 = 0))) Then - If Not $NoResources Then - SetLog(GetLangText("msgNoResource") & $itxtReturnh & GetLangText("msgSeconds"), $COLOR_GREEN) - $NoResources = True - $ExitTimer = TimerInit() - EndIf - EndIf - If _Sleep(100) Then Return - WEnd - -EndFunc ;==>GoldElixirChange - +;========================================================================== +; Function name: GoldElixirChange +; Authored by: +; Edited by: Samota, +; +; Description: Checks if the gold/elixir changes values within 20 seconds, Returns True if changed. Also +; checks every 5 seconds if gold/elixir = "", meaning battle is over. If either condition is met, return +; false. +; Now also check Dark Elixir +; +; Notes: If all troops are used, the battle will end when they are all dead, the timer runs out, or the +; base has been 3-starred. When the battle ends, it is detected within 5 seconds, otherwise it takes up +; to 20 seconds. +; +;========================================================================== +Func GoldElixirChange() + Local $Gold1, $Gold2 + Local $Elixir1, $Elixir2 + Local $Dark1, $Dark2 + Local $ExitOkay = False + Local $FirstTime = True + $ExitTimer = TimerInit() + $Gold1 = ReadText(50, 70, 150, $textVillageSearch) + $Elixir1 = ReadText(50, 99, 150, $textVillageSearch) + $Dark1 = ReadText(50, 128, 80, $textVillageSearch) + + $NoResources = False + + While True + $Gold2 = ReadText(50, 70, 150, $textVillageSearch) + $Elixir2 = ReadText(50, 99, 150, $textVillageSearch) + $Dark2 = ReadText(50, 128, 80, $textVillageSearch) + _CaptureRegion() + If ($Gold1 <> $Gold2 Or $Elixir1 <> $Elixir2 Or $Dark1 <> $Dark2) Then + If (TimerDiff($ExitTimer)/1000 > ($itxtReturnh/2)) And Not $NoResources Then + SetLog(GetLangText("msgLootChange"), $COLOR_GREEN) + EndIf + If Not $NoResources Then $ExitTimer = TimerInit() + $Gold1 = $Gold2 + $Elixir1 = $Elixir2 + $Dark1 = $Dark2 + ElseIf TimerDiff($ExitTimer)/1000 > $itxtReturnh Then + If Not $NoResources Then SetLog(GetLangText("msgNoIncome"), $COLOR_GREEN) + Return + ElseIf ($Gold2 = "" And $Elixir2 = "" And $Dark2 = "") Then + SetLog(GetLangText("msgBattleFinished"), $COLOR_GREEN) + Return + ElseIf ($Gold2 = 0 And $Elixir2 = 0 And ((Not _ColorCheck(_GetPixelColor(38, 136), Hex(0xD3CADA, 6), 40)) ? (True) : ($Dark2 = 0))) Then + If Not $NoResources Then + SetLog(GetLangText("msgNoResource") & $itxtReturnh & GetLangText("msgSeconds"), $COLOR_GREEN) + $NoResources = True + $ExitTimer = TimerInit() + EndIf + EndIf + If _Sleep(100) Then Return + WEnd + +EndFunc ;==>GoldElixirChange diff --git a/COCBot/functions/Attack/NameOfTroop.au3 b/COCBot/functions/Attack/NameOfTroop.au3 index 9027e06..4cc123e 100644 --- a/COCBot/functions/Attack/NameOfTroop.au3 +++ b/COCBot/functions/Attack/NameOfTroop.au3 @@ -1,30 +1,30 @@ -Func NameOfTroop($kind, $plurial = 0) - Switch $kind - Case $eBarbarian - Return "Barbarians" - Case $eArcher - Return "Archers" - Case $eGoblin - Return "Goblins" - Case $eGiant - Return "Giants" - Case $eWallbreaker - Return "Wall Breakers" - Case $eMinion - Return "Minions" - Case $eHog - Return "Hogs" - Case $eValkyrie - Return "Valkyries" - Case $eKing - Return "King" - Case $eQueen - Return "Queen" - Case $eCastle - Return "Clan castle" - Case $eLSpell - Return "Lightning Spell" - Case Else - Return "Unknown" - EndSwitch -EndFunc ;==>NameOfTroop +Func NameOfTroop($kind, $plurial = 0) + Switch $kind + Case $eBarbarian + Return "Barbarians" + Case $eArcher + Return "Archers" + Case $eGoblin + Return "Goblins" + Case $eGiant + Return "Giants" + Case $eWallbreaker + Return "Wall Breakers" + Case $eMinion + Return "Minions" + Case $eHog + Return "Hogs" + Case $eValkyrie + Return "Valkyries" + Case $eKing + Return "King" + Case $eQueen + Return "Queen" + Case $eCastle + Return "Clan castle" + Case $eLSpell + Return "Lightning Spell" + Case Else + Return "Unknown" + EndSwitch +EndFunc ;==>NameOfTroop diff --git a/COCBot/functions/Attack/ReturnHome.au3 b/COCBot/functions/Attack/ReturnHome.au3 index a2bc173..4022495 100644 --- a/COCBot/functions/Attack/ReturnHome.au3 +++ b/COCBot/functions/Attack/ReturnHome.au3 @@ -1,83 +1,79 @@ -;Returns home when in battle, will take screenshot and check for gold/elixir change unless specified not to. -;Added AbortSearch flag to avoid deadloop while try to recover from search error -Func ReturnHome($TakeSS = 1, $GoldChangeCheck = True, $AbortSearch = False) ;Return main screen - - If $GoldChangeCheck = True Then - GoldElixirChange() ; Waits for gold and elixir to stop changing - If _Sleep(100) Then Return - EndIf - - If $OverlayVisible Then DeleteOverlay() - - $checkKPower = False - $checkQPower = False - SetLog(GetLangText("msgReturnHome"), $COLOR_BLUE) - If $Running = False Then Return - _CaptureRegion() - If _ColorCheck(_GetPixelColor(36, 523), Hex(0xEE5056, 6), 30) Then - Click(77, 529) ;Click Surrender - If _WaitForColor(374, 416, Hex(0xCF4010, 6), 30, 2) Then - Click(522, 384) ; Click confirm - EndIf - EndIf - _WaitForColor(304, 569, Hex(0x020202, 6), 20, 5) - ; And wait a bitlonger - If _Sleep(1000) Then Return - - If $AbortSearch = False Then - _CaptureRegion() - $Raid = 1 - ;Get Last Raid Resources - $LastRaidGold = ReadText(300, 291, 140, $textReturnHome, 0) - $LastRaidElixir = ReadText(300, 329, 140, $textReturnHome, 0) - _CaptureRegion() - If _ColorCheck(_GetPixelColor(462, 372), Hex(0xF2D668, 6), 40) Then - ; No DE - $LastRaidDarkElixir = 0 - $LastRaidTrophy = ReadText(380, 367, 60, $textReturnHome, 0) - Else - $LastRaidDarkElixir = ReadText(300, 367, 140, $textReturnHome, 0) - $LastRaidTrophy = ReadText(380, 403, 60, $textReturnHome, 0) - EndIf - - $GoldTotalLoot += $LastRaidGold - $ElixirTotalLoot += $LastRaidElixir - $DarkTotalLoot += $LastRaidDarkElixir - $TrophyTotalLoot += $LastRaidTrophy - - If $TakeSS = 1 Then - SetLog(GetLangText("msgTakingLootSS"), $COLOR_ORANGE) - Local $Date = @MDAY & "." & @MON & "." & @YEAR - Local $Time = @HOUR & "." & @MIN - $FileName = $Date & "_at_" & $Time & ".jpg" - _CaptureRegion() - _GDIPlus_ImageSaveToFile($hBitmap, $dirLoots & $FileName) - EndIf - - If _Sleep(2000) Then Return - Click(428, 544) ;Click Return Home Button - Else - checkMainScreen(True) - EndIf - - If _GUICtrlEdit_GetLineCount($txtLog) > 5000 Then - _GUICtrlEdit_SetText($txtLog, "") - EndIf - - Local $counter = 0 - While 1 - If _Sleep(200) Then Return - _CaptureRegion() - If _ColorCheck(_GetPixelColor(284, 28), Hex(0x41B1CD, 6), 20) Then - Return - EndIf - - $counter += 1 - - If $counter >= 50 Then - SetLog(GetLangText("msgCannotReturn"), $COLOR_RED) - checkMainScreen() - Return - EndIf - WEnd -EndFunc ;==>ReturnHome +;Returns home when in battle, will take screenshot and check for gold/elixir change unless specified not to. +;Added AbortSearch flag to avoid deadloop while try to recover from search error +Func ReturnHome($TakeSS = 1, $GoldChangeCheck = True, $AbortSearch = False) ;Return main screen + + If $GoldChangeCheck = True Then + GoldElixirChange() ; Waits for gold and elixir to stop changing + If _Sleep(100) Then Return + EndIf + + If $OverlayVisible Then DeleteOverlay() + + $checkKPower = False + $checkQPower = False + SetLog(GetLangText("msgReturnHome"), $COLOR_BLUE) + If $Running = False Then Return + _CaptureRegion() + If _WaitForColorArea(19, 519, 100, 30, Hex(0xEE5056, 6), 50, 2) Then + Click(77, 529) ;Click Surrender + If _WaitForColorArea(280, 372, 130, 50, Hex(0xCF4010, 6), 30, 2) Then + Click(522, 384) ; Click confirm + EndIf + EndIf + + If (_WaitForColor(304, 569, Hex(0x020202, 6), 30, 5) And $AbortSearch = False) Then + If _Sleep(1500) Then Return ;wait until number stop changing. + _CaptureRegion() + $Raid = 1 + ;Get Last Raid Resources + $LastRaidGold = ReadText(300, 291, 140, $textReturnHome, 0) + $LastRaidElixir = ReadText(300, 329, 140, $textReturnHome, 0) + _CaptureRegion() + If _ColorCheck(_GetPixelColor(462, 372), Hex(0xF2D668, 6), 40) Then + ; No DE + $LastRaidDarkElixir = 0 + $LastRaidTrophy = ReadText(380, 367, 60, $textReturnHome, 0) + Else + $LastRaidDarkElixir = ReadText(300, 367, 140, $textReturnHome, 0) + $LastRaidTrophy = ReadText(380, 403, 60, $textReturnHome, 0) + EndIf + + $GoldTotalLoot += $LastRaidGold + $ElixirTotalLoot += $LastRaidElixir + $DarkTotalLoot += $LastRaidDarkElixir + $TrophyTotalLoot += $LastRaidTrophy + + If $TakeSS = 1 Then + SetLog(GetLangText("msgTakingLootSS"), $COLOR_ORANGE) + Local $Date = @MDAY & "." & @MON & "." & @YEAR + Local $Time = @HOUR & "." & @MIN + $FileName = $Date & "_at_" & $Time & ".jpg" + _CaptureRegion() + _GDIPlus_ImageSaveToFile($hBitmap, $dirLoots & $FileName) + EndIf + If _Sleep(2000) Then Return + Click(428, 544) ;Click Return Home Button + Else + checkMainScreen(True) + EndIf + + If _GUICtrlEdit_GetLineCount($txtLog) > 5000 Then + _GUICtrlEdit_SetText($txtLog, "") + EndIf + Local $counter = 0 + While 1 + If _Sleep(200) Then Return + _CaptureRegion() + If _ColorCheck(_GetPixelColor(284, 28), Hex(0x41B1CD, 6), 20) Then + Return + EndIf + + $counter += 1 + + If $counter >= 50 Then + SetLog(GetLangText("msgCannotReturn"), $COLOR_RED) + checkMainScreen() + Return + EndIf + WEnd +EndFunc ;==>ReturnHome diff --git a/COCBot/functions/Config/ScreenCoordinates.au3 b/COCBot/functions/Config/ScreenCoordinates.au3 index 959a581..d29d17c 100644 --- a/COCBot/functions/Config/ScreenCoordinates.au3 +++ b/COCBot/functions/Config/ScreenCoordinates.au3 @@ -1,170 +1,169 @@ -; x y color tolerance -Global $IsMain[4] = [284, 28, 0x41B1CD, 20] ; origin: [284, 28, 0x41B1CD, 20] -Global $IsMainGrayed[4] = [284, 28, 0x215B69, 20] ; origin: [284, 28, 0x41B1CD, 20] -Global $TopLeftClient[2] = [1, 1] -Global $IsInactive[4] = [458, 311, 0x33B5E5, 20] ; origin: [458, 311, 0x33B5E5, 20] -Global $ReloadButton[2] = [416, 399] ; origin: [416, 399] -Global $AttaqueButton[2] = [60, 614] ; origin: [60, 614] -Global $MatchButton[2] = [217, 510] ; origin: [217, 510] -Global $HasShield[4] = [513, 416, 0x5DAC10, 50] ; origin [513, 416, 0x5DAC10, 50] -Global $BreakShield[2] = [513, 416] ; origin: [513, 416] -Global $SurrenderButton[2] = [62, 519] ; origin: [62, 519] -Global $ConfirmSurrender[2] = [512, 394] ; origin: [512, 394] -Global $CancelFight[4] = [822, 48, 0xD80408, 20] ; origine:[822, 48, 0xD80408, 20] -Global $CancelFight2[4] = [830, 59, 0xD80408, 20] ; origine:[830, 59, 0xD80408, 20] -Global $CancelFightBtn[2] = [822, 48] ; origine:[822, 48] -Global $EndFightScene[4] = [429, 519, 0xB8E35F, 20] ; Victory or defeat scene -Global $ReturnHome[2] = [428, 544] -Global $CloseChat[4] = [330, 334, 0xF0A03C, 20] ; -Global $SomeXCancelBtn[4] = [819, 55, 0xD80400, 20] -Global $EndBattleBtn[4] = [71, 530, 0xC00000, 20] -Global $Attacked[4] = [235, 209, 0x9E3826, 20] ; -Global $AttackedBtn[2] = [429, 493] ; -Global $HasClanMessage[4] = [31, 313, 0xF80B09, 20] ; -Global $OpenChatBtn[2] = [10, 334] ; -Global $IsClanTabSelected[4] = [204, 20, 0x6F6C4F, 20] ; -Global $IsClanMessage[4] = [26, 320, 0xE70400, 20] ; - -Global $ClanRequestTextArea[2] = [430, 140] -Global $ConfirmClanTroopsRequest[2] = [524, 228] -Global $CampFull[4] = [328, 535, 0xD03840, 20] ; - -Global $DropTrophiesStartPoint = [34, 310] -Global $TrainBtn[4] = [541, 602, 0x728BB0, 20] ; -Global $TrainBarbarian[4] = [216, 325, 0xF09D1C, 30] ; -Global $TrainArcher[4] = [330, 323, 0xE84070, 30] ; -Global $TrainGiant[4] = [419, 319, 0xF88409, 30] ; -Global $TrainGoblin[4] = [549, 328, 0xFB4C24, 30] ; -Global $TrainWallbreaker[4] = [635, 335, 0x473940, 30] ; - -Global $TrainMinion[4] = [261, 365, 0x43D9E2, 28] ; -;Global $TrainMinion[4] = [261, 365, 0x5DDCE5, 10] ; -Global $TrainHog[4] = [369, 366, 0x39CBDA, 10] ; -Global $TrainValkyrie[4] = [475, 365, 0x3CD8E0, 10] ; - -Global $NextBtn[2] = [750, 500] -; Someone asking troupes : Color 0xD0E978 in x = 121 - - -Func SelectDropTroupe($troop) - Click(68 + (72 * $troop), 595) - _CaptureRegion() - $GlobalColor = CommonColor(54 + (72 * $troop), 585, 30, 35) -EndFunc ;==>SelectDropTroupe - -; Read the quantity for a given troop -Func ReadTroopQuantity($troop) - _CaptureRegion() - If _ColorCheck(_GetPixelColor(44 + (72 * $troop), 576), Hex(0xFFFFFF, 6), 20) Then - $ReturnQty = ReadText(43 + (72 * $troop), 578, 54, $textDeployNumber) - Else - $ReturnQty = ReadText(43 + (72 * $troop), 583, 54, $textDeployNumber) - EndIf - $ReturnQty = StringStripWS($ReturnQty, 8) - If StringLeft($ReturnQty, 1) = "x" Then $ReturnQty = StringRight($ReturnQty, StringLen($ReturnQty) - 1) - Return $ReturnQty -EndFunc ;==>ReadTroopQuantity - -Func IdentifyTroopKind($position) - -;~ If $position = 0 Then -;~ Click(68 + 72, 595) -;~ Else -;~ Click(68, 595) -;~ EndIf -;~ If $position < 2 Then -;~ If _Sleep(500) Then Return -;~ EndIf - - _CaptureRegion(32 + (72 * $position), 595, 104 + (72 * $position), 665) - $sendHBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap) - $resDeploy = DllCall(@ScriptDir & "\BrokenBot.org\BrokenBot32.dll", "str", "BrokenBotGetDeploy", "ptr", $sendHBitmap, "int", 201, "int", 3, "int", 1, "int", 0, "int", (IsChecked($chkSpeedBoost) ? (1) : (0))) - _WinAPI_DeleteObject($sendHBitmap) - If IsArray($resDeploy) Then - If $resDeploy[0] = -1 Then - $found = -1 - ; check for a large troop image - _CaptureRegion(32 + (72 * $position), 595, 104 + (72 * $position), 665) - $sendHBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap) - $resDeploy = DllCall(@ScriptDir & "\BrokenBot.org\BrokenBot32.dll", "str", "BrokenBotGetDeploy", "ptr", $sendHBitmap, "int", 203, "int", 3, "int", 1, "int", 0, "int", (IsChecked($chkSpeedBoost) ? (1) : (0))) - _WinAPI_DeleteObject($sendHBitmap) - If IsArray($resDeploy) Then - If $resDeploy[0] = -1 Then - $found = -1 - ElseIf $resDeploy[0] = -2 Then - SetLog(GetLangText("msgLicense"), $COLOR_RED) - $found = -1 - Else - $deploySplit = StringSplit($resDeploy[0], "|", 2) - $found = $deploySplit[5] - EndIf - Else - $found = -1 - SetLog(GetLangText("msgDLLError"), $COLOR_RED) - EndIf - ElseIf $resDeploy[0] = -2 Then - SetLog(GetLangText("msgLicense"), $COLOR_RED) - $found = -1 - Else - $deploySplit = StringSplit($resDeploy[0], "|", 2) - $found = $deploySplit[5] - EndIf - Else - $found = -1 - SetLog(GetLangText("msgDLLError"), $COLOR_RED) - EndIf - - Switch $found - Case 1 - Return $eBarbarian - Case 2 - Return $eArcher - Case 3 - Return $eGoblin - Case 4 - Return $eGiant - Case 5 - Return $eWallbreaker - Case 6 - Return $eBalloon - Case 7 - Return $eWizard - Case 8 - Return $eHealer - Case 9 - Return $eDragon - Case 10 - Return $ePekka - Case 11 - Return $eMinion - Case 12 - Return $eHog - Case 13 - Return $eValkyrie - Case 14 - Return $eGolem - Case 15 - Return $eWitch - Case 16 - Return $eLavaHound - Case 17 - Return $eKing - Case 18 - Return $eQueen - Case 19 - Return $eLSpell - Case 20 - Return -1 - Case 21 - Return -1 - Case 22 - Return -1 - Case 23 - Return -1 - Case Else - _CaptureRegion() - If _ColorCheck(_GetPixelColor(43 + (72 * $position), 604), Hex(0x5B9CD0, 6), 20) Then Return $eCastle ;Check if slot is Clan Castle - Return -1 - EndSwitch - -EndFunc ;==>IdentifyTroopKind +; x y color tolerance +Global $IsMain[4] = [284, 28, 0x41B1CD, 20] ; origin: [284, 28, 0x41B1CD, 20] +Global $IsMainGrayed[4] = [284, 28, 0x215B69, 20] ; origin: [284, 28, 0x41B1CD, 20] +Global $TopLeftClient[2] = [1, 1] +Global $IsInactive[4] = [458, 311, 0x33B5E5, 20] ; origin: [458, 311, 0x33B5E5, 20] +Global $ReloadButton[2] = [416, 399] ; origin: [416, 399] +Global $AttaqueButton[2] = [60, 614] ; origin: [60, 614] +Global $MatchButton[2] = [217, 510] ; origin: [217, 510] +Global $HasShield[4] = [513, 416, 0x5DAC10, 50] ; origin [513, 416, 0x5DAC10, 50] +Global $BreakShield[2] = [513, 416] ; origin: [513, 416] +Global $SurrenderButton[2] = [62, 519] ; origin: [62, 519] +Global $ConfirmSurrender[2] = [512, 394] ; origin: [512, 394] +Global $CancelFight[4] = [822, 48, 0xD80408, 20] ; origine:[822, 48, 0xD80408, 20] +Global $CancelFight2[4] = [830, 59, 0xD80408, 20] ; origine:[830, 59, 0xD80408, 20] +Global $CancelFightBtn[2] = [822, 48] ; origine:[822, 48] +Global $EndFightScene[4] = [429, 519, 0xB8E35F, 20] ; Victory or defeat scene +Global $ReturnHome[2] = [428, 544] +Global $CloseChat[4] = [330, 334, 0xF0A03C, 20] ; +Global $SomeXCancelBtn[4] = [819, 55, 0xD80400, 20] +Global $EndBattleBtn[4] = [71, 530, 0xC00000, 20] +Global $Attacked[4] = [235, 209, 0x9E3826, 20] ; +Global $AttackedBtn[2] = [429, 493] ; +Global $HasClanMessage[4] = [31, 313, 0xF80B09, 20] ; +Global $OpenChatBtn[2] = [10, 334] ; +Global $IsClanTabSelected[4] = [204, 20, 0x6F6C4F, 20] ; +Global $IsClanMessage[4] = [26, 320, 0xE70400, 20] ; + +Global $ClanRequestTextArea[2] = [430, 140] +Global $ConfirmClanTroopsRequest[2] = [524, 228] +Global $CampFull[4] = [328, 535, 0xD03840, 20] ; + +Global $DropTrophiesStartPoint = [34, 310] +Global $TrainBtn[4] = [541, 602, 0x728BB0, 20] ; +Global $TrainBarbarian[4] = [216, 325, 0xF09D1C, 30] ; +Global $TrainArcher[4] = [330, 323, 0xE84070, 30] ; +Global $TrainGiant[4] = [419, 319, 0xF88409, 30] ; +Global $TrainGoblin[4] = [549, 328, 0xFB4C24, 30] ; +Global $TrainWallbreaker[4] = [635, 335, 0x473940, 30] ; + +Global $TrainMinion[4] = [261, 365, 0x43D9E2, 28] ; +;Global $TrainMinion[4] = [261, 365, 0x5DDCE5, 10] ; +Global $TrainHog[4] = [369, 366, 0x39CBDA, 10] ; +Global $TrainValkyrie[4] = [475, 365, 0x3CD8E0, 10] ; + +Global $TrainMinionDll[2] = [-1, -1] ; +Global $TrainHogDll[2] = [-1, -1] ; +Global $TrainValkyrieDll[2] = [-1, -1] ; + +Global $NextBtn[2] = [750, 500] +; Someone asking troupes : Color 0xD0E978 in x = 121 + + +Func SelectDropTroupe($troop) + Click(68 + (72 * $troop), 595) + _CaptureRegion() + $GlobalColor = CommonColor(54 + (72 * $troop), 585, 30, 35) +EndFunc ;==>SelectDropTroupe + +; Read the quantity for a given troop +Func ReadTroopQuantity($troop) + _CaptureRegion() + If _ColorCheck(_GetPixelColor(44 + (72 * $troop), 576), Hex(0xFFFFFF, 6), 20) Then + $ReturnQty = ReadText(43 + (72 * $troop), 578, 54, $textDeployNumber) + Else + $ReturnQty = ReadText(43 + (72 * $troop), 583, 54, $textDeployNumber) + EndIf + $ReturnQty = StringStripWS($ReturnQty, 8) + If StringLeft($ReturnQty, 1) = "x" Then + $ReturnQty = StringRight($ReturnQty, StringLen($ReturnQty) - 1) + ElseIf StringLeft($ReturnQty, 2) = "11" Then + $ReturnQty = StringRight($ReturnQty, StringLen($ReturnQty) - 1) + EndIf + Return $ReturnQty +EndFunc ;==>ReadTroopQuantity + +Func IdentifyTroopKind($position) + + _CaptureRegion(32 + (72 * $position), 595, 104 + (72 * $position), 665) + $sendHBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap) + $resDeploy = DllCall(@ScriptDir & "\BrokenBot.org\BrokenBot32.dll", "str", "BrokenBotGetDeploy", "ptr", $sendHBitmap, "int", 201, "int", 3, "int", 1, "int", 0, "int", (IsChecked($chkSpeedBoost) ? (1) : (0))) + _WinAPI_DeleteObject($sendHBitmap) + If IsArray($resDeploy) Then + If $resDeploy[0] = -1 Then + $found = -1 + ; check for a large troop image + _CaptureRegion(32 + (72 * $position), 595, 104 + (72 * $position), 665) + $sendHBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap) + $resDeploy = DllCall(@ScriptDir & "\BrokenBot.org\BrokenBot32.dll", "str", "BrokenBotGetDeploy", "ptr", $sendHBitmap, "int", 203, "int", 3, "int", 1, "int", 0, "int", (IsChecked($chkSpeedBoost) ? (1) : (0))) + _WinAPI_DeleteObject($sendHBitmap) + If IsArray($resDeploy) Then + If $resDeploy[0] = -1 Then + $found = -1 + ElseIf $resDeploy[0] = -2 Then + SetLog(GetLangText("msgLicense"), $COLOR_RED) + $found = -1 + Else + $deploySplit = StringSplit($resDeploy[0], "|", 2) + $found = $deploySplit[5] + EndIf + Else + $found = -1 + SetLog(GetLangText("msgDLLError"), $COLOR_RED) + EndIf + ElseIf $resDeploy[0] = -2 Then + SetLog(GetLangText("msgLicense"), $COLOR_RED) + $found = -1 + Else + $deploySplit = StringSplit($resDeploy[0], "|", 2) + $found = $deploySplit[5] + EndIf + Else + $found = -1 + SetLog(GetLangText("msgDLLError"), $COLOR_RED) + EndIf + + Switch $found + Case 1 + Return $eBarbarian + Case 2 + Return $eArcher + Case 3 + Return $eGoblin + Case 4 + Return $eGiant + Case 5 + Return $eWallbreaker + Case 6 + Return $eBalloon + Case 7 + Return $eWizard + Case 8 + Return $eHealer + Case 9 + Return $eDragon + Case 10 + Return $ePekka + Case 11 + Return $eMinion + Case 12 + Return $eHog + Case 13 + Return $eValkyrie + Case 14 + Return $eGolem + Case 15 + Return $eWitch + Case 16 + Return $eLavaHound + Case 17 + Return $eKing + Case 18 + Return $eQueen + Case 19 + Return $eLSpell + Case 20 + Return -1 + Case 21 + Return -1 + Case 22 + Return -1 + Case 23 + Return -1 + Case Else + _CaptureRegion() + If _ColorCheck(_GetPixelColor(43 + (72 * $position), 604), Hex(0x5B9CD0, 6), 20) Then Return $eCastle ;Check if slot is Clan Castle + Return -1 + EndSwitch + +EndFunc ;==>IdentifyTroopKind diff --git a/COCBot/functions/Config/applyConfig.au3 b/COCBot/functions/Config/applyConfig.au3 index ebe94c0..ff3c8b3 100644 --- a/COCBot/functions/Config/applyConfig.au3 +++ b/COCBot/functions/Config/applyConfig.au3 @@ -1,258 +1,280 @@ -;Applies all of the variable to the GUI - -Func applyConfig() ;Applies the data from config to the controls in GUI - ;Donate Settings------------------------------------------------------------------------- - If $ichkRequest = 1 Then - GUICtrlSetState($chkRequest, $GUI_CHECKED) - Else - GUICtrlSetState($chkRequest, $GUI_UNCHECKED) - EndIf - -;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - If $ichkDonateBarbarians = 1 Then - GUICtrlSetState($chkDonateBarbarians, $GUI_CHECKED) - Else - GUICtrlSetState($chkDonateBarbarians, $GUI_UNCHECKED) - EndIf - If $ichkDonateAllBarbarians = 1 Then - GUICtrlSetState($chkDonateAllBarbarians, $GUI_CHECKED) - Else - GUICtrlSetState($chkDonateAllBarbarians, $GUI_UNCHECKED) - EndIf - ;```````````````````````````````````````````````` - If $ichkDonateArchers = 1 Then - GUICtrlSetState($chkDonateArchers, $GUI_CHECKED) - Else - GUICtrlSetState($chkDonateArchers, $GUI_UNCHECKED) - EndIf - If $ichkDonateAllArchers = 1 Then - GUICtrlSetState($chkDonateAllArchers, $GUI_CHECKED) - Else - GUICtrlSetState($chkDonateAllArchers, $GUI_UNCHECKED) - EndIf -;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - If $ichkDonateGiants = 1 Then - GUICtrlSetState($chkDonateGiants, $GUI_CHECKED) - Else - GUICtrlSetState($chkDonateGiants, $GUI_UNCHECKED) - EndIf - If $ichkDonateAllGiants = 1 Then - GUICtrlSetState($chkDonateAllGiants, $GUI_CHECKED) - Else - GUICtrlSetState($chkDonateAllGiants, $GUI_UNCHECKED) - EndIf - If IniRead($config, "donate", "gtfo", "0") = 1 Then - GUICtrlSetState($gtfo, $GUI_CHECKED) - Else - GUICtrlSetState($gtfo, $GUI_UNCHECKED) - EndIf - - - GUICtrlSetData($txtDonateBarbarians, $itxtDonateBarbarians) - GUICtrlSetData($txtDonateArchers, $itxtDonateArchers) - GUICtrlSetData($txtDonateGiants, $itxtDonateGiants) - - GUICtrlSetData($txtRequest, $itxtRequest) - _GUICtrlComboBox_SetCurSel($cmbDonateBarbarians, IniRead($config, "donate", "donate1", "0")) - _GUICtrlComboBox_SetCurSel($cmbDonateArchers, IniRead($config, "donate", "donate2", "1")) - _GUICtrlComboBox_SetCurSel($cmbDonateGiants, IniRead($config, "donate", "donate3", "2")) - GUICtrlSetData($NoOfBarbarians, IniRead($config, "donate", "amount1", 5)) - GUICtrlSetData($NoOfArchers, IniRead($config, "donate", "amount2", 5)) - GUICtrlSetData($NoOfGiants, IniRead($config, "donate", "amount3", 5)) - chkRequest() - ;Other Settings-------------------------------------------------------------------------- - If $ichkWalls = 1 Then - GUICtrlSetState($chkWalls, $GUI_CHECKED) - Else - GUICtrlSetState($chkWalls, $GUI_UNCHECKED) - EndIf - _GUICtrlComboBox_SetCurSel($cmbWalls, $icmbWalls) - _GUICtrlComboBox_SetCurSel($cmbTolerance, $icmbTolerance) - - Switch $iUseStorage - Case 0 - GUICtrlSetState($UseGold, $GUI_CHECKED) - Case 1 - GUICtrlSetState($UseElixir, $GUI_CHECKED) - Case 2 - GUICtrlSetState($UseGoldElix, $GUI_CHECKED) - EndSwitch - - GUICtrlSetData($txtWallMinGold, $itxtWallMinGold) - GUICtrlSetData($txtWallMinElixir, $itxtWallMinElixir) - - ;Lab - If $ichkLab = 1 Then - GUICtrlSetState($chkLab, $GUI_CHECKED) - Else - GUICtrlSetState($chkLab, $GUI_UNCHECKED) - EndIf - _GUICtrlComboBox_SetCurSel($cmbLaboratory, $icmbLaboratory) - - ;General Settings-------------------------------------------------------------------------- - If $frmBotPosX <> -32000 Then - WinMove($sBotTitle, "", $frmBotPosX, $frmBotPosY) - _WinMoved(0, 0, 0, 0) - EndIf - GUISetState(@SW_SHOW, $frmBot) - GUICtrlSetData($txtMinimumTrophy, $itxtMinTrophy) - GUICtrlSetData($txtMaxTrophy, $itxtMaxTrophy) - ;Misc Settings-------------------------------------------------------------------------- - If $ichkCollect = 1 Then - GUICtrlSetState($chkCollect, $GUI_CHECKED) - Else - GUICtrlSetState($chkCollect, $GUI_UNCHECKED) - EndIf - If $TakeAttackSnapShot = 1 Then - GUICtrlSetState($chkTakeAttackSS, $GUI_CHECKED) - Else - GUICtrlSetState($chkTakeAttackSS, $GUI_UNCHECKED) - EndIf - If $DebugMode = 1 Then - GUICtrlSetState($chkDebug, $GUI_CHECKED) - Else - GUICtrlSetState($chkDebug, $GUI_UNCHECKED) - EndIf - GUICtrlSetData($txtReconnect, $itxtReconnect) - GUICtrlSetData($txtReturnh, $itxtReturnh) - _GUICtrlComboBox_SetCurSel($cmbSearchsp, $icmbSearchsp) - If $ichkTrap = 1 Then - GUICtrlSetState($chkTrap, $GUI_CHECKED) - Else - GUICtrlSetState($chkTrap, $GUI_UNCHECKED) - EndIf - If $WideEdge = 1 Then - GUICtrlSetState($chkWideEdge, $GUI_CHECKED) - Else - GUICtrlSetState($chkWideEdge, $GUI_UNCHECKED) - EndIf - If $iClearField = 1 Then - GUICtrlSetState($chkClearField, $GUI_CHECKED) - Else - GUICtrlSetState($chkClearField, $GUI_UNCHECKED) - EndIf - - If $ichkBotStop = 1 Then - GUICtrlSetState($chkBotStop, $GUI_CHECKED) - Else - GUICtrlSetState($chkBotStop, $GUI_UNCHECKED) - EndIf - _GUICtrlComboBox_SetCurSel($cmbBotCommand, $icmbBotCommand) - _GUICtrlComboBox_SetCurSel($cmbBotCond, $icmbBotCond) - - GUICtrlSetData($txtSpellCap, $itxtspellCap) - - If $TakeLootSnapShot = 1 Then - GUICtrlSetState($chkTakeLootSS, $GUI_CHECKED) - Else - GUICtrlSetState($chkTakeLootSS, $GUI_UNCHECKED) - EndIf - - If $TakeAllTownSnapShot = 1 Then - GUICtrlSetState($chkTakeTownSS, $GUI_CHECKED) - Else - GUICtrlSetState($chkTakeTownSS, $GUI_UNCHECKED) - EndIf - - If $AlertBaseFound = 1 Then - GUICtrlSetState($chkAlertSearch, $GUI_CHECKED) - Else - GUICtrlSetState($chkAlertSearch, $GUI_UNCHECKED) - EndIf - - ;Push Bullet - If $PushBulletEnabled = 1 Then - GUICtrlSetState($lblpushbulletenabled, $GUI_CHECKED) - Else - GUICtrlSetState($lblpushbulletenabled, $GUI_UNCHECKED) - EndIf - - GUICtrlSetData($pushbullettokenvalue, $PushBullettoken) - - If $PushBulletvillagereport = 1 Then - GUICtrlSetState($lblvillagereport, $GUI_CHECKED) - Else - GUICtrlSetState($lblvillagereport, $GUI_UNCHECKED) - EndIf - - If $PushBulletchatlog = 1 Then - GUICtrlSetState($lblchatlog, $GUI_CHECKED) - Else - GUICtrlSetState($lblchatlog, $GUI_UNCHECKED) - EndIf - - If $PushBulletmatchfound = 1 Then - GUICtrlSetState($lblmatchfound, $GUI_CHECKED) - Else - GUICtrlSetState($lblmatchfound, $GUI_UNCHECKED) - EndIf - - If $PushBulletlastraid = 1 Then - GUICtrlSetState($lbllastraid, $GUI_CHECKED) - Else - GUICtrlSetState($lbllastraid, $GUI_UNCHECKED) - EndIf - - If $PushBulletdebug = 1 Then - GUICtrlSetState($lblpushbulletdebug, $GUI_CHECKED) - Else - GUICtrlSetState($lblpushbulletdebug, $GUI_UNCHECKED) - EndIf - - If $PushBulletremote = 1 Then - GUICtrlSetState($lblpushbulletremote, $GUI_CHECKED) - Else - GUICtrlSetState($lblpushbulletremote, $GUI_UNCHECKED) - EndIf - - If $PushBulletdelete = 1 Then - GUICtrlSetState($lblpushbulletdelete, $GUI_CHECKED) - Else - GUICtrlSetState($lblpushbulletdelete, $GUI_UNCHECKED) - EndIf - - If $PushBulletfreebuilder = 1 Then - GUICtrlSetState($lblfreebuilder, $GUI_CHECKED) - Else - GUICtrlSetState($lblfreebuilder, $GUI_UNCHECKED) - EndIf - - If $PushBulletdisconnection = 1 Then - GUICtrlSetState($lbldisconnect, $GUI_CHECKED) - Else - GUICtrlSetState($lbldisconnect, $GUI_UNCHECKED) - EndIf - - If $PushBullettype = 1 Then - GUICtrlSetState($UseJPG, $GUI_CHECKED) - Else - GUICtrlSetState($UseJPG, $GUI_UNCHECKED) - EndIf - - If $PushBulletattacktype = 1 Then - GUICtrlSetState($UseAttackJPG, $GUI_CHECKED) - Else - GUICtrlSetState($UseAttackJPG, $GUI_UNCHECKED) - EndIf - - lblpushbulletenabled() - - If $ichkNoAttack = 1 Then - GUICtrlSetState($chkNoAttack, $GUI_CHECKED) - GUICtrlSetState($lblpushbulletenabled, $GUI_UNCHECKED) - GUICtrlSetState($lblpushbulletenabled, $GUI_DISABLE) - lblpushbulletenabled() - Else - GUICtrlSetState($chkNoAttack, $GUI_UNCHECKED) - EndIf - - If $ichkDonateOnly = 1 Then - GUICtrlSetState($chkDonateOnly, $GUI_CHECKED) - GUICtrlSetState($lblpushbulletenabled, $GUI_UNCHECKED) - GUICtrlSetState($lblpushbulletenabled, $GUI_DISABLE) - lblpushbulletenabled() - Else - GUICtrlSetState($chkDonateOnly, $GUI_UNCHECKED) - EndIf - -EndFunc ;==>applyConfig +;Applies all of the variable to the GUI + +Func applyConfig() ;Applies the data from config to the controls in GUI + ;Donate Settings------------------------------------------------------------------------- + If $ichkRequest = 1 Then + GUICtrlSetState($chkRequest, $GUI_CHECKED) + Else + GUICtrlSetState($chkRequest, $GUI_UNCHECKED) + EndIf + +;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + If $ichkDonateBarbarians = 1 Then + GUICtrlSetState($chkDonateBarbarians, $GUI_CHECKED) + Else + GUICtrlSetState($chkDonateBarbarians, $GUI_UNCHECKED) + EndIf + If $ichkDonateAllBarbarians = 1 Then + GUICtrlSetState($chkDonateAllBarbarians, $GUI_CHECKED) + Else + GUICtrlSetState($chkDonateAllBarbarians, $GUI_UNCHECKED) + EndIf + ;```````````````````````````````````````````````` + If $ichkDonateArchers = 1 Then + GUICtrlSetState($chkDonateArchers, $GUI_CHECKED) + Else + GUICtrlSetState($chkDonateArchers, $GUI_UNCHECKED) + EndIf + If $ichkDonateAllArchers = 1 Then + GUICtrlSetState($chkDonateAllArchers, $GUI_CHECKED) + Else + GUICtrlSetState($chkDonateAllArchers, $GUI_UNCHECKED) + EndIf +;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + If $ichkDonateGiants = 1 Then + GUICtrlSetState($chkDonateGiants, $GUI_CHECKED) + Else + GUICtrlSetState($chkDonateGiants, $GUI_UNCHECKED) + EndIf + If $ichkDonateAllGiants = 1 Then + GUICtrlSetState($chkDonateAllGiants, $GUI_CHECKED) + Else + GUICtrlSetState($chkDonateAllGiants, $GUI_UNCHECKED) + EndIf + If IniRead($config, "donate", "gtfo", "0") = 1 Then + GUICtrlSetState($gtfo, $GUI_CHECKED) + Else + GUICtrlSetState($gtfo, $GUI_UNCHECKED) + EndIf + + + GUICtrlSetData($txtDonateBarbarians, $itxtDonateBarbarians) + GUICtrlSetData($txtDonateArchers, $itxtDonateArchers) + GUICtrlSetData($txtDonateGiants, $itxtDonateGiants) + + GUICtrlSetData($txtRequest, $itxtRequest) + _GUICtrlComboBox_SetCurSel($cmbDonateBarbarians, IniRead($config, "donate", "donate1", "0")) + _GUICtrlComboBox_SetCurSel($cmbDonateArchers, IniRead($config, "donate", "donate2", "1")) + _GUICtrlComboBox_SetCurSel($cmbDonateGiants, IniRead($config, "donate", "donate3", "2")) + GUICtrlSetData($NoOfBarbarians, IniRead($config, "donate", "amount1", 5)) + GUICtrlSetData($NoOfArchers, IniRead($config, "donate", "amount2", 5)) + GUICtrlSetData($NoOfGiants, IniRead($config, "donate", "amount3", 5)) + chkRequest() + ;Other Settings-------------------------------------------------------------------------- + If $ichkWalls = 1 Then + GUICtrlSetState($chkWalls, $GUI_CHECKED) + Else + GUICtrlSetState($chkWalls, $GUI_UNCHECKED) + EndIf + _GUICtrlComboBox_SetCurSel($cmbWalls, $icmbWalls) + _GUICtrlComboBox_SetCurSel($cmbTolerance, $icmbTolerance) + + Switch $iUseStorage + Case 0 + GUICtrlSetState($UseGold, $GUI_CHECKED) + GUICtrlSetState($UseElixir, $GUI_UNCHECKED) + GUICtrlSetState($UseGoldElix, $GUI_UNCHECKED) + Case 1 + GUICtrlSetState($UseElixir, $GUI_CHECKED) + GUICtrlSetState($UseGold, $GUI_UNCHECKED) + GUICtrlSetState($UseGoldElix, $GUI_UNCHECKED) + Case 2 + GUICtrlSetState($UseGoldElix, $GUI_CHECKED) + GUICtrlSetState($UseGold, $GUI_UNCHECKED) + GUICtrlSetState($UseElixir, $GUI_UNCHECKED) + EndSwitch + + GUICtrlSetData($txtWallMinGold, $itxtWallMinGold) + GUICtrlSetData($txtWallMinElixir, $itxtWallMinElixir) + + ;Lab + If $ichkLab = 1 Then + GUICtrlSetState($chkLab, $GUI_CHECKED) + Else + GUICtrlSetState($chkLab, $GUI_UNCHECKED) + EndIf + _GUICtrlComboBox_SetCurSel($cmbLaboratory, $icmbLaboratory) + + ;UpgradeHeroes + If $ichkUpgradeKing = 1 Then ;==>upgradeking + GUICtrlSetState($chkUpgradeKing, $GUI_CHECKED) + Else + GUICtrlSetState($chkUpgradeKing, $GUI_UNCHECKED) + EndIf + + If $ichkUpgradeQueen = 1 Then ;==>upgradequeen + GUICtrlSetState($chkUpgradeQueen, $GUI_CHECKED) + Else + GUICtrlSetState($chkUpgradeQueen, $GUI_UNCHECKED) + EndIf + + GUICtrlSetData($txtKeepFreeBuilder, $itxtKeepFreeBuilder) ;==>FreeBuilderBox + + +;General Settings-------------------------------------------------------------------------- + If $frmBotPosX <> -32000 Then + WinMove($sBotTitle, "", $frmBotPosX, $frmBotPosY) + _WinMoved(0, 0, 0, 0) + EndIf + GUISetState(@SW_SHOW, $frmBot) + GUICtrlSetData($txtMinimumTrophy, $itxtMinTrophy) + GUICtrlSetData($txtMaxTrophy, $itxtMaxTrophy) + ;Misc Settings-------------------------------------------------------------------------- + If $ichkCollect = 1 Then + GUICtrlSetState($chkCollect, $GUI_CHECKED) + Else + GUICtrlSetState($chkCollect, $GUI_UNCHECKED) + EndIf + If $TakeAttackSnapShot = 1 Then + GUICtrlSetState($chkTakeAttackSS, $GUI_CHECKED) + Else + GUICtrlSetState($chkTakeAttackSS, $GUI_UNCHECKED) + EndIf + If $DebugMode = 1 Then + GUICtrlSetState($chkDebug, $GUI_CHECKED) + Else + GUICtrlSetState($chkDebug, $GUI_UNCHECKED) + EndIf + GUICtrlSetData($txtReconnect, $itxtReconnect) + GUICtrlSetData($txtReturnh, $itxtReturnh) + _GUICtrlComboBox_SetCurSel($cmbSearchsp, $icmbSearchsp) + If $ichkTrap = 1 Then + GUICtrlSetState($chkTrap, $GUI_CHECKED) + Else + GUICtrlSetState($chkTrap, $GUI_UNCHECKED) + EndIf + If $WideEdge = 1 Then + GUICtrlSetState($chkWideEdge, $GUI_CHECKED) + Else + GUICtrlSetState($chkWideEdge, $GUI_UNCHECKED) + EndIf + If $iClearField = 1 Then + GUICtrlSetState($chkClearField, $GUI_CHECKED) + Else + GUICtrlSetState($chkClearField, $GUI_UNCHECKED) + EndIf + + If $ichkBotStop = 1 Then + GUICtrlSetState($chkBotStop, $GUI_CHECKED) + Else + GUICtrlSetState($chkBotStop, $GUI_UNCHECKED) + EndIf + _GUICtrlComboBox_SetCurSel($cmbBotCommand, $icmbBotCommand) + _GUICtrlComboBox_SetCurSel($cmbBotCond, $icmbBotCond) + + GUICtrlSetData($txtSpellCap, $itxtspellCap) + + If $TakeLootSnapShot = 1 Then + GUICtrlSetState($chkTakeLootSS, $GUI_CHECKED) + Else + GUICtrlSetState($chkTakeLootSS, $GUI_UNCHECKED) + EndIf + + If $TakeAllTownSnapShot = 1 Then + GUICtrlSetState($chkTakeTownSS, $GUI_CHECKED) + Else + GUICtrlSetState($chkTakeTownSS, $GUI_UNCHECKED) + EndIf + + If $AlertBaseFound = 1 Then + GUICtrlSetState($chkAlertSearch, $GUI_CHECKED) + Else + GUICtrlSetState($chkAlertSearch, $GUI_UNCHECKED) + EndIf + + ;Push Bullet + If $PushBulletEnabled = 1 Then + GUICtrlSetState($lblpushbulletenabled, $GUI_CHECKED) + Else + GUICtrlSetState($lblpushbulletenabled, $GUI_UNCHECKED) + EndIf + + GUICtrlSetData($pushbullettokenvalue, $PushBullettoken) + + If $PushBulletvillagereport = 1 Then + GUICtrlSetState($lblvillagereport, $GUI_CHECKED) + Else + GUICtrlSetState($lblvillagereport, $GUI_UNCHECKED) + EndIf + + If $PushBulletchatlog = 1 Then + GUICtrlSetState($lblchatlog, $GUI_CHECKED) + Else + GUICtrlSetState($lblchatlog, $GUI_UNCHECKED) + EndIf + + If $PushBulletmatchfound = 1 Then + GUICtrlSetState($lblmatchfound, $GUI_CHECKED) + Else + GUICtrlSetState($lblmatchfound, $GUI_UNCHECKED) + EndIf + + If $PushBulletlastraid = 1 Then + GUICtrlSetState($lbllastraid, $GUI_CHECKED) + Else + GUICtrlSetState($lbllastraid, $GUI_UNCHECKED) + EndIf + + If $PushBulletdebug = 1 Then + GUICtrlSetState($lblpushbulletdebug, $GUI_CHECKED) + Else + GUICtrlSetState($lblpushbulletdebug, $GUI_UNCHECKED) + EndIf + + If $PushBulletremote = 1 Then + GUICtrlSetState($lblpushbulletremote, $GUI_CHECKED) + Else + GUICtrlSetState($lblpushbulletremote, $GUI_UNCHECKED) + EndIf + + If $PushBulletdelete = 1 Then + GUICtrlSetState($lblpushbulletdelete, $GUI_CHECKED) + Else + GUICtrlSetState($lblpushbulletdelete, $GUI_UNCHECKED) + EndIf + + If $PushBulletfreebuilder = 1 Then + GUICtrlSetState($lblfreebuilder, $GUI_CHECKED) + Else + GUICtrlSetState($lblfreebuilder, $GUI_UNCHECKED) + EndIf + + If $PushBulletdisconnection = 1 Then + GUICtrlSetState($lbldisconnect, $GUI_CHECKED) + Else + GUICtrlSetState($lbldisconnect, $GUI_UNCHECKED) + EndIf + + If $PushBullettype = 1 Then + GUICtrlSetState($UseJPG, $GUI_CHECKED) + Else + GUICtrlSetState($UseJPG, $GUI_UNCHECKED) + EndIf + + If $PushBulletattacktype = 1 Then + GUICtrlSetState($UseAttackJPG, $GUI_CHECKED) + Else + GUICtrlSetState($UseAttackJPG, $GUI_UNCHECKED) + EndIf + + lblpushbulletenabled() + + If $ichkNoAttack = 1 Then + GUICtrlSetState($chkNoAttack, $GUI_CHECKED) + GUICtrlSetState($lblpushbulletenabled, $GUI_UNCHECKED) + GUICtrlSetState($lblpushbulletenabled, $GUI_DISABLE) + lblpushbulletenabled() + Else + GUICtrlSetState($chkNoAttack, $GUI_UNCHECKED) + EndIf + + If $ichkDonateOnly = 1 Then + GUICtrlSetState($chkDonateOnly, $GUI_CHECKED) + GUICtrlSetState($lblpushbulletenabled, $GUI_UNCHECKED) + GUICtrlSetState($lblpushbulletenabled, $GUI_DISABLE) + lblpushbulletenabled() + Else + GUICtrlSetState($chkDonateOnly, $GUI_UNCHECKED) + EndIf + +EndFunc ;==>applyConfig diff --git a/COCBot/functions/Config/readConfig.au3 b/COCBot/functions/Config/readConfig.au3 index 54ef135..0d2e2c3 100644 --- a/COCBot/functions/Config/readConfig.au3 +++ b/COCBot/functions/Config/readConfig.au3 @@ -1,173 +1,178 @@ -;Reads config file and sets variables - -Func readConfig() ;Reads config and sets it to the variables - ;--------------------------------------------------------------------------------------- - ; Main settings ------------------------------------------------------------------------ - ;--------------------------------------------------------------------------------------- - $itxtMinTrophy = IniRead($config, "general", "MinTrophy", "0") - $itxtMaxTrophy = IniRead($config, "general", "MaxTrophy", "3000") - GUICtrlSetData($txtSnipeBelow, IniRead($config, "general", "MinSnipe", "0")) - $ichkBotStop = IniRead($config, "general", "BotStop", "0") - $icmbBotCommand = IniRead($config, "general", "Command", "0") - $icmbBotCond = IniRead($config, "general", "Cond", "0") - $ichkNoAttack = IniRead($config, "general", "NoAttack", "0") - $ichkDonateOnly = IniRead($config, "general", "DonateOnly", "0") - - ;--------------------------------------------------------------------------------------- - ; Attack settings ---------------------------------------------------------------------- - ;--------------------------------------------------------------------------------------- - _GUICtrlComboBox_SetCurSel($cmbUnitDelay, IniRead($config, "attack", "UnitD", "0")) - _GUICtrlComboBox_SetCurSel($cmbWaveDelay, IniRead($config, "attack", "WaveD", "0")) - - ;--------------------------------------------------------------------------------------- - ; Donate settings ---------------------------------------------------------------------- - ;--------------------------------------------------------------------------------------- - $ichkRequest = IniRead($config, "donate", "chkRequest", "0") - $itxtRequest = IniRead($config, "donate", "txtRequest", "") - $ichkDonateBarbarians = IniRead($config, "donate", "chkDonateBarbarians", "0") - $ichkDonateAllBarbarians = IniRead($config, "donate", "chkDonateAllBarbarians", "0") - $itxtDonateBarbarians = StringReplace(IniRead($config, "donate", "txtDonateBarbarians", "barbarians|barb|any"), "|", @CRLF) - $ichkDonateArchers = IniRead($config, "donate", "chkDonateArchers", "0") - $ichkDonateAllArchers = IniRead($config, "donate", "chkDonateAllArchers", "0") - $itxtDonateArchers = StringReplace(IniRead($config, "donate", "txtDonateArchers", "archers|arch|any"), "|", @CRLF) - $ichkDonateGiants = IniRead($config, "donate", "chkDonateGiants", "0") - $ichkDonateAllGiants = IniRead($config, "donate", "chkDonateAllGiants", "0") - $itxtDonateGiants = StringReplace(IniRead($config, "donate", "txtDonateGiants", "giants|giant|any"), "|", @CRLF) - If IniRead($config, "donate", "chkBlacklist", "0") = 1 Then - GUICtrlSetState($chkBlacklist, $GUI_CHECKED) - Else - GUICtrlSetState($chkBlacklist, $GUI_UNCHECKED) - EndIf - GUICtrlSetData($txtBlacklist, StringReplace(IniRead($config, "donate", "txtBlacklist", ""), "|", @CRLF)) - - ;--------------------------------------------------------------------------------------- - ; Upgrade settings --------------------------------------------------------------------- - ;--------------------------------------------------------------------------------------- - $ichkWalls = IniRead($config, "upgrade", "auto-wall", "0") - $icmbWalls = IniRead($config, "upgrade", "walllvl", "0") - $iUseStorage = IniRead($config, "upgrade", "use-storage", "0") - $itxtWallMinGold = IniRead($config, "upgrade", "minwallgold", "0") - $itxtWallMinElixir = IniRead($config, "upgrade", "minwallelixir", "0") - $icmbTolerance = IniRead($config, "upgrade", "walltolerance", "0") - - ;Laboratory - $ichkLab = IniRead($config, "upgrade", "auto-uptroops", "0") - $icmbLaboratory = IniRead($config, "upgrade", "troops-name", "0") - - ;--------------------------------------------------------------------------------------- - ; Notification settings ---------------------------------------------------------------- - ;--------------------------------------------------------------------------------------- - $PushBulletEnabled = IniRead($config, "notification", "pushbullet", "0") - $PushBullettoken = IniRead($config, "notification", "accounttoken", "") - $PushBullettype = IniRead($config, "notification", "lastraidtype", "0") - $PushBulletattacktype = IniRead($config, "notification", "attackimage", "0") - $PushBulletvillagereport = IniRead($config, "notification", "villagereport", "0") - $PushBulletchatlog = IniRead($config, "notification", "chatlog", "0") - $PushBulletmatchfound = IniRead($config, "notification", "matchfound", "0") - $PushBulletlastraid = IniRead($config, "notification", "lastraid", "0") - $PushBulletdebug = IniRead($config, "notification", "debug", "0") - $PushBulletremote = IniRead($config, "notification", "remote", "0") - $PushBulletdelete = IniRead($config, "notification", "delete", "0") - $PushBulletfreebuilder = IniRead($config, "notification", "freebuilder", "0") - $PushBulletdisconnection = IniRead($config, "notification", "disconnection", "0") - GUICtrlSetData($inppushuser, IniRead($config, "notification", "user", "")) -;~ If IniRead($config, "brokenbot.org", "senddata", "0") = 1 Then -;~ GUICtrlSetState($chkBBSendData, $GUI_CHECKED) -;~ Else -;~ GUICtrlSetState($chkBBSendData, $GUI_UNCHECKED) -;~ EndIf - ;--------------------------------------------------------------------------------------- - ; Misc settings ------------------------------------------------------------------------ - ;--------------------------------------------------------------------------------------- - $AlertBaseFound = IniRead($config, "misc", "AlertBaseFound", "0") - $TakeAttackSnapShot = IniRead($config, "misc", "TakeAttackSnapShot", "0") - $TakeLootSnapShot = IniRead($config, "misc", "TakeLootSnapShot", "0") - $TakeAllTownSnapShot = IniRead($config, "misc", "TakeAllTownSnapShot", "0") - $DebugMode = IniRead($config, "misc", "Debug", "0") - $ichkCollect = IniRead($config, "misc", "Collect", "1") - $itxtReconnect = IniRead($config, "misc", "reconnectdelay", "0") - $itxtReturnh = IniRead($config, "misc", "returnhomedelay", "0") - $icmbSearchsp = IniRead($config, "misc", "searchspd", "0") - $ichkTrap = IniRead($config, "misc", "chkTrap", "0") - $WideEdge = IniRead($config, "misc", "WideEdge", "0") - $iClearField = IniRead($config, "misc", "ClearField", "0") - $ichkAvoidEdge = IniRead($config, "misc", "AvoidEdge", "0") - $itxtspellCap = IniRead($config, "misc", "spellcap", "3") - ; Import old setting to new method - If $ichkAvoidEdge = "0" Then - GUICtrlSetData($sldAcc, 100) - IniWrite($config, "misc", "AvoidEdge", "-1") - ElseIf $ichkAvoidEdge = "1" Then - GUICtrlSetData($sldAcc, 10) - IniWrite($config, "misc", "AvoidEdge", "-1") - Else - GUICtrlSetData($sldAcc, IniRead($config, "misc", "RedLineAcc", "10")) - EndIf - - ;--------------------------------------------------------------------------------------- - ; Config settings ---------------------------------------------------------------------- - ;--------------------------------------------------------------------------------------- - If IniRead($config, "config", "Background", "0") = 1 Then - GUICtrlSetState($chkBackground, $GUI_CHECKED) - Else - GUICtrlSetState($chkBackground, $GUI_UNCHECKED) - EndIf - If IniRead($config, "config", "ForceBS", "0") = 1 Then - GUICtrlSetState($chkForceBS, $GUI_CHECKED) - Else - GUICtrlSetState($chkForceBS, $GUI_UNCHECKED) - EndIf - If IniRead($config, "config", "chkUpdate", "0") = 1 Then - GUICtrlSetState($chkUpdate, $GUI_CHECKED) - Else - GUICtrlSetState($chkUpdate, $GUI_UNCHECKED) - EndIf - If IniRead($config, "config", "stayalive", "0") = 1 Then - GUICtrlSetState($chkStayAlive, $GUI_CHECKED) - Else - GUICtrlSetState($chkStayAlive, $GUI_UNCHECKED) - EndIf - If IniRead($config, "config", "speedboost", "0") = 1 Then - GUICtrlSetState($chkSpeedBoost, $GUI_CHECKED) - Else - GUICtrlSetState($chkSpeedBoost, $GUI_UNCHECKED) - EndIf - - ;--------------------------------------------------------------------------------------- - ; Base location settings --------------------------------------------------------------- - ;--------------------------------------------------------------------------------------- - $CCPos[0] = IniRead($config, "position", "xCCPos", "") - $CCPos[1] = IniRead($config, "position", "yCCPos", "") - $frmBotPosX = IniRead($config, "position", "frmBotPosX", "100") - $frmBotPosY = IniRead($config, "position", "frmBotPosY", "100") - $TownHallPos[0] = IniRead($config, "position", "xTownHall", "") - $TownHallPos[1] = IniRead($config, "position", "yTownHall", "") - $ArmyPos[0] = IniRead($config, "position", "xArmy", "") - $ArmyPos[1] = IniRead($config, "position", "yArmy", "") - $SpellPos[0] = IniRead($config, "position", "xSpell", "") - $SpellPos[1] = IniRead($config, "position", "ySpell", "") - $KingPos[0] = IniRead($config, "position", "xKing", "") - $KingPos[1] = IniRead($config, "position", "yKing", "") - $QueenPos[0] = IniRead($config, "position", "xQueen", "") - $QueenPos[1] = IniRead($config, "position", "yQueen", "") - For $i = 0 To 3 ;Covers all 4 Barracks - $barrackPos[$i][0] = IniRead($config, "position", "xBarrack" & $i + 1, "") - $barrackPos[$i][1] = IniRead($config, "position", "yBarrack" & $i + 1, "") - Next - For $i = 0 To 1 ;Cover 2 Dark Barracks - $DarkBarrackPos[$i][0] = IniRead($config, "position", "xDarkBarrack" & $i + 1, "") - $DarkBarrackPos[$i][1] = IniRead($config, "position", "yDarkBarrack" & $i + 1, "") - Next - For $i = 0 To 16 ;Covers all Collectors - $collectorPos[$i][0] = IniRead($config, "position", "xCollector" & $i + 1, "") - $collectorPos[$i][1] = IniRead($config, "position", "yCollector" & $i + 1, "") - Next - $LabPos[0] = IniRead($config, "position", "LabPosX", "") - $LabPos[1] = IniRead($config, "position", "LabPosY", "") - - ;--------------------------------------------------------------------------------------- - ; Hidden settings ---------------------------------------------------------------------- - ;--------------------------------------------------------------------------------------- - ; These settings can be read in from config but aren't found in the GUI - $FontSize = IniRead($config, "hidden", "fontsize", "8.5") -EndFunc ;==>readConfig +;Reads config file and sets variables + +Func readConfig() ;Reads config and sets it to the variables + ;--------------------------------------------------------------------------------------- + ; Main settings ------------------------------------------------------------------------ + ;--------------------------------------------------------------------------------------- + $itxtMinTrophy = IniRead($config, "general", "MinTrophy", "0") + $itxtMaxTrophy = IniRead($config, "general", "MaxTrophy", "3000") + GUICtrlSetData($txtSnipeBelow, IniRead($config, "general", "MinSnipe", "0")) + $ichkBotStop = IniRead($config, "general", "BotStop", "0") + $icmbBotCommand = IniRead($config, "general", "Command", "0") + $icmbBotCond = IniRead($config, "general", "Cond", "0") + $ichkNoAttack = IniRead($config, "general", "NoAttack", "0") + $ichkDonateOnly = IniRead($config, "general", "DonateOnly", "0") + + ;--------------------------------------------------------------------------------------- + ; Attack settings ---------------------------------------------------------------------- + ;--------------------------------------------------------------------------------------- + _GUICtrlComboBox_SetCurSel($cmbUnitDelay, IniRead($config, "attack", "UnitD", "0")) + _GUICtrlComboBox_SetCurSel($cmbWaveDelay, IniRead($config, "attack", "WaveD", "0")) + + ;--------------------------------------------------------------------------------------- + ; Donate settings ---------------------------------------------------------------------- + ;--------------------------------------------------------------------------------------- + $ichkRequest = IniRead($config, "donate", "chkRequest", "0") + $itxtRequest = IniRead($config, "donate", "txtRequest", "") + $ichkDonateBarbarians = IniRead($config, "donate", "chkDonateBarbarians", "0") + $ichkDonateAllBarbarians = IniRead($config, "donate", "chkDonateAllBarbarians", "0") + $itxtDonateBarbarians = StringReplace(IniRead($config, "donate", "txtDonateBarbarians", "barbarians|barb|any"), "|", @CRLF) + $ichkDonateArchers = IniRead($config, "donate", "chkDonateArchers", "0") + $ichkDonateAllArchers = IniRead($config, "donate", "chkDonateAllArchers", "0") + $itxtDonateArchers = StringReplace(IniRead($config, "donate", "txtDonateArchers", "archers|arch|any"), "|", @CRLF) + $ichkDonateGiants = IniRead($config, "donate", "chkDonateGiants", "0") + $ichkDonateAllGiants = IniRead($config, "donate", "chkDonateAllGiants", "0") + $itxtDonateGiants = StringReplace(IniRead($config, "donate", "txtDonateGiants", "giants|giant|any"), "|", @CRLF) + If IniRead($config, "donate", "chkBlacklist", "0") = 1 Then + GUICtrlSetState($chkBlacklist, $GUI_CHECKED) + Else + GUICtrlSetState($chkBlacklist, $GUI_UNCHECKED) + EndIf + GUICtrlSetData($txtBlacklist, StringReplace(IniRead($config, "donate", "txtBlacklist", ""), "|", @CRLF)) + + ;--------------------------------------------------------------------------------------- + ; Upgrade settings --------------------------------------------------------------------- + ;--------------------------------------------------------------------------------------- + $ichkWalls = IniRead($config, "upgrade", "auto-wall", "0") + $icmbWalls = IniRead($config, "upgrade", "walllvl", "0") + $iUseStorage = IniRead($config, "upgrade", "use-storage", "0") + $itxtWallMinGold = IniRead($config, "upgrade", "minwallgold", "0") + $itxtWallMinElixir = IniRead($config, "upgrade", "minwallelixir", "0") + $icmbTolerance = IniRead($config, "upgrade", "walltolerance", "0") + + ;UpgradeHeroes + $ichkUpgradeKing = IniRead($config, "Upgrade", "UpKing", "0") ;==>upgradeking + $ichkUpgradeQueen = IniRead($config, "Upgrade", "UpQueen", "0") ;==>upgradequeen + $itxtKeepFreeBuilder = IniRead($config, "Upgrade", "KeepFreeBuilder", "1") ;==>FreeBuilderBox + + ;Laboratory + $ichkLab = IniRead($config, "upgrade", "auto-uptroops", "0") + $icmbLaboratory = IniRead($config, "upgrade", "troops-name", "0") + + ;--------------------------------------------------------------------------------------- + ; Notification settings ---------------------------------------------------------------- + ;--------------------------------------------------------------------------------------- + $PushBulletEnabled = IniRead($config, "notification", "pushbullet", "0") + $PushBullettoken = IniRead($config, "notification", "accounttoken", "") + $PushBullettype = IniRead($config, "notification", "lastraidtype", "0") + $PushBulletattacktype = IniRead($config, "notification", "attackimage", "0") + $PushBulletvillagereport = IniRead($config, "notification", "villagereport", "0") + $PushBulletchatlog = IniRead($config, "notification", "chatlog", "0") + $PushBulletmatchfound = IniRead($config, "notification", "matchfound", "0") + $PushBulletlastraid = IniRead($config, "notification", "lastraid", "0") + $PushBulletdebug = IniRead($config, "notification", "debug", "0") + $PushBulletremote = IniRead($config, "notification", "remote", "0") + $PushBulletdelete = IniRead($config, "notification", "delete", "0") + $PushBulletfreebuilder = IniRead($config, "notification", "freebuilder", "0") + $PushBulletdisconnection = IniRead($config, "notification", "disconnection", "0") + GUICtrlSetData($inppushuser, IniRead($config, "notification", "user", "")) +;~ If IniRead($config, "brokenbot.org", "senddata", "0") = 1 Then +;~ GUICtrlSetState($chkBBSendData, $GUI_CHECKED) +;~ Else +;~ GUICtrlSetState($chkBBSendData, $GUI_UNCHECKED) +;~ EndIf + ;--------------------------------------------------------------------------------------- + ; Misc settings ------------------------------------------------------------------------ + ;--------------------------------------------------------------------------------------- + $AlertBaseFound = IniRead($config, "misc", "AlertBaseFound", "0") + $TakeAttackSnapShot = IniRead($config, "misc", "TakeAttackSnapShot", "0") + $TakeLootSnapShot = IniRead($config, "misc", "TakeLootSnapShot", "0") + $TakeAllTownSnapShot = IniRead($config, "misc", "TakeAllTownSnapShot", "0") + $DebugMode = IniRead($config, "misc", "Debug", "0") + $ichkCollect = IniRead($config, "misc", "Collect", "1") + $itxtReconnect = IniRead($config, "misc", "reconnectdelay", "0") + $itxtReturnh = IniRead($config, "misc", "returnhomedelay", "0") + $icmbSearchsp = IniRead($config, "misc", "searchspd", "0") + $ichkTrap = IniRead($config, "misc", "chkTrap", "0") + $WideEdge = IniRead($config, "misc", "WideEdge", "0") + $iClearField = IniRead($config, "misc", "ClearField", "0") + $ichkAvoidEdge = IniRead($config, "misc", "AvoidEdge", "0") + $itxtspellCap = IniRead($config, "misc", "spellcap", "3") + ; Import old setting to new method + If $ichkAvoidEdge = "0" Then + GUICtrlSetData($sldAcc, 100) + IniWrite($config, "misc", "AvoidEdge", "-1") + ElseIf $ichkAvoidEdge = "1" Then + GUICtrlSetData($sldAcc, 10) + IniWrite($config, "misc", "AvoidEdge", "-1") + Else + GUICtrlSetData($sldAcc, IniRead($config, "misc", "RedLineAcc", "10")) + EndIf + + ;--------------------------------------------------------------------------------------- + ; Config settings ---------------------------------------------------------------------- + ;--------------------------------------------------------------------------------------- + If IniRead($config, "config", "Background", "0") = 1 Then + GUICtrlSetState($chkBackground, $GUI_CHECKED) + Else + GUICtrlSetState($chkBackground, $GUI_UNCHECKED) + EndIf + If IniRead($config, "config", "ForceBS", "0") = 1 Then + GUICtrlSetState($chkForceBS, $GUI_CHECKED) + Else + GUICtrlSetState($chkForceBS, $GUI_UNCHECKED) + EndIf + If IniRead($config, "config", "chkUpdate", "0") = 1 Then + GUICtrlSetState($chkUpdate, $GUI_CHECKED) + Else + GUICtrlSetState($chkUpdate, $GUI_UNCHECKED) + EndIf + If IniRead($config, "config", "stayalive", "0") = 1 Then + GUICtrlSetState($chkStayAlive, $GUI_CHECKED) + Else + GUICtrlSetState($chkStayAlive, $GUI_UNCHECKED) + EndIf + If IniRead($config, "config", "speedboost", "0") = 1 Then + GUICtrlSetState($chkSpeedBoost, $GUI_CHECKED) + Else + GUICtrlSetState($chkSpeedBoost, $GUI_UNCHECKED) + EndIf + + ;--------------------------------------------------------------------------------------- + ; Base location settings --------------------------------------------------------------- + ;--------------------------------------------------------------------------------------- + $CCPos[0] = IniRead($config, "position", "xCCPos", "") + $CCPos[1] = IniRead($config, "position", "yCCPos", "") + $frmBotPosX = IniRead($config, "position", "frmBotPosX", "100") + $frmBotPosY = IniRead($config, "position", "frmBotPosY", "100") + $TownHallPos[0] = IniRead($config, "position", "xTownHall", "") + $TownHallPos[1] = IniRead($config, "position", "yTownHall", "") + $ArmyPos[0] = IniRead($config, "position", "xArmy", "") + $ArmyPos[1] = IniRead($config, "position", "yArmy", "") + $SpellPos[0] = IniRead($config, "position", "xSpell", "") + $SpellPos[1] = IniRead($config, "position", "ySpell", "") + $KingPos[0] = IniRead($config, "position", "xKing", "") + $KingPos[1] = IniRead($config, "position", "yKing", "") + $QueenPos[0] = IniRead($config, "position", "xQueen", "") + $QueenPos[1] = IniRead($config, "position", "yQueen", "") + For $i = 0 To 3 ;Covers all 4 Barracks + $barrackPos[$i][0] = IniRead($config, "position", "xBarrack" & $i + 1, "") + $barrackPos[$i][1] = IniRead($config, "position", "yBarrack" & $i + 1, "") + Next + For $i = 0 To 1 ;Cover 2 Dark Barracks + $DarkBarrackPos[$i][0] = IniRead($config, "position", "xDarkBarrack" & $i + 1, "") + $DarkBarrackPos[$i][1] = IniRead($config, "position", "yDarkBarrack" & $i + 1, "") + Next + For $i = 0 To 16 ;Covers all Collectors + $collectorPos[$i][0] = IniRead($config, "position", "xCollector" & $i + 1, "") + $collectorPos[$i][1] = IniRead($config, "position", "yCollector" & $i + 1, "") + Next + $LabPos[0] = IniRead($config, "position", "LabPosX", "") + $LabPos[1] = IniRead($config, "position", "LabPosY", "") + + ;--------------------------------------------------------------------------------------- + ; Hidden settings ---------------------------------------------------------------------- + ;--------------------------------------------------------------------------------------- + ; These settings can be read in from config but aren't found in the GUI + $FontSize = IniRead($config, "hidden", "fontsize", "8.5") +EndFunc ;==>readConfig diff --git a/COCBot/functions/Config/saveConfig.au3 b/COCBot/functions/Config/saveConfig.au3 index ee0caf0..c95379b 100644 --- a/COCBot/functions/Config/saveConfig.au3 +++ b/COCBot/functions/Config/saveConfig.au3 @@ -1,353 +1,367 @@ -;Saves all of the GUI values to the config. - -Func saveConfig() ;Saves the controls settings to the config - ;--------------------------------------------------------------------------------------- - ; Main settings ------------------------------------------------------------------------ - ;--------------------------------------------------------------------------------------- - IniWrite($config, "general", "MinTrophy", GUICtrlRead($txtMinimumTrophy)) - IniWrite($config, "general", "MaxTrophy", GUICtrlRead($txtMaxTrophy)) - IniWrite($config, "general", "MinSnipe", GUICtrlRead($txtSnipeBelow)) - IniWrite($config, "general", "Command", _GUICtrlComboBox_GetCurSel($cmbBotCommand)) - IniWrite($config, "general", "Cond", _GUICtrlComboBox_GetCurSel($cmbBotCond)) - If IsChecked($chkNoAttack) Then - IniWrite($config, "general", "NoAttack", 1) - Else - IniWrite($config, "general", "NoAttack", 0) - EndIf - If IsChecked($chkDonateOnly) Then - IniWrite($config, "general", "DonateOnly", 1) - Else - IniWrite($config, "general", "DonateOnly", 0) - EndIf - If IsChecked($chkBotStop) Then - IniWrite($config, "general", "BotStop", 1) - Else - IniWrite($config, "general", "BotStop", 0) - EndIf - ;--------------------------------------------------------------------------------------- - ; Attack settings ---------------------------------------------------------------------- - ;--------------------------------------------------------------------------------------- - IniWrite($config, "attack", "UnitD", _GUICtrlComboBox_GetCurSel($cmbUnitDelay)) - IniWrite($config, "attack", "WaveD", _GUICtrlComboBox_GetCurSel($cmbWaveDelay)) - ;--------------------------------------------------------------------------------------- - ; Donate settings ---------------------------------------------------------------------- - ;--------------------------------------------------------------------------------------- - If IsChecked($chkRequest) Then - IniWrite($config, "donate", "chkRequest", 1) - Else - IniWrite($config, "donate", "chkRequest", 0) - EndIf - If IsChecked($chkDonateAllBarbarians) Then - IniWrite($config, "donate", "chkDonateAllBarbarians", 1) - Else - IniWrite($config, "donate", "chkDonateAllBarbarians", 0) - EndIf - - If IsChecked($chkDonateAllArchers) Then - IniWrite($config, "donate", "chkDonateAllArchers", 1) - Else - IniWrite($config, "donate", "chkDonateAllArchers", 0) - EndIf - - If IsChecked($chkDonateAllGiants) Then - IniWrite($config, "donate", "chkDonateAllGiants", 1) - Else - IniWrite($config, "donate", "chkDonateAllGiants", 0) - EndIf - If IsChecked($chkDonateBarbarians) Then - IniWrite($config, "donate", "chkDonateBarbarians", 1) - Else - IniWrite($config, "donate", "chkDonateBarbarians", 0) - EndIf - - If IsChecked($chkDonateArchers) Then - IniWrite($config, "donate", "chkDonateArchers", 1) - Else - IniWrite($config, "donate", "chkDonateArchers", 0) - EndIf - If IsChecked($chkDonateGiants) Then - IniWrite($config, "donate", "chkDonateGiants", 1) - Else - IniWrite($config, "donate", "chkDonateGiants", 0) - EndIf - IniWrite($config, "donate", "txtRequest", GUICtrlRead($txtRequest)) - IniWrite($config, "donate", "txtDonateBarbarians", StringReplace(GUICtrlRead($txtDonateBarbarians), @CRLF, "|")) - IniWrite($config, "donate", "txtDonateArchers", StringReplace(GUICtrlRead($txtDonateArchers), @CRLF, "|")) - IniWrite($config, "donate", "txtDonateGiants", StringReplace(GUICtrlRead($txtDonateGiants), @CRLF, "|")) - If IsChecked($chkBlacklist) Then - IniWrite($config, "donate", "chkBlacklist", 1) - Else - IniWrite($config, "donate", "chkBlacklist", 0) - EndIf - IniWrite($config, "donate", "txtBlacklist", StringReplace(GUICtrlRead($txtBlacklist), @CRLF, "|")) - - ; Relics below...in save but not read - If IsChecked($gtfo) Then - IniWrite($config, "donate", "gtfo", 1) - Else - IniWrite($config, "donate", "gtfo", 0) - EndIf - IniWrite($config, "donate", "donate1", _GUICtrlComboBox_GetCurSel($cmbDonateBarbarians)) - IniWrite($config, "donate", "donate2", _GUICtrlComboBox_GetCurSel($cmbDonateArchers)) - IniWrite($config, "donate", "donate3", _GUICtrlComboBox_GetCurSel($cmbDonateGiants)) - IniWrite($config, "donate", "amount1", GUICtrlRead($NoOfBarbarians)) - IniWrite($config, "donate", "amount2", GUICtrlRead($NoOfArchers)) - IniWrite($config, "donate", "amount3", GUICtrlRead($NoOfGiants)) - - ;--------------------------------------------------------------------------------------- - ; Upgrade settings --------------------------------------------------------------------- - ;--------------------------------------------------------------------------------------- - If IsChecked($chkWalls) Then - IniWrite($config, "upgrade", "auto-wall", 1) - Else - IniWrite($config, "upgrade", "auto-wall", 0) - EndIf - IniWrite($config, "upgrade", "walllvl", _GUICtrlComboBox_GetCurSel($cmbWalls)) - IniWrite($config, "upgrade", "walltolerance", _GUICtrlComboBox_GetCurSel($cmbTolerance)) - If IsChecked($UseGold) Then - IniWrite($config, "upgrade", "use-storage", 0) - ElseIf IsChecked($UseElixir) Then - IniWrite($config, "upgrade", "use-storage", 1) - ElseIf IsChecked($UseGoldElix) Then - IniWrite($config, "upgrade", "use-storage", 2) - EndIf - IniWrite($config, "upgrade", "minwallgold", GUICtrlRead($txtWallMinGold)) - IniWrite($config, "upgrade", "minwallelixir", GUICtrlRead($txtWallMinElixir)) - - ; Relics below...in save but not read - If IsChecked($chkUpgrade1) Then - IniWrite($config, "upgrade", "auto-upgrade1", 1) - Else - IniWrite($config, "upgrade", "auto-upgrade1", 0) - EndIf - If IsChecked($chkUpgrade2) Then - IniWrite($config, "upgrade", "auto-upgrade2", 1) - Else - IniWrite($config, "upgrade", "auto-upgrade2", 0) - EndIf - If IsChecked($chkUpgrade3) Then - IniWrite($config, "upgrade", "auto-upgrade3", 1) - Else - IniWrite($config, "upgrade", "auto-upgrade3", 0) - EndIf -;~ If IsChecked($chkUpgrade4) Then -;~ IniWrite($config, "upgrade", "auto-upgrade4", 1) -;~ Else -;~ IniWrite($config, "upgrade", "auto-upgrade4", 0) -;~ EndIf -;~ If IsChecked($chkUpgrade5) Then -;~ IniWrite($config, "upgrade", "auto-upgrade5", 1) -;~ Else -;~ IniWrite($config, "upgrade", "auto-upgrade5", 0) -;~ EndIf -;~ If IsChecked($chkUpgrade6) Then -;~ IniWrite($config, "upgrade", "auto-upgrade6", 1) -;~ Else -;~ IniWrite($config, "upgrade", "auto-upgrade6", 0) -;~ EndIf - IniWrite($config, "upgrade", "PosX1", GUICtrlRead($txtUpgradeX1)) - IniWrite($config, "upgrade", "PosY2", GUICtrlRead($txtUpgradeY2)) - IniWrite($config, "upgrade", "PosX2", GUICtrlRead($txtUpgradeX2)) - IniWrite($config, "upgrade", "PosY3", GUICtrlRead($txtUpgradeY3)) - IniWrite($config, "upgrade", "PosX3", GUICtrlRead($txtUpgradeX3)) -;~ IniWrite($config, "upgrade", "PosY4", GUICtrlRead($txtUpgradeY4)) -;~ IniWrite($config, "upgrade", "PosX4", GUICtrlRead($txtUpgradeX4)) -;~ IniWrite($config, "upgrade", "PosY5", GUICtrlRead($txtUpgradeY5)) -;~ IniWrite($config, "upgrade", "PosX5", GUICtrlRead($txtUpgradeX5)) -;~ IniWrite($config, "upgrade", "PosY6", GUICtrlRead($txtUpgradeY6)) -;~ IniWrite($config, "upgrade", "PosX6", GUICtrlRead($txtUpgradeX6)) - - If IsChecked($chkLab) Then - IniWrite($config, "upgrade", "auto-uptroops", 1) - Else - IniWrite($config, "upgrade", "auto-uptroops", 0) - EndIf - IniWrite($config, "upgrade", "troops-name", _GUICtrlComboBox_GetCurSel($cmbLaboratory)) - ;--------------------------------------------------------------------------------------- - ; Notification settings ---------------------------------------------------------------- - ;--------------------------------------------------------------------------------------- - If IsChecked($lblpushbulletenabled) Then - IniWrite($config, "notification", "pushbullet", 1) - Else - IniWrite($config, "notification", "pushbullet", 0) - EndIf - If IsChecked($lblvillagereport) Then - IniWrite($config, "notification", "villagereport", 1) - Else - IniWrite($config, "notification", "villagereport", 0) - EndIf - If IsChecked($lblchatlog) Then - IniWrite($config, "notification", "chatlog", 1) - Else - IniWrite($config, "notification", "chatlog", 0) - EndIf - If IsChecked($lblmatchfound) Then - IniWrite($config, "notification", "matchfound", 1) - Else - IniWrite($config, "notification", "matchfound", 0) - EndIf - If IsChecked($lbllastraid) Then - IniWrite($config, "notification", "lastraid", 1) - Else - IniWrite($config, "notification", "lastraid", 0) - EndIf - If IsChecked($lblfreebuilder) Then - IniWrite($config, "notification", "freebuilder", 1) - Else - IniWrite($config, "notification", "freebuilder", 0) - EndIf - If IsChecked($lbldisconnect) Then - IniWrite($config, "notification", "disconnection", 1) - Else - IniWrite($config, "notification", "disconnection", 0) - EndIf - If IsChecked($lblpushbulletdebug) Then - IniWrite($config, "notification", "debug", 1) - Else - IniWrite($config, "notification", "debug", 0) - EndIf - If IsChecked($lblpushbulletremote) Then - IniWrite($config, "notification", "remote", 1) - Else - IniWrite($config, "notification", "remote", 0) - EndIf - If IsChecked($lblpushbulletdelete) Then - IniWrite($config, "notification", "delete", 1) - Else - IniWrite($config, "notification", "delete", 0) - EndIf - IniWrite($config, "notification", "accounttoken", GUICtrlRead($pushbullettokenvalue)) - If IsChecked($UseJPG) Then - IniWrite($config, "notification", "lastraidtype", 1) - Else - IniWrite($config, "notification", "lastraidtype", 0) - EndIf - If IsChecked($UseAttackJPG) Then - IniWrite($config, "notification", "attackimage", 1) - Else - IniWrite($config, "notification", "attackimage", 0) - EndIf - IniWrite($config, "notification", "user", GUICtrlRead($inppushuser)) -;~ If IsChecked($chkBBSendData) Then -;~ IniWrite($config, "brokenbot.org", "senddata", 1) -;~ Else -;~ IniWrite($config, "brokenbot.org", "senddata", 0) -;~ EndIf - ;--------------------------------------------------------------------------------------- - ; Misc settings ------------------------------------------------------------------------ - ;--------------------------------------------------------------------------------------- - IniWrite($config, "misc", "RedLineAcc", GUICtrlRead($sldAcc)) - If IsChecked($chkTakeAttackSS) Then - IniWrite($config, "misc", "TakeAttackSnapShot", 1) - Else - IniWrite($config, "misc", "TakeAttackSnapShot", 0) - EndIf - If IsChecked($chkDebug) Then - IniWrite($config, "misc", "Debug", 1) - Else - IniWrite($config, "misc", "Debug", 0) - EndIf - If IsChecked($chkCollect) Then - IniWrite($config, "misc", "Collect", 1) - Else - IniWrite($config, "misc", "Collect", 0) - EndIf - IniWrite($config, "misc", "spellcap", GUICtrlRead($txtSpellCap)) - IniWrite($config, "misc", "reconnectdelay", GUICtrlRead($txtReconnect)) - IniWrite($config, "misc", "returnhomedelay", GUICtrlRead($txtReturnh)) - IniWrite($config, "misc", "searchspd", _GUICtrlComboBox_GetCurSel($cmbSearchsp)) - If IsChecked($chkWideEdge) Then - IniWrite($config, "misc", "WideEdge", 1) - Else - IniWrite($config, "misc", "WideEdge", 0) - EndIf - If IsChecked($chkClearField) Then - IniWrite($config, "misc", "ClearField", 1) - Else - IniWrite($config, "misc", "ClearField", 0) - EndIf - If IsChecked($chkTakeLootSS) Then - IniWrite($config, "misc", "TakeLootSnapShot", 1) - Else - IniWrite($config, "misc", "TakeLootSnapShot", 0) - EndIf - If IsChecked($chkTakeTownSS) Then - IniWrite($config, "misc", "TakeAllTownSnapShot", 1) - Else - IniWrite($config, "misc", "TakeAllTownSnapShot", 0) - EndIf - If IsChecked($chkAlertSearch) Then - IniWrite($config, "misc", "AlertBaseFound", 1) - Else - IniWrite($config, "misc", "AlertBaseFound", 0) - EndIf - If IsChecked($chkTrap) Then - IniWrite($config, "misc", "chkTrap", 1) - Else - IniWrite($config, "misc", "chkTrap", 0) - EndIf - - ;--------------------------------------------------------------------------------------- - ; Config settings ---------------------------------------------------------------------- - ;--------------------------------------------------------------------------------------- - $array = _GUICtrlComboBox_GetListArray($cmbLanguage) - IniWrite($config, "config", "language", $array[_GUICtrlComboBox_GetCurSel($cmbLanguage) + 1]) - If IsChecked($chkBackground) Then - IniWrite($config, "config", "Background", 1) - Else - IniWrite($config, "config", "Background", 0) - EndIf - If IsChecked($chkForceBS) Then - IniWrite($config, "config", "ForceBS", 1) - Else - IniWrite($config, "config", "ForceBS", 0) - EndIf - If IsChecked($chkUpdate) Then - IniWrite($config, "config", "chkUpdate", 1) - Else - IniWrite($config, "config", "chkUpdate", 0) - EndIf - If IsChecked($chkStayAlive) Then - IniWrite($config, "config", "stayalive", 1) - Else - IniWrite($config, "config", "stayalive", 0) - EndIf - If IsChecked($chkSpeedBoost) Then - IniWrite($config, "config", "speedboost", 1) - Else - IniWrite($config, "config", "speedboost", 0) - EndIf - - ;--------------------------------------------------------------------------------------- - ; Base location settings --------------------------------------------------------------- - ;--------------------------------------------------------------------------------------- - IniWrite($config, "position", "xCCPos", $CCPos[0]) - IniWrite($config, "position", "yCCPos", $CCPos[1]) - Local $frmBotPos = WinGetPos($sBotTitle) - IniWrite($config, "position", "frmBotPosX", $frmBotPos[0]) - IniWrite($config, "position", "frmBotPosY", $frmBotPos[1]) - IniWrite($config, "position", "xTownHall", $TownHallPos[0]) - IniWrite($config, "position", "yTownHall", $TownHallPos[1]) - IniWrite($config, "position", "xArmy", $ArmyPos[0]) - IniWrite($config, "position", "yArmy", $ArmyPos[1]) - IniWrite($config, "position", "xSpell", $SpellPos[0]) - IniWrite($config, "position", "ySpell", $SpellPos[1]) - IniWrite($config, "position", "xKing", $KingPos[0]) - IniWrite($config, "position", "yKing", $KingPos[1]) - IniWrite($config, "position", "xQueen", $QueenPos[0]) - IniWrite($config, "position", "yQueen", $QueenPos[1]) - For $i = 0 To 1 ;Cover 2 Dark Barracks - IniWrite($config, "position", "xDarkBarrack" & $i + 1, $DarkBarrackPos[$i][0]) - IniWrite($config, "position", "yDarkBarrack" & $i + 1, $DarkBarrackPos[$i][1]) - Next - For $i = 0 To 16 ;Covers all Collectors - IniWrite($config, "position", "xCollector" & $i + 1, $collectorPos[$i][0]) - IniWrite($config, "position", "yCollector" & $i + 1, $collectorPos[$i][1]) - Next - For $i = 0 To 3 ;Covers all 4 Barracks - IniWrite($config, "position", "xBarrack" & $i + 1, $barrackPos[$i][0]) - IniWrite($config, "position", "yBarrack" & $i + 1, $barrackPos[$i][1]) - Next - IniWrite($config, "position", "LabPosX", $LabPos[0]) - IniWrite($config, "position", "LabPosY", $LabPos[1]) -EndFunc ;==>saveConfig +;Saves all of the GUI values to the config. + +Func saveConfig() ;Saves the controls settings to the config + ;--------------------------------------------------------------------------------------- + ; Main settings ------------------------------------------------------------------------ + ;--------------------------------------------------------------------------------------- + IniWrite($config, "general", "MinTrophy", GUICtrlRead($txtMinimumTrophy)) + IniWrite($config, "general", "MaxTrophy", GUICtrlRead($txtMaxTrophy)) + IniWrite($config, "general", "MinSnipe", GUICtrlRead($txtSnipeBelow)) + IniWrite($config, "general", "Command", _GUICtrlComboBox_GetCurSel($cmbBotCommand)) + IniWrite($config, "general", "Cond", _GUICtrlComboBox_GetCurSel($cmbBotCond)) + If IsChecked($chkNoAttack) Then + IniWrite($config, "general", "NoAttack", 1) + Else + IniWrite($config, "general", "NoAttack", 0) + EndIf + If IsChecked($chkDonateOnly) Then + IniWrite($config, "general", "DonateOnly", 1) + Else + IniWrite($config, "general", "DonateOnly", 0) + EndIf + If IsChecked($chkBotStop) Then + IniWrite($config, "general", "BotStop", 1) + Else + IniWrite($config, "general", "BotStop", 0) + EndIf + ;--------------------------------------------------------------------------------------- + ; Attack settings ---------------------------------------------------------------------- + ;--------------------------------------------------------------------------------------- + IniWrite($config, "attack", "UnitD", _GUICtrlComboBox_GetCurSel($cmbUnitDelay)) + IniWrite($config, "attack", "WaveD", _GUICtrlComboBox_GetCurSel($cmbWaveDelay)) + ;--------------------------------------------------------------------------------------- + ; Donate settings ---------------------------------------------------------------------- + ;--------------------------------------------------------------------------------------- + If IsChecked($chkRequest) Then + IniWrite($config, "donate", "chkRequest", 1) + Else + IniWrite($config, "donate", "chkRequest", 0) + EndIf + If IsChecked($chkDonateAllBarbarians) Then + IniWrite($config, "donate", "chkDonateAllBarbarians", 1) + Else + IniWrite($config, "donate", "chkDonateAllBarbarians", 0) + EndIf + + If IsChecked($chkDonateAllArchers) Then + IniWrite($config, "donate", "chkDonateAllArchers", 1) + Else + IniWrite($config, "donate", "chkDonateAllArchers", 0) + EndIf + + If IsChecked($chkDonateAllGiants) Then + IniWrite($config, "donate", "chkDonateAllGiants", 1) + Else + IniWrite($config, "donate", "chkDonateAllGiants", 0) + EndIf + If IsChecked($chkDonateBarbarians) Then + IniWrite($config, "donate", "chkDonateBarbarians", 1) + Else + IniWrite($config, "donate", "chkDonateBarbarians", 0) + EndIf + + If IsChecked($chkDonateArchers) Then + IniWrite($config, "donate", "chkDonateArchers", 1) + Else + IniWrite($config, "donate", "chkDonateArchers", 0) + EndIf + If IsChecked($chkDonateGiants) Then + IniWrite($config, "donate", "chkDonateGiants", 1) + Else + IniWrite($config, "donate", "chkDonateGiants", 0) + EndIf + IniWrite($config, "donate", "txtRequest", GUICtrlRead($txtRequest)) + IniWrite($config, "donate", "txtDonateBarbarians", StringReplace(GUICtrlRead($txtDonateBarbarians), @CRLF, "|")) + IniWrite($config, "donate", "txtDonateArchers", StringReplace(GUICtrlRead($txtDonateArchers), @CRLF, "|")) + IniWrite($config, "donate", "txtDonateGiants", StringReplace(GUICtrlRead($txtDonateGiants), @CRLF, "|")) + If IsChecked($chkBlacklist) Then + IniWrite($config, "donate", "chkBlacklist", 1) + Else + IniWrite($config, "donate", "chkBlacklist", 0) + EndIf + IniWrite($config, "donate", "txtBlacklist", StringReplace(GUICtrlRead($txtBlacklist), @CRLF, "|")) + + ; Relics below...in save but not read + If IsChecked($gtfo) Then + IniWrite($config, "donate", "gtfo", 1) + Else + IniWrite($config, "donate", "gtfo", 0) + EndIf + IniWrite($config, "donate", "donate1", _GUICtrlComboBox_GetCurSel($cmbDonateBarbarians)) + IniWrite($config, "donate", "donate2", _GUICtrlComboBox_GetCurSel($cmbDonateArchers)) + IniWrite($config, "donate", "donate3", _GUICtrlComboBox_GetCurSel($cmbDonateGiants)) + IniWrite($config, "donate", "amount1", GUICtrlRead($NoOfBarbarians)) + IniWrite($config, "donate", "amount2", GUICtrlRead($NoOfArchers)) + IniWrite($config, "donate", "amount3", GUICtrlRead($NoOfGiants)) + + ;--------------------------------------------------------------------------------------- + ; Upgrade settings --------------------------------------------------------------------- + ;--------------------------------------------------------------------------------------- + If IsChecked($chkWalls) Then + IniWrite($config, "upgrade", "auto-wall", 1) + Else + IniWrite($config, "upgrade", "auto-wall", 0) + EndIf + IniWrite($config, "upgrade", "walllvl", _GUICtrlComboBox_GetCurSel($cmbWalls)) + IniWrite($config, "upgrade", "walltolerance", _GUICtrlComboBox_GetCurSel($cmbTolerance)) + If IsChecked($UseGold) Then + IniWrite($config, "upgrade", "use-storage", 0) + ElseIf IsChecked($UseElixir) Then + IniWrite($config, "upgrade", "use-storage", 1) + ElseIf IsChecked($UseGoldElix) Then + IniWrite($config, "upgrade", "use-storage", 2) + EndIf + IniWrite($config, "upgrade", "minwallgold", GUICtrlRead($txtWallMinGold)) + IniWrite($config, "upgrade", "minwallelixir", GUICtrlRead($txtWallMinElixir)) + + ; Relics below...in save but not read + If IsChecked($chkUpgrade1) Then + IniWrite($config, "upgrade", "auto-upgrade1", 1) + Else + IniWrite($config, "upgrade", "auto-upgrade1", 0) + EndIf + If IsChecked($chkUpgrade2) Then + IniWrite($config, "upgrade", "auto-upgrade2", 1) + Else + IniWrite($config, "upgrade", "auto-upgrade2", 0) + EndIf + If IsChecked($chkUpgrade3) Then + IniWrite($config, "upgrade", "auto-upgrade3", 1) + Else + IniWrite($config, "upgrade", "auto-upgrade3", 0) + EndIf +;~ If IsChecked($chkUpgrade4) Then +;~ IniWrite($config, "upgrade", "auto-upgrade4", 1) +;~ Else +;~ IniWrite($config, "upgrade", "auto-upgrade4", 0) +;~ EndIf +;~ If IsChecked($chkUpgrade5) Then +;~ IniWrite($config, "upgrade", "auto-upgrade5", 1) +;~ Else +;~ IniWrite($config, "upgrade", "auto-upgrade5", 0) +;~ EndIf +;~ If IsChecked($chkUpgrade6) Then +;~ IniWrite($config, "upgrade", "auto-upgrade6", 1) +;~ Else +;~ IniWrite($config, "upgrade", "auto-upgrade6", 0) +;~ EndIf + IniWrite($config, "upgrade", "PosX1", GUICtrlRead($txtUpgradeX1)) + IniWrite($config, "upgrade", "PosY2", GUICtrlRead($txtUpgradeY2)) + IniWrite($config, "upgrade", "PosX2", GUICtrlRead($txtUpgradeX2)) + IniWrite($config, "upgrade", "PosY3", GUICtrlRead($txtUpgradeY3)) + IniWrite($config, "upgrade", "PosX3", GUICtrlRead($txtUpgradeX3)) +;~ IniWrite($config, "upgrade", "PosY4", GUICtrlRead($txtUpgradeY4)) +;~ IniWrite($config, "upgrade", "PosX4", GUICtrlRead($txtUpgradeX4)) +;~ IniWrite($config, "upgrade", "PosY5", GUICtrlRead($txtUpgradeY5)) +;~ IniWrite($config, "upgrade", "PosX5", GUICtrlRead($txtUpgradeX5)) +;~ IniWrite($config, "upgrade", "PosY6", GUICtrlRead($txtUpgradeY6)) +;~ IniWrite($config, "upgrade", "PosX6", GUICtrlRead($txtUpgradeX6)) + + ;UpgradeHeroes + If IsChecked($chkUpgradeKing) = $GUI_CHECKED Then ;==>upgradeking + IniWrite($config, "Upgrade", "UpKing", 1) + Else + IniWrite($config, "Upgrade", "UpKing", 0) + EndIf + + If IsChecked($chkUpgradeQueen) = $GUI_CHECKED Then ;==>upgradequeen + IniWrite($config, "Upgrade", "UpQueen", 1) + Else + IniWrite($config, "Upgrade", "UpQueen", 0) + EndIf + IniWrite($config, "Upgrade", "KeepFreeBuilder", GUICtrlRead($txtKeepFreeBuilder)) ;==>FreeBuilderBox + + If IsChecked($chkLab) Then + IniWrite($config, "upgrade", "auto-uptroops", 1) + Else + IniWrite($config, "upgrade", "auto-uptroops", 0) + EndIf + IniWrite($config, "upgrade", "troops-name", _GUICtrlComboBox_GetCurSel($cmbLaboratory)) + ;--------------------------------------------------------------------------------------- + ; Notification settings ---------------------------------------------------------------- + ;--------------------------------------------------------------------------------------- + If IsChecked($lblpushbulletenabled) Then + IniWrite($config, "notification", "pushbullet", 1) + Else + IniWrite($config, "notification", "pushbullet", 0) + EndIf + If IsChecked($lblvillagereport) Then + IniWrite($config, "notification", "villagereport", 1) + Else + IniWrite($config, "notification", "villagereport", 0) + EndIf + If IsChecked($lblchatlog) Then + IniWrite($config, "notification", "chatlog", 1) + Else + IniWrite($config, "notification", "chatlog", 0) + EndIf + If IsChecked($lblmatchfound) Then + IniWrite($config, "notification", "matchfound", 1) + Else + IniWrite($config, "notification", "matchfound", 0) + EndIf + If IsChecked($lbllastraid) Then + IniWrite($config, "notification", "lastraid", 1) + Else + IniWrite($config, "notification", "lastraid", 0) + EndIf + If IsChecked($lblfreebuilder) Then + IniWrite($config, "notification", "freebuilder", 1) + Else + IniWrite($config, "notification", "freebuilder", 0) + EndIf + If IsChecked($lbldisconnect) Then + IniWrite($config, "notification", "disconnection", 1) + Else + IniWrite($config, "notification", "disconnection", 0) + EndIf + If IsChecked($lblpushbulletdebug) Then + IniWrite($config, "notification", "debug", 1) + Else + IniWrite($config, "notification", "debug", 0) + EndIf + If IsChecked($lblpushbulletremote) Then + IniWrite($config, "notification", "remote", 1) + Else + IniWrite($config, "notification", "remote", 0) + EndIf + If IsChecked($lblpushbulletdelete) Then + IniWrite($config, "notification", "delete", 1) + Else + IniWrite($config, "notification", "delete", 0) + EndIf + IniWrite($config, "notification", "accounttoken", GUICtrlRead($pushbullettokenvalue)) + If IsChecked($UseJPG) Then + IniWrite($config, "notification", "lastraidtype", 1) + Else + IniWrite($config, "notification", "lastraidtype", 0) + EndIf + If IsChecked($UseAttackJPG) Then + IniWrite($config, "notification", "attackimage", 1) + Else + IniWrite($config, "notification", "attackimage", 0) + EndIf + IniWrite($config, "notification", "user", GUICtrlRead($inppushuser)) +;~ If IsChecked($chkBBSendData) Then +;~ IniWrite($config, "brokenbot.org", "senddata", 1) +;~ Else +;~ IniWrite($config, "brokenbot.org", "senddata", 0) +;~ EndIf + ;--------------------------------------------------------------------------------------- + ; Misc settings ------------------------------------------------------------------------ + ;--------------------------------------------------------------------------------------- + IniWrite($config, "misc", "RedLineAcc", GUICtrlRead($sldAcc)) + If IsChecked($chkTakeAttackSS) Then + IniWrite($config, "misc", "TakeAttackSnapShot", 1) + Else + IniWrite($config, "misc", "TakeAttackSnapShot", 0) + EndIf + If IsChecked($chkDebug) Then + IniWrite($config, "misc", "Debug", 1) + Else + IniWrite($config, "misc", "Debug", 0) + EndIf + If IsChecked($chkCollect) Then + IniWrite($config, "misc", "Collect", 1) + Else + IniWrite($config, "misc", "Collect", 0) + EndIf + IniWrite($config, "misc", "spellcap", GUICtrlRead($txtSpellCap)) + IniWrite($config, "misc", "reconnectdelay", GUICtrlRead($txtReconnect)) + IniWrite($config, "misc", "returnhomedelay", GUICtrlRead($txtReturnh)) + IniWrite($config, "misc", "searchspd", _GUICtrlComboBox_GetCurSel($cmbSearchsp)) + If IsChecked($chkWideEdge) Then + IniWrite($config, "misc", "WideEdge", 1) + Else + IniWrite($config, "misc", "WideEdge", 0) + EndIf + If IsChecked($chkClearField) Then + IniWrite($config, "misc", "ClearField", 1) + Else + IniWrite($config, "misc", "ClearField", 0) + EndIf + If IsChecked($chkTakeLootSS) Then + IniWrite($config, "misc", "TakeLootSnapShot", 1) + Else + IniWrite($config, "misc", "TakeLootSnapShot", 0) + EndIf + If IsChecked($chkTakeTownSS) Then + IniWrite($config, "misc", "TakeAllTownSnapShot", 1) + Else + IniWrite($config, "misc", "TakeAllTownSnapShot", 0) + EndIf + If IsChecked($chkAlertSearch) Then + IniWrite($config, "misc", "AlertBaseFound", 1) + Else + IniWrite($config, "misc", "AlertBaseFound", 0) + EndIf + If IsChecked($chkTrap) Then + IniWrite($config, "misc", "chkTrap", 1) + Else + IniWrite($config, "misc", "chkTrap", 0) + EndIf + + ;--------------------------------------------------------------------------------------- + ; Config settings ---------------------------------------------------------------------- + ;--------------------------------------------------------------------------------------- + $array = _GUICtrlComboBox_GetListArray($cmbLanguage) + IniWrite($config, "config", "language", $array[_GUICtrlComboBox_GetCurSel($cmbLanguage) + 1]) + If IsChecked($chkBackground) Then + IniWrite($config, "config", "Background", 1) + Else + IniWrite($config, "config", "Background", 0) + EndIf + If IsChecked($chkForceBS) Then + IniWrite($config, "config", "ForceBS", 1) + Else + IniWrite($config, "config", "ForceBS", 0) + EndIf + If IsChecked($chkUpdate) Then + IniWrite($config, "config", "chkUpdate", 1) + Else + IniWrite($config, "config", "chkUpdate", 0) + EndIf + If IsChecked($chkStayAlive) Then + IniWrite($config, "config", "stayalive", 1) + Else + IniWrite($config, "config", "stayalive", 0) + EndIf + If IsChecked($chkSpeedBoost) Then + IniWrite($config, "config", "speedboost", 1) + Else + IniWrite($config, "config", "speedboost", 0) + EndIf + + ;--------------------------------------------------------------------------------------- + ; Base location settings --------------------------------------------------------------- + ;--------------------------------------------------------------------------------------- + IniWrite($config, "position", "xCCPos", $CCPos[0]) + IniWrite($config, "position", "yCCPos", $CCPos[1]) + Local $frmBotPos = WinGetPos($sBotTitle) + IniWrite($config, "position", "frmBotPosX", $frmBotPos[0]) + IniWrite($config, "position", "frmBotPosY", $frmBotPos[1]) + IniWrite($config, "position", "xTownHall", $TownHallPos[0]) + IniWrite($config, "position", "yTownHall", $TownHallPos[1]) + IniWrite($config, "position", "xArmy", $ArmyPos[0]) + IniWrite($config, "position", "yArmy", $ArmyPos[1]) + IniWrite($config, "position", "xSpell", $SpellPos[0]) + IniWrite($config, "position", "ySpell", $SpellPos[1]) + IniWrite($config, "position", "xKing", $KingPos[0]) + IniWrite($config, "position", "yKing", $KingPos[1]) + IniWrite($config, "position", "xQueen", $QueenPos[0]) + IniWrite($config, "position", "yQueen", $QueenPos[1]) + For $i = 0 To 1 ;Cover 2 Dark Barracks + IniWrite($config, "position", "xDarkBarrack" & $i + 1, $DarkBarrackPos[$i][0]) + IniWrite($config, "position", "yDarkBarrack" & $i + 1, $DarkBarrackPos[$i][1]) + Next + For $i = 0 To 16 ;Covers all Collectors + IniWrite($config, "position", "xCollector" & $i + 1, $collectorPos[$i][0]) + IniWrite($config, "position", "yCollector" & $i + 1, $collectorPos[$i][1]) + Next + For $i = 0 To 3 ;Covers all 4 Barracks + IniWrite($config, "position", "xBarrack" & $i + 1, $barrackPos[$i][0]) + IniWrite($config, "position", "yBarrack" & $i + 1, $barrackPos[$i][1]) + Next + IniWrite($config, "position", "LabPosX", $LabPos[0]) + IniWrite($config, "position", "LabPosY", $LabPos[1]) +EndFunc ;==>saveConfig diff --git a/COCBot/functions/Image Search/ImageSearch.au3 b/COCBot/functions/Image Search/ImageSearch.au3 index 31d2412..2279ce7 100644 --- a/COCBot/functions/Image Search/ImageSearch.au3 +++ b/COCBot/functions/Image Search/ImageSearch.au3 @@ -1,52 +1,52 @@ -Func _ImageSearch($findImage, $resultPosition, ByRef $x, ByRef $y, $Tolerance) - Return _ImageSearchArea($findImage, $resultPosition, 0, 0, 840, 720, $x, $y, $Tolerance) -EndFunc ;==>_ImageSearch - -Func _ImageSearchArea($findImage, $resultPosition, $x1, $y1, $right, $bottom, ByRef $x, ByRef $y, $Tolerance) - Global $HBMP = $hHBitmap - If Not IsChecked($chkBackground) Then - $HBMP = 0 - $x1 += $BSPos[0] - $y1 += $BSPos[1] - $right += $BSPos[0] - $bottom += $BSPos[1] - EndIf - ;MsgBox(0,"asd","" & $x1 & " " & $y1 & " " & $right & " " & $bottom) - - If IsString($findImage) Then - If $Tolerance > 0 Then $findImage = "*" & $Tolerance & " " & $findImage - If $HBMP = 0 Then - $result = DllCall(@ScriptDir & "\COCBot.dll", "str", "ImageSearch", "int", $x1, "int", $y1, "int", $right, "int", $bottom, "str", $findImage) - Else - $result = DllCall(@ScriptDir & "\COCBot.dll", "str", "ImageSearchEx", "int", $x1, "int", $y1, "int", $right, "int", $bottom, "str", $findImage, "ptr", $HBMP) - EndIf - Else - $result = DllCall(@ScriptDir & "\COCBot.dll", "str", "ImageSearchExt", "int", $x1, "int", $y1, "int", $right, "int", $bottom, "int", $Tolerance, "ptr", $findImage, "ptr", $HBMP) - EndIf - - ; If error exit - If IsArray($result) Then - If $result[0] = "0" Then Return 0 - Else - SetLog(GetLangText("msgImageSearchNotWork"), $COLOR_RED) - Return 1 - EndIf - - - ; Otherwise get the x,y location of the match and the size of the image to - ; compute the centre of search - $array = StringSplit($result[0], "|") - If (UBound($array) >= 4) Then - $x = Int(Number($array[2])) - $y = Int(Number($array[3])) - If $resultPosition = 1 Then - $x = $x + Int(Number($array[4]) / 2) - $y = $y + Int(Number($array[5]) / 2) - EndIf - If $Hide = False Then - $x -= $x1 - $y -= $y1 - EndIf - Return 1 - EndIf -EndFunc ;==>_ImageSearchArea +Func _ImageSearch($findImage, $resultPosition, ByRef $x, ByRef $y, $Tolerance) + Return _ImageSearchArea($findImage, $resultPosition, 0, 0, 840, 720, $x, $y, $Tolerance) +EndFunc ;==>_ImageSearch + +Func _ImageSearchArea($findImage, $resultPosition, $x1, $y1, $right, $bottom, ByRef $x, ByRef $y, $Tolerance) + Global $HBMP = $hHBitmap + If Not IsChecked($chkBackground) Then + $HBMP = 0 + $x1 += $BSPos[0] + $y1 += $BSPos[1] + $right += $BSPos[0] + $bottom += $BSPos[1] + EndIf + ;MsgBox(0,"asd","" & $x1 & " " & $y1 & " " & $right & " " & $bottom) + + If IsString($findImage) Then + If $Tolerance > 0 Then $findImage = "*" & $Tolerance & " " & $findImage + If $HBMP = 0 Then + $result = DllCall(@ScriptDir & "\COCBot.dll", "str", "ImageSearch", "int", $x1, "int", $y1, "int", $right, "int", $bottom, "str", $findImage) + Else + $result = DllCall(@ScriptDir & "\COCBot.dll", "str", "ImageSearchEx", "int", $x1, "int", $y1, "int", $right, "int", $bottom, "str", $findImage, "ptr", $HBMP) + EndIf + Else + $result = DllCall(@ScriptDir & "\COCBot.dll", "str", "ImageSearchExt", "int", $x1, "int", $y1, "int", $right, "int", $bottom, "int", $Tolerance, "ptr", $findImage, "ptr", $HBMP) + EndIf + + ; If error exit + If IsArray($result) Then + If $result[0] = "0" Then Return 0 + Else + SetLog(GetLangText("msgImageSearchNotWork"), $COLOR_RED) + Return 1 + EndIf + + + ; Otherwise get the x,y location of the match and the size of the image to + ; compute the centre of search + $array = StringSplit($result[0], "|") + If (UBound($array) >= 4) Then + $x = Int(Number($array[2])) + $y = Int(Number($array[3])) + If $resultPosition = 1 Then + $x = $x + Int(Number($array[4]) / 2) + $y = $y + Int(Number($array[5]) / 2) + EndIf + If $Hide = False Then + $x -= $x1 + $y -= $y1 + EndIf + Return 1 + EndIf +EndFunc ;==>_ImageSearchArea diff --git a/COCBot/functions/Image Search/checkButtonUpgrade.au3 b/COCBot/functions/Image Search/checkButtonUpgrade.au3 index d28dabd..5244bf9 100644 --- a/COCBot/functions/Image Search/checkButtonUpgrade.au3 +++ b/COCBot/functions/Image Search/checkButtonUpgrade.au3 @@ -1,46 +1,46 @@ -Global $checkUpgradelogic -Global $Building[5] - -$Building[0] = @ScriptDir & "\images\Building\upgrade.bmp" -$Building[1] = @ScriptDir & "\images\Building\upgrade1.bmp" -$Building[2] = @ScriptDir & "\images\Building\upgrade2.bmp" -$Building[3] = @ScriptDir & "\images\Building\upgrade3.bmp" -$Building[4] = @ScriptDir & "\images\Building\okay.bmp" -Global $BuildLoc -Global $Tolerance2 - -Func checkButtonUpgrade() - Switch _GUICtrlComboBox_GetCurSel($cmbTolerance) - Case 0 - $Tolerance2 = 55 - Case 1 - $Tolerance2 = 35 - Case 2 - $Tolerance2 = 100 - EndSwitch - #cs - If _Sleep(500) Then Return - _CaptureRegion() - For $i = 0 To 4 - ; Getting TH Location - If $THLocation = 1 Then - Return $THText[$i] - EndIf - Next - If $THLocation = 0 Then Return "-" - #ce - If _Sleep(500) Then Return - For $i = 0 To 4 - _CaptureRegion() - ; $WallLoc = _ImageSearch($Building[$icmbWalls], 1, $WallX, $WallY, $Tolerance2) ; Getting Wall Location - $BuildLoc = _ImageSearch($Building[$i], 1, $txtUpgradeX1, $txtUpgradeY1, $Tolerance2) ; Getting Button upgrade Location - - SetLog(GetLangText("msgUpgrading"), $COLOR_ORANGE) - $checkUpgradelogic = True - Return True - - Next - $checkUpgradelogic = False - SetLog(GetLangText("msgNoUpgradeButton"), $COLOR_RED) - Return False -EndFunc ;==>checkButtonUpgrade +Global $checkUpgradelogic +Global $Building[5] + +$Building[0] = @ScriptDir & "\images\Building\upgrade.bmp" +$Building[1] = @ScriptDir & "\images\Building\upgrade1.bmp" +$Building[2] = @ScriptDir & "\images\Building\upgrade2.bmp" +$Building[3] = @ScriptDir & "\images\Building\upgrade3.bmp" +$Building[4] = @ScriptDir & "\images\Building\okay.bmp" +Global $BuildLoc +Global $Tolerance2 + +Func checkButtonUpgrade() + Switch _GUICtrlComboBox_GetCurSel($cmbTolerance) + Case 0 + $Tolerance2 = 55 + Case 1 + $Tolerance2 = 35 + Case 2 + $Tolerance2 = 100 + EndSwitch + #cs + If _Sleep(500) Then Return + _CaptureRegion() + For $i = 0 To 4 + ; Getting TH Location + If $THLocation = 1 Then + Return $THText[$i] + EndIf + Next + If $THLocation = 0 Then Return "-" + #ce + If _Sleep(500) Then Return + For $i = 0 To 4 + _CaptureRegion() + ; $WallLoc = _ImageSearch($Building[$icmbWalls], 1, $WallX, $WallY, $Tolerance2) ; Getting Wall Location + $BuildLoc = _ImageSearch($Building[$i], 1, $txtUpgradeX1, $txtUpgradeY1, $Tolerance2) ; Getting Button upgrade Location + + SetLog(GetLangText("msgUpgrading"), $COLOR_ORANGE) + $checkUpgradelogic = True + Return True + + Next + $checkUpgradelogic = False + SetLog(GetLangText("msgNoUpgradeButton"), $COLOR_RED) + Return False +EndFunc ;==>checkButtonUpgrade diff --git a/COCBot/functions/Image Search/checkDarkElix.au3 b/COCBot/functions/Image Search/checkDarkElix.au3 index a9102ae..53ef885 100644 --- a/COCBot/functions/Image Search/checkDarkElix.au3 +++ b/COCBot/functions/Image Search/checkDarkElix.au3 @@ -1,58 +1,58 @@ -Func checkDarkElix() - Local $bumpTolerance - Local $maxTolerance - If IsChecked($rdoMaybeSkip) Then - $maxTolerance = 70 - $bumpTolerance = 60 - Else - $maxTolerance = 100 - $bumpTolerance = 70 - EndIf - If _Sleep(500) Then Return - Do - _CaptureRegion() - For $i = 1 To 223 - If FileExists(@ScriptDir & "\images\DElix\DE" & String($i) & ".png") Then - $DarkElixLocation = _ImageSearch(@ScriptDir & "\images\DElix\DE" & String($i) & ".png", 1, $DEx, $DEy, $bumpTolerance) ; Getting DE Location - If $DarkElixLocation = 1 Then - If ((((65 - 280) / (367 - 78)) * ($DEx - 78)) + 280 > $DEy) Or ((((277 - 62) / (780 - 481)) * ($DEx - 481)) + 62 > $DEy) Or ((((540 - 343) / (338 - 78)) * ($DEx - 78)) + 343 < $DEy) Or ((((345 - 538) / (780 - 524)) * ($DEx - 524)) + 538 < $DEy) Then - $DarkElixLocation = 0 - $DEx = 0 - $DEy = 0 - EndIf - EndIf - If $DarkElixLocation = 1 Then - If $DebugMode = 1 Then - $sPath = $dirDebug & "DataDE.csv" - If Not FileExists($sPath) Then - $hFileHandle = FileOpen($sPath, $FO_APPEND + $FO_CREATEPATH) - FileWriteLine($hFileHandle, "time,i,tolerance") - Else - $hFileHandle = FileOpen($sPath, $FO_APPEND) - EndIf - FileWriteLine($hFileHandle, @YEAR & "-" & @MON & "-" & @MDAY & "_" & @HOUR & "." & @MIN & "." & @SEC & "," & $i & "," & $bumpTolerance) - FileClose($hFileHandle) - $hClone = _GDIPlus_BitmapCloneArea($hBitmap, $DEx - 30, $DEy - 30, 60, 60, _GDIPlus_ImageGetPixelFormat($hBitmap)) - $j = 1 - Do - If Not FileExists($dirDebug & (IsChecked($rdoMaybeSkip) ? ("") : ("LowACC-")) & "PosDE-" & $i & "-" & $bumpTolerance & " (" & $j & ").jpg") Then ExitLoop - $j = $j + 1 - Until $j = 1000 - _GDIPlus_ImageSaveToFile($hClone, $dirDebug & (IsChecked($rdoMaybeSkip) ? ("") : ("LowACC-")) & "PosDE-" & $i & "-" & $bumpTolerance & " (" & $j & ").jpg") - _GDIPlus_ImageDispose($hClone) - EndIf - Return True - EndIf - EndIf - Next - $bumpTolerance += 10 - Until $bumpTolerance > $maxTolerance - - If $DarkElixLocation = 0 Then - SetLog(GetLangText("msgNoDEStorage"), $COLOR_RED) - If $DebugMode = 1 Then _GDIPlus_ImageSaveToFile($hBitmap, $dirDebug & (IsChecked($rdoMaybeSkip) ? ("") : ("LowACC-")) & "NegDE-" & @HOUR & @MIN & @SEC & ".png") - $DEx = 0 - $DEy = 0 - Return False ; return 0 - EndIf -EndFunc ;==>checkDarkElix +Func checkDarkElix() + Local $bumpTolerance + Local $maxTolerance + If IsChecked($rdoMaybeSkip) Then + $maxTolerance = 70 + $bumpTolerance = 60 + Else + $maxTolerance = 100 + $bumpTolerance = 70 + EndIf + If _Sleep(500) Then Return + Do + _CaptureRegion() + For $i = 1 To 223 + If FileExists(@ScriptDir & "\images\DElix\DE" & String($i) & ".png") Then + $DarkElixLocation = _ImageSearch(@ScriptDir & "\images\DElix\DE" & String($i) & ".png", 1, $DEx, $DEy, $bumpTolerance) ; Getting DE Location + If $DarkElixLocation = 1 Then + If ((((65 - 280) / (367 - 78)) * ($DEx - 78)) + 280 > $DEy) Or ((((277 - 62) / (780 - 481)) * ($DEx - 481)) + 62 > $DEy) Or ((((540 - 343) / (338 - 78)) * ($DEx - 78)) + 343 < $DEy) Or ((((345 - 538) / (780 - 524)) * ($DEx - 524)) + 538 < $DEy) Then + $DarkElixLocation = 0 + $DEx = 0 + $DEy = 0 + EndIf + EndIf + If $DarkElixLocation = 1 Then + If $DebugMode = 1 Then + $sPath = $dirDebug & "DataDE.csv" + If Not FileExists($sPath) Then + $hFileHandle = FileOpen($sPath, $FO_APPEND + $FO_CREATEPATH) + FileWriteLine($hFileHandle, "time,i,tolerance") + Else + $hFileHandle = FileOpen($sPath, $FO_APPEND) + EndIf + FileWriteLine($hFileHandle, @YEAR & "-" & @MON & "-" & @MDAY & "_" & @HOUR & "." & @MIN & "." & @SEC & "," & $i & "," & $bumpTolerance) + FileClose($hFileHandle) + $hClone = _GDIPlus_BitmapCloneArea($hBitmap, $DEx - 30, $DEy - 30, 60, 60, _GDIPlus_ImageGetPixelFormat($hBitmap)) + $j = 1 + Do + If Not FileExists($dirDebug & (IsChecked($rdoMaybeSkip) ? ("") : ("LowACC-")) & "PosDE-" & $i & "-" & $bumpTolerance & " (" & $j & ").jpg") Then ExitLoop + $j = $j + 1 + Until $j = 1000 + _GDIPlus_ImageSaveToFile($hClone, $dirDebug & (IsChecked($rdoMaybeSkip) ? ("") : ("LowACC-")) & "PosDE-" & $i & "-" & $bumpTolerance & " (" & $j & ").jpg") + _GDIPlus_ImageDispose($hClone) + EndIf + Return True + EndIf + EndIf + Next + $bumpTolerance += 10 + Until $bumpTolerance > $maxTolerance + + If $DarkElixLocation = 0 Then + SetLog(GetLangText("msgNoDEStorage"), $COLOR_RED) + If $DebugMode = 1 Then _GDIPlus_ImageSaveToFile($hBitmap, $dirDebug & (IsChecked($rdoMaybeSkip) ? ("") : ("LowACC-")) & "NegDE-" & @HOUR & @MIN & @SEC & ".png") + $DEx = 0 + $DEy = 0 + Return False ; return 0 + EndIf +EndFunc ;==>checkDarkElix diff --git a/COCBot/functions/Image Search/checkDeadBase.au3 b/COCBot/functions/Image Search/checkDeadBase.au3 index 0efbd8e..a9828d6 100644 --- a/COCBot/functions/Image Search/checkDeadBase.au3 +++ b/COCBot/functions/Image Search/checkDeadBase.au3 @@ -1,98 +1,98 @@ -Func checkDeadBase() - Return ZombieSearch() ; just so it compiles -EndFunc ;==>checkDeadBase - -;checkDeadBase Variables:-------------=========================== -Global $AdjustTolerance = 0 -Global $Tolerance[5][11] = [[55, 55, 55, 80, 70, 70, 75, 80, 0, 75, 65], [55, 55, 55, 80, 80, 70, 75, 80, 0, 75, 65], [55, 55, 55, 80, 80, 70, 75, 80, 0, 75, 65], [55, 55, 55, 80, 80, 60, 75, 75, 0, 75, 60], [55, 55, 55, 80, 80, 70, 75, 80, 0, 75, 65]] -Global $ZC = 0, $ZombieCount = 0;, $E -Global $ZombieFileSets = 4 ;Variant Image to use organized as per Folder -Global $ZSExclude = 0 ;Set to 0 to include Elixir Lvl 6, 1 to include lvl 7 and so on.. -Global $Lx[4] = [0, 400, 0, 400] -Global $Ly[4] = [0, 0, 265, 265] -Global $Rx[4] = [460, 860, 400, 860] -Global $Ry[4] = [325, 325, 590, 590] - -Global $Area[5][11][4], $IS_x[11][4], $IS_y[11][4], $E[5][11] - -$E[0][0] = @ScriptDir & "\images\ELIX1\E6F9.bmp" -$E[0][1] = @ScriptDir & "\images\ELIX1\E7F9.bmp" -$E[0][2] = @ScriptDir & "\images\ELIX1\E8F9.bmp" -$E[0][3] = @ScriptDir & "\images\ELIX1\E9F9.bmp" -$E[0][4] = @ScriptDir & "\images\ELIX1\E10F8.bmp" -$E[0][5] = @ScriptDir & "\images\ELIX1\E10F9.bmp" -$E[0][6] = @ScriptDir & "\images\ELIX1\E11F8.bmp" -$E[0][7] = @ScriptDir & "\images\ELIX1\E11F9.bmp" -$E[0][8] = @ScriptDir & "\images\ELIX1\E12F7.bmp" -$E[0][9] = @ScriptDir & "\images\ELIX1\E12F8.bmp" -$E[0][10] = @ScriptDir & "\images\ELIX1\E12F9.bmp" - -$E[1][0] = @ScriptDir & "\images\ELIX2\E6F9.bmp" -$E[1][1] = @ScriptDir & "\images\ELIX2\E7F9.bmp" -$E[1][2] = @ScriptDir & "\images\ELIX2\E8F9.bmp" -$E[1][3] = @ScriptDir & "\images\ELIX2\E9F9.bmp" -$E[1][4] = @ScriptDir & "\images\ELIX2\E10F8.bmp" -$E[1][5] = @ScriptDir & "\images\ELIX2\E10F9.bmp" -$E[1][6] = @ScriptDir & "\images\ELIX2\E11F8.bmp" -$E[1][7] = @ScriptDir & "\images\ELIX2\E11F9.bmp" -$E[1][8] = @ScriptDir & "\images\ELIX2\E12F7.bmp" -$E[1][9] = @ScriptDir & "\images\ELIX2\E12F8.bmp" -$E[1][10] = @ScriptDir & "\images\ELIX2\E12F9.bmp" - -$E[2][0] = @ScriptDir & "\images\ELIX3\E6F9.bmp" -$E[2][1] = @ScriptDir & "\images\ELIX3\E7F9.bmp" -$E[2][2] = @ScriptDir & "\images\ELIX3\E8F9.bmp" -$E[2][3] = @ScriptDir & "\images\ELIX3\E9F9.bmp" -$E[2][4] = @ScriptDir & "\images\ELIX3\E10F8.bmp" -$E[2][5] = @ScriptDir & "\images\ELIX3\E10F9.bmp" -$E[2][6] = @ScriptDir & "\images\ELIX3\E11F8.bmp" -$E[2][7] = @ScriptDir & "\images\ELIX3\E11F9.bmp" -$E[2][8] = @ScriptDir & "\images\ELIX3\E12F7.bmp" -$E[2][9] = @ScriptDir & "\images\ELIX3\E12F8.bmp" -$E[2][10] = @ScriptDir & "\images\ELIX3\E12F9.bmp" - -$E[3][0] = @ScriptDir & "\images\ELIX4\E6F9.bmp" -$E[3][1] = @ScriptDir & "\images\ELIX4\E7F9.bmp" -$E[3][2] = @ScriptDir & "\images\ELIX4\E8F9.bmp" -$E[3][3] = @ScriptDir & "\images\ELIX4\E9F9.bmp" -$E[3][4] = @ScriptDir & "\images\ELIX4\E10F8.bmp" -$E[3][5] = @ScriptDir & "\images\ELIX4\E10F9.bmp" -$E[3][6] = @ScriptDir & "\images\ELIX4\E11F8.bmp" -$E[3][7] = @ScriptDir & "\images\ELIX4\E11F9.bmp" -$E[3][8] = @ScriptDir & "\images\ELIX4\E12F7.bmp" -$E[3][9] = @ScriptDir & "\images\ELIX4\E12F8.bmp" -$E[3][10] = @ScriptDir & "\images\ELIX4\E12F9.bmp" - -#Region ### Check Dead Base Functions ### - ;============================================================================================================== - ;===Main Function============================================================================================== - ;-------------------------------------------------------------------------------------------------------------- - ;Uses imagesearch to see whether a collector is full or semi-full to indicate that it is a dead base - ;Returns True if it is, returns false if it is not a dead base - ;-------------------------------------------------------------------------------------------------------------- - - Func ZombieSearch() - _CaptureRegion() - $ZombieCount = 0 - $ZC = 0 - For $s = 0 To ($ZombieFileSets - 1) Step 1 - For $p = 10 To 0 + $ZSExclude Step -1 - If FileExists($E[$s][$p]) Then - $Area[$s][$p][0] = _ImageSearch($E[$s][$p], 1, $IS_x[$p][0], $IS_y[$p][0], $Tolerance[$s][$p] + $AdjustTolerance) - If $Area[$s][$p][0] > 0 Then - $ZC = 1 - ExitLoop (2) - EndIf - Else - $Area[$s][$p][0] = 0 - EndIf - Next - Next - $ZombieCount += $ZC - If $ZombieCount > 0 Then - Return True - Else - Return False - EndIf - EndFunc ;==>ZombieSearch -#EndRegion ### Check Dead Base Functions ### +Func checkDeadBase() + Return ZombieSearch() ; just so it compiles +EndFunc ;==>checkDeadBase + +;checkDeadBase Variables:-------------=========================== +Global $AdjustTolerance = 0 +Global $Tolerance[5][11] = [[55, 55, 55, 80, 70, 70, 75, 80, 0, 75, 65], [55, 55, 55, 80, 80, 70, 75, 80, 0, 75, 65], [55, 55, 55, 80, 80, 70, 75, 80, 0, 75, 65], [55, 55, 55, 80, 80, 60, 75, 75, 0, 75, 60], [55, 55, 55, 80, 80, 70, 75, 80, 0, 75, 65]] +Global $ZC = 0, $ZombieCount = 0;, $E +Global $ZombieFileSets = 4 ;Variant Image to use organized as per Folder +Global $ZSExclude = 0 ;Set to 0 to include Elixir Lvl 6, 1 to include lvl 7 and so on.. +Global $Lx[4] = [0, 400, 0, 400] +Global $Ly[4] = [0, 0, 265, 265] +Global $Rx[4] = [460, 860, 400, 860] +Global $Ry[4] = [325, 325, 590, 590] + +Global $Area[5][11][4], $IS_x[11][4], $IS_y[11][4], $E[5][11] + +$E[0][0] = @ScriptDir & "\images\ELIX1\E6F9.bmp" +$E[0][1] = @ScriptDir & "\images\ELIX1\E7F9.bmp" +$E[0][2] = @ScriptDir & "\images\ELIX1\E8F9.bmp" +$E[0][3] = @ScriptDir & "\images\ELIX1\E9F9.bmp" +$E[0][4] = @ScriptDir & "\images\ELIX1\E10F8.bmp" +$E[0][5] = @ScriptDir & "\images\ELIX1\E10F9.bmp" +$E[0][6] = @ScriptDir & "\images\ELIX1\E11F8.bmp" +$E[0][7] = @ScriptDir & "\images\ELIX1\E11F9.bmp" +$E[0][8] = @ScriptDir & "\images\ELIX1\E12F7.bmp" +$E[0][9] = @ScriptDir & "\images\ELIX1\E12F8.bmp" +$E[0][10] = @ScriptDir & "\images\ELIX1\E12F9.bmp" + +$E[1][0] = @ScriptDir & "\images\ELIX2\E6F9.bmp" +$E[1][1] = @ScriptDir & "\images\ELIX2\E7F9.bmp" +$E[1][2] = @ScriptDir & "\images\ELIX2\E8F9.bmp" +$E[1][3] = @ScriptDir & "\images\ELIX2\E9F9.bmp" +$E[1][4] = @ScriptDir & "\images\ELIX2\E10F8.bmp" +$E[1][5] = @ScriptDir & "\images\ELIX2\E10F9.bmp" +$E[1][6] = @ScriptDir & "\images\ELIX2\E11F8.bmp" +$E[1][7] = @ScriptDir & "\images\ELIX2\E11F9.bmp" +$E[1][8] = @ScriptDir & "\images\ELIX2\E12F7.bmp" +$E[1][9] = @ScriptDir & "\images\ELIX2\E12F8.bmp" +$E[1][10] = @ScriptDir & "\images\ELIX2\E12F9.bmp" + +$E[2][0] = @ScriptDir & "\images\ELIX3\E6F9.bmp" +$E[2][1] = @ScriptDir & "\images\ELIX3\E7F9.bmp" +$E[2][2] = @ScriptDir & "\images\ELIX3\E8F9.bmp" +$E[2][3] = @ScriptDir & "\images\ELIX3\E9F9.bmp" +$E[2][4] = @ScriptDir & "\images\ELIX3\E10F8.bmp" +$E[2][5] = @ScriptDir & "\images\ELIX3\E10F9.bmp" +$E[2][6] = @ScriptDir & "\images\ELIX3\E11F8.bmp" +$E[2][7] = @ScriptDir & "\images\ELIX3\E11F9.bmp" +$E[2][8] = @ScriptDir & "\images\ELIX3\E12F7.bmp" +$E[2][9] = @ScriptDir & "\images\ELIX3\E12F8.bmp" +$E[2][10] = @ScriptDir & "\images\ELIX3\E12F9.bmp" + +$E[3][0] = @ScriptDir & "\images\ELIX4\E6F9.bmp" +$E[3][1] = @ScriptDir & "\images\ELIX4\E7F9.bmp" +$E[3][2] = @ScriptDir & "\images\ELIX4\E8F9.bmp" +$E[3][3] = @ScriptDir & "\images\ELIX4\E9F9.bmp" +$E[3][4] = @ScriptDir & "\images\ELIX4\E10F8.bmp" +$E[3][5] = @ScriptDir & "\images\ELIX4\E10F9.bmp" +$E[3][6] = @ScriptDir & "\images\ELIX4\E11F8.bmp" +$E[3][7] = @ScriptDir & "\images\ELIX4\E11F9.bmp" +$E[3][8] = @ScriptDir & "\images\ELIX4\E12F7.bmp" +$E[3][9] = @ScriptDir & "\images\ELIX4\E12F8.bmp" +$E[3][10] = @ScriptDir & "\images\ELIX4\E12F9.bmp" + +#Region ### Check Dead Base Functions ### + ;============================================================================================================== + ;===Main Function============================================================================================== + ;-------------------------------------------------------------------------------------------------------------- + ;Uses imagesearch to see whether a collector is full or semi-full to indicate that it is a dead base + ;Returns True if it is, returns false if it is not a dead base + ;-------------------------------------------------------------------------------------------------------------- + + Func ZombieSearch() + _CaptureRegion() + $ZombieCount = 0 + $ZC = 0 + For $s = 0 To ($ZombieFileSets - 1) Step 1 + For $p = 10 To 0 + $ZSExclude Step -1 + If FileExists($E[$s][$p]) Then + $Area[$s][$p][0] = _ImageSearch($E[$s][$p], 1, $IS_x[$p][0], $IS_y[$p][0], $Tolerance[$s][$p] + $AdjustTolerance) + If $Area[$s][$p][0] > 0 Then + $ZC = 1 + ExitLoop (2) + EndIf + Else + $Area[$s][$p][0] = 0 + EndIf + Next + Next + $ZombieCount += $ZC + If $ZombieCount > 0 Then + Return True + Else + Return False + EndIf + EndFunc ;==>ZombieSearch +#EndRegion ### Check Dead Base Functions ### diff --git a/COCBot/functions/Image Search/checkTownhall.au3 b/COCBot/functions/Image Search/checkTownhall.au3 index 4921f50..658e6f1 100644 --- a/COCBot/functions/Image Search/checkTownhall.au3 +++ b/COCBot/functions/Image Search/checkTownhall.au3 @@ -1,37 +1,37 @@ -Func checkTownhall() - $bumpTolerance = 70 - If _Sleep(500) Then Return - Do - _CaptureRegion() - For $i = 1 To 50 - If FileExists(@ScriptDir & "\images\TH\townhall" & String($i) & ".bmp") Then - $THLocation = _ImageSearch(@ScriptDir & "\images\TH\townhall" & String($i) & ".bmp", 1, $THx, $THy, $bumpTolerance) ; Getting TH Location - If $THLocation = 1 Then - If ((((65 - 280) / (367 - 78)) * ($THx - 78)) + 280 > $THy) Or ((((277 - 62) / (780 - 481)) * ($THx - 481)) + 62 > $THy) Or ((((540 - 343) / (338 - 78)) * ($THx - 78)) + 343 < $THy) Or ((((345 - 538) / (780 - 524)) * ($THx - 524)) + 538 < $THy) Then - $THLocation = 0 - $THx = 0 - $THy = 0 - EndIf - EndIf - If $THLocation = 1 Then - If $DebugMode = 1 Then - $hClone = _GDIPlus_BitmapCloneArea($hBitmap, $THx - 30, $THy - 30, 60, 60, _GDIPlus_ImageGetPixelFormat($hBitmap)) - $j = 1 - Do - If Not FileExists($dirDebug & "PosTH-" & $THText[Floor(($i - 1) / 10)] & "-" & $bumpTolerance & "(" & $j & ").jpg") Then ExitLoop - $j = $j + 1 - Until $j = 1000 - _GDIPlus_ImageSaveToFile($hClone, $dirDebug & "PosTH-" & $THText[Floor(($i - 1) / 10)] & "(" & $j & ").jpg") - _GDIPlus_ImageDispose($hClone) - EndIf - Return $THText[Floor(($i - 1) / 10)] - EndIf - EndIf - Next - $bumpTolerance += 5 - Until $bumpTolerance > 80 - If $THLocation = 0 Then - If $DebugMode = 1 Then _GDIPlus_ImageSaveToFile($hBitmap, $dirDebug & "NegTH-" & @HOUR & @MIN & @SEC & ".png") - Return "-" - EndIf -EndFunc ;==>checkTownhall +Func checkTownhall() + $bumpTolerance = 70 + If _Sleep(500) Then Return + Do + _CaptureRegion() + For $i = 1 To 50 + If FileExists(@ScriptDir & "\images\TH\townhall" & String($i) & ".bmp") Then + $THLocation = _ImageSearch(@ScriptDir & "\images\TH\townhall" & String($i) & ".bmp", 1, $THx, $THy, $bumpTolerance) ; Getting TH Location + If $THLocation = 1 Then + If ((((65 - 280) / (367 - 78)) * ($THx - 78)) + 280 > $THy) Or ((((277 - 62) / (780 - 481)) * ($THx - 481)) + 62 > $THy) Or ((((540 - 343) / (338 - 78)) * ($THx - 78)) + 343 < $THy) Or ((((345 - 538) / (780 - 524)) * ($THx - 524)) + 538 < $THy) Then + $THLocation = 0 + $THx = 0 + $THy = 0 + EndIf + EndIf + If $THLocation = 1 Then + If $DebugMode = 1 Then + $hClone = _GDIPlus_BitmapCloneArea($hBitmap, $THx - 30, $THy - 30, 60, 60, _GDIPlus_ImageGetPixelFormat($hBitmap)) + $j = 1 + Do + If Not FileExists($dirDebug & "PosTH-" & $THText[Floor(($i - 1) / 10)] & "-" & $bumpTolerance & "(" & $j & ").jpg") Then ExitLoop + $j = $j + 1 + Until $j = 1000 + _GDIPlus_ImageSaveToFile($hClone, $dirDebug & "PosTH-" & $THText[Floor(($i - 1) / 10)] & "(" & $j & ").jpg") + _GDIPlus_ImageDispose($hClone) + EndIf + Return $THText[Floor(($i - 1) / 10)] + EndIf + EndIf + Next + $bumpTolerance += 5 + Until $bumpTolerance > 80 + If $THLocation = 0 Then + If $DebugMode = 1 Then _GDIPlus_ImageSaveToFile($hBitmap, $dirDebug & "NegTH-" & @HOUR & @MIN & @SEC & ".png") + Return "-" + EndIf +EndFunc ;==>checkTownhall diff --git a/COCBot/functions/Image Search/checkWall.au3 b/COCBot/functions/Image Search/checkWall.au3 index bc9640c..4a4bb32 100644 --- a/COCBot/functions/Image Search/checkWall.au3 +++ b/COCBot/functions/Image Search/checkWall.au3 @@ -1,65 +1,65 @@ -; check Wall function | safar46 -Global $checkwalllogic -Global $Wall[8] -For $i = 0 To 7 - $Wall[$i] = @ScriptDir & "\images\Walls\" & $i + 4 & ".png" -Next - -Global $WallX = 0, $WallY = 0, $WallLoc = 0 -Global $Tolerance2 - -Func checkWall() - Switch _GUICtrlComboBox_GetCurSel($cmbTolerance) - Case 0 - $Tolerance2 = 55 - Case 1 - $Tolerance2 = 35 - Case 2 - $Tolerance2 = 75 - EndSwitch - - If _Sleep(500) Then Return - For $i = 0 To 3 - _CaptureRegion() - $WallLoc = _ImageSearch($Wall[$icmbWalls], 1, $WallX, $WallY, $Tolerance2) ; Getting Wall Location - If $icmbWalls = 6 Then - If $WallLoc = 0 Then $WallLoc = _ImageSearch($Wall[$icmbWalls + 1], 1, $WallX, $WallY, $Tolerance2) ; Getting Wall lvl 10 Location - EndIf - If $WallLoc = 1 Then - SetLog(GetLangText("msgWallFound") & $icmbWalls + 4 & ", " & GetLangText("msgUpgrading"), $COLOR_GREEN) - $checkwalllogic = True - Return True - EndIf - Next - $checkwalllogic = False - SetLog(GetLangText("msgWallNotFound") & $icmbWalls + 4 & GetLangText("msgWallSkipUpgrade"), $COLOR_RED) - Return False -EndFunc ;==>checkWall - -Func FindWall() - Switch _GUICtrlComboBox_GetCurSel($cmbTolerance) - Case 0 - $Tolerance2 = 55 - Case 1 - $Tolerance2 = 35 - Case 2 - $Tolerance2 = 75 - EndSwitch - - _Sleep(500) - For $i = 0 To 3 - _CaptureRegion() - $WallLoc = _ImageSearch($Wall[$icmbWalls], 1, $WallX, $WallY, $Tolerance2) ; Getting Wall Location - If $icmbWalls = 6 Then - If $WallLoc = 0 Then $WallLoc = _ImageSearch($Wall[$icmbWalls + 1], 1, $WallX, $WallY, $Tolerance2) ; Getting Wall lvl 10 Location - EndIf - If $WallLoc = 1 Then - WinActivate($HWnD) - Click($WallX, $WallY) - SetLog(GetLangText("msgWallFound") & $icmbWalls + 4 & " " & GetLangText("msgWallAt") & " PosX: " & $WallX & ", PosY: " & $WallY & "...", $COLOR_GREEN) - Return True - EndIf - Next - SetLog(GetLangText("msgWallNotFound") & $icmbWalls + 4 & GetLangText("msgWallAdjustTol"), $COLOR_RED) - Return False -EndFunc ;==>FindWall +; check Wall function | safar46 +Global $checkwalllogic +Global $Wall[8] +For $i = 0 To 7 + $Wall[$i] = @ScriptDir & "\images\Walls\" & $i + 4 & ".png" +Next + +Global $WallX = 0, $WallY = 0, $WallLoc = 0 +Global $Tolerance2 + +Func checkWall() + Switch _GUICtrlComboBox_GetCurSel($cmbTolerance) + Case 0 + $Tolerance2 = 55 + Case 1 + $Tolerance2 = 35 + Case 2 + $Tolerance2 = 75 + EndSwitch + + If _Sleep(500) Then Return + For $i = 0 To 3 + _CaptureRegion() + $WallLoc = _ImageSearch($Wall[$icmbWalls], 1, $WallX, $WallY, $Tolerance2) ; Getting Wall Location + If $icmbWalls = 6 Then + If $WallLoc = 0 Then $WallLoc = _ImageSearch($Wall[$icmbWalls + 1], 1, $WallX, $WallY, $Tolerance2) ; Getting Wall lvl 10 Location + EndIf + If $WallLoc = 1 Then + SetLog(GetLangText("msgWallFound") & $icmbWalls + 4 & ", " & GetLangText("msgUpgrading"), $COLOR_GREEN) + $checkwalllogic = True + Return True + EndIf + Next + $checkwalllogic = False + SetLog(GetLangText("msgWallNotFound") & $icmbWalls + 4 & GetLangText("msgWallSkipUpgrade"), $COLOR_RED) + Return False +EndFunc ;==>checkWall + +Func FindWall() + Switch _GUICtrlComboBox_GetCurSel($cmbTolerance) + Case 0 + $Tolerance2 = 55 + Case 1 + $Tolerance2 = 35 + Case 2 + $Tolerance2 = 75 + EndSwitch + + _Sleep(500) + For $i = 0 To 3 + _CaptureRegion() + $WallLoc = _ImageSearch($Wall[$icmbWalls], 1, $WallX, $WallY, $Tolerance2) ; Getting Wall Location + If $icmbWalls = 6 Then + If $WallLoc = 0 Then $WallLoc = _ImageSearch($Wall[$icmbWalls + 1], 1, $WallX, $WallY, $Tolerance2) ; Getting Wall lvl 10 Location + EndIf + If $WallLoc = 1 Then + WinActivate($HWnD) + Click($WallX, $WallY) + SetLog(GetLangText("msgWallFound") & $icmbWalls + 4 & " " & GetLangText("msgWallAt") & " PosX: " & $WallX & ", PosY: " & $WallY & "...", $COLOR_GREEN) + Return True + EndIf + Next + SetLog(GetLangText("msgWallNotFound") & $icmbWalls + 4 & GetLangText("msgWallAdjustTol"), $COLOR_RED) + Return False +EndFunc ;==>FindWall diff --git a/COCBot/functions/Main Screen/ZoomOut.au3 b/COCBot/functions/Main Screen/ZoomOut.au3 index 20b8930..0b5b422 100644 --- a/COCBot/functions/Main Screen/ZoomOut.au3 +++ b/COCBot/functions/Main Screen/ZoomOut.au3 @@ -1,21 +1,21 @@ -;Tries to zoom out of the screen until the borders, located at the top of the game (usually black), is located. - -Func ZoomOut() - $i = 0 - _CaptureRegion(0, 0, 860, 2) - If _GetPixelColor(1, 1) <> Hex(0x000000, 6) And _GetPixelColor(850, 1) <> Hex(0x000000, 6) Then SetLog(GetLangText("msgZoomingOut"), $COLOR_GREEN) - While (_GetPixelColor(1, 1) <> Hex(0x000000, 6) And _GetPixelColor(850, 1) <> Hex(0x000000, 6)) And $i <= 40 - If BitAND(GUICtrlGetState($btnStop), $GUI_HIDE) Then - _Sleep(600, True, False) - Else - If _Sleep(600) Then Return False - EndIf - If ControlSend($Title, "", "", "{DOWN}") Then $i += 1 - _CaptureRegion(0, 0, 860, 2) - WEnd - If _GetPixelColor(1, 1) <> Hex(0x000000, 6) And _GetPixelColor(850, 1) <> Hex(0x000000, 6) Then - Return False - Else - Return True - EndIf -EndFunc ;==>ZoomOut +;Tries to zoom out of the screen until the borders, located at the top of the game (usually black), is located. + +Func ZoomOut() + $i = 0 + _CaptureRegion(0, 0, 860, 2) + If _GetPixelColor(1, 1) <> Hex(0x000000, 6) And _GetPixelColor(850, 1) <> Hex(0x000000, 6) Then SetLog(GetLangText("msgZoomingOut"), $COLOR_GREEN) + While (_GetPixelColor(1, 1) <> Hex(0x000000, 6) And _GetPixelColor(850, 1) <> Hex(0x000000, 6)) And $i <= 40 + If BitAND(GUICtrlGetState($btnStop), $GUI_HIDE) Then + _Sleep(600, True, False) + Else + If _Sleep(600) Then Return False + EndIf + If ControlSend($Title, "", "", "{DOWN}") Then $i += 1 + _CaptureRegion(0, 0, 860, 2) + WEnd + If _GetPixelColor(1, 1) <> Hex(0x000000, 6) And _GetPixelColor(850, 1) <> Hex(0x000000, 6) Then + Return False + Else + Return True + EndIf +EndFunc ;==>ZoomOut diff --git a/COCBot/functions/Main Screen/checkMainScreen.au3 b/COCBot/functions/Main Screen/checkMainScreen.au3 index 06dee82..37566db 100644 --- a/COCBot/functions/Main Screen/checkMainScreen.au3 +++ b/COCBot/functions/Main Screen/checkMainScreen.au3 @@ -1,28 +1,28 @@ -;This function checks whether the pixel, located in the eyes of the builder in mainscreen, is available -;If it is not available, it calls checkObstacles and also waitMainScreen. - -Func checkMainScreen($Check = False, $maxDelay = 1) ;Checks if in main screen - If $Check = True Then SetLog(GetLangText("msgMSTry"), $COLOR_BLUE) - _WinAPI_EmptyWorkingSet(WinGetProcess($Title)) ; Reduce BlueStacks Memory Usage - - If Not _WaitForColor(284, 28, Hex(0x41B1CD, 6), 20, $maxDelay) Then - While _ColorCheck(_GetPixelColor(284, 28), Hex(0x41B1CD, 6), 20) = False - $HWnD = WinGetHandle($Title) - If (Not checkObstacles()) And (BitAND(GUICtrlGetState($btnStart), $GUI_HIDE)) Then - Click(126, 700, 1, 500) - Local $RunApp = StringReplace(_WinAPI_GetProcessFileName(WinGetProcess($Title)), "Frontend", "RunApp") - Run($RunApp & " Android com.supercell.clashofclans com.supercell.clashofclans.GameApp") - EndIf - If _Sleep(3000) Then Return False - waitMainScreen() - WEnd - EndIf - If $Check = True Then SetLog(GetLangText("msgMSLocated"), $COLOR_BLUE) - If Not ZoomOut() Then - SetLog(GetLangText("msgMSFailed"), $COLOR_BLUE) - Return False - Else - Return True - EndIf - -EndFunc ;==>checkMainScreen +;This function checks whether the pixel, located in the eyes of the builder in mainscreen, is available +;If it is not available, it calls checkObstacles and also waitMainScreen. + +Func checkMainScreen($Check = False, $maxDelay = 1) ;Checks if in main screen + If $Check = True Then SetLog(GetLangText("msgMSTry"), $COLOR_BLUE) + _WinAPI_EmptyWorkingSet(WinGetProcess($Title)) ; Reduce BlueStacks Memory Usage + + If Not _WaitForColor(284, 28, Hex(0x41B1CD, 6), 20, $maxDelay) Then + While _ColorCheck(_GetPixelColor(284, 28), Hex(0x41B1CD, 6), 20) = False + $HWnD = WinGetHandle($Title) + If (Not checkObstacles()) And (BitAND(GUICtrlGetState($btnStart), $GUI_HIDE)) Then + Click(126, 700, 1, 500) + Local $RunApp = StringReplace(_WinAPI_GetProcessFileName(WinGetProcess($Title)), "Frontend", "RunApp") + Run($RunApp & " -p com.supercell.clashofclans -a com.supercell.clashofclans.GameApp") + EndIf + If _Sleep(3000) Then Return False + waitMainScreen() + WEnd + EndIf + If $Check = True Then SetLog(GetLangText("msgMSLocated"), $COLOR_BLUE) + If Not ZoomOut() Then + SetLog(GetLangText("msgMSFailed"), $COLOR_BLUE) + Return False + Else + Return True + EndIf + +EndFunc ;==>checkMainScreen diff --git a/COCBot/functions/Main Screen/checkObstacles.au3 b/COCBot/functions/Main Screen/checkObstacles.au3 index 8f3acf5..515d42c 100644 --- a/COCBot/functions/Main Screen/checkObstacles.au3 +++ b/COCBot/functions/Main Screen/checkObstacles.au3 @@ -1,80 +1,80 @@ -;Checks whether something is blocking the pixel for mainscreen and tries to unblock -;Returns True when there is something blocking - -Func checkObstacles() ;Checks if something is in the way for mainscreen - Local $x, $y - _CaptureRegion() - If _ImageSearchArea($device, 0, 237, 321, 293, 346, $x, $y, 80) Then - SetLog(GetLangText("msgAnotherDev") & $itxtReconnect & GetLangText("msgAnotherDevMinutes"), $COLOR_RED) - If _Sleep($itxtReconnect * 60000) Then Return - $iTimeTroops = 0 - Click(416, 399);Check for "Another device" message - If _Sleep(6000) Then Return - $Checkrearm = True - ZoomOut() - Return True - EndIf - - If _ImageSearch($break, 0, $x, $y, 80) Then - SetLog(GetLangText("msgTakeBreak"), $COLOR_RED) - If _Sleep(120000) Then Return ; 2 Minutes - Click(416, 399);Check for "Take a break" message - $Checkrearm = True - Return True - EndIf - - $Message = _PixelSearch(457, 300, 458, 330, Hex(0x33B5E5, 6), 10) - If IsArray($Message) Then - Click(416, 399);Check for out of sync or inactivity - If _Sleep(6000) Then Return - ZoomOut() - Return True - EndIf - - _CaptureRegion() - If _ColorCheck(_GetPixelColor(235, 209), Hex(0x9E3826, 6), 20) Then - Click(429, 493);See if village was attacked, clicks Okay - $Checkrearm = True - Return True - EndIf - - If _ColorCheck(_GetPixelColor(284, 28), Hex(0x215B69, 6), 20) Then - Click(1, 1) ;Click away If things are open - Return True - EndIf - - If _ColorCheck(_GetPixelColor(819, 55), Hex(0xD80400, 6), 20) Then - Click(819, 55) ;Clicks X - Return True - EndIf - - If _ColorCheck(_GetPixelColor(822, 48), Hex(0xD80408, 6), 20) Or _ColorCheck(_GetPixelColor(830, 59), Hex(0xD80408, 6), 20) Then - Click(822, 48) ;Clicks X - Return True - EndIf - - If _ColorCheck(_GetPixelColor(331, 330), Hex(0xF0A03B, 6), 20) Then - Click(331, 330) ;Clicks chat thing - If _Sleep(1000) Then Return - Return True - EndIf - - If _ColorCheck(_GetPixelColor(429, 519), Hex(0xB8E35F, 6), 20) Then - Click(429, 519) ;If in that victory or defeat scene - Return True - EndIf - - If _ColorCheck(_GetPixelColor(71, 530), Hex(0xC00000, 6), 20) Then - ReturnHome(False, False) ;If End battle is available - Return True - EndIf - - $Message = _PixelSearch(19, 565, 104, 580, Hex(0xD9DDCF, 6), 10) - If IsArray($Message) Then - Click(67, 602);Check if Return Home button available - If _Sleep(2000) Then Return - Return True - EndIf - - Return False -EndFunc ;==>checkObstacles +;Checks whether something is blocking the pixel for mainscreen and tries to unblock +;Returns True when there is something blocking + +Func checkObstacles() ;Checks if something is in the way for mainscreen + Local $x, $y + _CaptureRegion() + If _ImageSearchArea($device, 0, 237, 321, 293, 346, $x, $y, 80) Then + SetLog(GetLangText("msgAnotherDev") & $itxtReconnect & GetLangText("msgAnotherDevMinutes"), $COLOR_RED) + If _Sleep($itxtReconnect * 60000) Then Return + $iTimeTroops = 0 + Click(416, 399);Check for "Another device" message + If _Sleep(6000) Then Return + $Checkrearm = True + ZoomOut() + Return True + EndIf + + If _ImageSearch($break, 0, $x, $y, 80) Then + SetLog(GetLangText("msgTakeBreak"), $COLOR_RED) + If _Sleep(120000) Then Return ; 2 Minutes + Click(416, 399);Check for "Take a break" message + $Checkrearm = True + Return True + EndIf + + $Message = _PixelSearch(457, 300, 458, 330, Hex(0x33B5E5, 6), 10) + If IsArray($Message) Then + Click(416, 399);Check for out of sync or inactivity + If _Sleep(6000) Then Return + ZoomOut() + Return True + EndIf + + _CaptureRegion() + If _ColorCheck(_GetPixelColor(235, 209), Hex(0x9E3826, 6), 20) Then + Click(429, 493);See if village was attacked, clicks Okay + $Checkrearm = True + Return True + EndIf + + If _ColorCheck(_GetPixelColor(284, 28), Hex(0x215B69, 6), 20) Then + Click(1, 1) ;Click away If things are open + Return True + EndIf + + If _ColorCheck(_GetPixelColor(819, 55), Hex(0xD80400, 6), 20) Then + Click(819, 55) ;Clicks X + Return True + EndIf + + If _ColorCheck(_GetPixelColor(822, 48), Hex(0xD80408, 6), 20) Or _ColorCheck(_GetPixelColor(830, 59), Hex(0xD80408, 6), 20) Then + Click(822, 48) ;Clicks X + Return True + EndIf + + If _ColorCheck(_GetPixelColor(331, 330), Hex(0xF0A03B, 6), 20) Then + Click(331, 330) ;Clicks chat thing + If _Sleep(1000) Then Return + Return True + EndIf + + If _ColorCheck(_GetPixelColor(429, 519), Hex(0xB8E35F, 6), 20) Then + Click(429, 519) ;If in that victory or defeat scene + Return True + EndIf + + If _ColorCheck(_GetPixelColor(71, 530), Hex(0xC00000, 6), 20) Then + ReturnHome(False, False) ;If End battle is available + Return True + EndIf + + $Message = _PixelSearch(19, 565, 104, 580, Hex(0xD9DDCF, 6), 10) + If IsArray($Message) Then + Click(67, 602);Check if Return Home button available + If _Sleep(2000) Then Return + Return True + EndIf + + Return False +EndFunc ;==>checkObstacles diff --git a/COCBot/functions/Main Screen/waitMainScreen.au3 b/COCBot/functions/Main Screen/waitMainScreen.au3 index df72caf..e194a3b 100644 --- a/COCBot/functions/Main Screen/waitMainScreen.au3 +++ b/COCBot/functions/Main Screen/waitMainScreen.au3 @@ -1,27 +1,22 @@ -;Waits 5 minutes for the pixel of mainscreen to be located, checks for obstacles every 2 seconds. -;After five minutes, will try to restart bluestacks. - -Func waitMainScreen() ;Waits for main screen to popup - If ($ichkForceBS) = 1 Then - WinActivate($HWnD) - EndIf - SetLog(GetLangText("msgWaitMS"), $COLOR_ORANGE) - For $i = 0 To 150 ;150*2000 = 5 Minutes - _CaptureRegion() - If Not _ColorCheck(_GetPixelColor(284, 28), Hex(0x41B1CD, 6), 20) Then ;Checks for Main Screen - If _Sleep(2000) Then Return - If checkObstacles() Then $i = 0 ;See if there is anything in the way of mainscreen - Else - Return - EndIf - Next - - SetLog(GetLangText("msgUnableLoad"), $COLOR_RED) - Local $RestartApp = StringReplace(_WinAPI_GetProcessFileName(WinGetProcess($Title)), "Frontend", "Restart") - Run($RestartApp & " Android") - If _Sleep(10000) Then Return - - Do - If _Sleep(5000) Then Return - Until ControlGetHandle($Title, "", "BlueStacksApp1") <> 0 -EndFunc ;==>waitMainScreen +;Waits 5 minutes for the pixel of mainscreen to be located, checks for obstacles every 2 seconds. +;After five minutes, will try to restart bluestacks. + +Func waitMainScreen() ;Waits for main screen to popup + If ($ichkForceBS) = 1 Then + WinActivate($HWnD) + EndIf + SetLog(GetLangText("msgWaitMS"), $COLOR_ORANGE) + For $i = 0 To 150 ;150*2000 = 5 Minutes + _CaptureRegion() + If Not _ColorCheck(_GetPixelColor(284, 28), Hex(0x41B1CD, 6), 20) Then ;Checks for Main Screen + If _Sleep(2000) Then Return + ;If checkObstacles() Then $i = 0 ;See if there is anything in the way of mainscreen + checkObstacles() ;in case of bluestack freeze, this may become dead loop. Just stick to 5 minutes waiting + Else + Return + EndIf + Next + + SetLog(GetLangText("msgUnableLoad"), $COLOR_RED) + If Not restartBlueStack() Then Return +EndFunc ;==>waitMainScreen diff --git a/COCBot/functions/Notification/PushBullet.au3 b/COCBot/functions/Notification/PushBullet.au3 index 6aef668..aa10002 100644 --- a/COCBot/functions/Notification/PushBullet.au3 +++ b/COCBot/functions/Notification/PushBullet.au3 @@ -1,177 +1,180 @@ -#include -#include - -Func _RemoteControl() - $oHTTP = ObjCreate("WinHTTP.WinHTTPRequest.5.1") - $access_token = $PushBullettoken - $oHTTP.Open("Get", "https://api.pushbullet.com/v2/pushes?active=true&limit=3", False) - $oHTTP.SetCredentials($access_token, "", 0) - $oHTTP.SetRequestHeader("Content-Type", "application/json") - $oHTTP.SetTimeouts(5000,5000,5000,5000) - $oHTTP.Send() - If @error Then Return - $Result = $oHTTP.ResponseText - - If StringInStr(StringLower($Result), '"body":"bot') Then - Local $title = _StringBetween($Result, '"body":"', '"', "", False) - Local $iden = _StringBetween($Result, '"iden":"', '"', "", False) - For $x = 0 To UBound($title) - 1 - If $title <> "" Or $iden <> "" Then - $title[$x] = StringUpper(StringStripWS($title[$x], $STR_STRIPLEADING + $STR_STRIPTRAILING + $STR_STRIPSPACES)) - $iden[$x] = StringStripWS($iden[$x], $STR_STRIPLEADING + $STR_STRIPTRAILING + $STR_STRIPSPACES) - If StringLeft($title[$x], 8) = "BOT HELP" Then - SetLog(GetLangText("msgPBHelpSent")) - _Push(GetLangText("pushHRa"), GetLangText("pushHRb")) - _DeleteMessage($iden[$x]) - ElseIf StringLeft($title[$x], 9) = "BOT PAUSE" And StringStripWS(StringRight($title[$x], StringLen($title[$x]) - 9), 3) = StringUpper(StringStripWS(GUICtrlRead($inppushuser), 3)) Then - If $PauseBot = False Then - SetLog(GetLangText("msgPBBotPauseFuture")) - _Push(GetLangText("pushPRa"), GetLangText("pushPRb")) - $PauseBot = True - Else - SetLog(GetLangText("msgPBNoAction")) - _Push(GetLangText("pushPRa"), GetLangText("pushPRc")) - EndIf - _DeleteMessage($iden[$x]) - ElseIf StringLeft($title[$x], 10) = "BOT RESUME" And StringStripWS(StringRight($title[$x], StringLen($title[$x]) - 10), 3) = StringUpper(StringStripWS(GUICtrlRead($inppushuser), 3)) Then - If $PauseBot = True Then - SetLog(GetLangText("msgPBResumed")) - _Push(GetLangText("pushRRa"), GetLangText("pushRRb")) - $PauseBot = False - If GUICtrlRead($btnPause) = "Resume" Then btnPause() - Else - SetLog(GetLangText("msgPBRunning")) - _Push(GetLangText("pushRRa"), GetLangText("pushRRc")) - EndIf - _DeleteMessage($iden[$x]) - ElseIf StringLeft($title[$x], 9) = "BOT STATS" And StringStripWS(StringRight($title[$x], StringLen($title[$x]) - 9), 3) = StringUpper(StringStripWS(GUICtrlRead($inppushuser), 3)) 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("pushStatRq1") & GUICtrlRead($lblresultsearchdisconnected) & GetLangText("pushStatRr") & GUICtrlRead($lblresultsearchcost) & GetLangText("pushStatRs") & StringFormat("%02i:%02i:%02i", $hour, $min, $sec)) - _DeleteMessage($iden[$x]) - ElseIf StringLeft($title[$x], 8) = "BOT LOGS" And StringStripWS(StringRight($title[$x], StringLen($title[$x]) - 8), 3) = StringUpper(StringStripWS(GUICtrlRead($inppushuser), 3)) Then - SetLog(GetLangText("msgPBLog")) - _PushFile($sLogFileName, "logs", "text/plain; charset=utf-8", "Current Logs", $sLogFileName) - _DeleteMessage($iden[$x]) - EndIf - $title[$x] = "" - $iden[$x] = "" - EndIf - Next - EndIf -EndFunc ;==>_RemoteControl - -Func _PushBullet($pTitle = "", $pMessage = "") - $oHTTP = ObjCreate("WinHTTP.WinHTTPRequest.5.1") - $access_token = $PushBullettoken - $oHTTP.Open("Get", "https://api.pushbullet.com/v2/devices", False) - $oHTTP.SetCredentials($access_token, "", 0) - $oHTTP.Send() - $Result = $oHTTP.ResponseText - Local $device_iden = _StringBetween($Result, 'iden":"', '"') - Local $device_name = _StringBetween($Result, 'nickname":"', '"') -EndFunc ;==>_PushBullet - -Func _Push($pTitle, $pMessage) - If StringStripWS(GUICtrlRead($inppushuser), 3) <> "" Then $pTitle = "[" & StringStripWS(GUICtrlRead($inppushuser), 3) & "] " & $pTitle - $oHTTP = ObjCreate("WinHTTP.WinHTTPRequest.5.1") - $access_token = $PushBullettoken - $oHTTP.Open("Post", "https://api.pushbullet.com/v2/pushes", False) - $oHTTP.SetCredentials($access_token, "", 0) - $oHTTP.SetRequestHeader("Content-Type", "application/json") - Local $pPush = '{"type": "note", "title": "' & $pTitle & '", "body": "' & $pMessage & '"}' - $oHTTP.Send($pPush) -EndFunc ;==>_Push - -Func _PushFile($File, $Folder, $FileType, $title, $body) - If StringStripWS(GUICtrlRead($inppushuser), 3) <> "" Then $title = "[" & StringStripWS(GUICtrlRead($inppushuser), 3) & "] " & $title - $oHTTP = ObjCreate("WinHTTP.WinHTTPRequest.5.1") - $access_token = $PushBullettoken - $oHTTP.Open("Post", "https://api.pushbullet.com/v2/upload-request", False) - $oHTTP.SetCredentials($access_token, "", 0) - $oHTTP.SetRequestHeader("Content-Type", "application/json") - - Local $pPush = '{"file_name": "' & $File & '", "file_type": "' & $FileType & '"}' - $oHTTP.Send($pPush) - $Result = $oHTTP.ResponseText - $Result1 = $Result - Local $upload_url = _StringBetween($Result, 'upload_url":"', '"') - Local $awsaccesskeyid = _StringBetween($Result, 'awsaccesskeyid":"', '"') - Local $acl = _StringBetween($Result, 'acl":"', '"') - Local $key = _StringBetween($Result, 'key":"', '"') - Local $signature = _StringBetween($Result, 'signature":"', '"') - Local $policy = _StringBetween($Result, 'policy":"', '"') - Local $file_url = _StringBetween($Result, 'file_url":"', '"') - - If IsArray($upload_url) And IsArray($awsaccesskeyid) And IsArray($acl) And IsArray($key) And IsArray($signature) And IsArray($policy) Then - $Result = RunWait(@ScriptDir & "\curl\curl.exe -i -X POST " & $upload_url[0] & ' -F awsaccesskeyid="' & $awsaccesskeyid[0] & '" -F acl="' & $acl[0] & '" -F key="' & $key[0] & '" -F signature="' & $signature[0] & '" -F policy="' & $policy[0] & '" -F content-type="' & $FileType & '" -F file=@"' & @ScriptDir & '\' & $Folder & '\' & $File & '" -o "' & @ScriptDir & '\logs\curl.log"', "", @SW_HIDE) - If Not FileExists($dirLogs & "curl.log") Then _FileCreate($dirLogs & "curl.log") - If IsChecked($lblpushbulletdebug) Then - SetLog('=========================================================================') - SetLog($Result) - SetLog($upload_url[0]) - SetLog($acl[0]) - SetLog($key[0]) - SetLog($signature[0]) - SetLog($policy[0]) - SetLog($awsaccesskeyid[0]) - SetLog($file_url[0]) - SetLog($Result1) - SetLog(@ScriptDir & "\curl\curl.exe -i -X POST " & $upload_url[0] & ' -F awsaccesskeyid="' & $awsaccesskeyid[0] & '" -F acl="' & $acl[0] & '" -F key="' & $key[0] & '" -F signature="' & $signature[0] & '" -F policy="' & $policy[0] & '" -F content-type="' & $FileType & '" -F file=@"' & @ScriptDir & '\' & $Folder & '\' & $File & '" -o "' & @ScriptDir & '\logs\curl.log"') - EndIf - If Not FileExists($dirLogs & "curl.log") Then _FileCreate($dirLogs & "curl.log") - If _FileCountLines(@ScriptDir & '\logs\curl.log') > 8 Then - Local $hFileOpen = FileOpen(@ScriptDir & '\logs\curl.log') - Local $sFileRead = FileReadLine($hFileOpen, 8) - Local $sFileRead1 = StringSplit($sFileRead, " ") - Local $sLink = $sFileRead1[2] - Local $findstr1 = StringRegExp($sLink, 'https://') - If $findstr1 = 1 Then - $oHTTP.Open("Post", "https://api.pushbullet.com/v2/pushes", False) - $oHTTP.SetCredentials($access_token, "", 0) - $oHTTP.SetRequestHeader("Content-Type", "application/json") - ;Local $pPush = '{"type": "file", "file_name": "' & $FileName & '", "file_type": "' & $FileType & '", "file_url": "' & $file_url[0] & '", "title": "' & $title & '", "body": "' & $body & '"}' - Local $pPush = '{"type": "file", "file_name": "' & $File & '", "file_type": "' & $FileType & '", "file_url": "' & $sLink & '", "title": "' & $title & '", "body": "' & $body & '"}' - $oHTTP.Send($pPush) - $Result = $oHTTP.ResponseText - Else - If IsChecked($lblpushbulletdebug) Then - SetLog($hFileOpen) - SetLog(GetLangText("msgPBErrorUpload")) - EndIf - EndIf - Else - If IsChecked($lblpushbulletdebug) Then - SetLog(GetLangText("msgPBErrorUploading")) - EndIf - EndIf - Else - If IsChecked($lblpushbulletdebug) Then - SetLog('=========================================================================') - SetLog('Malformed HTTP response:') - SetLog($Result) - EndIf - EndIf - If IsChecked($lblpushbulletdebug) Then - SetLog($Result) - SetLog(GetLangText("msgPBPasteForum")) - SetLog('=========================================================================') - EndIf -EndFunc ;==>_PushFile - -Func _DeletePush() - $oHTTP = ObjCreate("WinHTTP.WinHTTPRequest.5.1") - $access_token = $PushBullettoken - $oHTTP.Open("Delete", "https://api.pushbullet.com/v2/pushes", False) - $oHTTP.SetCredentials($access_token, "", 0) - $oHTTP.SetRequestHeader("Content-Type", "application/json") - $oHTTP.Send() -EndFunc ;==>_DeletePush - -Func _DeleteMessage($iden) - $oHTTP = ObjCreate("WinHTTP.WinHTTPRequest.5.1") - $access_token = $PushBullettoken - $oHTTP.Open("Delete", "https://api.pushbullet.com/v2/pushes/" & $iden, False) - $oHTTP.SetCredentials($access_token, "", 0) - $oHTTP.SetRequestHeader("Content-Type", "application/json") - $oHTTP.Send() -EndFunc ;==>_DeleteMessage +#include +#include + +Func _RemoteControl() + $oHTTP = ObjCreate("WinHTTP.WinHTTPRequest.5.1") + $access_token = $PushBullettoken + $oHTTP.Open("Get", "https://api.pushbullet.com/v2/pushes?active=true&limit=3", False) + $oHTTP.SetCredentials($access_token, "", 0) + $oHTTP.SetRequestHeader("Content-Type", "application/json") + $oHTTP.SetTimeouts(5000,5000,5000,5000) + $oHTTP.Send() + If @error Then Return + $Result = $oHTTP.ResponseText + + If StringInStr(StringLower($Result), '"body":"bot') Then + Local $title = _StringBetween($Result, '"body":"', '"', "", False) + Local $iden = _StringBetween($Result, '"iden":"', '"', "", False) + For $x = 0 To UBound($title) - 1 + If $title <> "" Or $iden <> "" Then + $title[$x] = StringUpper(StringStripWS($title[$x], $STR_STRIPLEADING + $STR_STRIPTRAILING + $STR_STRIPSPACES)) + $iden[$x] = StringStripWS($iden[$x], $STR_STRIPLEADING + $STR_STRIPTRAILING + $STR_STRIPSPACES) + If StringLeft($title[$x], 8) = "BOT HELP" Then + SetLog(GetLangText("msgPBHelpSent")) + _Push(GetLangText("pushHRa"), GetLangText("pushHRb")) + _DeleteMessage($iden[$x]) + ElseIf StringLeft($title[$x], 9) = "BOT PAUSE" And StringStripWS(StringRight($title[$x], StringLen($title[$x]) - 9), 3) = StringUpper(StringStripWS(GUICtrlRead($inppushuser), 3)) Then + If $PauseBot = False Then + SetLog(GetLangText("msgPBBotPauseFuture")) + _Push(GetLangText("pushPRa"), GetLangText("pushPRb")) + $PauseBot = True + Else + SetLog(GetLangText("msgPBNoAction")) + _Push(GetLangText("pushPRa"), GetLangText("pushPRc")) + EndIf + _DeleteMessage($iden[$x]) + ElseIf StringLeft($title[$x], 10) = "BOT RESUME" And StringStripWS(StringRight($title[$x], StringLen($title[$x]) - 10), 3) = StringUpper(StringStripWS(GUICtrlRead($inppushuser), 3)) Then + If $PauseBot = True Then + SetLog(GetLangText("msgPBResumed")) + _Push(GetLangText("pushRRa"), GetLangText("pushRRb")) + $PauseBot = False + If GUICtrlRead($btnPause) = "Resume" Then btnPause() + Else + SetLog(GetLangText("msgPBRunning")) + _Push(GetLangText("pushRRa"), GetLangText("pushRRc")) + EndIf + _DeleteMessage($iden[$x]) + ElseIf StringLeft($title[$x], 9) = "BOT STATS" And StringStripWS(StringRight($title[$x], StringLen($title[$x]) - 9), 3) = StringUpper(StringStripWS(GUICtrlRead($inppushuser), 3)) 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("pushStatRq1") & GUICtrlRead($lblresultsearchdisconnected) & GetLangText("pushStatRr") & GUICtrlRead($lblresultsearchcost) & GetLangText("pushStatRs") & StringFormat("%02i:%02i:%02i", $hour, $min, $sec)) + _DeleteMessage($iden[$x]) + ElseIf StringLeft($title[$x], 8) = "BOT LOGS" And StringStripWS(StringRight($title[$x], StringLen($title[$x]) - 8), 3) = StringUpper(StringStripWS(GUICtrlRead($inppushuser), 3)) Then + SetLog(GetLangText("msgPBLog")) + _PushFile($sLogFileName, "logs", "text/plain; charset=utf-8", "Current Logs", $sLogFileName) + _DeleteMessage($iden[$x]) + EndIf + $title[$x] = "" + $iden[$x] = "" + EndIf + Next + EndIf +EndFunc ;==>_RemoteControl + +Func _PushBullet($pTitle = "", $pMessage = "") + $oHTTP = ObjCreate("WinHTTP.WinHTTPRequest.5.1") + $access_token = $PushBullettoken + $oHTTP.Open("Get", "https://api.pushbullet.com/v2/devices", False) + $oHTTP.SetCredentials($access_token, "", 0) + $oHTTP.Send() + $Result = $oHTTP.ResponseText + Local $device_iden = _StringBetween($Result, 'iden":"', '"') + Local $device_name = _StringBetween($Result, 'nickname":"', '"') +EndFunc ;==>_PushBullet + +Func _Push($pTitle, $pMessage) + Local $Date = @MDAY & "." & @MON & "." & @YEAR + Local $Time = @HOUR & "." & @MIN & "." & @SEC + If StringStripWS(GUICtrlRead($inppushuser), 3) <> "" Then $pTitle = "[" & StringStripWS(GUICtrlRead($inppushuser), 3) & "] " & $pTitle + $oHTTP = ObjCreate("WinHTTP.WinHTTPRequest.5.1") + $access_token = $PushBullettoken + $oHTTP.Open("Post", "https://api.pushbullet.com/v2/pushes", False) + $oHTTP.SetCredentials($access_token, "", 0) + $oHTTP.SetRequestHeader("Content-Type", "application/json") + $pMessage = $Date & " at " & $Time & "\n" & $pMessage + Local $pPush = '{"type": "note", "title": "' & $pTitle & '", "body": "' & $pMessage & '"}' + $oHTTP.Send($pPush) +EndFunc ;==>_Push + +Func _PushFile($File, $Folder, $FileType, $title, $body) + If StringStripWS(GUICtrlRead($inppushuser), 3) <> "" Then $title = "[" & StringStripWS(GUICtrlRead($inppushuser), 3) & "] " & $title + $oHTTP = ObjCreate("WinHTTP.WinHTTPRequest.5.1") + $access_token = $PushBullettoken + $oHTTP.Open("Post", "https://api.pushbullet.com/v2/upload-request", False) + $oHTTP.SetCredentials($access_token, "", 0) + $oHTTP.SetRequestHeader("Content-Type", "application/json") + + Local $pPush = '{"file_name": "' & $File & '", "file_type": "' & $FileType & '"}' + $oHTTP.Send($pPush) + $Result = $oHTTP.ResponseText + $Result1 = $Result + Local $upload_url = _StringBetween($Result, 'upload_url":"', '"') + Local $awsaccesskeyid = _StringBetween($Result, 'awsaccesskeyid":"', '"') + Local $acl = _StringBetween($Result, 'acl":"', '"') + Local $key = _StringBetween($Result, 'key":"', '"') + Local $signature = _StringBetween($Result, 'signature":"', '"') + Local $policy = _StringBetween($Result, 'policy":"', '"') + Local $file_url = _StringBetween($Result, 'file_url":"', '"') + + If IsArray($upload_url) And IsArray($awsaccesskeyid) And IsArray($acl) And IsArray($key) And IsArray($signature) And IsArray($policy) Then + $Result = RunWait(@ScriptDir & "\curl\curl.exe -i -X POST " & $upload_url[0] & ' -F awsaccesskeyid="' & $awsaccesskeyid[0] & '" -F acl="' & $acl[0] & '" -F key="' & $key[0] & '" -F signature="' & $signature[0] & '" -F policy="' & $policy[0] & '" -F content-type="' & $FileType & '" -F file=@"' & @ScriptDir & '\' & $Folder & '\' & $File & '" -o "' & @ScriptDir & '\logs\curl.log"', "", @SW_HIDE) + If Not FileExists($dirLogs & "curl.log") Then _FileCreate($dirLogs & "curl.log") + If IsChecked($lblpushbulletdebug) Then + SetLog('=========================================================================') + SetLog($Result) + SetLog($upload_url[0]) + SetLog($acl[0]) + SetLog($key[0]) + SetLog($signature[0]) + SetLog($policy[0]) + SetLog($awsaccesskeyid[0]) + SetLog($file_url[0]) + SetLog($Result1) + SetLog(@ScriptDir & "\curl\curl.exe -i -X POST " & $upload_url[0] & ' -F awsaccesskeyid="' & $awsaccesskeyid[0] & '" -F acl="' & $acl[0] & '" -F key="' & $key[0] & '" -F signature="' & $signature[0] & '" -F policy="' & $policy[0] & '" -F content-type="' & $FileType & '" -F file=@"' & @ScriptDir & '\' & $Folder & '\' & $File & '" -o "' & @ScriptDir & '\logs\curl.log"') + EndIf + If Not FileExists($dirLogs & "curl.log") Then _FileCreate($dirLogs & "curl.log") + If _FileCountLines(@ScriptDir & '\logs\curl.log') > 8 Then + Local $hFileOpen = FileOpen(@ScriptDir & '\logs\curl.log') + Local $sFileRead = FileReadLine($hFileOpen, 8) + Local $sFileRead1 = StringSplit($sFileRead, " ") + Local $sLink = $sFileRead1[2] + Local $findstr1 = StringRegExp($sLink, 'https://') + If $findstr1 = 1 Then + $oHTTP.Open("Post", "https://api.pushbullet.com/v2/pushes", False) + $oHTTP.SetCredentials($access_token, "", 0) + $oHTTP.SetRequestHeader("Content-Type", "application/json") + ;Local $pPush = '{"type": "file", "file_name": "' & $FileName & '", "file_type": "' & $FileType & '", "file_url": "' & $file_url[0] & '", "title": "' & $title & '", "body": "' & $body & '"}' + Local $pPush = '{"type": "file", "file_name": "' & $File & '", "file_type": "' & $FileType & '", "file_url": "' & $sLink & '", "title": "' & $title & '", "body": "' & $body & '"}' + $oHTTP.Send($pPush) + $Result = $oHTTP.ResponseText + Else + If IsChecked($lblpushbulletdebug) Then + SetLog($hFileOpen) + SetLog(GetLangText("msgPBErrorUpload")) + EndIf + EndIf + Else + If IsChecked($lblpushbulletdebug) Then + SetLog(GetLangText("msgPBErrorUploading")) + EndIf + EndIf + Else + If IsChecked($lblpushbulletdebug) Then + SetLog('=========================================================================') + SetLog('Malformed HTTP response:') + SetLog($Result) + EndIf + EndIf + If IsChecked($lblpushbulletdebug) Then + SetLog($Result) + SetLog(GetLangText("msgPBPasteForum")) + SetLog('=========================================================================') + EndIf +EndFunc ;==>_PushFile + +Func _DeletePush() + $oHTTP = ObjCreate("WinHTTP.WinHTTPRequest.5.1") + $access_token = $PushBullettoken + $oHTTP.Open("Delete", "https://api.pushbullet.com/v2/pushes", False) + $oHTTP.SetCredentials($access_token, "", 0) + $oHTTP.SetRequestHeader("Content-Type", "application/json") + $oHTTP.Send() +EndFunc ;==>_DeletePush + +Func _DeleteMessage($iden) + $oHTTP = ObjCreate("WinHTTP.WinHTTPRequest.5.1") + $access_token = $PushBullettoken + $oHTTP.Open("Delete", "https://api.pushbullet.com/v2/pushes/" & $iden, False) + $oHTTP.SetCredentials($access_token, "", 0) + $oHTTP.SetRequestHeader("Content-Type", "application/json") + $oHTTP.Send() +EndFunc ;==>_DeleteMessage diff --git a/COCBot/functions/Other/BlockInputEx.au3 b/COCBot/functions/Other/BlockInputEx.au3 index a19a0ce..df353a7 100644 --- a/COCBot/functions/Other/BlockInputEx.au3 +++ b/COCBot/functions/Other/BlockInputEx.au3 @@ -1,442 +1,442 @@ -#Region Header - - #CS UDF Info - ;Extended (advanced) function to block mouse & keyboard inputs. - ; - ; This UDF supports few features that built-in BlockInput() function does not. - ; Here is a quick "features list": - ;---------------------------------------------------------------------- - ;* Block seperately mouse or keyboard input. - ;* Block specific keyboard/mouse keys/clicks. - ; [+] Not only hex keys are supported, string keys (such as {ENTER}) is also valid. - ;* Block all keyboard/mouse keys *except* specific keys/events. - ;* Block keys by CLASS Name (see UDF documentation). - ;* Block inputs only for specific window. - ;* BlockInput does not re-enables input after pressing Ctrl+Alt+Del. - ;---------------------------------------------------------------------- - ; - ; AutoIt Version: 3.2.12.1+ - ; Author: G.Sandler (a.k.a MrCreatoR). Initial idea and hooks example by rasim. - ; - ; Remarks: This UDF, same as built-in BlockInput function, can not block Ctrl+Alt+Del, however, it will not re-enable the input. - ; - ; - ;================== - ; History version: - ;================== - ; [v1.8 - 12.05.2013, 12:16] - ; * Fixed issue when some numeric keyboard keys was not blocked. - ; * Fixed issue when ALT+Tab was not blocked. - - ; [v1.7 - 04.05.2012, 18:45] - ; * Now by default the UDF affects only on user-input, the same as standard BlockInput function. Can be changed with additional parameter $iBlockAllInput, if set to 1, then all input will be blocked, not just the user's. - ; * Added optional parameter $iBlockAllInput to allow block only user-input (default 0, block only user-input). - ; * Minor fixes. - ; - ; [v1.6 - 04.04.2011, 22:30] - ; * Fixed (again, caused by fix with re-enabled input) an issue with held down "Alt + Ctrl" keys after the user was called "Alt + Ctrl + Del". - ; * Fixed an issue with wrong parameter passed to _WinAPI_CallNextHookEx. Thanks to Ascend4nt. - ; + Added remarks to the UDF header. - ; + Added "Example - Block TaskMan.au3". - ; - ; [v1.5 - 11.10.2010, 22:20] - ; * Fixed an issue with re-enabled input after pressing Ctrl+Alt+Del. - ; * Now the $hWindows parameter can be used for mouse blocking. - ; For that reason the $i_MouseHookGetAncestorHwnd variable was added to the UDF, - ; if user sets it to 0, then the $hWindows is compared to currently hovered window handle, otherwise (1 - default) it's compared to ancestor of the hovered window/control. - ; - ; [v1.4 - 03.08.2010, 12:00] - ; + AutoIt 3.3.6.1 support. - ; * Fixed an issue with held down "Alt + Ctrl" keys after the user was called "Alt + Ctrl + Del". It was causing a problems to use HotKeySet later. - ; * Fixed examples to be compatible with AutoIt 3.3.6.1. - ; * Minor "cosmetic" changes. - ; - ; [v1.3 - 24.09.2009, 23:00] - ; + Added _BlockInputEx Example (Pass Lock) - ; * Fixed few examples. - ; * Fixed spell mistakes in the UDF. - ; - ; [v1.2 - 16.01.2009, 21:00] - ; + Added key strings support. - ; Now users can set simple hotkey strings for Exclude/Include parameters + Group chars, i.e: "[Group]|{UP}|{DOWN}" - ; (See UDF documentation) - ; + Added mouse events blocking support to the $sExclude/$sInclude parameters. - ; + Added example for mouse events blocking. - ; - ; [v1.1 - 16.01.2009] - ; + Added CLASSes support (see UDF documentation), thanks to FireFox for the idea and the keys lists. - ; + Added example for CLASS usage. - ; * Changed behaviour of $iBlockMode parameter as following: - ; - ; 1 - Block All - ; <= 0 - UnBlock all - ; 2 - Block only mouse - ; 3 - Block only keyboard. - ; - ; * Fixed hard-crash that related to incorrect BlockInput releasing process (only callbacks was released, not the window hooks). - ; - ; [v1.0 - 15.01.2009] - ; First release. - #CE - - #include-once - #include - #include - #include - - If @AutoItVersion >= '3.3.2.0' Then - Execute('OnAutoItExitRegister("__BlockInputEx_OnAutoItExit")') - Else - Execute('Assign("i_OptOEF", Opt("OnExitFunc", "__BlockInputEx_OnAutoItExit"), 2)') - EndIf - -#EndRegion Header - -#Region Global Variables - - Global $ah_MouseKeyboard_WinHooks[8] - Global $s_KeyboardKeys_Buffer - Global $i_MouseHookGetAncestorHwnd = 1 - -#EndRegion Global Variables - -#Region Public Functions - - ; #FUNCTION# ==================================================================================================================== - ; Name...........: _BlockInputEx - ; Description ...: Disable/enable the mouse and/or keyboard. Supporting blocking (by include/exclude) of seperate keys. - ; Syntax.........: _BlockInputEx( [iBlockMode [, sExclude [, sInclude [, hWindows [, $iBlockAllInput]]]]] ) - ; - ; Parameters ....: $iBlockMode - [Optional] Set the block mode. - ; 1 - Block All - ; <= 0 - UnBlock all - ; 2 - Block only mouse - ; 3 - Block only keyboard. - ; - ; $sExclude - [Optional] Keys hex/string-list (| delimited) to *exclude* when blocking. - ; [*] All keys will be blocked, except the keys in $sExclude list. - ; [!] This list supports keys CLASSes, - ; key strings as supported in HotKeySet() function, - ; and seperate mouse events classes, see "Remarks" for more details. - ; - ; - ; - ; $sInclude - [Optional] Keys hex/string-list (| delimited) to *include* when blocking. - ; [*] Only these keys will be blocked, the $sExclude ignored in this case. - ; [!] This list supports keys CLASSes, - ; key strings as supported in HotKeySet() function, - ; and seperate mouse events classes, see "Remarks" for more details. - ; - ; $hWindows - [Optional] Window handles list (| delimited) to limit the blocking process. - ; - ; $iBlockAllInput - [Optional] If this parameter is 0 (default), - ; then only user input will be blocked (the same behaviour as standard BlockInput function), otherwise all input will be blocked (including *Send and Mouse* functions). - ; - ; Return values .: Success - 1. - ; Failure - 0 and set @error to 1. This can happend only when passing wrong parameters. - ; - ; Author ........: G.Sandler (a.k.a MrCreatoR), Rasim -> Initial idea and hooks example. - ; Thanks to FireFox for other block methods, it gave me a starting point for adding the "keys classes" support. - ; - ; - ; Modified.......: - ; Remarks .......: * This UDF includes OnAutoItExit function to release the callback/hooks resources. - ; - ; * $sExclude and $sInclude parameters supporting keys/mouse classes as hex or as string, - ; [!] The hex keys list can be found in _IsPressed documentation section. - ; Here is a full list of supported classess/events: - ; ======= KeyBoard ======= - ; [:FUNC:] - ; [:ALPHA:] - ; [:NUMBER:] - ; [:ARROWS:] - ; [:SPECIAL:] - ; [GROUP_abcd] -> Use raw chars/key strings inside squere brackets. - ; {KEY} -> Standard keys support ({F1}, {ENTER} etc.). - ; - ; ========= Mouse ========= - ; {MMOVE} -> Mouse move event - ; {MPDOWN} -> Mouse Primary Down event - ; {MPUP} -> Mouse Primary Up event - ; {MSDOWN} -> Mouse Secondary Down event - ; {MSUP} -> Mouse Secondary Up event - ; {MWDOWN} -> Mouse WHEEL Button Down event - ; {MWUP} -> Mouse WHEEL Button Up event - ; {MWSCROLL} -> Mouse WHEEL Scroll event - ; {MSPDOWN} -> Mouse Special Button Down event - ; {MSPUP} -> Mouse Special Button Up event - ; - ; - ; * See also built-in BlockInput() documentation. - ; - ; Related .......: BlockInput()? - ; Link ..........; http://www.autoitscript.com/forum/index.php?s=&showtopic=87735 - ; Example .......; Yes - ; =============================================================================================================================== - Func _BlockInputEx($iBlockMode = -1, $sExclude = "", $sInclude = "", $hWindows = "", $iBlockAllInput = 0) - If $iBlockMode < -1 Or $iBlockMode > 3 Then Return SetError(1, 0, 0) ;Only -1 to 3 modes are supported. - - If $iBlockMode <= 0 Then Return __BlockInputEx_UnhookWinHooks_Proc() - - Local $pStub_KeyProc = 0, $pStub_MouseProc = 0, $hHook_Keyboard = 0, $hHook_Mouse = 0 - Local $hHook_Module = _WinAPI_GetModuleHandle(0) - - For $i = 0 To 3 - If $ah_MouseKeyboard_WinHooks[$i] > 0 Then - __BlockInputEx_UnhookWinHooks_Proc() - ExitLoop - EndIf - Next - - If $iBlockMode = 1 Or $iBlockMode = 2 Then - $pStub_MouseProc = DllCallbackRegister("__BlockInputEx_MouseHook_Proc", "int", "int;ptr;ptr") - $hHook_Mouse = _WinAPI_SetWindowsHookEx($WH_MOUSE_LL, DllCallbackGetPtr($pStub_MouseProc), $hHook_Module, 0) - EndIf - - If $iBlockMode = 1 Or $iBlockMode = 3 Then - $pStub_KeyProc = DllCallbackRegister("__BlockInputEx_KeyBoardHook_Proc", "int", "int;ptr;ptr") - $hHook_Keyboard = _WinAPI_SetWindowsHookEx($WH_KEYBOARD_LL, DllCallbackGetPtr($pStub_KeyProc), $hHook_Module, 0) - EndIf - - $ah_MouseKeyboard_WinHooks[0] = $pStub_KeyProc - $ah_MouseKeyboard_WinHooks[1] = $pStub_MouseProc - $ah_MouseKeyboard_WinHooks[2] = $hHook_Keyboard - $ah_MouseKeyboard_WinHooks[3] = $hHook_Mouse - $ah_MouseKeyboard_WinHooks[4] = "|" & __BlockInputEx_Parse_vmCodesList_CLASSes(__BlockInputEx_Parse_vkCodesList_CLASSes($sInclude)) & "|" - $ah_MouseKeyboard_WinHooks[5] = "|" & __BlockInputEx_Parse_vmCodesList_CLASSes(__BlockInputEx_Parse_vkCodesList_CLASSes($sExclude)) & "|" - $ah_MouseKeyboard_WinHooks[6] = "|" & $hWindows & "|" - $ah_MouseKeyboard_WinHooks[7] = $iBlockAllInput - - Return 1 - EndFunc ;==>_BlockInputEx - -#EndRegion Public Functions - -#Region Internal Functions - - ;KeyBoard hook processing function - Func __BlockInputEx_KeyBoardHook_Proc($nCode, $wParam, $lParam) - If $nCode < 0 Then - Return _WinAPI_CallNextHookEx($ah_MouseKeyboard_WinHooks[2], $nCode, $wParam, $lParam) - EndIf - - Local $KBDLLHOOKSTRUCT = DllStructCreate("dword vkCode;dword scanCode;dword flags;dword time;ptr dwExtraInfo", $lParam) - Local $iFlags = DllStructGetData($KBDLLHOOKSTRUCT, "flags") - Local $iDec_vkCode = DllStructGetData($KBDLLHOOKSTRUCT, "vkCode") - Local $vkCode = "0x" & Hex($iDec_vkCode, 2) - - If Not StringInStr($s_KeyboardKeys_Buffer, $iDec_vkCode & '|') Then - $s_KeyboardKeys_Buffer &= $iDec_vkCode & '|' - EndIf - - Local $sInclude = $ah_MouseKeyboard_WinHooks[4] - Local $sExclude = $ah_MouseKeyboard_WinHooks[5] - Local $hWnds = $ah_MouseKeyboard_WinHooks[6] - Local $iBlockAllInput = $ah_MouseKeyboard_WinHooks[7] - - If $iBlockAllInput = 0 And BitAND($iFlags, 16) Then - Return _WinAPI_CallNextHookEx($ah_MouseKeyboard_WinHooks[2], $nCode, $wParam, $lParam) - EndIf - - If (StringInStr($s_KeyboardKeys_Buffer, '165|') And StringInStr($s_KeyboardKeys_Buffer, '163|') And StringInStr($s_KeyboardKeys_Buffer, '46|')) Or _ - (StringInStr($s_KeyboardKeys_Buffer, '164|') And StringInStr($s_KeyboardKeys_Buffer, '162|') And StringInStr($s_KeyboardKeys_Buffer, '46|')) Then - - _ModifiedSleep(10) - $s_KeyboardKeys_Buffer = "" - - Return _WinAPI_CallNextHookEx($ah_MouseKeyboard_WinHooks[2], $nCode, $wParam, $lParam) ;Continue processing - EndIf - - If $sInclude <> "||" Then ;Include proc - If StringInStr($sInclude, "|" & $vkCode & "|") And ($hWnds = "||" Or StringInStr($hWnds, "|" & WinGetHandle("[ACTIVE]") & "|")) Then - Return 1 ;Block processing! - EndIf - Else ;Exclude proc - If Not StringInStr($sExclude, "|" & $vkCode & "|") And ($hWnds = "||" Or StringInStr($hWnds, "|" & WinGetHandle("[ACTIVE]") & "|")) Then - Return 1 ;Block processing! - EndIf - EndIf - - Return _WinAPI_CallNextHookEx($ah_MouseKeyboard_WinHooks[2], $nCode, $wParam, $lParam) ;Continue processing - EndFunc ;==>__BlockInputEx_KeyBoardHook_Proc - - ;Mouse hook processing function - Func __BlockInputEx_MouseHook_Proc($nCode, $wParam, $lParam) - If $nCode < 0 Then Return _WinAPI_CallNextHookEx($ah_MouseKeyboard_WinHooks[3], $nCode, $wParam, $lParam) ;Continue processing - - Local $MOUSEHOOKSTRUCT = DllStructCreate("ptr pt;hwnd hwnd;uint wHitTestCode;ulong_ptr dwExtraInfo", $lParam) - Local $iExtraInfo = DllStructGetData($MOUSEHOOKSTRUCT, "dwExtraInfo") - Local $iMouse_Event = BitAND($wParam, 0xFFFF) - ;Add mouse exclude/include actions support... - - Local $sInclude = $ah_MouseKeyboard_WinHooks[4] - Local $sExclude = $ah_MouseKeyboard_WinHooks[5] - Local $hWnds = $ah_MouseKeyboard_WinHooks[6] - Local $iBlockAllInput = $ah_MouseKeyboard_WinHooks[7] - - If $iBlockAllInput = 0 And $iExtraInfo <> 0 Then - Return _WinAPI_CallNextHookEx($ah_MouseKeyboard_WinHooks[3], $nCode, $wParam, $lParam) ;Continue processing - EndIf - - If $sInclude <> "||" Then ;Include proc - If StringInStr($sInclude, "|" & $iMouse_Event & "|") And ($hWnds = "||" Or StringInStr($hWnds, "|" & __BlockInputEx_WinGetHovered() & "|")) Then - Return 1 ;Block processing! - EndIf - Else ;Exclude proc - If Not StringInStr($sExclude, "|" & $iMouse_Event & "|") And ($hWnds = "||" Or StringInStr($hWnds, "|" & __BlockInputEx_WinGetHovered() & "|")) Then - Return 1 ;Block processing! - EndIf - EndIf - - Return _WinAPI_CallNextHookEx($ah_MouseKeyboard_WinHooks[3], $nCode, $wParam, $lParam) ;Continue processing - EndFunc ;==>__BlockInputEx_MouseHook_Proc - - ;Releases callbacks and Unhook Windows hooks - Func __BlockInputEx_UnhookWinHooks_Proc() - ;Release KeyBoard callback function - If $ah_MouseKeyboard_WinHooks[0] > 0 Then - DllCallbackFree($ah_MouseKeyboard_WinHooks[0]) - $ah_MouseKeyboard_WinHooks[0] = 0 - EndIf - - ;Release Mouse callback function - If $ah_MouseKeyboard_WinHooks[1] > 0 Then - DllCallbackFree($ah_MouseKeyboard_WinHooks[1]) - $ah_MouseKeyboard_WinHooks[1] = 0 - EndIf - - ;Release KeyBoard Window hook - If IsPtr($ah_MouseKeyboard_WinHooks[2]) Then - _WinAPI_UnhookWindowsHookEx($ah_MouseKeyboard_WinHooks[2]) - $ah_MouseKeyboard_WinHooks[2] = 0 - EndIf - - ;Release Mouse Window hook - If IsPtr($ah_MouseKeyboard_WinHooks[3]) Then - _WinAPI_UnhookWindowsHookEx($ah_MouseKeyboard_WinHooks[3]) - $ah_MouseKeyboard_WinHooks[3] = 0 - EndIf - - Return 1 - EndFunc ;==>__BlockInputEx_UnhookWinHooks_Proc - - Func __BlockInputEx_Parse_vkCodesList_CLASSes($sList) - $sList = StringRegExpReplace($sList, "(?i)\{(Ctrl|Shift|Alt)\}", "{L$1}|{R$1}") ;Fix for Ctrl/Shift/Alt keys (add L/R to them) - - Local $a_vkCode_List = StringSplit($sList, "|") - Local $sRet_Keys = "" - - For $i = 1 To $a_vkCode_List[0] - Switch $a_vkCode_List[$i] - Case "[:FUNC:]" - $a_vkCode_List[$i] = "0x70|0x71|0x72|0x73|0x74|0x75|0x76|0x77|0x78|0x79|0x7A|0x7B|0x7C|0x7D|0x7E|0x7F|0x80H|0x81H|0x82H|0x83H|0x84H|0x85H|0x86H|0x87H" - Case "[:ALPHA:]" - $a_vkCode_List[$i] = "0x41|0x42|0x43|0x44|0x45|0x46|0x47|0x48|0x49|0x4A|0x4B|0x4C|0x4D|0x4E|0x4F|0x50|0x51|0x52|0x53|0x54|0x55|0x56|0x57|0x58|0x59|0x5A" - Case "[:NUMBER:]" - $a_vkCode_List[$i] = "0x30|0x31|0x32|0x33|0x34|0x35|0x36|0x37|0x38|0x39|0x60|0x61|0x62|0x63|0x64|0x65|0x66|0x67|0x68|0x69" - Case "[:ARROWS:]" - $a_vkCode_List[$i] = "0x25|0x26|0x27|0x28" - Case "[:SPECIAL:]" - $a_vkCode_List[$i] = "0x08|0x09|0x0C|0x0D|0x10|0x11|0x12|0x13|0x14|0x1B|0x20|0x21|0x22|" & _ - "0x23|0x24|0x29|0x2A|0x2B|0x2C|0x2D|0x2E|0x5B|0x5C|0x6A|0x6B|0x6C|" & _ - "0x6D|0x6E|0x6F|0x90|0x91|0xA0|0xA1|0xA2|0xA3|0xA4|0xA5|0xBA|0xBB|" & _ - "0xBC|0xBD|0xBE|0xBF|0xC0|0xDB|0xDC|0xDD" - Case Else - $a_vkCode_List[$i] = __BlockInputEx_KeyStr_To_vkCode($a_vkCode_List[$i]) - EndSwitch - - $sRet_Keys &= $a_vkCode_List[$i] & "|" - Next - - Return StringRegExpReplace($sRet_Keys, "\|+$", "") - EndFunc ;==>__BlockInputEx_Parse_vkCodesList_CLASSes - - Func __BlockInputEx_Parse_vmCodesList_CLASSes($sList) - Local Const $MOUSE_MOVE_EVENT = 512 - Local Const $MOUSE_PRIMARYDOWN_EVENT = 513 - Local Const $MOUSE_PRIMARYUP_EVENT = 514 - Local Const $MOUSE_SECONDARYDOWN_EVENT = 516 - Local Const $MOUSE_SECONDARYUP_EVENT = 517 - Local Const $MOUSE_WHEELDOWN_EVENT = 519 - Local Const $MOUSE_WHEELUP_EVENT = 520 - Local Const $MOUSE_WHEELSCROLL_EVENT = 522 - Local Const $MOUSE_SPECIALBUTTONDOWN_EVENT = 523 - Local Const $MOUSE_SPECIALBUTTONUP_EVENT = 524 - - Local $a_vmCode_List = StringSplit($sList, "|") - Local $sRet_Keys = "" - - For $i = 1 To $a_vmCode_List[0] - Switch $a_vmCode_List[$i] - Case "{MMOVE}" - $a_vmCode_List[$i] = $MOUSE_MOVE_EVENT - Case "{MPDOWN}" - $a_vmCode_List[$i] = $MOUSE_PRIMARYDOWN_EVENT - Case "{MPUP}" - $a_vmCode_List[$i] = $MOUSE_PRIMARYUP_EVENT - Case "{MSDOWN}" - $a_vmCode_List[$i] = $MOUSE_SECONDARYDOWN_EVENT - Case "{MSUP}" - $a_vmCode_List[$i] = $MOUSE_SECONDARYUP_EVENT - Case "{MWDOWN}" - $a_vmCode_List[$i] = $MOUSE_WHEELDOWN_EVENT - Case "{MWUP}" - $a_vmCode_List[$i] = $MOUSE_WHEELUP_EVENT - Case "{MWSCROLL}" - $a_vmCode_List[$i] = $MOUSE_WHEELSCROLL_EVENT - Case "{MSPDOWN}" - $a_vmCode_List[$i] = $MOUSE_SPECIALBUTTONDOWN_EVENT - Case "{MSPUP}" - $a_vmCode_List[$i] = $MOUSE_SPECIALBUTTONUP_EVENT - EndSwitch - - $sRet_Keys &= $a_vmCode_List[$i] & "|" - Next - - Return StringRegExpReplace($sRet_Keys, "\|+$", "") - EndFunc ;==>__BlockInputEx_Parse_vmCodesList_CLASSes - - Func __BlockInputEx_KeyStr_To_vkCode($sKeyStr) - Local $sRet_Keys = "", $aDelim_Keys[1] - Local $aKeys = StringSplit("{LMouse}|{RMouse}|{}|(MMouse}|{}|{}|{}|{BACKSPACE}|{TAB}|{}|{}|{}|{ENTER}|{}|{}|{SHIFT}|{CTRL}|{ALT}|{PAUSE}|{CAPSLOCK}|{}|{}|{}|{}|{}|{}|{ESC}|{}|{}|{}|{]|{SPACE}|{PGUP}|{PGDN}|{END}|{HOME}|{LEFT}|{UP}|{RIGHT}|{DOWN}|{SELECT}|{PRINTSCREEN}|{}|{PRINTSCREEN}|{INSERT}|{DEL}|{}|0|1|2|3|4|5|6|7|8|9|{}|{}|{}|{}|{}|{}|{}|a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z|{LWIN}|{RWIN}|{APPSKEY}|{}|{SLEEP}|{numpad0}|{numpad1}|{numpad2}|{numpad3}|{numpad4}|{numpad5}|{numpad6}|{numpad7}|{numpad8}|{numpad9}|{NUMPADMULT}|{NUMPADADD}|{}|{NUMPADSUB}|{NUMPADDOT}|{NUMPADDIV}|{F1}|{F2}|{F3}|{F4}|{F5}|{F6}|{F7}|{F8}|{F9}|{F10}|{F11}|{F12}|{F13}|{F14}|{F15}|{F16}|{F17}|{F18}|{F19}|{F20}|{F21}|{F22}|{F23}|{F24}|{}|{}|{}|{}|{}|{}|{}|{}|{NUMLOCK}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{LSHIFT}|{RSHIFT}|{LCTRL}|{RCTRL}|{LALT}|{RALT}|{BROWSER_BACK}|{BROWSER_FORWARD}|{BROWSER_REFRESH}|{BROWSER_STOP}|{BROWSER_SEARCH}|{BROWSER_FAVORITES}|{BROWSER_HOME}|{VOLUME_MUTE}|{VOLUME_DOWN}|{VOLUME_UP}|{MEDIA_NEXT}|{MEDIA_PREV}|{MEDIA_STOP}|{MEDIA_PLAY_PAUSE}|{LAUNCH_MAIL}|{LAUNCH_MEDIA}|{LAUNCH_APP1}|{LAUNCH_APP2}|{}|{}|;|{+}|,|{-}|.|/|`|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|[|\|]|'", "|") - - If StringRegExp($sKeyStr, "\A\[|\]\z") Then - $sKeyStr = StringRegExpReplace($sKeyStr, "\A\[|\]\z", "") - $sKeyStr = StringRegExpReplace($sKeyStr, "(.)", "\1|") - $sKeyStr = StringRegExpReplace($sKeyStr, "\|+$", "") - - $aDelim_Keys = StringSplit($sKeyStr, "") - EndIf - - For $i = 1 To $aKeys[0] - If $aDelim_Keys[0] > 1 Then - For $j = 1 To $aDelim_Keys[0] - If $aKeys[$i] = $aDelim_Keys[$j] Then $sRet_Keys &= "0x" & Hex($i, 2) & "|" - Next - Else - If $aKeys[$i] = $sKeyStr Then Return "0x" & Hex($i, 2) - EndIf - Next - - If $sRet_Keys = "" Then Return $sKeyStr - Return StringRegExpReplace($sRet_Keys, "\|+$", "") - EndFunc ;==>__BlockInputEx_KeyStr_To_vkCode - - Func __BlockInputEx_WinGetHovered() - Local $iOld_Opt_MCM = Opt("MouseCoordMode", 1) - Local $aRet = DllCall("user32.dll", "int", "WindowFromPoint", "long", MouseGetPos(0), "long", MouseGetPos(1)) - Opt("MouseCoordMode", $iOld_Opt_MCM) - - If $i_MouseHookGetAncestorHwnd Then - $aRet = DllCall("User32.dll", "hwnd", "GetAncestor", "hwnd", $aRet[0], "uint", 2) ;$GA_ROOT - EndIf - - Return HWnd($aRet[0]) - EndFunc ;==>__BlockInputEx_WinGetHovered - - ;Called when script exits to release resources. - Func __BlockInputEx_OnAutoItExit() - _BlockInputEx(0) - EndFunc ;==>__BlockInputEx_OnAutoItExit - -#EndRegion Internal Functions +#Region Header + + #CS UDF Info + ;Extended (advanced) function to block mouse & keyboard inputs. + ; + ; This UDF supports few features that built-in BlockInput() function does not. + ; Here is a quick "features list": + ;---------------------------------------------------------------------- + ;* Block seperately mouse or keyboard input. + ;* Block specific keyboard/mouse keys/clicks. + ; [+] Not only hex keys are supported, string keys (such as {ENTER}) is also valid. + ;* Block all keyboard/mouse keys *except* specific keys/events. + ;* Block keys by CLASS Name (see UDF documentation). + ;* Block inputs only for specific window. + ;* BlockInput does not re-enables input after pressing Ctrl+Alt+Del. + ;---------------------------------------------------------------------- + ; + ; AutoIt Version: 3.2.12.1+ + ; Author: G.Sandler (a.k.a MrCreatoR). Initial idea and hooks example by rasim. + ; + ; Remarks: This UDF, same as built-in BlockInput function, can not block Ctrl+Alt+Del, however, it will not re-enable the input. + ; + ; + ;================== + ; History version: + ;================== + ; [v1.8 - 12.05.2013, 12:16] + ; * Fixed issue when some numeric keyboard keys was not blocked. + ; * Fixed issue when ALT+Tab was not blocked. + + ; [v1.7 - 04.05.2012, 18:45] + ; * Now by default the UDF affects only on user-input, the same as standard BlockInput function. Can be changed with additional parameter $iBlockAllInput, if set to 1, then all input will be blocked, not just the user's. + ; * Added optional parameter $iBlockAllInput to allow block only user-input (default 0, block only user-input). + ; * Minor fixes. + ; + ; [v1.6 - 04.04.2011, 22:30] + ; * Fixed (again, caused by fix with re-enabled input) an issue with held down "Alt + Ctrl" keys after the user was called "Alt + Ctrl + Del". + ; * Fixed an issue with wrong parameter passed to _WinAPI_CallNextHookEx. Thanks to Ascend4nt. + ; + Added remarks to the UDF header. + ; + Added "Example - Block TaskMan.au3". + ; + ; [v1.5 - 11.10.2010, 22:20] + ; * Fixed an issue with re-enabled input after pressing Ctrl+Alt+Del. + ; * Now the $hWindows parameter can be used for mouse blocking. + ; For that reason the $i_MouseHookGetAncestorHwnd variable was added to the UDF, + ; if user sets it to 0, then the $hWindows is compared to currently hovered window handle, otherwise (1 - default) it's compared to ancestor of the hovered window/control. + ; + ; [v1.4 - 03.08.2010, 12:00] + ; + AutoIt 3.3.6.1 support. + ; * Fixed an issue with held down "Alt + Ctrl" keys after the user was called "Alt + Ctrl + Del". It was causing a problems to use HotKeySet later. + ; * Fixed examples to be compatible with AutoIt 3.3.6.1. + ; * Minor "cosmetic" changes. + ; + ; [v1.3 - 24.09.2009, 23:00] + ; + Added _BlockInputEx Example (Pass Lock) + ; * Fixed few examples. + ; * Fixed spell mistakes in the UDF. + ; + ; [v1.2 - 16.01.2009, 21:00] + ; + Added key strings support. + ; Now users can set simple hotkey strings for Exclude/Include parameters + Group chars, i.e: "[Group]|{UP}|{DOWN}" + ; (See UDF documentation) + ; + Added mouse events blocking support to the $sExclude/$sInclude parameters. + ; + Added example for mouse events blocking. + ; + ; [v1.1 - 16.01.2009] + ; + Added CLASSes support (see UDF documentation), thanks to FireFox for the idea and the keys lists. + ; + Added example for CLASS usage. + ; * Changed behaviour of $iBlockMode parameter as following: + ; + ; 1 - Block All + ; <= 0 - UnBlock all + ; 2 - Block only mouse + ; 3 - Block only keyboard. + ; + ; * Fixed hard-crash that related to incorrect BlockInput releasing process (only callbacks was released, not the window hooks). + ; + ; [v1.0 - 15.01.2009] + ; First release. + #CE + + #include-once + #include + #include + #include + + If @AutoItVersion >= '3.3.2.0' Then + Execute('OnAutoItExitRegister("__BlockInputEx_OnAutoItExit")') + Else + Execute('Assign("i_OptOEF", Opt("OnExitFunc", "__BlockInputEx_OnAutoItExit"), 2)') + EndIf + +#EndRegion Header + +#Region Global Variables + + Global $ah_MouseKeyboard_WinHooks[8] + Global $s_KeyboardKeys_Buffer + Global $i_MouseHookGetAncestorHwnd = 1 + +#EndRegion Global Variables + +#Region Public Functions + + ; #FUNCTION# ==================================================================================================================== + ; Name...........: _BlockInputEx + ; Description ...: Disable/enable the mouse and/or keyboard. Supporting blocking (by include/exclude) of seperate keys. + ; Syntax.........: _BlockInputEx( [iBlockMode [, sExclude [, sInclude [, hWindows [, $iBlockAllInput]]]]] ) + ; + ; Parameters ....: $iBlockMode - [Optional] Set the block mode. + ; 1 - Block All + ; <= 0 - UnBlock all + ; 2 - Block only mouse + ; 3 - Block only keyboard. + ; + ; $sExclude - [Optional] Keys hex/string-list (| delimited) to *exclude* when blocking. + ; [*] All keys will be blocked, except the keys in $sExclude list. + ; [!] This list supports keys CLASSes, + ; key strings as supported in HotKeySet() function, + ; and seperate mouse events classes, see "Remarks" for more details. + ; + ; + ; + ; $sInclude - [Optional] Keys hex/string-list (| delimited) to *include* when blocking. + ; [*] Only these keys will be blocked, the $sExclude ignored in this case. + ; [!] This list supports keys CLASSes, + ; key strings as supported in HotKeySet() function, + ; and seperate mouse events classes, see "Remarks" for more details. + ; + ; $hWindows - [Optional] Window handles list (| delimited) to limit the blocking process. + ; + ; $iBlockAllInput - [Optional] If this parameter is 0 (default), + ; then only user input will be blocked (the same behaviour as standard BlockInput function), otherwise all input will be blocked (including *Send and Mouse* functions). + ; + ; Return values .: Success - 1. + ; Failure - 0 and set @error to 1. This can happend only when passing wrong parameters. + ; + ; Author ........: G.Sandler (a.k.a MrCreatoR), Rasim -> Initial idea and hooks example. + ; Thanks to FireFox for other block methods, it gave me a starting point for adding the "keys classes" support. + ; + ; + ; Modified.......: + ; Remarks .......: * This UDF includes OnAutoItExit function to release the callback/hooks resources. + ; + ; * $sExclude and $sInclude parameters supporting keys/mouse classes as hex or as string, + ; [!] The hex keys list can be found in _IsPressed documentation section. + ; Here is a full list of supported classess/events: + ; ======= KeyBoard ======= + ; [:FUNC:] + ; [:ALPHA:] + ; [:NUMBER:] + ; [:ARROWS:] + ; [:SPECIAL:] + ; [GROUP_abcd] -> Use raw chars/key strings inside squere brackets. + ; {KEY} -> Standard keys support ({F1}, {ENTER} etc.). + ; + ; ========= Mouse ========= + ; {MMOVE} -> Mouse move event + ; {MPDOWN} -> Mouse Primary Down event + ; {MPUP} -> Mouse Primary Up event + ; {MSDOWN} -> Mouse Secondary Down event + ; {MSUP} -> Mouse Secondary Up event + ; {MWDOWN} -> Mouse WHEEL Button Down event + ; {MWUP} -> Mouse WHEEL Button Up event + ; {MWSCROLL} -> Mouse WHEEL Scroll event + ; {MSPDOWN} -> Mouse Special Button Down event + ; {MSPUP} -> Mouse Special Button Up event + ; + ; + ; * See also built-in BlockInput() documentation. + ; + ; Related .......: BlockInput()? + ; Link ..........; http://www.autoitscript.com/forum/index.php?s=&showtopic=87735 + ; Example .......; Yes + ; =============================================================================================================================== + Func _BlockInputEx($iBlockMode = -1, $sExclude = "", $sInclude = "", $hWindows = "", $iBlockAllInput = 0) + If $iBlockMode < -1 Or $iBlockMode > 3 Then Return SetError(1, 0, 0) ;Only -1 to 3 modes are supported. + + If $iBlockMode <= 0 Then Return __BlockInputEx_UnhookWinHooks_Proc() + + Local $pStub_KeyProc = 0, $pStub_MouseProc = 0, $hHook_Keyboard = 0, $hHook_Mouse = 0 + Local $hHook_Module = _WinAPI_GetModuleHandle(0) + + For $i = 0 To 3 + If $ah_MouseKeyboard_WinHooks[$i] > 0 Then + __BlockInputEx_UnhookWinHooks_Proc() + ExitLoop + EndIf + Next + + If $iBlockMode = 1 Or $iBlockMode = 2 Then + $pStub_MouseProc = DllCallbackRegister("__BlockInputEx_MouseHook_Proc", "int", "int;ptr;ptr") + $hHook_Mouse = _WinAPI_SetWindowsHookEx($WH_MOUSE_LL, DllCallbackGetPtr($pStub_MouseProc), $hHook_Module, 0) + EndIf + + If $iBlockMode = 1 Or $iBlockMode = 3 Then + $pStub_KeyProc = DllCallbackRegister("__BlockInputEx_KeyBoardHook_Proc", "int", "int;ptr;ptr") + $hHook_Keyboard = _WinAPI_SetWindowsHookEx($WH_KEYBOARD_LL, DllCallbackGetPtr($pStub_KeyProc), $hHook_Module, 0) + EndIf + + $ah_MouseKeyboard_WinHooks[0] = $pStub_KeyProc + $ah_MouseKeyboard_WinHooks[1] = $pStub_MouseProc + $ah_MouseKeyboard_WinHooks[2] = $hHook_Keyboard + $ah_MouseKeyboard_WinHooks[3] = $hHook_Mouse + $ah_MouseKeyboard_WinHooks[4] = "|" & __BlockInputEx_Parse_vmCodesList_CLASSes(__BlockInputEx_Parse_vkCodesList_CLASSes($sInclude)) & "|" + $ah_MouseKeyboard_WinHooks[5] = "|" & __BlockInputEx_Parse_vmCodesList_CLASSes(__BlockInputEx_Parse_vkCodesList_CLASSes($sExclude)) & "|" + $ah_MouseKeyboard_WinHooks[6] = "|" & $hWindows & "|" + $ah_MouseKeyboard_WinHooks[7] = $iBlockAllInput + + Return 1 + EndFunc ;==>_BlockInputEx + +#EndRegion Public Functions + +#Region Internal Functions + + ;KeyBoard hook processing function + Func __BlockInputEx_KeyBoardHook_Proc($nCode, $wParam, $lParam) + If $nCode < 0 Then + Return _WinAPI_CallNextHookEx($ah_MouseKeyboard_WinHooks[2], $nCode, $wParam, $lParam) + EndIf + + Local $KBDLLHOOKSTRUCT = DllStructCreate("dword vkCode;dword scanCode;dword flags;dword time;ptr dwExtraInfo", $lParam) + Local $iFlags = DllStructGetData($KBDLLHOOKSTRUCT, "flags") + Local $iDec_vkCode = DllStructGetData($KBDLLHOOKSTRUCT, "vkCode") + Local $vkCode = "0x" & Hex($iDec_vkCode, 2) + + If Not StringInStr($s_KeyboardKeys_Buffer, $iDec_vkCode & '|') Then + $s_KeyboardKeys_Buffer &= $iDec_vkCode & '|' + EndIf + + Local $sInclude = $ah_MouseKeyboard_WinHooks[4] + Local $sExclude = $ah_MouseKeyboard_WinHooks[5] + Local $hWnds = $ah_MouseKeyboard_WinHooks[6] + Local $iBlockAllInput = $ah_MouseKeyboard_WinHooks[7] + + If $iBlockAllInput = 0 And BitAND($iFlags, 16) Then + Return _WinAPI_CallNextHookEx($ah_MouseKeyboard_WinHooks[2], $nCode, $wParam, $lParam) + EndIf + + If (StringInStr($s_KeyboardKeys_Buffer, '165|') And StringInStr($s_KeyboardKeys_Buffer, '163|') And StringInStr($s_KeyboardKeys_Buffer, '46|')) Or _ + (StringInStr($s_KeyboardKeys_Buffer, '164|') And StringInStr($s_KeyboardKeys_Buffer, '162|') And StringInStr($s_KeyboardKeys_Buffer, '46|')) Then + + _ModifiedSleep(10) + $s_KeyboardKeys_Buffer = "" + + Return _WinAPI_CallNextHookEx($ah_MouseKeyboard_WinHooks[2], $nCode, $wParam, $lParam) ;Continue processing + EndIf + + If $sInclude <> "||" Then ;Include proc + If StringInStr($sInclude, "|" & $vkCode & "|") And ($hWnds = "||" Or StringInStr($hWnds, "|" & WinGetHandle("[ACTIVE]") & "|")) Then + Return 1 ;Block processing! + EndIf + Else ;Exclude proc + If Not StringInStr($sExclude, "|" & $vkCode & "|") And ($hWnds = "||" Or StringInStr($hWnds, "|" & WinGetHandle("[ACTIVE]") & "|")) Then + Return 1 ;Block processing! + EndIf + EndIf + + Return _WinAPI_CallNextHookEx($ah_MouseKeyboard_WinHooks[2], $nCode, $wParam, $lParam) ;Continue processing + EndFunc ;==>__BlockInputEx_KeyBoardHook_Proc + + ;Mouse hook processing function + Func __BlockInputEx_MouseHook_Proc($nCode, $wParam, $lParam) + If $nCode < 0 Then Return _WinAPI_CallNextHookEx($ah_MouseKeyboard_WinHooks[3], $nCode, $wParam, $lParam) ;Continue processing + + Local $MOUSEHOOKSTRUCT = DllStructCreate("ptr pt;hwnd hwnd;uint wHitTestCode;ulong_ptr dwExtraInfo", $lParam) + Local $iExtraInfo = DllStructGetData($MOUSEHOOKSTRUCT, "dwExtraInfo") + Local $iMouse_Event = BitAND($wParam, 0xFFFF) + ;Add mouse exclude/include actions support... + + Local $sInclude = $ah_MouseKeyboard_WinHooks[4] + Local $sExclude = $ah_MouseKeyboard_WinHooks[5] + Local $hWnds = $ah_MouseKeyboard_WinHooks[6] + Local $iBlockAllInput = $ah_MouseKeyboard_WinHooks[7] + + If $iBlockAllInput = 0 And $iExtraInfo <> 0 Then + Return _WinAPI_CallNextHookEx($ah_MouseKeyboard_WinHooks[3], $nCode, $wParam, $lParam) ;Continue processing + EndIf + + If $sInclude <> "||" Then ;Include proc + If StringInStr($sInclude, "|" & $iMouse_Event & "|") And ($hWnds = "||" Or StringInStr($hWnds, "|" & __BlockInputEx_WinGetHovered() & "|")) Then + Return 1 ;Block processing! + EndIf + Else ;Exclude proc + If Not StringInStr($sExclude, "|" & $iMouse_Event & "|") And ($hWnds = "||" Or StringInStr($hWnds, "|" & __BlockInputEx_WinGetHovered() & "|")) Then + Return 1 ;Block processing! + EndIf + EndIf + + Return _WinAPI_CallNextHookEx($ah_MouseKeyboard_WinHooks[3], $nCode, $wParam, $lParam) ;Continue processing + EndFunc ;==>__BlockInputEx_MouseHook_Proc + + ;Releases callbacks and Unhook Windows hooks + Func __BlockInputEx_UnhookWinHooks_Proc() + ;Release KeyBoard callback function + If $ah_MouseKeyboard_WinHooks[0] > 0 Then + DllCallbackFree($ah_MouseKeyboard_WinHooks[0]) + $ah_MouseKeyboard_WinHooks[0] = 0 + EndIf + + ;Release Mouse callback function + If $ah_MouseKeyboard_WinHooks[1] > 0 Then + DllCallbackFree($ah_MouseKeyboard_WinHooks[1]) + $ah_MouseKeyboard_WinHooks[1] = 0 + EndIf + + ;Release KeyBoard Window hook + If IsPtr($ah_MouseKeyboard_WinHooks[2]) Then + _WinAPI_UnhookWindowsHookEx($ah_MouseKeyboard_WinHooks[2]) + $ah_MouseKeyboard_WinHooks[2] = 0 + EndIf + + ;Release Mouse Window hook + If IsPtr($ah_MouseKeyboard_WinHooks[3]) Then + _WinAPI_UnhookWindowsHookEx($ah_MouseKeyboard_WinHooks[3]) + $ah_MouseKeyboard_WinHooks[3] = 0 + EndIf + + Return 1 + EndFunc ;==>__BlockInputEx_UnhookWinHooks_Proc + + Func __BlockInputEx_Parse_vkCodesList_CLASSes($sList) + $sList = StringRegExpReplace($sList, "(?i)\{(Ctrl|Shift|Alt)\}", "{L$1}|{R$1}") ;Fix for Ctrl/Shift/Alt keys (add L/R to them) + + Local $a_vkCode_List = StringSplit($sList, "|") + Local $sRet_Keys = "" + + For $i = 1 To $a_vkCode_List[0] + Switch $a_vkCode_List[$i] + Case "[:FUNC:]" + $a_vkCode_List[$i] = "0x70|0x71|0x72|0x73|0x74|0x75|0x76|0x77|0x78|0x79|0x7A|0x7B|0x7C|0x7D|0x7E|0x7F|0x80H|0x81H|0x82H|0x83H|0x84H|0x85H|0x86H|0x87H" + Case "[:ALPHA:]" + $a_vkCode_List[$i] = "0x41|0x42|0x43|0x44|0x45|0x46|0x47|0x48|0x49|0x4A|0x4B|0x4C|0x4D|0x4E|0x4F|0x50|0x51|0x52|0x53|0x54|0x55|0x56|0x57|0x58|0x59|0x5A" + Case "[:NUMBER:]" + $a_vkCode_List[$i] = "0x30|0x31|0x32|0x33|0x34|0x35|0x36|0x37|0x38|0x39|0x60|0x61|0x62|0x63|0x64|0x65|0x66|0x67|0x68|0x69" + Case "[:ARROWS:]" + $a_vkCode_List[$i] = "0x25|0x26|0x27|0x28" + Case "[:SPECIAL:]" + $a_vkCode_List[$i] = "0x08|0x09|0x0C|0x0D|0x10|0x11|0x12|0x13|0x14|0x1B|0x20|0x21|0x22|" & _ + "0x23|0x24|0x29|0x2A|0x2B|0x2C|0x2D|0x2E|0x5B|0x5C|0x6A|0x6B|0x6C|" & _ + "0x6D|0x6E|0x6F|0x90|0x91|0xA0|0xA1|0xA2|0xA3|0xA4|0xA5|0xBA|0xBB|" & _ + "0xBC|0xBD|0xBE|0xBF|0xC0|0xDB|0xDC|0xDD" + Case Else + $a_vkCode_List[$i] = __BlockInputEx_KeyStr_To_vkCode($a_vkCode_List[$i]) + EndSwitch + + $sRet_Keys &= $a_vkCode_List[$i] & "|" + Next + + Return StringRegExpReplace($sRet_Keys, "\|+$", "") + EndFunc ;==>__BlockInputEx_Parse_vkCodesList_CLASSes + + Func __BlockInputEx_Parse_vmCodesList_CLASSes($sList) + Local Const $MOUSE_MOVE_EVENT = 512 + Local Const $MOUSE_PRIMARYDOWN_EVENT = 513 + Local Const $MOUSE_PRIMARYUP_EVENT = 514 + Local Const $MOUSE_SECONDARYDOWN_EVENT = 516 + Local Const $MOUSE_SECONDARYUP_EVENT = 517 + Local Const $MOUSE_WHEELDOWN_EVENT = 519 + Local Const $MOUSE_WHEELUP_EVENT = 520 + Local Const $MOUSE_WHEELSCROLL_EVENT = 522 + Local Const $MOUSE_SPECIALBUTTONDOWN_EVENT = 523 + Local Const $MOUSE_SPECIALBUTTONUP_EVENT = 524 + + Local $a_vmCode_List = StringSplit($sList, "|") + Local $sRet_Keys = "" + + For $i = 1 To $a_vmCode_List[0] + Switch $a_vmCode_List[$i] + Case "{MMOVE}" + $a_vmCode_List[$i] = $MOUSE_MOVE_EVENT + Case "{MPDOWN}" + $a_vmCode_List[$i] = $MOUSE_PRIMARYDOWN_EVENT + Case "{MPUP}" + $a_vmCode_List[$i] = $MOUSE_PRIMARYUP_EVENT + Case "{MSDOWN}" + $a_vmCode_List[$i] = $MOUSE_SECONDARYDOWN_EVENT + Case "{MSUP}" + $a_vmCode_List[$i] = $MOUSE_SECONDARYUP_EVENT + Case "{MWDOWN}" + $a_vmCode_List[$i] = $MOUSE_WHEELDOWN_EVENT + Case "{MWUP}" + $a_vmCode_List[$i] = $MOUSE_WHEELUP_EVENT + Case "{MWSCROLL}" + $a_vmCode_List[$i] = $MOUSE_WHEELSCROLL_EVENT + Case "{MSPDOWN}" + $a_vmCode_List[$i] = $MOUSE_SPECIALBUTTONDOWN_EVENT + Case "{MSPUP}" + $a_vmCode_List[$i] = $MOUSE_SPECIALBUTTONUP_EVENT + EndSwitch + + $sRet_Keys &= $a_vmCode_List[$i] & "|" + Next + + Return StringRegExpReplace($sRet_Keys, "\|+$", "") + EndFunc ;==>__BlockInputEx_Parse_vmCodesList_CLASSes + + Func __BlockInputEx_KeyStr_To_vkCode($sKeyStr) + Local $sRet_Keys = "", $aDelim_Keys[1] + Local $aKeys = StringSplit("{LMouse}|{RMouse}|{}|(MMouse}|{}|{}|{}|{BACKSPACE}|{TAB}|{}|{}|{}|{ENTER}|{}|{}|{SHIFT}|{CTRL}|{ALT}|{PAUSE}|{CAPSLOCK}|{}|{}|{}|{}|{}|{}|{ESC}|{}|{}|{}|{]|{SPACE}|{PGUP}|{PGDN}|{END}|{HOME}|{LEFT}|{UP}|{RIGHT}|{DOWN}|{SELECT}|{PRINTSCREEN}|{}|{PRINTSCREEN}|{INSERT}|{DEL}|{}|0|1|2|3|4|5|6|7|8|9|{}|{}|{}|{}|{}|{}|{}|a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z|{LWIN}|{RWIN}|{APPSKEY}|{}|{SLEEP}|{numpad0}|{numpad1}|{numpad2}|{numpad3}|{numpad4}|{numpad5}|{numpad6}|{numpad7}|{numpad8}|{numpad9}|{NUMPADMULT}|{NUMPADADD}|{}|{NUMPADSUB}|{NUMPADDOT}|{NUMPADDIV}|{F1}|{F2}|{F3}|{F4}|{F5}|{F6}|{F7}|{F8}|{F9}|{F10}|{F11}|{F12}|{F13}|{F14}|{F15}|{F16}|{F17}|{F18}|{F19}|{F20}|{F21}|{F22}|{F23}|{F24}|{}|{}|{}|{}|{}|{}|{}|{}|{NUMLOCK}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{LSHIFT}|{RSHIFT}|{LCTRL}|{RCTRL}|{LALT}|{RALT}|{BROWSER_BACK}|{BROWSER_FORWARD}|{BROWSER_REFRESH}|{BROWSER_STOP}|{BROWSER_SEARCH}|{BROWSER_FAVORITES}|{BROWSER_HOME}|{VOLUME_MUTE}|{VOLUME_DOWN}|{VOLUME_UP}|{MEDIA_NEXT}|{MEDIA_PREV}|{MEDIA_STOP}|{MEDIA_PLAY_PAUSE}|{LAUNCH_MAIL}|{LAUNCH_MEDIA}|{LAUNCH_APP1}|{LAUNCH_APP2}|{}|{}|;|{+}|,|{-}|.|/|`|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|[|\|]|'", "|") + + If StringRegExp($sKeyStr, "\A\[|\]\z") Then + $sKeyStr = StringRegExpReplace($sKeyStr, "\A\[|\]\z", "") + $sKeyStr = StringRegExpReplace($sKeyStr, "(.)", "\1|") + $sKeyStr = StringRegExpReplace($sKeyStr, "\|+$", "") + + $aDelim_Keys = StringSplit($sKeyStr, "") + EndIf + + For $i = 1 To $aKeys[0] + If $aDelim_Keys[0] > 1 Then + For $j = 1 To $aDelim_Keys[0] + If $aKeys[$i] = $aDelim_Keys[$j] Then $sRet_Keys &= "0x" & Hex($i, 2) & "|" + Next + Else + If $aKeys[$i] = $sKeyStr Then Return "0x" & Hex($i, 2) + EndIf + Next + + If $sRet_Keys = "" Then Return $sKeyStr + Return StringRegExpReplace($sRet_Keys, "\|+$", "") + EndFunc ;==>__BlockInputEx_KeyStr_To_vkCode + + Func __BlockInputEx_WinGetHovered() + Local $iOld_Opt_MCM = Opt("MouseCoordMode", 1) + Local $aRet = DllCall("user32.dll", "int", "WindowFromPoint", "long", MouseGetPos(0), "long", MouseGetPos(1)) + Opt("MouseCoordMode", $iOld_Opt_MCM) + + If $i_MouseHookGetAncestorHwnd Then + $aRet = DllCall("User32.dll", "hwnd", "GetAncestor", "hwnd", $aRet[0], "uint", 2) ;$GA_ROOT + EndIf + + Return HWnd($aRet[0]) + EndFunc ;==>__BlockInputEx_WinGetHovered + + ;Called when script exits to release resources. + Func __BlockInputEx_OnAutoItExit() + _BlockInputEx(0) + EndFunc ;==>__BlockInputEx_OnAutoItExit + +#EndRegion Internal Functions diff --git a/COCBot/functions/Other/Click.au3 b/COCBot/functions/Other/Click.au3 index 16080b1..337d439 100644 --- a/COCBot/functions/Other/Click.au3 +++ b/COCBot/functions/Other/Click.au3 @@ -1,19 +1,19 @@ -Func Click($x, $y, $times = 1, $speed = 0, $CenteredOn = 0, $BufferDist = -1) - If $CenteredOn = 0 Then - If $times <> 1 Then - For $i = 0 To ($times - 1) - ControlClick($Title, "", "", "left", "1", $x, $y) - If _Sleep($speed, False) Then ExitLoop - Next - Else - ControlClick($Title, "", "", "left", "1", $x, $y) - EndIf - Else - RedLineDeploy($x, $y, $times, $speed, $CenteredOn, $BufferDist) - EndIf -EndFunc ;==>Click - -; ClickP : takes an array[2] (or array[4]) as a parameter [x,y] -Func ClickP($point, $howMuch = 1, $speed = 0) - Click($point[0], $point[1], $howMuch, $speed) -EndFunc ;==>ClickP +Func Click($x, $y, $times = 1, $speed = 0, $CenteredOn = 0, $BufferDist = -1) + If $CenteredOn = 0 Then + If $times <> 1 Then + For $i = 0 To ($times - 1) + ControlClick($Title, "", "", "left", "1", $x, $y) + If _Sleep($speed, False) Then ExitLoop + Next + Else + ControlClick($Title, "", "", "left", "1", $x, $y) + EndIf + Else + RedLineDeploy($x, $y, $times, $speed, $CenteredOn, $BufferDist) + EndIf +EndFunc ;==>Click + +; ClickP : takes an array[2] (or array[4]) as a parameter [x,y] +Func ClickP($point, $howMuch = 1, $speed = 0) + Click($point[0], $point[1], $howMuch, $speed) +EndFunc ;==>ClickP diff --git a/COCBot/functions/Other/ClickDrag.au3 b/COCBot/functions/Other/ClickDrag.au3 index 70e80ba..d1fac31 100644 --- a/COCBot/functions/Other/ClickDrag.au3 +++ b/COCBot/functions/Other/ClickDrag.au3 @@ -1,73 +1,73 @@ -;================================================================================================= -; Function: _PostMessage_ClickDrag($hWnd, $X1, $Y1, $X2, $Y2, $Button = "left") -; Description: Sends a mouse click and drag command to a specified window. -; Parameter(s): $hWnd - The handle or the title of the window. -; $X1, $Y1 - The x/y position to start the drag operation from. -; $X2, $Y2 - The x/y position to end the drag operation at. -; $Button - (optional) The button to click, "left", "right", "middle". Default is the left button. -; $Delay - (optional) Delay in milliseconds. Default is 50. -; Requirement(s): A window handle/title. -; Return Value(s): On Success - Returns true -; On Failure - Returns false -; @Error - 0 = No error. -; 1 = Invalid window handle or title. -; 2 = Invalid start position. -; 3 = Invalid end position. -; 4 = Failed to open the dll. -; 5 = Failed to send a MouseDown command. -; 5 = Failed to send a MouseMove command. -; 7 = Failed to send a MouseUp command. -; Author(s): KillerDeluxe -;================================================================================================= -Func _PostMessage_ClickDrag($X1, $Y1, $X2, $Y2, $Button = "left", $Delay = 50) - If Not IsHWnd($Title) And $Title <> "" Then - $Title = WinGetHandle($Title) - EndIf - - If Not IsHWnd($Title) Then - Return SetError(1, "", False) - EndIf - - If Not IsInt($X1) Or Not IsInt($Y1) Then - Return SetError(2, "", False) - EndIf - - If Not IsInt($X2) Or Not IsInt($Y2) Then - Return SetError(3, "", False) - EndIf - - If StringLower($Button) == "left" Then - $Button = $WM_LBUTTONDOWN - $Pressed = 1 - ElseIf StringLower($Button) == "right" Then - $Button = $WM_RBUTTONDOWN - $Pressed = 2 - ElseIf StringLower($Button) == "middle" Then - $Button = $WM_MBUTTONDOWN - $Pressed = 10 - If $Delay == 10 Then $Delay = 100 - EndIf - - $User32 = DllOpen("User32.dll") - If @error Then Return SetError(4, "", False) - - DllCall($User32, "bool", "PostMessage", "hwnd", $Title, "int", $Button, "int", "0", "long", _MakeLong($X1, $Y1)) - If @error Then Return SetError(5, "", False) - - _ModifiedSleep($Delay / 2) - - DllCall($User32, "bool", "PostMessage", "hwnd", $Title, "int", $WM_MOUSEMOVE, "int", $Pressed, "long", _MakeLong($X2, $Y2)) - If @error Then Return SetError(6, "", False) - - _ModifiedSleep($Delay / 2) - - DllCall($User32, "bool", "PostMessage", "hwnd", $Title, "int", $Button + 1, "int", "0", "long", _MakeLong($X2, $Y2)) - If @error Then Return SetError(7, "", False) - - DllClose($User32) - Return SetError(0, 0, True) -EndFunc ;==>_PostMessage_ClickDrag - -Func _MakeLong($LowWORD, $HiWORD) - Return BitOR($HiWORD * 0x10000, BitAND($LowWORD, 0xFFFF)) -EndFunc ;==>_MakeLong +;================================================================================================= +; Function: _PostMessage_ClickDrag($hWnd, $X1, $Y1, $X2, $Y2, $Button = "left") +; Description: Sends a mouse click and drag command to a specified window. +; Parameter(s): $hWnd - The handle or the title of the window. +; $X1, $Y1 - The x/y position to start the drag operation from. +; $X2, $Y2 - The x/y position to end the drag operation at. +; $Button - (optional) The button to click, "left", "right", "middle". Default is the left button. +; $Delay - (optional) Delay in milliseconds. Default is 50. +; Requirement(s): A window handle/title. +; Return Value(s): On Success - Returns true +; On Failure - Returns false +; @Error - 0 = No error. +; 1 = Invalid window handle or title. +; 2 = Invalid start position. +; 3 = Invalid end position. +; 4 = Failed to open the dll. +; 5 = Failed to send a MouseDown command. +; 5 = Failed to send a MouseMove command. +; 7 = Failed to send a MouseUp command. +; Author(s): KillerDeluxe +;================================================================================================= +Func _PostMessage_ClickDrag($X1, $Y1, $X2, $Y2, $Button = "left", $Delay = 50) + If Not IsHWnd($Title) And $Title <> "" Then + $Title = WinGetHandle($Title) + EndIf + + If Not IsHWnd($Title) Then + Return SetError(1, "", False) + EndIf + + If Not IsInt($X1) Or Not IsInt($Y1) Then + Return SetError(2, "", False) + EndIf + + If Not IsInt($X2) Or Not IsInt($Y2) Then + Return SetError(3, "", False) + EndIf + + If StringLower($Button) == "left" Then + $Button = $WM_LBUTTONDOWN + $Pressed = 1 + ElseIf StringLower($Button) == "right" Then + $Button = $WM_RBUTTONDOWN + $Pressed = 2 + ElseIf StringLower($Button) == "middle" Then + $Button = $WM_MBUTTONDOWN + $Pressed = 10 + If $Delay == 10 Then $Delay = 100 + EndIf + + $User32 = DllOpen("User32.dll") + If @error Then Return SetError(4, "", False) + + DllCall($User32, "bool", "PostMessage", "hwnd", $Title, "int", $Button, "int", "0", "long", _MakeLong($X1, $Y1)) + If @error Then Return SetError(5, "", False) + + _ModifiedSleep($Delay / 2) + + DllCall($User32, "bool", "PostMessage", "hwnd", $Title, "int", $WM_MOUSEMOVE, "int", $Pressed, "long", _MakeLong($X2, $Y2)) + If @error Then Return SetError(6, "", False) + + _ModifiedSleep($Delay / 2) + + DllCall($User32, "bool", "PostMessage", "hwnd", $Title, "int", $Button + 1, "int", "0", "long", _MakeLong($X2, $Y2)) + If @error Then Return SetError(7, "", False) + + DllClose($User32) + Return SetError(0, 0, True) +EndFunc ;==>_PostMessage_ClickDrag + +Func _MakeLong($LowWORD, $HiWORD) + Return BitOR($HiWORD * 0x10000, BitAND($LowWORD, 0xFFFF)) +EndFunc ;==>_MakeLong diff --git a/COCBot/functions/Other/CreateLogFile.au3 b/COCBot/functions/Other/CreateLogFile.au3 index bd3bbee..8a46755 100644 --- a/COCBot/functions/Other/CreateLogFile.au3 +++ b/COCBot/functions/Other/CreateLogFile.au3 @@ -1,5 +1,5 @@ -Func CreateLogFile() - $sLogPath = $dirLogs & @YEAR & "-" & @MON & "-" & @MDAY & "_" & @HOUR & "." & @MIN & "." & @SEC & ".log" - $sLogFileName = @YEAR & "-" & @MON & "-" & @MDAY & "_" & @HOUR & "." & @MIN & "." & @SEC & ".log" - $hLogFileHandle = FileOpen($sLogPath, $FO_APPEND) -EndFunc ;==>CreateLogFile +Func CreateLogFile() + $sLogPath = $dirLogs & @YEAR & "-" & @MON & "-" & @MDAY & "_" & @HOUR & "." & @MIN & "." & @SEC & ".log" + $sLogFileName = @YEAR & "-" & @MON & "-" & @MDAY & "_" & @HOUR & "." & @MIN & "." & @SEC & ".log" + $hLogFileHandle = FileOpen($sLogPath, $FO_APPEND) +EndFunc ;==>CreateLogFile diff --git a/COCBot/functions/Other/DisableBS.au3 b/COCBot/functions/Other/DisableBS.au3 index c129abb..edf8e20 100644 --- a/COCBot/functions/Other/DisableBS.au3 +++ b/COCBot/functions/Other/DisableBS.au3 @@ -1,6 +1,6 @@ -Func DisableBS($HWnD, $iButton) - ConsoleWrite('+ Window Handle: ' & $HWnD & @CRLF) - $hSysMenu = _GUICtrlMenu_GetSystemMenu($HWnD, 0) - _GUICtrlMenu_RemoveMenu($hSysMenu, $iButton, False) - _GUICtrlMenu_DrawMenuBar($HWnD) -EndFunc ;==>DisableBS +Func DisableBS($HWnD, $iButton) + ConsoleWrite('+ Window Handle: ' & $HWnD & @CRLF) + $hSysMenu = _GUICtrlMenu_GetSystemMenu($HWnD, 0) + _GUICtrlMenu_RemoveMenu($hSysMenu, $iButton, False) + _GUICtrlMenu_DrawMenuBar($HWnD) +EndFunc ;==>DisableBS diff --git a/COCBot/functions/Other/EnableBS.au3 b/COCBot/functions/Other/EnableBS.au3 index 1ceb9dd..0227b61 100644 --- a/COCBot/functions/Other/EnableBS.au3 +++ b/COCBot/functions/Other/EnableBS.au3 @@ -1,6 +1,6 @@ -Func EnableBS($HWnD, $iButton) - ConsoleWrite('+ Window Handle: ' & $HWnD & @CRLF) - $hSysMenu = _GUICtrlMenu_GetSystemMenu($HWnD, 1) - _GUICtrlMenu_RemoveMenu($hSysMenu, $iButton, False) - _GUICtrlMenu_DrawMenuBar($HWnD) -EndFunc ;==>EnableBS +Func EnableBS($HWnD, $iButton) + ConsoleWrite('+ Window Handle: ' & $HWnD & @CRLF) + $hSysMenu = _GUICtrlMenu_GetSystemMenu($HWnD, 1) + _GUICtrlMenu_RemoveMenu($hSysMenu, $iButton, False) + _GUICtrlMenu_DrawMenuBar($HWnD) +EndFunc ;==>EnableBS diff --git a/COCBot/functions/Other/Experience.au3 b/COCBot/functions/Other/Experience.au3 index f9fb42d..5b0c942 100644 --- a/COCBot/functions/Other/Experience.au3 +++ b/COCBot/functions/Other/Experience.au3 @@ -1,85 +1,269 @@ -Func experience() - While 1 - Click(66, 607);attack button - If _Sleep(500) Then ExitLoop - - For $i = 0 To 20 - ControlSend($Title, "", "", "{DOWN}") ; scroll up the goblin page - If _Sleep(500) Then ExitLoop - Next - - If _Sleep(3000) Then ExitLoop - - Click(674, 208);choose 2nd goblin base - If _Sleep(500) Then ExitLoop - Click(665, 247);attack goblin button - SetLog(GetLangText("msgAttackingGoblin"), $COLOR_BLUE) - - _CaptureRegion() - While 1 - If _ColorCheck(_GetPixelColor(430, 430), Hex(0x888844, 6), 20) Then - ExitLoop - Else - If _Sleep(1000) Then ExitLoop - _CaptureRegion() - EndIf - WEnd - - If _Sleep(500) Then ExitLoop - Local $kingPos = getKingPos() ; find king, make sure you have king - If $kingPos <> -1 Then dropKing(402, 325, $kingPos) ; drop you king - - _CaptureRegion() - While 1 - If _ColorCheck(_GetPixelColor(430, 530), Hex(0xD0E873, 6), 20) Then - ExitLoop - Else - If _Sleep(1000) Then ExitLoop - _CaptureRegion() - EndIf - WEnd - ; If _Sleep(10000) Then ExitLoop ; wait for it to finish. increase the timer if it takes longer - Click(428, 544) ;return home button - - If _Sleep(1000) Then ExitLoop - - _CaptureRegion() - While 1 - If _ColorCheck(_GetPixelColor(820, 180), Hex(0xD0EC7C, 6), 20) Then - ExitLoop - Else - If _Sleep(1000) Then ExitLoop - _CaptureRegion() - EndIf - WEnd - ;DonateCC() - ;Sleep(1000) - ;Train() - SetLog(GetLangText("msgVictory"), $COLOR_BLUE) - If _Sleep(1000) Then ExitLoop - WEnd -EndFunc ;==>experience - -Func getKingPos() - ; SetLog("Finding king pos", $COLOR_BLUE) - Local $pos = -1 - For $i = 0 To 8 - Local $troop = IdentifyTroopKind($i) - If $troop = $eKing Then - $pos = $i - ExitLoop - EndIf - Next - Return $pos -EndFunc ;==>getKingPos - -Func dropKing($x = 10, $y = 10, $num = 2) - If $num <> -1 Then - ; SetLog("Dropping King", $COLOR_BLUE) - Click(68 + (72 * $num), 595) ;Select King - If _Sleep(500) Then Return - Click($x, $y) - If _Sleep(5000) Then Return ; wait 5 seconds - Click(68 + (72 * $num), 595) ; before activate king power - EndIf -EndFunc ;==>dropKing +Func experience() + Local $totalLoops = 0 + Local $successfulLoops = 0 + Local $expGained = 0 + + While True And $totalLoops < 30 + $totalLoops += 1 + + ;if the AQ is available, attack Goblin Picnic with her + If ChkQueenAvailability() Then + Click(66 + Random(-5,5,1), 607+ Random(-5,5,1));attack button + + Local $loadedGobScreen = _WaitForPixel(819, 17, 923, 21, Hex(0xF88488, 6), 5, 30) ;determines if gob attack is loaded, wait max 30 seconds + If IsArray($loadedGobScreen) = False Then + SetLog("Failed to reach attack screen...", $COLOR_RED) + errorReturnHome() + ContinueLoop + EndIf + _Sleep(200) + Local $atBottom = _WaitForPixel(840, 580, 844, 584, Hex(0x403828, 6), 5, 1) ;determines if at bottom already, wait max 1 second Hex(0x403828,6)(842,582) + If IsArray($atBottom) = False Then + SetLog("Need to scroll to bottom!", $COLOR_BLUE) + For $i = 0 To 9 + ControlSend($Title, "", "", "{UP}") ; scroll to the bottom of the goblin page + If _Sleep(500) Then Return + Next + EndIf + + _PostMessage_ClickDrag(510 + Random(-5,5,1), 11 + Random(-5,5,1), 695 + Random(-5,5,1), 661 + Random(-5,5,1), "left", 1000) + If _Sleep(250) Then Return + + Local $gobCircle = _WaitForPixel(567, 190, 569, 300, Hex(0xD85400, 6), 5, 2) ;determines if gob circle is there, wait max 2 seconds + If IsArray($gobCircle) = False Then + SetLog("Failed to find goblin base circle...", $COLOR_RED) + errorReturnHome() + ContinueLoop + EndIf + + Click($gobCircle[0]+ Random(-5,5,1), $gobCircle[1]+ Random(-5,5,1));choose Goblin Picnic + + Local $gobAttack = _WaitForPixel(573, 225, 577, 335, Hex(0xA6A39E, 6), 5, 2) ;determines if gob attack is there, wait max 2 seconds + If IsArray($gobAttack) = False Then + SetLog("Failed to find goblin attack button...", $COLOR_RED) + errorReturnHome() + ContinueLoop + EndIf + _Sleep(50) + + Click($gobCircle[0]+ Random(-5,5,1), $gobCircle[1]+ Random(-5,5,1) + 35);choose Goblin Picnic + + SetLog(GetLangText("msgAttackingGoblin"), $COLOR_BLUE) + + Local $loadedBaseLoc = _WaitForPixel(428, 427, 432, 431, Hex(0x6D8034, 6), 5, 10) ;determines if base is loaded, wait max 2 seconds + If IsArray($loadedBaseLoc) = False Then + SetLog("Failed to attack base...", $COLOR_RED) + If $DebugMode = 2 Then _GDIPlus_ImageSaveToFile($hBitmap, $dirDebug & "ExpNoBase-" & @HOUR & @MIN & @SEC & ".png") + errorReturnHome() + ContinueLoop + EndIf + + Local $queenPos = getQueenPos() ; find AQ, make sure you have AQ + If $queenPos = -1 Then + SetLog("Cannot find AQ. Try again...", $COLOR_RED) + _Sleep(100) + $queenPos = getQueenPos() ; find AQ, make sure you have AQ + If $queenPos = -1 Then + SetLog("Cannot find AQ. Return Home", $COLOR_RED) + errorReturnHome() + ContinueLoop + EndIf + EndIf + + dropQueen(323+ Random(-5,5,1), 202+ Random(-5,5,1), $queenPos) ; drop your AQ + + Local $firstStar = _WaitForPixel(428, 358, 432, 362, Hex(0xC0C8C0, 6), 20, 8) ;Waits for the first star, wait max 15 seconds + If IsArray($firstStar) = False Then + Local $firstStar2 = _WaitForPixel(711, 536, 715, 540, Hex(0xC0C8C0, 6), 5, 2) ;Waits for the first star, wait max 2 seconds + If IsArray($firstStar2) = False Then + SetLog("Failed to destroy TH...", $COLOR_RED) + If $DebugMode = 2 Then _GDIPlus_ImageSaveToFile($hBitmap, $dirDebug & "ExpFailedAtk-" & @HOUR & @MIN & @SEC & ".png") + errorReturnHome() + ContinueLoop + EndIf + EndIf + + Click(70+ Random(-5,5,1), 530+ Random(-5,5,1)) ;End Battle button + + Local $okayButton = _WaitForPixel(513, 398, 517, 402, Hex(0x354217, 6), 5, 2) ;finds Okay button, wait max 2 seconds + If IsArray($okayButton) = False Then + SetLog("Failed to find Okay button...", $COLOR_RED) + errorReturnHome() + ContinueLoop + EndIf + + Click(515+ Random(-5,5,1), 400+ Random(-5,5,1)) ;Confirm button + + Local $returnButton = _WaitForPixel(426, 542, 430, 548, Hex(0xFFFFFF, 6), 5, 2) ;finds Return Home button, wait max 2 seconds + If IsArray($returnButton) = False Then + SetLog("Failed to find Return Home button...", $COLOR_RED) + errorReturnHome() + ContinueLoop + EndIf + + Click(428+ Random(-5,5,1), 544+ Random(-5,5,1)) ;return home button + + Local $homeScreen = _WaitForPixel(818, 178, 822, 182, Hex(0xD0EC7C, 6), 5, 5) ;Waits for main screen to load, wait max 5 seconds + If IsArray($homeScreen) = False Then + SetLog("Failed to return home...", $COLOR_RED) + If $DebugMode = 2 Then _GDIPlus_ImageSaveToFile($hBitmap, $dirDebug & "ExpFailedRtnHome-" & @HOUR & @MIN & @SEC & ".png") + errorReturnHome() + ContinueLoop + EndIf + $successfulLoops += 1 + $expGained += 5 + SetLog(GetLangText("msgVictory") & " " & $successfulLoops & " out of " & $totalLoops & " successful. " & $expGained & " Exp gained since start", $COLOR_BLUE) + + + ;If the AQ is unavailable, attack the 2nd goblin base with the Barb King + ElseIf ChkKingAvailability() Then + + Click(66 + Random(-5,5,1), 607 + Random(-5,5,1));attack button + If Not _WaitForColorArea(287, 494, 5, 5, Hex(0xEEAC28, 6), 50) Then + restartBlueStack() + ContinueLoop + EndIf + If _Sleep(500) Then Return + + $i = 0 + While $i < 20 + _PostMessage_ClickDrag(510 + Random(-5,5,1), 50 + Random(-5,5,1), 510 + Random(-5,5,1), 1800 + Random(-200,200,1), "left", 500) + If _Sleep(500) Then Return + _CaptureRegion() + If _ColorCheck(_GetPixelColor(474, 7), Hex(0x403828, 6), 20) Then ExitLoop + $i += 1 + WEnd + + If $i = 20 Then + errorReturnHome() + ContinueLoop + EndIf + + If _Sleep(500) Then Return + + Click(674 + Random(-5,5,1), 208 + Random(-5,5,1));choose 2nd goblin base + If Not _WaitForColorArea(630, 233, 90, 15, Hex(0xF0BC44, 6), 30, 5) Then + errorReturnHome() + ContinueLoop + EndIf + + Click(665 + Random(-5,5,1), 247 + Random(-5,5,1));attack goblin button + SetLog(GetLangText("msgAttackingGoblin"), $COLOR_BLUE) + + If Not _WaitForColorArea(485, 290, 5, 5, Hex(0xFFCC18, 6), 30, 5) Then ; Wait for base to appear + errorReturnHome() + ContinueLoop + EndIf + + If Not _WaitForColorArea(5, 665, 5, 5, Hex(0x030605, 6), 30, 5) Then ; Wait for clouds to clear + errorReturnHome() + ContinueLoop + EndIf + + If _Sleep(200) Then Return + Local $kingPos = getKingPos() ; find king, make sure you have king + If $kingPos = -1 Then + SetLog("Cannot find BK. Try again...", $COLOR_RED) + _Sleep(500) + $kingPos = getQueenPos() ; find AQ, make sure you have AQ + If $queenPos = -1 Then + SetLog("Cannot find BK. Return Home", $COLOR_RED) + errorReturnHome() + ContinueLoop + EndIf + EndIf + If $kingPos <> -1 Then dropKing(402 + Random(-5,5,1), 325 + Random(-5,5,1), $kingPos) ; drop your king + + _WaitForColorArea(367, 520, 130, 30, Hex(0xCAE868, 6), 30, 300) + + If _Sleep(500) Then Return + Click(428 + Random(-5,5,1), 544 + Random(-5,5,1)) ;return home button + If _Sleep(1000) Then Return + + checkMainScreen() + + $successfulLoops += 1 + $expGained += 1 + SetLog(GetLangText("msgVictory") & " " & $successfulLoops & " out of " & $totalLoops & " successful. " & $expGained & " Exp gained since start", $COLOR_BLUE) + If _Sleep(500) Then Return + Else + ;If neither hero is available, wait 30 seconds then check heroes again + $totalLoops -= 1 + SetLog("Waiting for Hero...", $COLOR_BLUE) + If _Sleep(30000) Then Return + EndIf + + WEnd +EndFunc ;==>experience + +Func getKingPos() + ; SetLog("Finding king pos", $COLOR_BLUE) + Local $pos = -1 + For $i = 0 To 8 + Local $troop = IdentifyTroopKind($i) + If $troop = $eKing Then + $pos = $i + ExitLoop + EndIf + Next + Return $pos +EndFunc ;==>getKingPos + +Func dropKing($x = 10, $y = 10, $num = 2) + If $num <> -1 Then + ; SetLog("Dropping King", $COLOR_BLUE) + Click(68 + (72 * $num) + Random(-5,5,1), 595 + Random(-5,5,1)) ;Select King + If _Sleep(500) Then Return + Click($x, $y) + If _Sleep(5000) Then Return ; wait 5 seconds + Click(68 + (72 * $num) + Random(-5,5,1), 595 + Random(-5,5,1)) ; before activate king power + EndIf +EndFunc ;==>dropKing + +Func getQueenPos() + ; SetLog("Finding queen pos", $COLOR_BLUE) + Local $pos = -1 + For $i = 0 To 8 + Local $troop = IdentifyTroopKind($i) + If $troop = $eQueen Then + $pos = $i + ExitLoop + EndIf + Next + Return $pos +EndFunc ;==>getQueenPos + +Func dropQueen($x = 10, $y = 10, $num = 2) + If $num <> -1 Then + ; SetLog("Dropping Queen", $COLOR_BLUE) + Click(68 + (72 * $num) + Random(-5,5,1), 595 + Random(-5,5,1)) ;Select Queen + If _Sleep(500) Then Return + Click($x, $y) + If _Sleep(250) Then Return ; wait 0.25 seconds + Click(68 + (72 * $num) + Random(-5,5,1), 595 + Random(-5,5,1)) ; before activate queen power + EndIf +EndFunc ;==>dropQueen + + Func errorReturnHome() + SetLog("Attempting to return home.", $COLOR_BLUE) + Local $redX = _WaitForPixel(819, 17, 923, 21, Hex(0xF88488, 6), 5, 1) ;determines if gob attack is open, wait max 1 seconds + If IsArray($redX) = True Then + Click(823 + Random(-5,5,1),32 + Random(-5,5,1)) + Else + Local $endNowButton = _WaitForPixel(68, 528, 72, 532, Hex(0xFEFCFC, 6), 5, 1) ;finds End Now button, wait max 1 seconds + If IsArray($endNowButton) = True Then + Click(70 + Random(-5,5,1), 530 + Random(-5,5,1)) ;End Battle button + EndIf + + Local $okayButton = _WaitForPixel(513, 398, 517, 402, Hex(0x354217, 6), 5, 1) ;finds Okay button, wait max 1 seconds + If IsArray($okayButton) = True Then + Click(515 + Random(-5,5,1), 400 + Random(-5,5,1)) ;Confirm button + EndIf + + Local $returnButton = _WaitForPixel(426, 542, 430, 548, Hex(0xFFFFFF, 6), 5, 1) ;finds Return Home button, wait max 1 seconds + If IsArray($returnButton) = True Then + Click(428 + Random(-5,5,1), 544 + Random(-5,5,1)) ;return home button + EndIf + EndIf + checkMainScreen() +EndFunc diff --git a/COCBot/functions/Other/FindPos.au3 b/COCBot/functions/Other/FindPos.au3 index 8774a2d..2ba77ab 100644 --- a/COCBot/functions/Other/FindPos.au3 +++ b/COCBot/functions/Other/FindPos.au3 @@ -1,11 +1,11 @@ -Func FindPos() - getBSPos() - Local $Pos[2] - While 1 - If _IsPressed("01") Then - $Pos[0] = MouseGetPos()[0] - $BSpos[0] - $Pos[1] = MouseGetPos()[1] - $BSpos[1] - Return $Pos - EndIf - WEnd -EndFunc ;==>FindPos +Func FindPos() + getBSPos() + Local $Pos[2] + While 1 + If _IsPressed("01") Then + $Pos[0] = MouseGetPos()[0] - $BSpos[0] + $Pos[1] = MouseGetPos()[1] - $BSpos[1] + Return $Pos + EndIf + WEnd +EndFunc ;==>FindPos diff --git a/COCBot/functions/Other/General Functions.au3 b/COCBot/functions/Other/General Functions.au3 index 4de5a1e..9d1a8ed 100644 --- a/COCBot/functions/Other/General Functions.au3 +++ b/COCBot/functions/Other/General Functions.au3 @@ -1,118 +1,125 @@ -Func SetTime() - Local $time = _TicksToTime(Int(TimerDiff($sTimer)), $hour, $min, $sec) - If _GUICtrlTab_GetCurSel($tabMain) = 7 Then GUICtrlSetData($lblresultruntime, StringFormat("%02i:%02i:%02i", $hour, $min, $sec)) - If IsChecked($lblpushbulletremote) Then - If StringRight(StringFormat("%02i", $sec), 2) = "30" Then - _RemoteControl() - EndIf - EndIf -EndFunc ;==>SetTime - -Func Initiate() - If IsArray(ControlGetPos($Title, "_ctl.Window", "[CLASS:BlueStacksApp; INSTANCE:1]")) Then - Local $BSsize = [ControlGetPos($Title, "_ctl.Window", "[CLASS:BlueStacksApp; INSTANCE:1]")[2], ControlGetPos($Title, "_ctl.Window", "[CLASS:BlueStacksApp; INSTANCE:1]")[3]] - Local $fullScreenRegistryData = RegRead($REGISTRY_KEY_DIRECTORY, "FullScreen") - Local $guestHeightRegistryData = RegRead($REGISTRY_KEY_DIRECTORY, "GuestHeight") - Local $guestWidthRegistryData = RegRead($REGISTRY_KEY_DIRECTORY, "GuestWidth") - Local $windowHeightRegistryData = RegRead($REGISTRY_KEY_DIRECTORY, "WindowHeight") - Local $windowWidthRegistryData = RegRead($REGISTRY_KEY_DIRECTORY, "WindowWidth") - - Local $BSx = ($BSsize[0] > $BSsize[1]) ? $BSsize[0] : $BSsize[1] - Local $BSy = ($BSsize[0] > $BSsize[1]) ? $BSsize[1] : $BSsize[0] - - $Running = True - - If $BSx <> 860 Or $BSy <> 720 Then - RegWrite($REGISTRY_KEY_DIRECTORY, "FullScreen", "REG_DWORD", "0") - RegWrite($REGISTRY_KEY_DIRECTORY, "GuestHeight", "REG_DWORD", $DEFAULT_HEIGHT) - RegWrite($REGISTRY_KEY_DIRECTORY, "GuestWidth", "REG_DWORD", $DEFAULT_WIDTH) - RegWrite($REGISTRY_KEY_DIRECTORY, "WindowHeight", "REG_DWORD", $DEFAULT_HEIGHT) - RegWrite($REGISTRY_KEY_DIRECTORY, "WindowWidth", "REG_DWORD", $DEFAULT_WIDTH) - SetLog(GetLangText("msgPleaseRestart"), $COLOR_ORANGE) - _Sleep(3000) - $MsgRet = MsgBox(BitOR($MB_OKCANCEL, $MB_SYSTEMMODAL), GetLangText("boxRestart"), GetLangText("boxRestart2") & @CRLF & GetLangText("boxRestart3"), 10) - If $MsgRet <> $IDOK Then - btnStop() - Return - EndIf - EndIf - - WinActivate($Title) - - SetLog(GetLangText("msgWelcome") & $sBotTitle & "!~~~~", $COLOR_PURPLE) - SetLog($Compiled & GetLangText("msgRunningOn") & @OSArch & " OS", $COLOR_GREEN) - SetLog(GetLangText("msgStarting"), $COLOR_ORANGE) - - If IsChecked($lblpushbulletenabled) And IsChecked($lblpushbulletdelete) Then - _DeletePush() - EndIf - - $AttackNow = False - $FirstStart = True - $Checkrearm = True - GUICtrlSetState($cmbBoostBarracks, $GUI_DISABLE) - GUICtrlSetState($btnLocateDarkBarracks, $GUI_DISABLE) - GUICtrlSetState($btnLocateBarracks, $GUI_DISABLE) - GUICtrlSetState($btnLocateCamp, $GUI_DISABLE) - GUICtrlSetState($btnFindWall, $GUI_DISABLE) - GUICtrlSetState($chkBackground, $GUI_DISABLE) - GUICtrlSetState($chkNoAttack, $GUI_DISABLE) - GUICtrlSetState($chkDonateOnly, $GUI_DISABLE) - GUICtrlSetState($chkForceBS, $GUI_DISABLE) - GUICtrlSetState($btnLocateTownHall, $GUI_DISABLE) - GUICtrlSetState($btnLocateKingAltar, $GUI_DISABLE) - GUICtrlSetState($btnLocateQueenAltar, $GUI_DISABLE) - GUICtrlSetState($btnLoad, $GUI_DISABLE) - GUICtrlSetState($btnSave, $GUI_DISABLE) - GUICtrlSetState($btnLocateClanCastle, $GUI_DISABLE) - GUICtrlSetState($btnLocateSFactory, $GUI_DISABLE) - $sTimer = TimerInit() - $GoldTotalLoot = 0 - $ElixirTotalLoot = 0 - $DarkTotalLoot = 0 - $TrophyTotalLoot = 0 - - AdlibRegister("SetTime", 1000) - runBot() - GUICtrlSetState($btnStart, $GUI_ENABLE) - GUICtrlSetData($btnStart, "Start Bot") - Else - SetLog(GetLangText("msgNotInGame"), $COLOR_RED) - btnStop() - EndIf -EndFunc ;==>Initiate - -Func Open() - If $64Bit Then ;If 64-Bit - ShellExecute("C:\Program Files (x86)\BlueStacks\HD-StartLauncher.exe") - SetLog(GetLangText("msgStartingBS"), $COLOR_GREEN) - _ModifiedSleep(290) - SetLog(GetLangText("msgWaitingBS"), $COLOR_GREEN) - Check() - Else ;If 32-Bit - ShellExecute("C:\Program Files\BlueStacks\HD-StartLauncher.exe") - SetLog(GetLangText("msgStartingBS"), $COLOR_GREEN) - _ModifiedSleep(290) - SetLog(GetLangText("msgWaitingBS"), $COLOR_GREEN) - Check() - EndIf -EndFunc ;==>Open - -Func Check() - If IsArray(ControlGetPos($Title, "_ctl.Window", "[CLASS:BlueStacksApp; INSTANCE:1]")) Then - SetLog(GetLangText("msgBSLoaded") & ($Initiate) & GetLangText("msgBSLoadSecs"), $COLOR_GREEN) - Initiate() - Else - _ModifiedSleep(1000) - $Initiate = $Initiate + 1 - Check() - EndIf -EndFunc ;==>Check - -Func getfilename($psFilename) - Local $szDrive, $szDir, $szFName, $szExt - _PathSplit($psFilename, $szDrive, $szDir, $szFName, $szExt) - Return $szFName & $szExt -EndFunc ;==>getfilename - - +Func SetTime() + Local $time = _TicksToTime(Int(TimerDiff($sTimer)), $hour, $min, $sec) + If _GUICtrlTab_GetCurSel($tabMain) = 7 Then GUICtrlSetData($lblresultruntime, StringFormat("%02i:%02i:%02i", $hour, $min, $sec)) + If IsChecked($lblpushbulletremote) Then + If StringRight(StringFormat("%02i", $sec), 2) = "30" Then + _RemoteControl() + EndIf + EndIf +EndFunc ;==>SetTime + +Func Initiate() + If IsArray(ControlGetPos($Title, "_ctl.Window", "[CLASS:BlueStacksApp; INSTANCE:1]")) Then + Local $BSsize = [ControlGetPos($Title, "_ctl.Window", "[CLASS:BlueStacksApp; INSTANCE:1]")[2], ControlGetPos($Title, "_ctl.Window", "[CLASS:BlueStacksApp; INSTANCE:1]")[3]] + Local $fullScreenRegistryData = RegRead($REGISTRY_KEY_DIRECTORY, "FullScreen") + Local $guestHeightRegistryData = RegRead($REGISTRY_KEY_DIRECTORY, "GuestHeight") + Local $guestWidthRegistryData = RegRead($REGISTRY_KEY_DIRECTORY, "GuestWidth") + Local $windowHeightRegistryData = RegRead($REGISTRY_KEY_DIRECTORY, "WindowHeight") + Local $windowWidthRegistryData = RegRead($REGISTRY_KEY_DIRECTORY, "WindowWidth") + + Local $BSx = ($BSsize[0] > $BSsize[1]) ? $BSsize[0] : $BSsize[1] + Local $BSy = ($BSsize[0] > $BSsize[1]) ? $BSsize[1] : $BSsize[0] + + $Running = True + + If $BSx <> 860 Or $BSy <> 720 Then + RegWrite($REGISTRY_KEY_DIRECTORY, "FullScreen", "REG_DWORD", "0") + RegWrite($REGISTRY_KEY_DIRECTORY, "GuestHeight", "REG_DWORD", $DEFAULT_HEIGHT) + RegWrite($REGISTRY_KEY_DIRECTORY, "GuestWidth", "REG_DWORD", $DEFAULT_WIDTH) + RegWrite($REGISTRY_KEY_DIRECTORY, "WindowHeight", "REG_DWORD", $DEFAULT_HEIGHT) + RegWrite($REGISTRY_KEY_DIRECTORY, "WindowWidth", "REG_DWORD", $DEFAULT_WIDTH) + SetLog(GetLangText("msgPleaseRestart"), $COLOR_ORANGE) + _Sleep(3000) + $MsgRet = MsgBox(BitOR($MB_OKCANCEL, $MB_SYSTEMMODAL), GetLangText("boxRestart"), GetLangText("boxRestart2") & @CRLF & GetLangText("boxRestart3"), 10) + If $MsgRet <> $IDOK Then + btnStop() + Return + EndIf + EndIf + + WinActivate($Title) + + SetLog(GetLangText("msgWelcome") & $sBotTitle & "!~~~~", $COLOR_PURPLE) + SetLog($Compiled & GetLangText("msgRunningOn") & @OSArch & " OS", $COLOR_GREEN) + SetLog(GetLangText("msgStarting"), $COLOR_ORANGE) + + If IsChecked($lblpushbulletenabled) And IsChecked($lblpushbulletdelete) Then + _DeletePush() + EndIf + + $AttackNow = False + $FirstStart = True + $Checkrearm = True + GUICtrlSetState($cmbBoostBarracks, $GUI_DISABLE) + GUICtrlSetState($btnLocateDarkBarracks, $GUI_DISABLE) + GUICtrlSetState($btnLocateBarracks, $GUI_DISABLE) + GUICtrlSetState($btnLocateCamp, $GUI_DISABLE) + GUICtrlSetState($btnFindWall, $GUI_DISABLE) + GUICtrlSetState($chkBackground, $GUI_DISABLE) + GUICtrlSetState($chkNoAttack, $GUI_DISABLE) + GUICtrlSetState($chkDonateOnly, $GUI_DISABLE) + GUICtrlSetState($chkForceBS, $GUI_DISABLE) + GUICtrlSetState($btnLocateTownHall, $GUI_DISABLE) + GUICtrlSetState($btnLocateKingAltar, $GUI_DISABLE) + GUICtrlSetState($btnLocateQueenAltar, $GUI_DISABLE) + GUICtrlSetState($btnLoad, $GUI_DISABLE) + GUICtrlSetState($btnSave, $GUI_DISABLE) + GUICtrlSetState($btnLocateClanCastle, $GUI_DISABLE) + GUICtrlSetState($btnLocateSFactory, $GUI_DISABLE) + $sTimer = TimerInit() + $GoldTotalLoot = 0 + $ElixirTotalLoot = 0 + $DarkTotalLoot = 0 + $TrophyTotalLoot = 0 + + AdlibRegister("SetTime", 1000) + runBot() + GUICtrlSetState($btnStart, $GUI_ENABLE) + GUICtrlSetData($btnStart, "Start Bot") + Else + SetLog(GetLangText("msgNotInGame"), $COLOR_RED) + btnStop() + EndIf +EndFunc ;==>Initiate + +Func Open() + If $64Bit Then ;If 64-Bit + ShellExecute("C:\Program Files (x86)\BlueStacks\HD-StartLauncher.exe") + SetLog(GetLangText("msgStartingBS"), $COLOR_GREEN) + _ModifiedSleep(290) + SetLog(GetLangText("msgWaitingBS"), $COLOR_GREEN) + $Initiate = 0 + Check() + Else ;If 32-Bit + ShellExecute("C:\Program Files\BlueStacks\HD-StartLauncher.exe") + SetLog(GetLangText("msgStartingBS"), $COLOR_GREEN) + _ModifiedSleep(290) + SetLog(GetLangText("msgWaitingBS"), $COLOR_GREEN) + $Initiate = 0 + Check() + EndIf +EndFunc ;==>Open + +Func Check() + If $Initiate > 90 Then + restartBlueStack() + $Initiate = 0 + Else + If IsArray(ControlGetPos($Title, "_ctl.Window", "[CLASS:BlueStacksApp; INSTANCE:1]")) Then + SetLog(GetLangText("msgBSLoaded") & ($Initiate) & GetLangText("msgBSLoadSecs"), $COLOR_GREEN) + Initiate() + Else + _ModifiedSleep(1000) + $Initiate = $Initiate + 1 + Check() + EndIf + EndIf +EndFunc ;==>Check + +Func getfilename($psFilename) + Local $szDrive, $szDir, $szFName, $szExt + _PathSplit($psFilename, $szDrive, $szDir, $szFName, $szExt) + Return $szFName & $szExt +EndFunc ;==>getfilename + + diff --git a/COCBot/functions/Other/LootLogCleanup.au3 b/COCBot/functions/Other/LootLogCleanup.au3 index c83443f..3e706b7 100644 --- a/COCBot/functions/Other/LootLogCleanup.au3 +++ b/COCBot/functions/Other/LootLogCleanup.au3 @@ -1,22 +1,22 @@ -Func LootLogCleanup($no_rotator) - Local $dir_list[3] = ["Loots", "logs", "Debug"] - For $l = 0 To UBound($dir_list) - 1 - Local $dir = @ScriptDir & "\" & $dir_list[$l] - If FileExists($dir) == 0 Then - SetLog(GetLangText("msgDirNotFound") & $dir, $COLOR_RED) - ContinueLoop - EndIf - Local $fArray = _FileListToArrayRec($dir, "*", $FLTAR_FILESFOLDERS, $FLTAR_RECUR, $FLTAR_SORT, $FLTAR_FULLPATH) - If UBound($fArray) == 0 Then ContinueLoop - Local $data_size = $fArray[0] - If $data_size > $no_rotator Then - For $i = 1 To Number($data_size - $no_rotator) - Local $file_path = $fArray[$i] - If Not FileDelete($file_path) Then - SetLog(GetLangText("msgFailDel") & $file_path, $COLOR_RED) - EndIf - Next - EndIf - Next -EndFunc ;==>LootLogCleanup - +Func LootLogCleanup($no_rotator) + Local $dir_list[3] = ["Loots", "logs", "Debug"] + For $l = 0 To UBound($dir_list) - 1 + Local $dir = @ScriptDir & "\" & $dir_list[$l] + If FileExists($dir) == 0 Then + SetLog(GetLangText("msgDirNotFound") & $dir, $COLOR_RED) + ContinueLoop + EndIf + Local $fArray = _FileListToArrayRec($dir, "*", $FLTAR_FILESFOLDERS, $FLTAR_RECUR, $FLTAR_SORT, $FLTAR_FULLPATH) + If UBound($fArray) == 0 Then ContinueLoop + Local $data_size = $fArray[0] + If $data_size > $no_rotator Then + For $i = 1 To Number($data_size - $no_rotator) + Local $file_path = $fArray[$i] + If Not FileDelete($file_path) Then + SetLog(GetLangText("msgFailDel") & $file_path, $COLOR_RED) + EndIf + Next + EndIf + Next +EndFunc ;==>LootLogCleanup + diff --git a/COCBot/functions/Other/Pause.au3 b/COCBot/functions/Other/Pause.au3 index 89fc823..0b5e28a 100644 --- a/COCBot/functions/Other/Pause.au3 +++ b/COCBot/functions/Other/Pause.au3 @@ -1,9 +1,9 @@ -Func Pause() - Local $count = 0 - While GUICtrlRead($btnPause) = "Resume" - $count += 1 - If _Sleep(100) Then Return True - If Mod($count, 600) = 0 Then _BumpMouse() - WEnd - Return False -EndFunc ;==>Pause +Func Pause() + Local $count = 0 + While GUICtrlRead($btnPause) = "Resume" + $count += 1 + If _Sleep(100) Then Return True + If Mod($count, 600) = 0 Then _BumpMouse() + WEnd + Return False +EndFunc ;==>Pause diff --git a/COCBot/functions/Other/RandomGaussian.au3 b/COCBot/functions/Other/RandomGaussian.au3 index 879edd2..e4d1a2b 100644 --- a/COCBot/functions/Other/RandomGaussian.au3 +++ b/COCBot/functions/Other/RandomGaussian.au3 @@ -1,9 +1,9 @@ -Func _Random_Gaussian($nMean, $nSD) - Do - $nX = ((2 * Random()) - 1) - $nY = ((2 * Random()) - 1) - $nR = ($nX ^ 2) + ($nY ^ 2) - Until $nR < 1 - $nGaus = ($nX * (Sqrt((-2 * (Log($nR) / $nR))))) - Return ($nGaus * $nSD) + $nMean -EndFunc ;==>_Random_Gaussian +Func _Random_Gaussian($nMean, $nSD) + Do + $nX = ((2 * Random()) - 1) + $nY = ((2 * Random()) - 1) + $nR = ($nX ^ 2) + ($nY ^ 2) + Until $nR < 1 + $nGaus = ($nX * (Sqrt((-2 * (Log($nR) / $nR))))) + Return ($nGaus * $nSD) + $nMean +EndFunc ;==>_Random_Gaussian diff --git a/COCBot/functions/Other/RedLineDeploy.au3 b/COCBot/functions/Other/RedLineDeploy.au3 index 3b43dfa..5556674 100644 --- a/COCBot/functions/Other/RedLineDeploy.au3 +++ b/COCBot/functions/Other/RedLineDeploy.au3 @@ -1,278 +1,268 @@ -;Red border finding -Global $Grid[43][43][3] -$Grid[0][0][0] = 35 -$Grid[0][0][1] = 314 -$Grid[42][0][0] = 429 -$Grid[42][0][1] = 610 -$Grid[0][42][0] = 429 -$Grid[0][42][1] = 18 -$Grid[42][42][0] = 824 -$Grid[42][42][1] = 314 -For $i = 1 To 41 - $Grid[$i][0][0] = ($Grid[$i - 1][0][0] + (($Grid[42][0][0] - $Grid[0][0][0]) / 42)) - $Grid[$i][0][1] = ($Grid[$i - 1][0][1] + (($Grid[42][0][1] - $Grid[0][0][1]) / 42)) - $Grid[$i][42][0] = ($Grid[$i - 1][42][0] + (($Grid[42][42][0] - $Grid[0][42][0]) / 42)) - $Grid[$i][42][1] = ($Grid[$i - 1][42][1] + (($Grid[42][42][1] - $Grid[0][42][1]) / 42)) -Next -For $i = 0 To 42 - For $j = 1 To 41 - $Grid[$i][$j][0] = ($Grid[$i][0][0] + $j * (($Grid[$i][42][0] - $Grid[$i][0][0]) / 42)) - $Grid[$i][$j][1] = ($Grid[$i][0][1] + $j * (($Grid[$i][42][1] - $Grid[$i][0][1]) / 42)) - Next -Next -For $j = 0 To 42 - For $i = 0 To 42 - $Grid[$j][$i][0] = Round($Grid[$j][$i][0]) - $Grid[$j][$i][1] = Round($Grid[$j][$i][1]) - Next -Next -$AimCenter = 1 -$AimTH = 2 -$AimPoint = 3 - -Func RedLineDeploy($x, $y, $times = 1, $speed = 0, $CenteredOn = 1, $BufferDist = -1, $CenterX = 395, $CenterY = 314, $RandomizeBuffer = 6) - If $BufferDist - 1 Then $BufferDist = GUICtrlRead($sldAcc) + 10 - If $RandomizeBuffer > 0 Then - $BufferDist = $BufferDist + _Random_Gaussian($RandomizeBuffer / 2, $RandomizeBuffer / 6.2) ; Randomly distributes buffer zone from $BufferDist to $BufferDist + $RandomizeBuffer - EndIf - If $CenteredOn = $AimCenter Then - $AimX = $BaseCenter[0] - $AimY = $BaseCenter[1] - ElseIf $CenteredOn = $AimTH Then - $AimX = $THx - $AimY = $THy - ElseIf $CenteredOn = $AimPoint Then - $AimX = $CenterX - $AimY = $CenterY - Else - SetLog(GetLangText("msgBadCall")) - Return - EndIf - For $i = 0 To 41 - For $j = 0 To 41 - If ($Grid[$i][$j][2] > 0 And $Grid[$i][$j + 1][2] > 0) Then ; Up and to the right edges - If (($x < $Grid[$i][$j + 1][0]) And ($Grid[$i][$j][0] < $AimX)) Or (($x > $Grid[$i][$j][0]) And ($Grid[$i][$j + 1][0] > $AimX)) Then - If (($y < $Grid[$i][$j][1]) And ($Grid[$i][$j + 1][1] < $AimY)) Or (($y > $Grid[$i][$j + 1][1]) And ($Grid[$i][$j][1] > $AimY)) Then - $A1 = $AimY - $y - $B1 = $x - $AimX - $C1 = ($A1 * $x) + ($B1 * $y) - $A2 = $Grid[$i][$j + 1][1] - $Grid[$i][$j][1] - $B2 = $Grid[$i][$j][0] - $Grid[$i][$j + 1][0] - $C2 = ($A2 * $Grid[$i][$j][0]) + ($B2 * $Grid[$i][$j][1]) - If $A1 * $B2 <> $A2 * $B1 Then - $IntX = ($B2 * $C1 - $B1 * $C2) / ($A1 * $B2 - $A2 * $B1) - If $Grid[$i][$j][0] < $IntX And $IntX < $Grid[$i][$j + 1][0] Then - ; They cross, so lets make intersection the new aimed point - $AimX = ($B2 * $C1 - $B1 * $C2) / ($A1 * $B2 - $A2 * $B1) - $AimY = ($A1 * $C2 - $A2 * $C1) / ($A1 * $B2 - $A2 * $B1) - EndIf - EndIf - EndIf - EndIf - EndIf - If ($Grid[$i][$j][2] > 0 And $Grid[$i + 1][$j][2] > 0) Then ; Down and to the right edges - If (($x < $Grid[$i + 1][$j][0]) And ($Grid[$i][$j][0] < $AimX)) Or (($x > $Grid[$i][$j][0]) And ($Grid[$i + 1][$j][0] > $AimX)) Then - If (($y < $Grid[$i + 1][$j][1]) And ($Grid[$i][$j][1] < $AimY)) Or (($y > $Grid[$i][$j][1]) And ($Grid[$i + 1][$j][1] > $AimY)) Then - $A1 = $AimY - $y - $B1 = $x - $AimX - $C1 = ($A1 * $x) + ($B1 * $y) - $A2 = $Grid[$i + 1][$j][1] - $Grid[$i][$j][1] - $B2 = $Grid[$i][$j][0] - $Grid[$i + 1][$j][0] - $C2 = ($A2 * $Grid[$i][$j][0]) + ($B2 * $Grid[$i][$j][1]) - If $A1 * $B2 <> $A2 * $B1 Then - $IntX = ($B2 * $C1 - $B1 * $C2) / ($A1 * $B2 - $A2 * $B1) - If $Grid[$i][$j][0] < $IntX And $IntX < $Grid[$i + 1][$j][0] Then - ; They cross, so lets make intersection the new aimed point - $AimX = ($B2 * $C1 - $B1 * $C2) / ($A1 * $B2 - $A2 * $B1) - $AimY = ($A1 * $C2 - $A2 * $C1) / ($A1 * $B2 - $A2 * $B1) - EndIf - EndIf - EndIf - EndIf - EndIf - Next - Next - $j = 42 - For $i = 0 To 41 - If ($Grid[$i][$j][2] > 0 And $Grid[$i + 1][$j][2] > 0) Then ; Down and to the right edges - If (($x < $Grid[$i + 1][$j][0]) And ($Grid[$i][$j][0] < $AimX)) Or (($x > $Grid[$i][$j][0]) And ($Grid[$i + 1][$j][0] > $AimX)) Then - If (($y < $Grid[$i + 1][$j][1]) And ($Grid[$i][$j][1] < $AimY)) Or (($y > $Grid[$i][$j][1]) And ($Grid[$i + 1][$j][1] > $AimY)) Then - $A1 = $AimY - $y - $B1 = $x - $AimX - $C1 = ($A1 * $x) + ($B1 * $y) - $A2 = $Grid[$i + 1][$j][1] - $Grid[$i][$j][1] - $B2 = $Grid[$i][$j][0] - $Grid[$i + 1][$j][0] - $C2 = ($A2 * $Grid[$i][$j][0]) + ($B2 * $Grid[$i][$j][1]) - If $A1 * $B2 <> $A2 * $B1 Then - $IntX = ($B2 * $C1 - $B1 * $C2) / ($A1 * $B2 - $A2 * $B1) - If $Grid[$i][$j][0] < $IntX And $IntX < $Grid[$i + 1][$j][0] Then - ; They cross, so lets make intersection the new aimed point - $AimX = ($B2 * $C1 - $B1 * $C2) / ($A1 * $B2 - $A2 * $B1) - $AimY = ($A1 * $C2 - $A2 * $C1) / ($A1 * $B2 - $A2 * $B1) - EndIf - EndIf - EndIf - EndIf - EndIf - Next - $i = 42 - For $j = 0 To 41 - If ($Grid[$i][$j][2] > 0 And $Grid[$i][$j + 1][2] > 0) Then ; Up and to the right edges - If (($x < $Grid[$i][$j + 1][0]) And ($Grid[$i][$j][0] < $AimX)) Or (($x > $Grid[$i][$j][0]) And ($Grid[$i][$j + 1][0] > $AimX)) Then - If (($y < $Grid[$i][$j][1]) And ($Grid[$i][$j + 1][1] < $AimY)) Or (($y > $Grid[$i][$j + 1][1]) And ($Grid[$i][$j][1] > $AimY)) Then - $A1 = $AimY - $y - $B1 = $x - $AimX - $C1 = ($A1 * $x) + ($B1 * $y) - $A2 = $Grid[$i][$j + 1][1] - $Grid[$i][$j][1] - $B2 = $Grid[$i][$j][0] - $Grid[$i][$j + 1][0] - $C2 = ($A2 * $Grid[$i][$j][0]) + ($B2 * $Grid[$i][$j][1]) - If $A1 * $B2 <> $A2 * $B1 Then - $IntX = ($B2 * $C1 - $B1 * $C2) / ($A1 * $B2 - $A2 * $B1) - If $Grid[$i][$j][0] < $IntX And $IntX < $Grid[$i][$j + 1][0] Then - ; They cross, so lets make intersection the new aimed point - $AimX = ($B2 * $C1 - $B1 * $C2) / ($A1 * $B2 - $A2 * $B1) - $AimY = ($A1 * $C2 - $A2 * $C1) / ($A1 * $B2 - $A2 * $B1) - EndIf - EndIf - EndIf - EndIf - EndIf - Next - ; Now we are sitting right on top of the edge so let's move back a bit - $m = ($AimY - $y) / ($AimX - $x) - $Dist = _Random_Gaussian($BufferDist, 2) - $deltaX = (($Dist ^ 2) / (1 + $m ^ 2)) ^ .5 - If $AimX > $x Then $deltaX = $deltaX * -1 - If Abs($x - $AimX) < Abs($deltaX) Then - $AimX = Round($x) - $AimY = Round($y) - Else - $AimX = Round($AimX + $deltaX) - $AimY = Round($AimY + $m * $deltaX) - EndIf - - If $times <> 1 Then - For $i = 0 To ($times - 1) - ControlClick($Title, "", "", "left", "1", Random($AimX - 2, $AimX + 2, 1), Random($AimY - 2, $AimY + 2, 1)) - OverlayX(Random($AimX - 2, $AimX + 2, 1) - 2, Random($AimY - 2, $AimY + 2, 1) - 2, 5, 5, $GlobalColor, 1) - If Wave_Sleep(0) Then Return - Next - Else - ControlClick($Title, "", "", "left", "1", $AimX, $AimY) - OverlayX($AimX - 2, $AimY - 2, 5, 5, $GlobalColor, 1) - If Wave_Sleep(0) Then Return - EndIf -EndFunc ;==>RedLineDeploy - -Func SeekEdges() - Local $mH, $mS, $cl, $cr, $ci - - $cl = 1 - $cr = 1 - $ci = 1 - - If GUICtrlRead($sldAcc) < 10 Then - $mH = 65 + GUICtrlRead($sldAcc) - $mS = 135 - GUICtrlRead($sldAcc) - ElseIf GUICtrlRead($sldAcc) = 100 Then - For $i = 0 To 42 - For $j = 0 To 42 - $Grid[$i][$j][2] = 1 - Next - Next - Return - Else - $mH = 75 + 10 * ((GUICtrlRead($sldAcc) - 10) / 90) - $mS = 125 - 10 * ((GUICtrlRead($sldAcc) - 10) / 90) - EndIf - - ; Clear edge data - SetLog(GetLangText("msgAnalyzingBase"), $COLOR_BLUE) - For $i = 0 To 42 - For $j = 0 To 42 - $Grid[$i][$j][2] = 0 - Next - Next - - For $loop = 1 To 5 - _CaptureRegion() - $hCheckHBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap) - $ret = "" - $ret = DllCall(@ScriptDir & "\BrokenBot.org\BrokenBot32.dll", "str", "BrokenBotRedLineCheck", "ptr", $hCheckHBitmap, "int", $mH, "int", $mS, "int", $ci, "int", $cl, "int", $cr) - _WinAPI_DeleteObject($hCheckHBitmap) - - If IsArray($ret) Then - If $ret[0] = -2 Then - SetLog(GetLangText("msgLicense"), $COLOR_RED) - For $i = 0 To 42 - For $j = 0 To 42 - $Grid[$i][$j][2] = 1 - Next - Next - Else - $Array = StringSplit($ret[0], "|", 2) - For $i = 0 To (43 * 43) - 1 - If $Grid[Floor($i / 43)][Mod($i, 43)][2] = 0 Then - $Grid[Floor($i / 43)][Mod($i, 43)][2] = $Array[$i] - EndIf - Next - EndIf - Else - For $i = 0 To 42 - For $j = 0 To 42 - $Grid[$i][$j][2] = 1 - Next - Next - EndIf - For $i = 0 To 41 - For $j = 0 To 41 - If ($Grid[$i][$j][2] > 0 And $Grid[$i][$j + 1][2] > 0) Then ; Up and to the right edges - OverlayLine($Grid[$i][$j][0], $Grid[$i][$j][1], $Grid[$i][$j + 1][0], $Grid[$i][$j + 1][1], 0x22C0D9D9, 1) - EndIf - If ($Grid[$i][$j][2] > 0 And $Grid[$i + 1][$j][2] > 0) Then ; Down and to the right edges - OverlayLine($Grid[$i][$j][0], $Grid[$i][$j][1], $Grid[$i + 1][$j][0], $Grid[$i + 1][$j][1], 0x22C0D9D9, 1) - EndIf - Next - Next - $j = 42 - For $i = 0 To 41 - If ($Grid[$i][$j][2] > 0 And $Grid[$i + 1][$j][2] > 0) Then ; Down and to the right edges - OverlayLine($Grid[$i][$j][0], $Grid[$i][$j][1], $Grid[$i + 1][$j][0], $Grid[$i + 1][$j][1], 0x22C0D9D9, 1) - EndIf - Next - $i = 42 - For $j = 0 To 41 - If ($Grid[$i][$j][2] > 0 And $Grid[$i][$j + 1][2] > 0) Then ; Up and to the right edges - OverlayLine($Grid[$i][$j][0], $Grid[$i][$j][1], $Grid[$i][$j + 1][0], $Grid[$i][$j + 1][1], 0x22C0D9D9, 1) - EndIf - Next - Next - - FindCenter() - - SetLog(GetLangText("msgDone"), $COLOR_BLUE) -EndFunc ;==>SeekEdges - -Func FindCenter() - - Local $pointCount = 0 - Local $sumX = 0 - Local $sumY = 0 - For $i = 0 To 42 - For $j = 0 To 42 - If $Grid[$i][$j][2] > 0 Then - $pointCount += 1 - $sumX += $Grid[$i][$j][0] - $sumY += $Grid[$i][$j][1] - EndIf - Next - Next - If $sumX = 0 Then - $BaseCenter[0] = 395 - $BaseCenter[1] = 314 - Else - $BaseCenter[0] = Round($sumX / $pointCount) - $BaseCenter[1] = Round($sumY / $pointCount) - EndIf - -EndFunc ;==>FindCenter +;Red border finding +Global $Grid[43][43][3] +$Grid[0][0][0] = 35 +$Grid[0][0][1] = 314 +$Grid[42][0][0] = 429 +$Grid[42][0][1] = 610 +$Grid[0][42][0] = 429 +$Grid[0][42][1] = 18 +$Grid[42][42][0] = 824 +$Grid[42][42][1] = 314 +For $i = 1 To 41 + $Grid[$i][0][0] = ($Grid[$i - 1][0][0] + (($Grid[42][0][0] - $Grid[0][0][0]) / 42)) + $Grid[$i][0][1] = ($Grid[$i - 1][0][1] + (($Grid[42][0][1] - $Grid[0][0][1]) / 42)) + $Grid[$i][42][0] = ($Grid[$i - 1][42][0] + (($Grid[42][42][0] - $Grid[0][42][0]) / 42)) + $Grid[$i][42][1] = ($Grid[$i - 1][42][1] + (($Grid[42][42][1] - $Grid[0][42][1]) / 42)) +Next +For $i = 0 To 42 + For $j = 1 To 41 + $Grid[$i][$j][0] = ($Grid[$i][0][0] + $j * (($Grid[$i][42][0] - $Grid[$i][0][0]) / 42)) + $Grid[$i][$j][1] = ($Grid[$i][0][1] + $j * (($Grid[$i][42][1] - $Grid[$i][0][1]) / 42)) + Next +Next +For $j = 0 To 42 + For $i = 0 To 42 + $Grid[$j][$i][0] = Round($Grid[$j][$i][0]) + $Grid[$j][$i][1] = Round($Grid[$j][$i][1]) + Next +Next +$AimCenter = 1 +$AimTH = 2 +$AimPoint = 3 + +Func RedLineDeploy($x, $y, $times = 1, $speed = 0, $CenteredOn = 1, $BufferDist = -1, $CenterX = 395, $CenterY = 314, $RandomizeBuffer = 6) + If $BufferDist = - 1 Then $BufferDist = GUICtrlRead($sldAcc) + 10 + If $RandomizeBuffer > 0 Then + $BufferDist = $BufferDist + _Random_Gaussian($RandomizeBuffer / 2, $RandomizeBuffer / 6.2) ; Randomly distributes buffer zone from $BufferDist to $BufferDist + $RandomizeBuffer + EndIf + If $CenteredOn = $AimCenter Then + $AimX = $BaseCenter[0] + $AimY = $BaseCenter[1] + ElseIf $CenteredOn = $AimTH Then + $AimX = $THx + $AimY = $THy + ElseIf $CenteredOn = $AimPoint Then + $AimX = $CenterX + $AimY = $CenterY + Else + SetLog(GetLangText("msgBadCall")) + Return + EndIf + For $i = 0 To 41 + For $j = 0 To 41 + If ($Grid[$i][$j][2] > 0 And $Grid[$i][$j + 1][2] > 0) Then ; Up and to the right edges + If (($x < $Grid[$i][$j + 1][0]) And ($Grid[$i][$j][0] < $AimX)) Or (($x > $Grid[$i][$j][0]) And ($Grid[$i][$j + 1][0] > $AimX)) Then + If (($y < $Grid[$i][$j][1]) And ($Grid[$i][$j + 1][1] < $AimY)) Or (($y > $Grid[$i][$j + 1][1]) And ($Grid[$i][$j][1] > $AimY)) Then + $A1 = $AimY - $y + $B1 = $x - $AimX + $C1 = ($A1 * $x) + ($B1 * $y) + $A2 = $Grid[$i][$j + 1][1] - $Grid[$i][$j][1] + $B2 = $Grid[$i][$j][0] - $Grid[$i][$j + 1][0] + $C2 = ($A2 * $Grid[$i][$j][0]) + ($B2 * $Grid[$i][$j][1]) + If $A1 * $B2 <> $A2 * $B1 Then + $IntX = ($B2 * $C1 - $B1 * $C2) / ($A1 * $B2 - $A2 * $B1) + If $Grid[$i][$j][0] < $IntX And $IntX < $Grid[$i][$j + 1][0] Then + ; They cross, so lets make intersection the new aimed point + $AimX = ($B2 * $C1 - $B1 * $C2) / ($A1 * $B2 - $A2 * $B1) + $AimY = ($A1 * $C2 - $A2 * $C1) / ($A1 * $B2 - $A2 * $B1) + EndIf + EndIf + EndIf + EndIf + EndIf + If ($Grid[$i][$j][2] > 0 And $Grid[$i + 1][$j][2] > 0) Then ; Down and to the right edges + If (($x < $Grid[$i + 1][$j][0]) And ($Grid[$i][$j][0] < $AimX)) Or (($x > $Grid[$i][$j][0]) And ($Grid[$i + 1][$j][0] > $AimX)) Then + If (($y < $Grid[$i + 1][$j][1]) And ($Grid[$i][$j][1] < $AimY)) Or (($y > $Grid[$i][$j][1]) And ($Grid[$i + 1][$j][1] > $AimY)) Then + $A1 = $AimY - $y + $B1 = $x - $AimX + $C1 = ($A1 * $x) + ($B1 * $y) + $A2 = $Grid[$i + 1][$j][1] - $Grid[$i][$j][1] + $B2 = $Grid[$i][$j][0] - $Grid[$i + 1][$j][0] + $C2 = ($A2 * $Grid[$i][$j][0]) + ($B2 * $Grid[$i][$j][1]) + If $A1 * $B2 <> $A2 * $B1 Then + $IntX = ($B2 * $C1 - $B1 * $C2) / ($A1 * $B2 - $A2 * $B1) + If $Grid[$i][$j][0] < $IntX And $IntX < $Grid[$i + 1][$j][0] Then + ; They cross, so lets make intersection the new aimed point + $AimX = ($B2 * $C1 - $B1 * $C2) / ($A1 * $B2 - $A2 * $B1) + $AimY = ($A1 * $C2 - $A2 * $C1) / ($A1 * $B2 - $A2 * $B1) + EndIf + EndIf + EndIf + EndIf + EndIf + Next + Next + $j = 42 + For $i = 0 To 41 + If ($Grid[$i][$j][2] > 0 And $Grid[$i + 1][$j][2] > 0) Then ; Down and to the right edges + If (($x < $Grid[$i + 1][$j][0]) And ($Grid[$i][$j][0] < $AimX)) Or (($x > $Grid[$i][$j][0]) And ($Grid[$i + 1][$j][0] > $AimX)) Then + If (($y < $Grid[$i + 1][$j][1]) And ($Grid[$i][$j][1] < $AimY)) Or (($y > $Grid[$i][$j][1]) And ($Grid[$i + 1][$j][1] > $AimY)) Then + $A1 = $AimY - $y + $B1 = $x - $AimX + $C1 = ($A1 * $x) + ($B1 * $y) + $A2 = $Grid[$i + 1][$j][1] - $Grid[$i][$j][1] + $B2 = $Grid[$i][$j][0] - $Grid[$i + 1][$j][0] + $C2 = ($A2 * $Grid[$i][$j][0]) + ($B2 * $Grid[$i][$j][1]) + If $A1 * $B2 <> $A2 * $B1 Then + $IntX = ($B2 * $C1 - $B1 * $C2) / ($A1 * $B2 - $A2 * $B1) + If $Grid[$i][$j][0] < $IntX And $IntX < $Grid[$i + 1][$j][0] Then + ; They cross, so lets make intersection the new aimed point + $AimX = ($B2 * $C1 - $B1 * $C2) / ($A1 * $B2 - $A2 * $B1) + $AimY = ($A1 * $C2 - $A2 * $C1) / ($A1 * $B2 - $A2 * $B1) + EndIf + EndIf + EndIf + EndIf + EndIf + Next + $i = 42 + For $j = 0 To 41 + If ($Grid[$i][$j][2] > 0 And $Grid[$i][$j + 1][2] > 0) Then ; Up and to the right edges + If (($x < $Grid[$i][$j + 1][0]) And ($Grid[$i][$j][0] < $AimX)) Or (($x > $Grid[$i][$j][0]) And ($Grid[$i][$j + 1][0] > $AimX)) Then + If (($y < $Grid[$i][$j][1]) And ($Grid[$i][$j + 1][1] < $AimY)) Or (($y > $Grid[$i][$j + 1][1]) And ($Grid[$i][$j][1] > $AimY)) Then + $A1 = $AimY - $y + $B1 = $x - $AimX + $C1 = ($A1 * $x) + ($B1 * $y) + $A2 = $Grid[$i][$j + 1][1] - $Grid[$i][$j][1] + $B2 = $Grid[$i][$j][0] - $Grid[$i][$j + 1][0] + $C2 = ($A2 * $Grid[$i][$j][0]) + ($B2 * $Grid[$i][$j][1]) + If $A1 * $B2 <> $A2 * $B1 Then + $IntX = ($B2 * $C1 - $B1 * $C2) / ($A1 * $B2 - $A2 * $B1) + If $Grid[$i][$j][0] < $IntX And $IntX < $Grid[$i][$j + 1][0] Then + ; They cross, so lets make intersection the new aimed point + $AimX = ($B2 * $C1 - $B1 * $C2) / ($A1 * $B2 - $A2 * $B1) + $AimY = ($A1 * $C2 - $A2 * $C1) / ($A1 * $B2 - $A2 * $B1) + EndIf + EndIf + EndIf + EndIf + EndIf + Next + ; Now we are sitting right on top of the edge so let's move back a bit + $m = ($AimY - $y) / ($AimX - $x) + $Dist = _Random_Gaussian($BufferDist, 2) + $deltaX = (($Dist ^ 2) / (1 + $m ^ 2)) ^ .5 + If $AimX > $x Then $deltaX = $deltaX * -1 + If Abs($x - $AimX) < Abs($deltaX) Then + $AimX = Round($x) + $AimY = Round($y) + Else + $AimX = Round($AimX + $deltaX) + $AimY = Round($AimY + $m * $deltaX) + EndIf + + If $times <> 1 Then + For $i = 0 To ($times - 1) + ControlClick($Title, "", "", "left", "1", Random($AimX - 2, $AimX + 2, 1), Random($AimY - 2, $AimY + 2, 1)) + OverlayX(Random($AimX - 2, $AimX + 2, 1) - 2, Random($AimY - 2, $AimY + 2, 1) - 2, 5, 5, $GlobalColor, 1) + If Wave_Sleep(0) Then Return + Next + Else + ControlClick($Title, "", "", "left", "1", $AimX, $AimY) + OverlayX($AimX - 2, $AimY - 2, 5, 5, $GlobalColor, 1) + If Wave_Sleep(0) Then Return + EndIf +EndFunc ;==>RedLineDeploy + +Func SeekEdges() + Local $mH, $mS, $cl, $cr, $ci + + $cl = 1 + $cr = 1 + $ci = 1 + + If GUICtrlRead($sldAcc) < 10 Then + $mH = 65 + GUICtrlRead($sldAcc) + $mS = 135 - GUICtrlRead($sldAcc) + ElseIf GUICtrlRead($sldAcc) = 100 Then + For $i = 0 To 42 + For $j = 0 To 42 + $Grid[$i][$j][2] = 1 + Next + Next + FindCenter() + Return + Else + $mH = 75 + 10 * ((GUICtrlRead($sldAcc) - 10) / 90) + $mS = 125 - 10 * ((GUICtrlRead($sldAcc) - 10) / 90) + EndIf + + ; Clear edge data + SetLog(GetLangText("msgAnalyzingBase"), $COLOR_BLUE) + For $i = 0 To 42 + For $j = 0 To 42 + $Grid[$i][$j][2] = 0 + Next + Next + + For $loop = 1 To 5 + $ret = CallHelper("0 0 860 720 BrokenBotRedLineCheck " & $mH & " " & $mS & " " & $ci & " " & $cl & " " & $cr, 3) + + If $ret = $DLLLicense or $ret = $DLLFailed Or $ret = $DLLTimeout Then + If $ret = $DLLLicense Then SetLog(GetLangText("msgLicense"), $COLOR_RED) + For $i = 0 To 42 + For $j = 0 To 42 + $Grid[$i][$j][2] = 1 + Next + Next + Else + $Array = StringSplit($ret, "|", 2) + For $i = 0 To (43 * 43) - 1 + If $Grid[Floor($i / 43)][Mod($i, 43)][2] = 0 Then + $Grid[Floor($i / 43)][Mod($i, 43)][2] = $Array[$i] + EndIf + Next + EndIf + + For $i = 0 To 41 + For $j = 0 To 41 + If ($Grid[$i][$j][2] > 0 And $Grid[$i][$j + 1][2] > 0) Then ; Up and to the right edges + OverlayLine($Grid[$i][$j][0], $Grid[$i][$j][1], $Grid[$i][$j + 1][0], $Grid[$i][$j + 1][1], 0x22C0D9D9, 1) + EndIf + If ($Grid[$i][$j][2] > 0 And $Grid[$i + 1][$j][2] > 0) Then ; Down and to the right edges + OverlayLine($Grid[$i][$j][0], $Grid[$i][$j][1], $Grid[$i + 1][$j][0], $Grid[$i + 1][$j][1], 0x22C0D9D9, 1) + EndIf + Next + Next + $j = 42 + For $i = 0 To 41 + If ($Grid[$i][$j][2] > 0 And $Grid[$i + 1][$j][2] > 0) Then ; Down and to the right edges + OverlayLine($Grid[$i][$j][0], $Grid[$i][$j][1], $Grid[$i + 1][$j][0], $Grid[$i + 1][$j][1], 0x22C0D9D9, 1) + EndIf + Next + $i = 42 + For $j = 0 To 41 + If ($Grid[$i][$j][2] > 0 And $Grid[$i][$j + 1][2] > 0) Then ; Up and to the right edges + OverlayLine($Grid[$i][$j][0], $Grid[$i][$j][1], $Grid[$i][$j + 1][0], $Grid[$i][$j + 1][1], 0x22C0D9D9, 1) + EndIf + Next + Next + + FindCenter() + + SetLog(GetLangText("msgDone"), $COLOR_BLUE) +EndFunc ;==>SeekEdges + +Func FindCenter() + + Local $pointCount = 0 + Local $sumX = 0 + Local $sumY = 0 + For $i = 0 To 42 + For $j = 0 To 42 + If $Grid[$i][$j][2] > 0 Then + $pointCount += 1 + $sumX += $Grid[$i][$j][0] + $sumY += $Grid[$i][$j][1] + EndIf + Next + Next + If $sumX = 0 Then + $BaseCenter[0] = 395 + $BaseCenter[1] = 314 + Else + $BaseCenter[0] = Round($sumX / $pointCount) + $BaseCenter[1] = Round($sumY / $pointCount) + EndIf + +EndFunc ;==>FindCenter diff --git a/COCBot/functions/Other/SetLog.au3 b/COCBot/functions/Other/SetLog.au3 index f05891f..c53b627 100644 --- a/COCBot/functions/Other/SetLog.au3 +++ b/COCBot/functions/Other/SetLog.au3 @@ -1,23 +1,23 @@ -Func SetLog($String, $Color = 0x000000) ;Sets the text for the log - _GUICtrlRichEdit_AppendTextColor($txtLog, Time(), 0x000000) - _GUICtrlRichEdit_AppendTextColor($txtLog, $String & @CRLF, _ColorConvert($Color)) - _GUICtrlStatusBar_SetText($statLog, "Status : " & $String) - _FileWriteLog($hLogFileHandle, $String) -EndFunc ;==>SetLog - -Func _GUICtrlRichEdit_AppendTextColor($hWnd, $sText, $iColor) - Local $iLength = _GUICtrlRichEdit_GetTextLength($hWnd, True, True) - Local $iCp = _GUICtrlRichEdit_GetCharPosOfNextWord($hWnd, $iLength) - _GUICtrlRichEdit_SetFont($hWnd, $FontSize) - _GUICtrlRichEdit_AppendText($hWnd, $sText) - _GUICtrlRichEdit_SetSel($hWnd, $iCp - 1, $iLength + StringLen($sText)) - _GUICtrlRichEdit_SetCharColor($hWnd, $iColor) - _GUICtrlRichEdit_Deselect($hWnd) -EndFunc ;==>_GUICtrlRichEdit_AppendTextColor - -Func _ColorConvert($nColor);RGB to BGR or BGR to RGB - Return _ - BitOR(BitShift(BitAND($nColor, 0x000000FF), -16), _ - BitAND($nColor, 0x0000FF00), _ - BitShift(BitAND($nColor, 0x00FF0000), 16)) -EndFunc ;==>_ColorConvert +Func SetLog($String, $Color = 0x000000) ;Sets the text for the log + _GUICtrlRichEdit_AppendTextColor($txtLog, Time(), 0x000000) + _GUICtrlRichEdit_AppendTextColor($txtLog, $String & @CRLF, _ColorConvert($Color)) + _GUICtrlStatusBar_SetText($statLog, "Status : " & $String) + _FileWriteLog($hLogFileHandle, $String) +EndFunc ;==>SetLog + +Func _GUICtrlRichEdit_AppendTextColor($hWnd, $sText, $iColor) + Local $iLength = _GUICtrlRichEdit_GetTextLength($hWnd, True, True) + Local $iCp = _GUICtrlRichEdit_GetCharPosOfNextWord($hWnd, $iLength) + _GUICtrlRichEdit_SetFont($hWnd, $FontSize) + _GUICtrlRichEdit_AppendText($hWnd, $sText) + _GUICtrlRichEdit_SetSel($hWnd, $iCp - 1, $iLength + StringLen($sText)) + _GUICtrlRichEdit_SetCharColor($hWnd, $iColor) + _GUICtrlRichEdit_Deselect($hWnd) +EndFunc ;==>_GUICtrlRichEdit_AppendTextColor + +Func _ColorConvert($nColor);RGB to BGR or BGR to RGB + Return _ + BitOR(BitShift(BitAND($nColor, 0x000000FF), -16), _ + BitAND($nColor, 0x0000FF00), _ + BitShift(BitAND($nColor, 0x00FF0000), 16)) +EndFunc ;==>_ColorConvert diff --git a/COCBot/functions/Other/Tab.au3 b/COCBot/functions/Other/Tab.au3 index c5c95b0..4903b23 100644 --- a/COCBot/functions/Other/Tab.au3 +++ b/COCBot/functions/Other/Tab.au3 @@ -1,7 +1,7 @@ -Func Tab($a, $b) - $Tab = "" - For $i = StringLen($a) To $b Step 1 - $Tab &= " " - Next - Return $Tab -EndFunc ;==>Tab +Func Tab($a, $b) + $Tab = "" + For $i = StringLen($a) To $b Step 1 + $Tab &= " " + Next + Return $Tab +EndFunc ;==>Tab diff --git a/COCBot/functions/Other/Time.au3 b/COCBot/functions/Other/Time.au3 index 6abd9f5..7a7bb40 100644 --- a/COCBot/functions/Other/Time.au3 +++ b/COCBot/functions/Other/Time.au3 @@ -1,3 +1,3 @@ -Func Time() ;Gives the time in '[00:00:00 AM/PM]' format - Return "[" & _NowTime(3) & "] " -EndFunc ;==>Time +Func Time() ;Gives the time in '[00:00:00 AM/PM]' format + Return "[" & _NowTime(3) & "] " +EndFunc ;==>Time diff --git a/COCBot/functions/Other/WriteStats.au3 b/COCBot/functions/Other/WriteStats.au3 index 061af12..b19d4e7 100644 --- a/COCBot/functions/Other/WriteStats.au3 +++ b/COCBot/functions/Other/WriteStats.au3 @@ -1,12 +1,12 @@ -; Outputs stats of battles to log file -Func WriteStats($Skips, $EarnedGold, $EarnedElixir, $EarnedDark) - $sStatPath = $dirLogs & "Loot Results.csv" - If Not FileExists($sStatPath) Then - $hStatFileHandle = FileOpen($sStatPath, $FO_APPEND) - FileWriteLine($hStatFileHandle, "Time,SearchGold,SearchElixir,SearchDark,SearchTrophy,SearchTHLvl,SearchDead,SearchInside,NukeAttack,Skips,EarnedGold,EarnedElixir,EarnedDark") - Else - $hStatFileHandle = FileOpen($sStatPath, $FO_APPEND) - EndIf - FileWriteLine($hStatFileHandle, @YEAR & "-" & @MON & "-" & @MDAY & "_" & @HOUR & "." & @MIN & "." & @SEC & "," & $searchGold & "," & $searchElixir & "," & $searchDark & "," & $searchTrophy & "," & $searchTH & "," & $searchDead & "," & $THLoc & "," & $NukeAttack & "," & $Skips & "," & $EarnedGold & "," & $EarnedElixir & "," & $EarnedDark) - FileClose($hStatFileHandle) -EndFunc ;==>WriteStats +; Outputs stats of battles to log file +Func WriteStats($Skips, $EarnedGold, $EarnedElixir, $EarnedDark) + $sStatPath = $dirLogs & "Loot Results.csv" + If Not FileExists($sStatPath) Then + $hStatFileHandle = FileOpen($sStatPath, $FO_APPEND) + FileWriteLine($hStatFileHandle, "Time,SearchGold,SearchElixir,SearchDark,SearchTrophy,SearchTHLvl,SearchDead,SearchInside,NukeAttack,Skips,EarnedGold,EarnedElixir,EarnedDark") + Else + $hStatFileHandle = FileOpen($sStatPath, $FO_APPEND) + EndIf + FileWriteLine($hStatFileHandle, @YEAR & "-" & @MON & "-" & @MDAY & "_" & @HOUR & "." & @MIN & "." & @SEC & "," & $searchGold & "," & $searchElixir & "," & $searchDark & "," & $searchTrophy & "," & $searchTH & "," & $searchDead & "," & $THLoc & "," & $NukeAttack & "," & $Skips & "," & $EarnedGold & "," & $EarnedElixir & "," & $EarnedDark) + FileClose($hStatFileHandle) +EndFunc ;==>WriteStats diff --git a/COCBot/functions/Other/_NumberFormat.au3 b/COCBot/functions/Other/_NumberFormat.au3 index 6f1a895..5642c60 100644 --- a/COCBot/functions/Other/_NumberFormat.au3 +++ b/COCBot/functions/Other/_NumberFormat.au3 @@ -1,13 +1,13 @@ -; _NumberFormat - -Func _NumberFormat($Number = "") ; pad numbers with spaces as thousand separator - - If $Number = "" Then Return "" - - If StringLeft($Number, 1) = "-" Then - Return "- " & StringRegExpReplace(StringTrimLeft($Number, 1), "(\A\d{1,3}(?=(\d{3})+\z)|\d{3}(?=\d))", "\1 ") - Else - Return StringRegExpReplace($Number, "(\A\d{1,3}(?=(\d{3})+\z)|\d{3}(?=\d))", "\1 ") - EndIf - -EndFunc ;==>_NumberFormat +; _NumberFormat + +Func _NumberFormat($Number = "") ; pad numbers with spaces as thousand separator + + If $Number = "" Then Return "" + + If StringLeft($Number, 1) = "-" Then + Return "- " & StringRegExpReplace(StringTrimLeft($Number, 1), "(\A\d{1,3}(?=(\d{3})+\z)|\d{3}(?=\d))", "\1 ") + Else + Return StringRegExpReplace($Number, "(\A\d{1,3}(?=(\d{3})+\z)|\d{3}(?=\d))", "\1 ") + EndIf + +EndFunc ;==>_NumberFormat diff --git a/COCBot/functions/Other/_Sleep.au3 b/COCBot/functions/Other/_Sleep.au3 index 4776c32..4f28240 100644 --- a/COCBot/functions/Other/_Sleep.au3 +++ b/COCBot/functions/Other/_Sleep.au3 @@ -1,37 +1,37 @@ -; Pauses exectution for number of milliseconds -; Returns True if bot no longer running - -Func _Sleep($iDelay, $iSleep = True, $ReturnIfStopped = True) - Local $iBegin = TimerInit() - Local $count = 0 - While TimerDiff($iBegin) < $iDelay - If $ReturnIfStopped Then - If BitAND(GUICtrlGetState($btnStop), $GUI_HIDE) Then Return True - EndIf - While GUICtrlRead($btnPause) = "Resume" - $count += 1 - If Mod($count, 600) = 0 Then _BumpMouse() - If _GUICtrlTab_GetCurSel($tabMain) = 0 Then - ControlShow("", "", $txtLog) - Else - ControlHide("", "", $txtLog) - EndIf - If $iSleep = True Then _ModifiedSleep(50) - WEnd - If _GUICtrlTab_GetCurSel($tabMain) = 0 Then - ControlShow("", "", $txtLog) - Else - ControlHide("", "", $txtLog) - EndIf - If $iSleep = True Then - _ModifiedSleep(50) - Else - _ModifiedSleep(1) - EndIf - WEnd - Return False -EndFunc ;==>_Sleep - -Func _ModifiedSleep($T) - DllCall($KernelDLL, "none", "Sleep", "long", $T) +; Pauses exectution for number of milliseconds +; Returns True if bot no longer running + +Func _Sleep($iDelay, $iSleep = True, $ReturnIfStopped = True) + Local $iBegin = TimerInit() + Local $count = 0 + While TimerDiff($iBegin) < $iDelay + If $ReturnIfStopped Then + If BitAND(GUICtrlGetState($btnStop), $GUI_HIDE) Then Return True + EndIf + While GUICtrlRead($btnPause) = "Resume" + $count += 1 + If Mod($count, 600) = 0 Then _BumpMouse() + If _GUICtrlTab_GetCurSel($tabMain) = 0 Then + ControlShow("", "", $txtLog) + Else + ControlHide("", "", $txtLog) + EndIf + If $iSleep = True Then _ModifiedSleep(50) + WEnd + If _GUICtrlTab_GetCurSel($tabMain) = 0 Then + ControlShow("", "", $txtLog) + Else + ControlHide("", "", $txtLog) + EndIf + If $iSleep = True Then + _ModifiedSleep(50) + Else + _ModifiedSleep(1) + EndIf + WEnd + Return False +EndFunc ;==>_Sleep + +Func _ModifiedSleep($T) + DllCall($KernelDLL, "none", "Sleep", "long", $T) EndFunc ;==>_ModifiedSLeep \ No newline at end of file diff --git a/COCBot/functions/Other/getBSPos.au3 b/COCBot/functions/Other/getBSPos.au3 index 60e9a6b..aa5df5c 100644 --- a/COCBot/functions/Other/getBSPos.au3 +++ b/COCBot/functions/Other/getBSPos.au3 @@ -1,10 +1,10 @@ -Func getBSPos() - $aPos = ControlGetPos($Title, "", "[CLASS:BlueStacksApp; INSTANCE:1]") - $tPoint = DllStructCreate("int X;int Y") - DllStructSetData($tPoint, "X", $aPos[0]) - DllStructSetData($tPoint, "Y", $aPos[1]) - _WinAPI_ClientToScreen(WinGetHandle(WinGetTitle($Title)), $tPoint) - - $BSpos[0] = DllStructGetData($tPoint, "X") - $BSpos[1] = DllStructGetData($tPoint, "Y") -EndFunc ;==>getBSPos +Func getBSPos() + $aPos = ControlGetPos($Title, "", "[CLASS:BlueStacksApp; INSTANCE:1]") + $tPoint = DllStructCreate("int X;int Y") + DllStructSetData($tPoint, "X", $aPos[0]) + DllStructSetData($tPoint, "Y", $aPos[1]) + _WinAPI_ClientToScreen(WinGetHandle(WinGetTitle($Title)), $tPoint) + + $BSpos[0] = DllStructGetData($tPoint, "X") + $BSpos[1] = DllStructGetData($tPoint, "Y") +EndFunc ;==>getBSPos diff --git a/COCBot/functions/Other/stuckHandler.au3 b/COCBot/functions/Other/stuckHandler.au3 index d985b68..4c26861 100644 --- a/COCBot/functions/Other/stuckHandler.au3 +++ b/COCBot/functions/Other/stuckHandler.au3 @@ -1,25 +1,59 @@ -#include - -Func handleBarracksError($i) ;Sets the text for the log - If $i = 0 Then $brerror[0] = True - If $i = 1 Then $brerror[1] = True - If $i = 2 Then $brerror[2] = True - If $i = 3 Then $brerror[3] = True - - If $brerror[0] = True And $brerror[1] = True And $brerror[2] = True And $brerror[3] = True Then - SetLog(GetLangText("msgRestartBarracks"), $COLOR_RED) - Local $RestartApp = StringReplace(_WinAPI_GetProcessFileName(WinGetProcess($Title)), "Frontend", "Restart") - Run($RestartApp & " Android") - If _Sleep(10000) Then Return - Do - If _Sleep(5000) Then Return - Until ControlGetHandle($Title, "", "BlueStacksApp1") <> 0 - EndIf -EndFunc ;==>handleBarracksError - -Func resetBarracksError() - $brerror[0] = False - $brerror[1] = False - $brerror[2] = False - $brerror[3] = False -EndFunc ;==>resetBarracksError +#include + +Func restartBlueStack() ;Kill and Restart bluestack + If $PushBulletEnabled = 1 Then + Local $iCount = _FileCountLines($sLogPath) + Local $myLines = "" + Local $i + For $i = 1 to 5 + $myLines = $myLines & FileReadLine($sLogPath, ($iCount - 5 + $i)) & "\n" + Next + _Push(GetLangText("pushRestartBlueStack"), GetLangText("pushRestartBlueStackMSG") & _ + GetLangText("pushLast5Lines") & $myLines) + EndIf + SetLog(GetLangText("pushRestartBlueStack"), $COLOR_RED) + Local $BSFront = _WinAPI_GetProcessFileName(WinGetProcess($Title)) + Local $QuitApp = StringReplace($BSFront, "Frontend", "Quit") + Run($QuitApp) + Sleep(5000) + Local $RunApp = StringReplace($BSFront, "Frontend", "RunApp") + Run($RunApp & " -p com.supercell.clashofclans -a com.supercell.clashofclans.GameApp") + If _Sleep(10000) Then Return False + Local $protection = 0 + Do + If _Sleep(5000) Then Return False + $protection += 1 + Until (ControlGetHandle($Title, "", "BlueStacksApp1") <> 0) Or $protection >= 60 + If $protection >= 60 Then + SetLog("Listing all windows:") + Local $aList = WinList() + For $i = 1 To $aList[0][0] + SetLog("Title: " & $aList[$i][0] & " Handle: " & $aList[$i][1]) + Next + SetLog("Exists: " & WinExists($Title, "") + SetLog("Handle of control: " & ControlGetHandle($Title, "", "BlueStacksApp1") <> 0) + restartBlueStack() + Else + waitMainScreen() + EndIf + Return True +EndFunc ;==>restartBlueStack + +Func handleBarracksError($i) ;Sets the text for the log + If $i = 0 Then $brerror[0] = True + If $i = 1 Then $brerror[1] = True + If $i = 2 Then $brerror[2] = True + If $i = 3 Then $brerror[3] = True + + If $brerror[0] = True And $brerror[1] = True And $brerror[2] = True And $brerror[3] = True Then + SetLog(GetLangText("msgRestartBarracks"), $COLOR_RED) + If Not restartBlueStack() Then Return + EndIf +EndFunc ;==>handleBarracksError + +Func resetBarracksError() + $brerror[0] = False + $brerror[1] = False + $brerror[2] = False + $brerror[3] = False +EndFunc ;==>resetBarracksError diff --git a/COCBot/functions/Pixels/_CaptureRegion.au3 b/COCBot/functions/Pixels/_CaptureRegion.au3 index f8ed900..d6d36c1 100644 --- a/COCBot/functions/Pixels/_CaptureRegion.au3 +++ b/COCBot/functions/Pixels/_CaptureRegion.au3 @@ -1,37 +1,37 @@ -;Saves a screenshot of the window into memory. - -Func _CaptureRegion($iLeft = 0, $iTop = 0, $iRight = 860, $iBottom = 720, $ReturnBMP = False, $NeedMove = False) - _GDIPlus_BitmapDispose($hBitmap) - _WinAPI_DeleteObject($hHBitmap) - - If IsChecked($chkBackground) Then - Local $iW = Number($iRight) - Number($iLeft), $iH = Number($iBottom) - Number($iTop) - - Local $hDC_Capture = _WinAPI_GetWindowDC(ControlGetHandle($Title, "", "[CLASS:BlueStacksApp; INSTANCE:1]")) - Local $hMemDC = _WinAPI_CreateCompatibleDC($hDC_Capture) - $hHBitmap = _WinAPI_CreateCompatibleBitmap($hDC_Capture, $iW, $iH) - Local $hObjectOld = _WinAPI_SelectObject($hMemDC, $hHBitmap) - - DllCall("user32.dll", "int", "PrintWindow", "hwnd", $HWnD, "handle", $hMemDC, "int", 0) - _WinAPI_SelectObject($hMemDC, $hHBitmap) - _WinAPI_BitBlt($hMemDC, 0, 0, $iW, $iH, $hDC_Capture, $iLeft, $iTop, 0x00CC0020) - - Global $hBitmap = _GDIPlus_BitmapCreateFromHBITMAP($hHBitmap) - - _WinAPI_DeleteDC($hMemDC) - _WinAPI_SelectObject($hMemDC, $hObjectOld) - _WinAPI_ReleaseDC($HWnD, $hDC_Capture) - Else - If $OverlayVisible And $NeedMove Then - WinMove($frmOverlay, "", 10000, 10000, 860, 720) - EndIf - getBSPos() - $hHBitmap = _ScreenCapture_Capture("", $iLeft + $BSpos[0], $iTop + $BSpos[1], $iRight + $BSpos[0], $iBottom + $BSpos[1]) - Global $hBitmap = _GDIPlus_BitmapCreateFromHBITMAP($hHBitmap) - If $OverlayVisible And $NeedMove Then - WinMove($frmOverlay, "", $BSpos[0], $BSpos[1], 860, 720) - EndIf - EndIf - - If $ReturnBMP Then Return $hBitmap -EndFunc ;==>_CaptureRegion +;Saves a screenshot of the window into memory. + +Func _CaptureRegion($iLeft = 0, $iTop = 0, $iRight = 860, $iBottom = 720, $ReturnBMP = False, $NeedMove = False) + _GDIPlus_BitmapDispose($hBitmap) + _WinAPI_DeleteObject($hHBitmap) + + If IsChecked($chkBackground) Then + Local $iW = Number($iRight) - Number($iLeft), $iH = Number($iBottom) - Number($iTop) + + Local $hDC_Capture = _WinAPI_GetWindowDC(ControlGetHandle($Title, "", "[CLASS:BlueStacksApp; INSTANCE:1]")) + Local $hMemDC = _WinAPI_CreateCompatibleDC($hDC_Capture) + $hHBitmap = _WinAPI_CreateCompatibleBitmap($hDC_Capture, $iW, $iH) + Local $hObjectOld = _WinAPI_SelectObject($hMemDC, $hHBitmap) + + DllCall("user32.dll", "int", "PrintWindow", "hwnd", $HWnD, "handle", $hMemDC, "int", 0) + _WinAPI_SelectObject($hMemDC, $hHBitmap) + _WinAPI_BitBlt($hMemDC, 0, 0, $iW, $iH, $hDC_Capture, $iLeft, $iTop, 0x00CC0020) + + Global $hBitmap = _GDIPlus_BitmapCreateFromHBITMAP($hHBitmap) + + _WinAPI_DeleteDC($hMemDC) + _WinAPI_SelectObject($hMemDC, $hObjectOld) + _WinAPI_ReleaseDC($HWnD, $hDC_Capture) + Else + If $OverlayVisible And $NeedMove Then + WinMove($frmOverlay, "", 10000, 10000, 860, 720) + EndIf + getBSPos() + $hHBitmap = _ScreenCapture_Capture("", $iLeft + $BSpos[0], $iTop + $BSpos[1], $iRight + $BSpos[0], $iBottom + $BSpos[1]) + Global $hBitmap = _GDIPlus_BitmapCreateFromHBITMAP($hHBitmap) + If $OverlayVisible And $NeedMove Then + WinMove($frmOverlay, "", $BSpos[0], $BSpos[1], 860, 720) + EndIf + EndIf + + If $ReturnBMP Then Return $hBitmap +EndFunc ;==>_CaptureRegion diff --git a/COCBot/functions/Pixels/_ColorCheck.au3 b/COCBot/functions/Pixels/_ColorCheck.au3 index 8c9a0c5..d073d73 100644 --- a/COCBot/functions/Pixels/_ColorCheck.au3 +++ b/COCBot/functions/Pixels/_ColorCheck.au3 @@ -1,37 +1,37 @@ -;============================================================================================================== -;============================================================================================================== -;===Color Variation============================================================================================ -;-------------------------------------------------------------------------------------------------------------- -;Checks if the color components exceed $sVari and returns true if they are below $sVari. -;-------------------------------------------------------------------------------------------------------------- - -Func _ColorCheck($nColor1, $nColor2, $sVari = 5) - Local $Red1, $Red2, $Blue1, $Blue2, $Green1, $Green2 - - $Red1 = Dec(StringMid(String($nColor1), 1, 2)) - $Blue1 = Dec(StringMid(String($nColor1), 3, 2)) - $Green1 = Dec(StringMid(String($nColor1), 5, 2)) - - $Red2 = Dec(StringMid(String($nColor2), 1, 2)) - $Blue2 = Dec(StringMid(String($nColor2), 3, 2)) - $Green2 = Dec(StringMid(String($nColor2), 5, 2)) - - If Abs($Blue1 - $Blue2) > $sVari Then Return False - If Abs($Green1 - $Green2) > $sVari Then Return False - If Abs($Red1 - $Red2) > $sVari Then Return False - Return True -EndFunc ;==>_ColorCheck - -; CheckPixel : takes an array[4] as a parameter, [x, y, color, tolerance] -Func CheckPixel($tab) - If _ColorCheck(_GetPixelColor($tab[0], $tab[1]), Hex($tab[2], 6), $tab[3]) Then - Return True - Else - SetLog(GetLangText("msgLocationX") & $tab[0] & " Y:" & $tab[1], $COLOR_RED) - SetLog(GetLangText("msgGot") & _GetPixelColor($tab[0], $tab[1]), $COLOR_RED) - SetLog(GetLangText("msgWanted") & Hex($tab[2], 6), $COLOR_RED) - SetLog(GetLangText("msgVariance") & $tab[3], $COLOR_RED) - _GDIPlus_ImageSaveToFile($hBitmap, $dirDebug & "Missedcolor-" & $tab[0] & "-" & $tab[1] & "-" & Hex($tab[2], 6) & "-" & _GetPixelColor($tab[0], $tab[1]) & ".png") - Return False - EndIf -EndFunc ;==>CheckPixel +;============================================================================================================== +;============================================================================================================== +;===Color Variation============================================================================================ +;-------------------------------------------------------------------------------------------------------------- +;Checks if the color components exceed $sVari and returns true if they are below $sVari. +;-------------------------------------------------------------------------------------------------------------- + +Func _ColorCheck($nColor1, $nColor2, $sVari = 5) + Local $Red1, $Red2, $Blue1, $Blue2, $Green1, $Green2 + + $Red1 = Dec(StringMid(String($nColor1), 1, 2)) + $Blue1 = Dec(StringMid(String($nColor1), 3, 2)) + $Green1 = Dec(StringMid(String($nColor1), 5, 2)) + + $Red2 = Dec(StringMid(String($nColor2), 1, 2)) + $Blue2 = Dec(StringMid(String($nColor2), 3, 2)) + $Green2 = Dec(StringMid(String($nColor2), 5, 2)) + + If Abs($Blue1 - $Blue2) > $sVari Then Return False + If Abs($Green1 - $Green2) > $sVari Then Return False + If Abs($Red1 - $Red2) > $sVari Then Return False + Return True +EndFunc ;==>_ColorCheck + +; CheckPixel : takes an array[4] as a parameter, [x, y, color, tolerance] +Func CheckPixel($tab) + If _ColorCheck(_GetPixelColor($tab[0], $tab[1]), Hex($tab[2], 6), $tab[3]) Then + Return True + Else + SetLog(GetLangText("msgLocationX") & $tab[0] & " Y:" & $tab[1], $COLOR_RED) + SetLog(GetLangText("msgGot") & _GetPixelColor($tab[0], $tab[1]), $COLOR_RED) + SetLog(GetLangText("msgWanted") & Hex($tab[2], 6), $COLOR_RED) + SetLog(GetLangText("msgVariance") & $tab[3], $COLOR_RED) + _GDIPlus_ImageSaveToFile($hBitmap, $dirDebug & "Missedcolor-" & $tab[0] & "-" & $tab[1] & "-" & Hex($tab[2], 6) & "-" & _GetPixelColor($tab[0], $tab[1]) & ".png") + Return False + EndIf +EndFunc ;==>CheckPixel diff --git a/COCBot/functions/Pixels/_GetPixelColor.au3 b/COCBot/functions/Pixels/_GetPixelColor.au3 index d7885e1..89b226b 100644 --- a/COCBot/functions/Pixels/_GetPixelColor.au3 +++ b/COCBot/functions/Pixels/_GetPixelColor.au3 @@ -1,6 +1,6 @@ -;Returns color of pixel in the coordinations - -Func _GetPixelColor($iX, $iY) - Local $aPixelColor = _GDIPlus_BitmapGetPixel($hBitmap, $iX, $iY) - Return Hex($aPixelColor, 6) -EndFunc ;==>_GetPixelColor +;Returns color of pixel in the coordinations + +Func _GetPixelColor($iX, $iY) + Local $aPixelColor = _GDIPlus_BitmapGetPixel($hBitmap, $iX, $iY) + Return Hex($aPixelColor, 6) +EndFunc ;==>_GetPixelColor diff --git a/COCBot/functions/Pixels/_MultiPixelSearch.au3 b/COCBot/functions/Pixels/_MultiPixelSearch.au3 index ba5e6ba..ffd1a27 100644 --- a/COCBot/functions/Pixels/_MultiPixelSearch.au3 +++ b/COCBot/functions/Pixels/_MultiPixelSearch.au3 @@ -1,26 +1,26 @@ -;Uses multiple pixels with coordinates of each color in a certain region, works for memory BMP - -;$xSkip and $ySkip for numbers of pixels skip -;$offColor[2][COLOR/OFFSETX/OFFSETY] offset relative to firstColor coordination - -Func _MultiPixelSearch($iLeft, $iTop, $iRight, $iBottom, $xSkip, $ySkip, $firstColor, $offColor, $iColorVariation) - _CaptureRegion($iLeft, $iTop, $iRight, $iBottom) - For $x = 0 To $iRight - $iLeft Step $xSkip - For $y = 0 To $iBottom - $iTop Step $ySkip - If _ColorCheck(_GetPixelColor($x, $y), $firstColor, $iColorVariation) Then - Local $allchecked = True - For $i = 0 To UBound($offColor) - 1 - If _ColorCheck(_GetPixelColor($x + $offColor[$i][1], $y + $offColor[$i][2]), Hex($offColor[$i][0], 6), $iColorVariation) = False Then - $allchecked = False - ExitLoop - EndIf - Next - If $allchecked Then - Local $Pos[2] = [$iLeft + $x, $iTop + $y] - Return $Pos - EndIf - EndIf - Next - Next - Return 0 -EndFunc ;==>_MultiPixelSearch +;Uses multiple pixels with coordinates of each color in a certain region, works for memory BMP + +;$xSkip and $ySkip for numbers of pixels skip +;$offColor[2][COLOR/OFFSETX/OFFSETY] offset relative to firstColor coordination + +Func _MultiPixelSearch($iLeft, $iTop, $iRight, $iBottom, $xSkip, $ySkip, $firstColor, $offColor, $iColorVariation) + _CaptureRegion($iLeft, $iTop, $iRight, $iBottom) + For $x = 0 To $iRight - $iLeft Step $xSkip + For $y = 0 To $iBottom - $iTop Step $ySkip + If _ColorCheck(_GetPixelColor($x, $y), $firstColor, $iColorVariation) Then + Local $allchecked = True + For $i = 0 To UBound($offColor) - 1 + If _ColorCheck(_GetPixelColor($x + $offColor[$i][1], $y + $offColor[$i][2]), Hex($offColor[$i][0], 6), $iColorVariation) = False Then + $allchecked = False + ExitLoop + EndIf + Next + If $allchecked Then + Local $Pos[2] = [$iLeft + $x, $iTop + $y] + Return $Pos + EndIf + EndIf + Next + Next + Return 0 +EndFunc ;==>_MultiPixelSearch diff --git a/COCBot/functions/Pixels/_PixelSearch.au3 b/COCBot/functions/Pixels/_PixelSearch.au3 index 7436ad7..8fd443b 100644 --- a/COCBot/functions/Pixels/_PixelSearch.au3 +++ b/COCBot/functions/Pixels/_PixelSearch.au3 @@ -1,14 +1,14 @@ -;PixelSearch a certain region, works for memory BMP - -Func _PixelSearch($iLeft, $iTop, $iRight, $iBottom, $iColor, $iColorVariation) - _CaptureRegion($iLeft, $iTop, $iRight, $iBottom) - For $x = $iRight - $iLeft To 0 Step -1 - For $y = 0 To $iBottom - $iTop - If _ColorCheck(_GetPixelColor($x, $y), $iColor, $iColorVariation) Then - Local $Pos[2] = [$iLeft + $x, $iTop + $y] - Return $Pos - EndIf - Next - Next - Return 0 -EndFunc ;==>_PixelSearch +;PixelSearch a certain region, works for memory BMP + +Func _PixelSearch($iLeft, $iTop, $iRight, $iBottom, $iColor, $iColorVariation) + _CaptureRegion($iLeft, $iTop, $iRight, $iBottom) + For $x = $iRight - $iLeft To 0 Step -1 + For $y = 0 To $iBottom - $iTop + If _ColorCheck(_GetPixelColor($x, $y), $iColor, $iColorVariation) Then + Local $Pos[2] = [$iLeft + $x, $iTop + $y] + Return $Pos + EndIf + Next + Next + Return 0 +EndFunc ;==>_PixelSearch diff --git a/COCBot/functions/Pixels/boolPixelSearch.au3 b/COCBot/functions/Pixels/boolPixelSearch.au3 index 49f6b6b..6197773 100644 --- a/COCBot/functions/Pixels/boolPixelSearch.au3 +++ b/COCBot/functions/Pixels/boolPixelSearch.au3 @@ -1,10 +1,10 @@ -;============================================================================================================== -;===Check Pixels=============================================================================================== -;-------------------------------------------------------------------------------------------------------------- -;Using _ColorCheck, checks compares multiple pixels and returns true if they all pass _ColorCheck. -;-------------------------------------------------------------------------------------------------------------- - -Func boolPixelSearch($pixel1, $pixel2, $pixel3, $variation = 10) - If _ColorCheck(_GetPixelColor($pixel1[0], $pixel1[1]), $pixel1[2], $variation) And _ColorCheck(_GetPixelColor($pixel2[0], $pixel2[1]), $pixel2[2], $variation) And _ColorCheck(_GetPixelColor($pixel3[0], $pixel3[1]), $pixel3[2], $variation) Then Return True - Return False -EndFunc ;==>boolPixelSearch +;============================================================================================================== +;===Check Pixels=============================================================================================== +;-------------------------------------------------------------------------------------------------------------- +;Using _ColorCheck, checks compares multiple pixels and returns true if they all pass _ColorCheck. +;-------------------------------------------------------------------------------------------------------------- + +Func boolPixelSearch($pixel1, $pixel2, $pixel3, $variation = 10) + If _ColorCheck(_GetPixelColor($pixel1[0], $pixel1[1]), $pixel1[2], $variation) And _ColorCheck(_GetPixelColor($pixel2[0], $pixel2[1]), $pixel2[2], $variation) And _ColorCheck(_GetPixelColor($pixel3[0], $pixel3[1]), $pixel3[2], $variation) Then Return True + Return False +EndFunc ;==>boolPixelSearch diff --git a/COCBot/functions/Read Text/getChar.au3 b/COCBot/functions/Read Text/getChar.au3 index ca741cc..331198f 100644 --- a/COCBot/functions/Read Text/getChar.au3 +++ b/COCBot/functions/Read Text/getChar.au3 @@ -1,871 +1,871 @@ -;============================================================================================================== -;===Get Char============================================================================================= -;-------------------------------------------------------------------------------------------------------------- -;Finds pixel color pattern of specific X and Y values, returns char if pixel color pattern found. -;-------------------------------------------------------------------------------------------------------------- - -Func getChar(ByRef $x, $y) - Local $width = 0 - - ;search for 'A' - $width = 7 - Local $c1 = Hex(0xE7E7E7, 6), $c2 = Hex(0xDBDCDB, 6), $c3 = Hex(0xD5D6D5, 6) - For $i = 1 To 3 - Local $pixel1[3] = [$x + 1, $y + 8, $c1], $pixel2[3] = [$x + 5, $y + 7, $c2], $pixel3[3] = [$x + 6, $y + 8, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then - $x += $width - Return "A" - Else - $x += 1 - EndIf - Next - $x -= 3 - - ;search for 'a' - $width = 5 - Local $c1 = Hex(0xACAEAC, 6), $c2 = Hex(0xC2C3C2, 6), $c3 = Hex(0xDADBDA, 6) - For $i = 1 To 3 - Local $pixel1[3] = [$x + 5, $y + 3, $c1], $pixel2[3] = [$x + 1, $y + 4, $c2], $pixel3[3] = [$x + 4, $y + 7, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then - $x += $width - Return "a" - Else - $x += 1 - EndIf - Next - $x -= 3 - - ;search for 'B' - $width = 7 - Local $c1 = Hex(0xE2E3E2, 6), $c2 = Hex(0xFBFBFB, 6), $c3 = Hex(0xE8E9E8, 6) - For $i = 1 To 3 - Local $pixel1[3] = [$x + 6, $y + 1, $c1], $pixel2[3] = [$x + 1, $y + 1, $c2], $pixel3[3] = [$x + 3, $y + 4, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 2) Then - $x += $width - Return "B" - Else - $x += 1 - EndIf - Next - $x -= 3 - - ;search for 'b' - $width = 6 - Local $c1 = Hex(0x8D8F8D, 6), $c2 = Hex(0xCACBCA, 6), $c3 = Hex(0xFBFBFB, 6) - For $i = 1 To 3 - Local $pixel1[3] = [$x + 3, $y + 4, $c1], $pixel2[3] = [$x + 4, $y + 7, $c2], $pixel3[3] = [$x + 1, $y + 1, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then - $x += $width - Return "b" - Else - $x += 1 - EndIf - Next - $x -= 3 - - ;search for 'C' - $width = 6 - Local $c1 = Hex(0xE8E8E8, 6), $c2 = Hex(0xC9CAC9, 6), $c3 = Hex(0xDBDBDB, 6) - For $i = 1 To 3 - Local $pixel1[3] = [$x + 1, $y + 1, $c1], $pixel2[3] = [$x + 2, $y + 2, $c2], $pixel3[3] = [$x + 5, $y + 3, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then - $x += $width - Return "C" - Else - $x += 1 - EndIf - Next - $x -= 3 - - ;search for 'c' - $width = 5 - ;Local $c1 = Hex(0x818481, 6), $c2 = Hex(0x949694, 6), $c3 = Hex(0xECEDEC, 6) - Local $c1 = Hex(0x828481, 6), $c2 = Hex(0x939693, 6), $c3 = Hex(0xEEEEEE, 6) - For $i = 1 To 3 - Local $pixel1[3] = [$x + 3, $y + 2, $c1], $pixel2[3] = [$x + 5, $y + 8, $c2], $pixel3[3] = [$x + 4, $y + 4, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then - $x += $width - Return "c" - Else - $x += 1 - EndIf - Next - $x -= 3 - - ;search for 'c' - $width = 5 - Local $c1 = Hex(0x818481, 6), $c2 = Hex(0x949694, 6), $c3 = Hex(0xECEDEC, 6) - For $i = 1 To 3 - Local $pixel1[3] = [$x + 3, $y + 2, $c1], $pixel2[3] = [$x + 5, $y + 8, $c2], $pixel3[3] = [$x + 4, $y + 4, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then - $x += $width - Return "c" - Else - $x += 1 - EndIf - Next - $x -= 3 - - ;search for 'D' - $width = 6 - Local $c1 = Hex(0xACAEAC, 6), $c2 = Hex(0xA0A2A0, 6), $c3 = Hex(0xB6B8B6, 6) - For $i = 1 To 5 - Local $pixel1[3] = [$x + 3, $y + 7, $c1], $pixel2[3] = [$x + 6, $y + 1, $c2], $pixel3[3] = [$x + 2, $y + 3, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then - $x += $width - Return "D" - Else - $x += 1 - EndIf - Next - $x -= 5 - - ;search for 'd' - $width = 6 - Local $c1 = Hex(0x8D8F8D, 6), $c2 = Hex(0xE4E5E4, 6), $c3 = Hex(0xABADAB, 6) - For $i = 1 To 3 - Local $pixel1[3] = [$x + 3, $y + 4, $c1], $pixel2[3] = [$x + 4, $y + 7, $c2], $pixel3[3] = [$x + 1, $y + 3, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then - $x += $width - Return "d" - Else - $x += 1 - EndIf - Next - $x -= 3 - - ;search for 'E' - $width = 6 - Local $c1 = Hex(0xA5A7A5, 6), $c2 = Hex(0xC3C5C3, 6), $c3 = Hex(0x767976, 6) - For $i = 1 To 3 - Local $pixel1[3] = [$x + 2, $y + 6, $c1], $pixel2[3] = [$x + 2, $y + 2, $c2], $pixel3[3] = [$x + 3, $y + 0, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then - $x += $width - Return "E" - Else - $x += 1 - EndIf - Next - $x -= 3 - - ;search for 'e' - $width = 6 - Local $c1 = Hex(0x404440, 6), $c2 = Hex(0xF5F5F5, 6), $c3 = Hex(0x7B7D7B, 6) - For $i = 1 To 3 - Local $pixel1[3] = [$x + 1, $y + 2, $c1], $pixel2[3] = [$x + 2, $y + 3, $c2], $pixel3[3] = [$x + 4, $y + 6, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then - $x += $width - Return "e" - Else - $x += 1 - EndIf - Next - $x -= 3 - - ;search for 'F' - $width = 5 - Local $c1 = Hex(0x515451, 6), $c2 = Hex(0xE1E1E1, 6), $c3 = Hex(0xC6C7C6, 6) - For $i = 1 To 3 - Local $pixel1[3] = [$x + 3, $y + 2, $c1], $pixel2[3] = [$x + 1, $y + 8, $c2], $pixel3[3] = [$x + 5, $y + 1, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then - $x += $width - Return "F" - Else - $x += 1 - EndIf - Next - $x -= 3 - - ;search for 'f' - $width = 5 - Local $c1 = Hex(0xC4C5C4, 6), $c2 = Hex(0xBFC0BF, 6), $c3 = Hex(0x535653, 6) - For $i = 1 To 3 - Local $pixel1[3] = [$x + 5, $y + 1, $c1], $pixel2[3] = [$x + 2, $y + 4, $c2], $pixel3[3] = [$x + 2, $y + 8, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then - $x += $width - Return "f" - Else - $x += 1 - EndIf - Next - $x -= 3 - - ;search for 'G' - $width = 6 - Local $c1 = Hex(0x707370, 6), $c2 = Hex(0xC4C5C4, 6), $c3 = Hex(0xD1D2D1, 6) - For $i = 1 To 3 - Local $pixel1[3] = [$x + 4, $y + 4, $c1], $pixel2[3] = [$x + 3, $y + 0, $c2], $pixel3[3] = [$x + 4, $y + 5, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then - $x += $width - Return "G" - Else - $x += 1 - EndIf - Next - $x -= 3 - - ;search for 'g' - $width = 5 - Local $c1 = Hex(0xD7D8D7, 6), $c2 = Hex(0xF2F2F2, 6), $c3 = Hex(0xE6E7E6, 6) - For $i = 1 To 3 - Local $pixel1[3] = [$x + 1, $y + 9, $c1], $pixel2[3] = [$x + 4, $y + 9, $c2], $pixel3[3] = [$x + 4, $y + 4, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then - $x += $width - Return "g" - Else - $x += 1 - EndIf - Next - $x -= 3 - - ;search for 'H' - $width = 8 - Local $c1 = Hex(0x5F635F, 6), $c2 = Hex(0x464A46, 6), $c3 = Hex(0xFAFAFA, 6) - For $i = 1 To 3 - Local $pixel1[3] = [$x + 5, $y + 8, $c1], $pixel2[3] = [$x + 3, $y + 3, $c2], $pixel3[3] = [$x + 1, $y + 1, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then - $x += $width - Return "H" - Else - $x += 1 - EndIf - Next - $x -= 3 - - ;search for 'h' - $width = 6 - Local $c1 = Hex(0x818481, 6), $c2 = Hex(0xD3D4D3, 6), $c3 = Hex(0x646764, 6) - For $i = 1 To 3 - Local $pixel1[3] = [$x + 2, $y + 5, $c1], $pixel2[3] = [$x + 3, $y + 4, $c2], $pixel3[3] = [$x + 5, $y + 3, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then - $x += $width - Return "h" - Else - $x += 1 - EndIf - Next - $x -= 3 - - ;search for 'I' - $width = 2 - Local $c1 = Hex(0xFEFEFE, 6), $c2 = Hex(0xA3A5A3, 6), $c3 = Hex(0xE1E1E1, 6) - For $i = 1 To 3 - Local $pixel1[3] = [$x + 1, $y + 2, $c1], $pixel2[3] = [$x + 2, $y + 5, $c2], $pixel3[3] = [$x + 1, $y + 8, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then - $x += $width - Return "I" - Else - $x += 1 - EndIf - Next - $x -= 3 - - ;search for 'i' - $width = 2 - Local $c1 = Hex(0xF0F1F0, 6), $c2 = Hex(0x454945, 6), $c3 = Hex(0xE1E1E1, 6) - For $i = 1 To 3 - Local $pixel1[3] = [$x + 1, $y + 1, $c1], $pixel2[3] = [$x + 1, $y + 2, $c2], $pixel3[3] = [$x + 1, $y + 8, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then - $x += $width - Return "i" - Else - $x += 1 - EndIf - Next - $x -= 3 - - ;search for 'J' - $width = 6 - Local $c1 = Hex(0x8E908E, 6), $c2 = Hex(0xC4C5C4, 6), $c3 = Hex(0xFBFBFB, 6) - For $i = 1 To 3 - Local $pixel1[3] = [$x + 1, $y + 5, $c1], $pixel2[3] = [$x + 4, $y + 7, $c2], $pixel3[3] = [$x + 6, $y + 1, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then - $x += $width - Return "J" - Else - $x += 1 - EndIf - Next - $x -= 3 - - ;search for 'j' - $width = 2 - Local $c1 = Hex(0xA0A2A0, 6), $c2 = Hex(0xFDFDFD, 6), $c3 = Hex(0xFEFEFE, 6) - For $i = 1 To 3 - Local $pixel1[3] = [$x + 1, $y + 0, $c1], $pixel2[3] = [$x + 1, $y + 4, $c2], $pixel3[3] = [$x + 1, $y + 9, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then - $x += $width - Return "j" - Else - $x += 1 - EndIf - Next - $x -= 3 - - ;search for 'K' - $width = 7 - Local $c1 = Hex(0xC7C8C7, 6), $c2 = Hex(0x828482, 6), $c3 = Hex(0x7C7E7C, 6) - For $i = 1 To 3 - Local $pixel1[3] = [$x + 2, $y + 3, $c1], $pixel2[3] = [$x + 3, $y + 6, $c2], $pixel3[3] = [$x + 6, $y + 0, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then - $x += $width - Return "K" - Else - $x += 1 - EndIf - Next - $x -= 3 - - ;search for 'k' - $width = 5 - Local $c1 = Hex(0xFBFBFB, 6), $c2 = Hex(0x646764, 6), $c3 = Hex(0xDBDCDB, 6) - For $i = 1 To 3 - Local $pixel1[3] = [$x + 1, $y + 1, $c1], $pixel2[3] = [$x + 2, $y + 1, $c2], $pixel3[3] = [$x + 4, $y + 8, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then - $x += $width - Return "k" - Else - $x += 1 - EndIf - Next - $x -= 3 - - ;search for 'L' - $width = 4 - Local $c1 = Hex(0xFDFDFD, 6), $c2 = Hex(0x828482, 6), $c3 = Hex(0x646764, 6) - For $i = 1 To 3 - Local $pixel1[3] = [$x + 2, $y + 7, $c1], $pixel2[3] = [$x + 4, $y + 7, $c2], $pixel3[3] = [$x + 1, $y + 0, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then - $x += $width - Return "L" - Else - $x += 1 - EndIf - Next - $x -= 3 - - ;search for 'l' - $width = 2 - Local $c1 = Hex(0xFEFEFE, 6), $c2 = Hex(0x909290, 6), $c3 = Hex(0xFEFEFE, 6) - For $i = 1 To 3 - Local $pixel1[3] = [$x + 1, $y + 2, $c1], $pixel2[3] = [$x + 0, $y + 2, $c2], $pixel3[3] = [$x + 1, $y + 7, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then - $x += $width - Return "l" - Else - $x += 1 - EndIf - Next - $x -= 3 - - ;search for 'M' - $width = 10 - Local $c1 = Hex(0x8C8E8C, 6), $c2 = Hex(0x6A6D6A, 6), $c3 = Hex(0xA9ABA9, 6) - For $i = 1 To 3 - Local $pixel1[3] = [$x + 4, $y + 8, $c1], $pixel2[3] = [$x + 6, $y + 1, $c2], $pixel3[3] = [$x + 8, $y + 8, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then - $x += $width - Return "M" - Else - $x += 1 - EndIf - Next - $x -= 3 - - ;search for 'm' - $width = 10 - Local $c1 = Hex(0xD5D6D5, 6), $c2 = Hex(0x585C58, 6), $c3 = Hex(0xFFFFFF, 6) - For $i = 1 To 3 - Local $pixel1[3] = [$x + 1, $y + 8, $c1], $pixel2[3] = [$x + 7, $y + 2, $c2], $pixel3[3] = [$x + 5, $y + 4, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then - $x += $width - Return "m" - Else - $x += 1 - EndIf - Next - $x -= 3 - - ;search for 'N' - $width = 7 - Local $c1 = Hex(0x949694, 6), $c2 = Hex(0x707370, 6), $c3 = Hex(0xBFC0BF, 6) - For $i = 1 To 3 - Local $pixel1[3] = [$x + 3, $y + 1, $c1], $pixel2[3] = [$x + 5, $y + 4, $c2], $pixel3[3] = [$x + 6, $y + 1, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then - $x += $width - Return "N" - Else - $x += 1 - EndIf - Next - $x -= 3 - - ;search for 'n' - $width = 6 - Local $c1 = Hex(0xBEC0BE, 6), $c2 = Hex(0x8A8D8A, 6), $c3 = Hex(0x7A7D7A, 6) - For $i = 1 To 3 - Local $pixel1[3] = [$x + 5, $y + 3, $c1], $pixel2[3] = [$x + 4, $y + 8, $c2], $pixel3[3] = [$x + 2, $y + 5, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then - $x += $width - Return "n" - Else - $x += 1 - EndIf - Next - $x -= 3 - - ;search for 'O' - $width = 6 - Local $c1 = Hex(0xBBBDBB, 6), $c2 = Hex(0x888A88, 6), $c3 = Hex(0xD9DAD9, 6) - For $i = 1 To 3 - Local $pixel1[3] = [$x + 2, $y + 6, $c1], $pixel2[3] = [$x + 2, $y + 0, $c2], $pixel3[3] = [$x + 5, $y + 6, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then - $x += $width - Return "O" - Else - $x += 1 - EndIf - Next - $x -= 3 - - ;search for 'o' - $width = 6 - Local $c1 = Hex(0x888A88, 6), $c2 = Hex(0xA9ABA9, 6), $c3 = Hex(0x585C58, 6) - For $i = 1 To 3 - Local $pixel1[3] = [$x + 2, $y + 4, $c1], $pixel2[3] = [$x + 4, $y + 5, $c2], $pixel3[3] = [$x + 3, $y + 2, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then - $x += $width - Return "o" - Else - $x += 1 - EndIf - Next - $x -= 3 - - ;search for 'P' - $width = 6 - Local $c1 = Hex(0x636663, 6), $c2 = Hex(0x858785, 6), $c3 = Hex(0xE6E7E6, 6) - For $i = 1 To 3 - Local $pixel1[3] = [$x + 4, $y + 2, $c1], $pixel2[3] = [$x + 2, $y + 8, $c2], $pixel3[3] = [$x + 5, $y + 3, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then - $x += $width - Return "P" - Else - $x += 1 - EndIf - Next - $x -= 3 - - ;search for 'p' - $width = 5 - Local $c1 = Hex(0x8D908D, 6), $c2 = Hex(0xFFFFFF, 6), $c3 = Hex(0x898B89, 6) - For $i = 1 To 3 - Local $pixel1[3] = [$x + 2, $y + 4, $c1], $pixel2[3] = [$x + 1, $y + 10, $c2], $pixel3[3] = [$x + 5, $y + 3, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then - $x += $width - Return "p" - Else - $x += 1 - EndIf - Next - $x -= 3 - - ;search for 'Q' - $width = 7 - Local $c1 = Hex(0xE6E7E6, 6), $c2 = Hex(0xABADAB, 6), $c3 = Hex(0xFFFFFF, 6) - For $i = 1 To 3 - Local $pixel1[3] = [$x + 4, $y + 9, $c1], $pixel2[3] = [$x + 2, $y + 2, $c2], $pixel3[3] = [$x + 6, $y + 4, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then - $x += $width - Return "Q" - Else - $x += 1 - EndIf - Next - $x -= 3 - - ;search for 'q' - $width = 6 - Local $c1 = Hex(0x696C69, 6), $c2 = Hex(0xFFFFFF, 6), $c3 = Hex(0xC1C2C1, 6) - For $i = 1 To 3 - Local $pixel1[3] = [$x + 3, $y + 4, $c1], $pixel2[3] = [$x + 4, $y + 8, $c2], $pixel3[3] = [$x + 4, $y + 10, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then - $x += $width - Return "q" - Else - $x += 1 - EndIf - Next - $x -= 3 - - ;search for 'R' - $width = 7 - Local $c1 = Hex(0x575A57, 6), $c2 = Hex(0x939593, 6), $c3 = Hex(0xB8BAB8, 6) - For $i = 1 To 3 - Local $pixel1[3] = [$x + 4, $y + 2, $c1], $pixel2[3] = [$x + 3, $y + 6, $c2], $pixel3[3] = [$x + 6, $y + 1, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then - $x += $width - Return "R" - Else - $x += 1 - EndIf - Next - $x -= 3 - - ;search for 'r' - $width = 5 - Local $c1 = Hex(0x747774, 6), $c2 = Hex(0x5F635F, 6), $c3 = Hex(0x464A46, 6) - For $i = 1 To 3 - Local $pixel1[3] = [$x + 4, $y + 5, $c1], $pixel2[3] = [$x + 2, $y + 6, $c2], $pixel3[3] = [$x + 2, $y + 2, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then - $x += $width - Return "r" - Else - $x += 1 - EndIf - Next - $x -= 3 - - ;search for 'S' - $width = 7 - Local $c1 = Hex(0x8E908E, 6), $c2 = Hex(0x9C9E9C, 6), $c3 = Hex(0x7C7F7C, 6) - For $i = 1 To 3 - Local $pixel1[3] = [$x + 2, $y + 0, $c1], $pixel2[3] = [$x + 5, $y + 4, $c2], $pixel3[3] = [$x + 3, $y + 7, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then - $x += $width - Return "S" - Else - $x += 1 - EndIf - Next - $x -= 3 - - ;search for 's' - $width = 6 - Local $c1 = Hex(0x707370, 6), $c2 = Hex(0xC3C4C3, 6), $c3 = Hex(0x909290, 6) - For $i = 1 To 3 - Local $pixel1[3] = [$x + 2, $y + 2, $c1], $pixel2[3] = [$x + 4, $y + 4, $c2], $pixel3[3] = [$x + 2, $y + 7, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then - $x += $width - Return "s" - Else - $x += 1 - EndIf - Next - $x -= 3 - - ;search for 'T' - $width = 6 - $x -= 2 - Local $c1 = Hex(0x707370, 6), $c2 = Hex(0xB7B8B7, 6), $c3 = Hex(0x969896, 6) - For $i = 1 To 5 - Local $pixel1[3] = [$x + 1, $y + 0, $c1], $pixel2[3] = [$x + 4, $y + 2, $c2], $pixel3[3] = [$x + 2, $y + 8, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then - $x += $width - Return "T" - Else - $x += 1 - EndIf - Next - $x -= 3 - - ;search for 't' - $width = 6 - Local $c1 = Hex(0x767976, 6), $c2 = Hex(0xB6B8B6, 6), $c3 = Hex(0xA6A8A6, 6) - For $i = 1 To 3 - Local $pixel1[3] = [$x + 2, $y + 1, $c1], $pixel2[3] = [$x + 1, $y + 8, $c2], $pixel3[3] = [$x + 4, $y + 6, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then - $x += $width - Return "t" - Else - $x += 1 - EndIf - Next - $x -= 3 - - ;search for 'U' - $width = 7 - Local $c1 = Hex(0xFBFBFB, 6), $c2 = Hex(0x626562, 6), $c3 = Hex(0xBFC0BF, 6) - For $i = 1 To 3 - Local $pixel1[3] = [$x + 1, $y + 1, $c1], $pixel2[3] = [$x + 1, $y + 8, $c2], $pixel3[3] = [$x + 5, $y + 1, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then - $x += $width - Return "U" - Else - $x += 1 - EndIf - Next - $x -= 3 - - ;search for 'u' - $width = 6 - Local $c1 = Hex(0x525652, 6), $c2 = Hex(0xCBCCCB, 6), $c3 = Hex(0x888A88, 6) - For $i = 1 To 3 - Local $pixel1[3] = [$x + 2, $y + 3, $c1], $pixel2[3] = [$x + 2, $y + 7, $c2], $pixel3[3] = [$x + 4, $y + 3, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then - $x += $width - Return "u" - Else - $x += 1 - EndIf - Next - $x -= 3 - - ;search for 'V' - $width = 7 - Local $c1 = Hex(0x898C89, 6), $c2 = Hex(0x707370, 6), $c3 = Hex(0xE1E2E1, 6) - For $i = 1 To 3 - Local $pixel1[3] = [$x + 2, $y + 2, $c1], $pixel2[3] = [$x + 3, $y + 5, $c2], $pixel3[3] = [$x + 5, $y + 7, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then - $x += $width - Return "V" - Else - $x += 1 - EndIf - Next - $x -= 3 - - ;search for 'v' - $width = 6 - Local $c1 = Hex(0x595C59, 6), $c2 = Hex(0x525652, 6), $c3 = Hex(0xEEEEEE, 6) - For $i = 1 To 3 - Local $pixel1[3] = [$x + 2, $y + 3, $c1], $pixel2[3] = [$x + 3, $y + 6, $c2], $pixel3[3] = [$x + 5, $y + 3, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then - $x += $width - Return "v" - Else - $x += 1 - EndIf - Next - $x -= 3 - - ;search for 'W' - $width = 11 - Local $c1 = Hex(0xAEB0AE, 6), $c2 = Hex(0xC5C6C5, 6), $c3 = Hex(0x989A98, 6) - For $i = 1 To 3 - Local $pixel1[3] = [$x + 2, $y + 3, $c1], $pixel2[3] = [$x + 6, $y + 1, $c2], $pixel3[3] = [$x + 9, $y + 8, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then - $x += $width - Return "W" - Else - $x += 1 - EndIf - Next - $x -= 3 - - ;search for 'w' - $width = 9 - Local $c1 = Hex(0x8E918E, 6), $c2 = Hex(0x747674, 6), $c3 = Hex(0x797C79, 6) - For $i = 1 To 3 - Local $pixel1[3] = [$x + 3, $y + 5, $c1], $pixel2[3] = [$x + 5, $y + 7, $c2], $pixel3[3] = [$x + 8, $y + 8, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then - $x += $width - Return "w" - Else - $x += 1 - EndIf - Next - $x -= 3 - - ;search for 'X' - $width = 7 - Local $c1 = Hex(0x989B98, 6), $c2 = Hex(0x939593, 6), $c3 = Hex(0xB6B8B6, 6) - For $i = 1 To 3 - Local $pixel1[3] = [$x + 1, $y + 2, $c1], $pixel2[3] = [$x + 3, $y + 7, $c2], $pixel3[3] = [$x + 5, $y + 4, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then - $x += $width - Return "X" - Else - $x += 1 - EndIf - Next - $x -= 3 - - ;search for 'x' - $width = 6 - Local $c1 = Hex(0x8C8E8C, 6), $c2 = Hex(0x9EA09E, 6), $c3 = Hex(0x4C4F4C, 6) - For $i = 1 To 3 - Local $pixel1[3] = [$x + 1, $y + 4, $c1], $pixel2[3] = [$x + 2, $y + 8, $c2], $pixel3[3] = [$x + 5, $y + 6, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then - $x += $width - Return "x" - Else - $x += 1 - EndIf - Next - $x -= 3 - - ;search for 'Y' - $width = 7 - Local $c1 = Hex(0xA1A3A1, 6), $c2 = Hex(0x8C8E8C, 6), $c3 = Hex(0xD5D6D5, 6) - For $i = 1 To 3 - Local $pixel1[3] = [$x + 2, $y + 1, $c1], $pixel2[3] = [$x + 5, $y + 5, $c2], $pixel3[3] = [$x + 3, $y + 8, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then - $x += $width - Return "Y" - Else - $x += 1 - EndIf - Next - $x -= 3 - - ;search for 'y' - $width = 6 - Local $c1 = Hex(0x5D615D, 6), $c2 = Hex(0xEEEEEE, 6), $c3 = Hex(0xE8E9E8, 6) - For $i = 1 To 3 - Local $pixel1[3] = [$x + 1, $y + 8, $c1], $pixel2[3] = [$x + 3, $y + 7, $c2], $pixel3[3] = [$x + 3, $y + 10, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then - $x += $width - Return "y" - Else - $x += 1 - EndIf - Next - $x -= 3 - - ;search for 'Z' - $width = 7 - Local $c1 = Hex(0x505450, 6), $c2 = Hex(0x707370, 6), $c3 = Hex(0x888B88, 6) - For $i = 1 To 3 - Local $pixel1[3] = [$x + 2, $y + 2, $c1], $pixel2[3] = [$x + 1, $y + 7, $c2], $pixel3[3] = [$x + 5, $y + 7, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then - $x += $width - Return "Z" - Else - $x += 1 - EndIf - Next - $x -= 3 - - ;search for 'z' - $width = 4 - Local $c1 = Hex(0x757775, 6), $c2 = Hex(0x757875, 6), $c3 = Hex(0xDADBDA, 6) - For $i = 1 To 3 - Local $pixel1[3] = [$x + 1, $y + 4, $c1], $pixel2[3] = [$x + 3, $y + 5, $c2], $pixel3[3] = [$x + 2, $y + 8, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then - $x += $width - Return "z" - Else - $x += 1 - EndIf - Next - $x -= 3 - - ;search for ',' - $width = 3 - Local $c1 = Hex(0xE8E8E8, 6), $c2 = Hex(0xFEFEFE, 6), $c3 = Hex(0xA5A7A5, 6) - For $i = 1 To 3 - Local $pixel1[3] = [$x + 1, $y + 7, $c1], $pixel2[3] = [$x + 1, $y + 8, $c2], $pixel3[3] = [$x + 1, $y + 9, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then - $x += $width - Return "," - Else - $x += 1 - EndIf - Next - $x -= 3 - - ;search for '{space}' - $width = 2 - ;Local $c1 = Hex(0x404440, 6), $c2 = Hex(0x404440, 6), $c3 = Hex(0x404440, 6) - Local $c1 = Hex(0x3F4440, 6), $c2 = Hex(0x3F4440, 6), $c3 = Hex(0x3F4440, 6) - For $i = 1 To 3 - Local $pixel1[3] = [$x + 1, $y + 3, $c1], $pixel2[3] = [$x + 1, $y + 7, $c2], $pixel3[3] = [$x + 2, $y + 5, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then - $x += $width - Return " " - Else - $x += 1 - EndIf - Next - $x -= 3 - - ;============================Numbers on requests as strings ====================================================== - ;search for '1' - $width = 2 - Local $c1 = Hex(0xFBFBFB, 6), $c2 = Hex(0xBBBCBB, 6), $c3 = Hex(0xFFFFFF, 6) - For $i = 1 To 3 - Local $pixel1[3] = [$x + 1, $y + 1, $c1], $pixel2[3] = [$x + 1, $y + 6, $c2], $pixel3[3] = [$x + 2, $y + 4, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then - $x += $width - Return "1" - Else - $x += 1 - EndIf - Next - $x -= 3 - - ;search for '2 Not at the beginning of the line !' - $width = 7 - Local $c1 = Hex(0xBEBFBE, 6), $c2 = Hex(0xFFFFFF, 6), $c3 = Hex(0x8F918F, 6) - For $i = 1 To 3 - Local $pixel1[3] = [$x + 3, $y + 2, $c1], $pixel2[3] = [$x + 2, $y + 7, $c2], $pixel3[3] = [$x + 7, $y + 1, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then - $x += $width - Return "2" - Else - $x += 1 - EndIf - Next - $x -= 3 - - - $width = 6 - Local $c1 = Hex(0xBEBFBE, 6), $c2 = Hex(0xFFFFFF, 6), $c3 = Hex(0x8F918F, 6) - For $i = 1 To 3 - Local $pixel1[3] = [$x + 2, $y + 2, $c1], $pixel2[3] = [$x + 1, $y + 7, $c2], $pixel3[3] = [$x + 6, $y + 1, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then - $x += $width - Return "2" - Else - $x += 1 - EndIf - Next - $x -= 3 - - ;search for '3' - $width = 6 - Local $c1 = Hex(0xFEFEFE, 6), $c2 = Hex(0x888A88, 6), $c3 = Hex(0xF8F8F8, 6) - For $i = 1 To 3 - Local $pixel1[3] = [$x + 1, $y + 2, $c1], $pixel2[3] = [$x + 4, $y + 3, $c2], $pixel3[3] = [$x + 5, $y + 2, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then - $x += $width - Return "3" - Else - $x += 1 - EndIf - Next - $x -= 3 - - ;search for '4' - $width = 7 - Local $c1 = Hex(0xA0A2A0, 6), $c2 = Hex(0xFBFBFB, 6), $c3 = Hex(0x7E817E, 6) - For $i = 1 To 3 - Local $pixel1[3] = [$x + 2, $y + 3, $c1], $pixel2[3] = [$x + 4, $y + 1, $c2], $pixel3[3] = [$x + 7, $y + 3, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then - $x += $width - Return "4" - Else - $x += 1 - EndIf - Next - $x -= 3 - - ;search for '5' - $width = 6 - Local $c1 = Hex(0xFEFEFE, 6), $c2 = Hex(0x777A77, 6), $c3 = Hex(0xE6E7E6, 6) - For $i = 1 To 3 - Local $pixel1[3] = [$x + 1, $y + 3, $c1], $pixel2[3] = [$x + 3, $y + 3, $c2], $pixel3[3] = [$x + 5, $y + 6, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then - $x += $width - Return "5" - Else - $x += 1 - EndIf - Next - $x -= 3 - - - - Return "|" -EndFunc ;==>getChar +;============================================================================================================== +;===Get Char============================================================================================= +;-------------------------------------------------------------------------------------------------------------- +;Finds pixel color pattern of specific X and Y values, returns char if pixel color pattern found. +;-------------------------------------------------------------------------------------------------------------- + +Func getChar(ByRef $x, $y) + Local $width = 0 + + ;search for 'A' + $width = 7 + Local $c1 = Hex(0xE7E7E7, 6), $c2 = Hex(0xDBDCDB, 6), $c3 = Hex(0xD5D6D5, 6) + For $i = 1 To 3 + Local $pixel1[3] = [$x + 1, $y + 8, $c1], $pixel2[3] = [$x + 5, $y + 7, $c2], $pixel3[3] = [$x + 6, $y + 8, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then + $x += $width + Return "A" + Else + $x += 1 + EndIf + Next + $x -= 3 + + ;search for 'a' + $width = 5 + Local $c1 = Hex(0xACAEAC, 6), $c2 = Hex(0xC2C3C2, 6), $c3 = Hex(0xDADBDA, 6) + For $i = 1 To 3 + Local $pixel1[3] = [$x + 5, $y + 3, $c1], $pixel2[3] = [$x + 1, $y + 4, $c2], $pixel3[3] = [$x + 4, $y + 7, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then + $x += $width + Return "a" + Else + $x += 1 + EndIf + Next + $x -= 3 + + ;search for 'B' + $width = 7 + Local $c1 = Hex(0xE2E3E2, 6), $c2 = Hex(0xFBFBFB, 6), $c3 = Hex(0xE8E9E8, 6) + For $i = 1 To 3 + Local $pixel1[3] = [$x + 6, $y + 1, $c1], $pixel2[3] = [$x + 1, $y + 1, $c2], $pixel3[3] = [$x + 3, $y + 4, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 2) Then + $x += $width + Return "B" + Else + $x += 1 + EndIf + Next + $x -= 3 + + ;search for 'b' + $width = 6 + Local $c1 = Hex(0x8D8F8D, 6), $c2 = Hex(0xCACBCA, 6), $c3 = Hex(0xFBFBFB, 6) + For $i = 1 To 3 + Local $pixel1[3] = [$x + 3, $y + 4, $c1], $pixel2[3] = [$x + 4, $y + 7, $c2], $pixel3[3] = [$x + 1, $y + 1, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then + $x += $width + Return "b" + Else + $x += 1 + EndIf + Next + $x -= 3 + + ;search for 'C' + $width = 6 + Local $c1 = Hex(0xE8E8E8, 6), $c2 = Hex(0xC9CAC9, 6), $c3 = Hex(0xDBDBDB, 6) + For $i = 1 To 3 + Local $pixel1[3] = [$x + 1, $y + 1, $c1], $pixel2[3] = [$x + 2, $y + 2, $c2], $pixel3[3] = [$x + 5, $y + 3, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then + $x += $width + Return "C" + Else + $x += 1 + EndIf + Next + $x -= 3 + + ;search for 'c' + $width = 5 + ;Local $c1 = Hex(0x818481, 6), $c2 = Hex(0x949694, 6), $c3 = Hex(0xECEDEC, 6) + Local $c1 = Hex(0x828481, 6), $c2 = Hex(0x939693, 6), $c3 = Hex(0xEEEEEE, 6) + For $i = 1 To 3 + Local $pixel1[3] = [$x + 3, $y + 2, $c1], $pixel2[3] = [$x + 5, $y + 8, $c2], $pixel3[3] = [$x + 4, $y + 4, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then + $x += $width + Return "c" + Else + $x += 1 + EndIf + Next + $x -= 3 + + ;search for 'c' + $width = 5 + Local $c1 = Hex(0x818481, 6), $c2 = Hex(0x949694, 6), $c3 = Hex(0xECEDEC, 6) + For $i = 1 To 3 + Local $pixel1[3] = [$x + 3, $y + 2, $c1], $pixel2[3] = [$x + 5, $y + 8, $c2], $pixel3[3] = [$x + 4, $y + 4, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then + $x += $width + Return "c" + Else + $x += 1 + EndIf + Next + $x -= 3 + + ;search for 'D' + $width = 6 + Local $c1 = Hex(0xACAEAC, 6), $c2 = Hex(0xA0A2A0, 6), $c3 = Hex(0xB6B8B6, 6) + For $i = 1 To 5 + Local $pixel1[3] = [$x + 3, $y + 7, $c1], $pixel2[3] = [$x + 6, $y + 1, $c2], $pixel3[3] = [$x + 2, $y + 3, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then + $x += $width + Return "D" + Else + $x += 1 + EndIf + Next + $x -= 5 + + ;search for 'd' + $width = 6 + Local $c1 = Hex(0x8D8F8D, 6), $c2 = Hex(0xE4E5E4, 6), $c3 = Hex(0xABADAB, 6) + For $i = 1 To 3 + Local $pixel1[3] = [$x + 3, $y + 4, $c1], $pixel2[3] = [$x + 4, $y + 7, $c2], $pixel3[3] = [$x + 1, $y + 3, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then + $x += $width + Return "d" + Else + $x += 1 + EndIf + Next + $x -= 3 + + ;search for 'E' + $width = 6 + Local $c1 = Hex(0xA5A7A5, 6), $c2 = Hex(0xC3C5C3, 6), $c3 = Hex(0x767976, 6) + For $i = 1 To 3 + Local $pixel1[3] = [$x + 2, $y + 6, $c1], $pixel2[3] = [$x + 2, $y + 2, $c2], $pixel3[3] = [$x + 3, $y + 0, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then + $x += $width + Return "E" + Else + $x += 1 + EndIf + Next + $x -= 3 + + ;search for 'e' + $width = 6 + Local $c1 = Hex(0x404440, 6), $c2 = Hex(0xF5F5F5, 6), $c3 = Hex(0x7B7D7B, 6) + For $i = 1 To 3 + Local $pixel1[3] = [$x + 1, $y + 2, $c1], $pixel2[3] = [$x + 2, $y + 3, $c2], $pixel3[3] = [$x + 4, $y + 6, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then + $x += $width + Return "e" + Else + $x += 1 + EndIf + Next + $x -= 3 + + ;search for 'F' + $width = 5 + Local $c1 = Hex(0x515451, 6), $c2 = Hex(0xE1E1E1, 6), $c3 = Hex(0xC6C7C6, 6) + For $i = 1 To 3 + Local $pixel1[3] = [$x + 3, $y + 2, $c1], $pixel2[3] = [$x + 1, $y + 8, $c2], $pixel3[3] = [$x + 5, $y + 1, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then + $x += $width + Return "F" + Else + $x += 1 + EndIf + Next + $x -= 3 + + ;search for 'f' + $width = 5 + Local $c1 = Hex(0xC4C5C4, 6), $c2 = Hex(0xBFC0BF, 6), $c3 = Hex(0x535653, 6) + For $i = 1 To 3 + Local $pixel1[3] = [$x + 5, $y + 1, $c1], $pixel2[3] = [$x + 2, $y + 4, $c2], $pixel3[3] = [$x + 2, $y + 8, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then + $x += $width + Return "f" + Else + $x += 1 + EndIf + Next + $x -= 3 + + ;search for 'G' + $width = 6 + Local $c1 = Hex(0x707370, 6), $c2 = Hex(0xC4C5C4, 6), $c3 = Hex(0xD1D2D1, 6) + For $i = 1 To 3 + Local $pixel1[3] = [$x + 4, $y + 4, $c1], $pixel2[3] = [$x + 3, $y + 0, $c2], $pixel3[3] = [$x + 4, $y + 5, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then + $x += $width + Return "G" + Else + $x += 1 + EndIf + Next + $x -= 3 + + ;search for 'g' + $width = 5 + Local $c1 = Hex(0xD7D8D7, 6), $c2 = Hex(0xF2F2F2, 6), $c3 = Hex(0xE6E7E6, 6) + For $i = 1 To 3 + Local $pixel1[3] = [$x + 1, $y + 9, $c1], $pixel2[3] = [$x + 4, $y + 9, $c2], $pixel3[3] = [$x + 4, $y + 4, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then + $x += $width + Return "g" + Else + $x += 1 + EndIf + Next + $x -= 3 + + ;search for 'H' + $width = 8 + Local $c1 = Hex(0x5F635F, 6), $c2 = Hex(0x464A46, 6), $c3 = Hex(0xFAFAFA, 6) + For $i = 1 To 3 + Local $pixel1[3] = [$x + 5, $y + 8, $c1], $pixel2[3] = [$x + 3, $y + 3, $c2], $pixel3[3] = [$x + 1, $y + 1, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then + $x += $width + Return "H" + Else + $x += 1 + EndIf + Next + $x -= 3 + + ;search for 'h' + $width = 6 + Local $c1 = Hex(0x818481, 6), $c2 = Hex(0xD3D4D3, 6), $c3 = Hex(0x646764, 6) + For $i = 1 To 3 + Local $pixel1[3] = [$x + 2, $y + 5, $c1], $pixel2[3] = [$x + 3, $y + 4, $c2], $pixel3[3] = [$x + 5, $y + 3, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then + $x += $width + Return "h" + Else + $x += 1 + EndIf + Next + $x -= 3 + + ;search for 'I' + $width = 2 + Local $c1 = Hex(0xFEFEFE, 6), $c2 = Hex(0xA3A5A3, 6), $c3 = Hex(0xE1E1E1, 6) + For $i = 1 To 3 + Local $pixel1[3] = [$x + 1, $y + 2, $c1], $pixel2[3] = [$x + 2, $y + 5, $c2], $pixel3[3] = [$x + 1, $y + 8, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then + $x += $width + Return "I" + Else + $x += 1 + EndIf + Next + $x -= 3 + + ;search for 'i' + $width = 2 + Local $c1 = Hex(0xF0F1F0, 6), $c2 = Hex(0x454945, 6), $c3 = Hex(0xE1E1E1, 6) + For $i = 1 To 3 + Local $pixel1[3] = [$x + 1, $y + 1, $c1], $pixel2[3] = [$x + 1, $y + 2, $c2], $pixel3[3] = [$x + 1, $y + 8, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then + $x += $width + Return "i" + Else + $x += 1 + EndIf + Next + $x -= 3 + + ;search for 'J' + $width = 6 + Local $c1 = Hex(0x8E908E, 6), $c2 = Hex(0xC4C5C4, 6), $c3 = Hex(0xFBFBFB, 6) + For $i = 1 To 3 + Local $pixel1[3] = [$x + 1, $y + 5, $c1], $pixel2[3] = [$x + 4, $y + 7, $c2], $pixel3[3] = [$x + 6, $y + 1, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then + $x += $width + Return "J" + Else + $x += 1 + EndIf + Next + $x -= 3 + + ;search for 'j' + $width = 2 + Local $c1 = Hex(0xA0A2A0, 6), $c2 = Hex(0xFDFDFD, 6), $c3 = Hex(0xFEFEFE, 6) + For $i = 1 To 3 + Local $pixel1[3] = [$x + 1, $y + 0, $c1], $pixel2[3] = [$x + 1, $y + 4, $c2], $pixel3[3] = [$x + 1, $y + 9, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then + $x += $width + Return "j" + Else + $x += 1 + EndIf + Next + $x -= 3 + + ;search for 'K' + $width = 7 + Local $c1 = Hex(0xC7C8C7, 6), $c2 = Hex(0x828482, 6), $c3 = Hex(0x7C7E7C, 6) + For $i = 1 To 3 + Local $pixel1[3] = [$x + 2, $y + 3, $c1], $pixel2[3] = [$x + 3, $y + 6, $c2], $pixel3[3] = [$x + 6, $y + 0, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then + $x += $width + Return "K" + Else + $x += 1 + EndIf + Next + $x -= 3 + + ;search for 'k' + $width = 5 + Local $c1 = Hex(0xFBFBFB, 6), $c2 = Hex(0x646764, 6), $c3 = Hex(0xDBDCDB, 6) + For $i = 1 To 3 + Local $pixel1[3] = [$x + 1, $y + 1, $c1], $pixel2[3] = [$x + 2, $y + 1, $c2], $pixel3[3] = [$x + 4, $y + 8, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then + $x += $width + Return "k" + Else + $x += 1 + EndIf + Next + $x -= 3 + + ;search for 'L' + $width = 4 + Local $c1 = Hex(0xFDFDFD, 6), $c2 = Hex(0x828482, 6), $c3 = Hex(0x646764, 6) + For $i = 1 To 3 + Local $pixel1[3] = [$x + 2, $y + 7, $c1], $pixel2[3] = [$x + 4, $y + 7, $c2], $pixel3[3] = [$x + 1, $y + 0, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then + $x += $width + Return "L" + Else + $x += 1 + EndIf + Next + $x -= 3 + + ;search for 'l' + $width = 2 + Local $c1 = Hex(0xFEFEFE, 6), $c2 = Hex(0x909290, 6), $c3 = Hex(0xFEFEFE, 6) + For $i = 1 To 3 + Local $pixel1[3] = [$x + 1, $y + 2, $c1], $pixel2[3] = [$x + 0, $y + 2, $c2], $pixel3[3] = [$x + 1, $y + 7, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then + $x += $width + Return "l" + Else + $x += 1 + EndIf + Next + $x -= 3 + + ;search for 'M' + $width = 10 + Local $c1 = Hex(0x8C8E8C, 6), $c2 = Hex(0x6A6D6A, 6), $c3 = Hex(0xA9ABA9, 6) + For $i = 1 To 3 + Local $pixel1[3] = [$x + 4, $y + 8, $c1], $pixel2[3] = [$x + 6, $y + 1, $c2], $pixel3[3] = [$x + 8, $y + 8, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then + $x += $width + Return "M" + Else + $x += 1 + EndIf + Next + $x -= 3 + + ;search for 'm' + $width = 10 + Local $c1 = Hex(0xD5D6D5, 6), $c2 = Hex(0x585C58, 6), $c3 = Hex(0xFFFFFF, 6) + For $i = 1 To 3 + Local $pixel1[3] = [$x + 1, $y + 8, $c1], $pixel2[3] = [$x + 7, $y + 2, $c2], $pixel3[3] = [$x + 5, $y + 4, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then + $x += $width + Return "m" + Else + $x += 1 + EndIf + Next + $x -= 3 + + ;search for 'N' + $width = 7 + Local $c1 = Hex(0x949694, 6), $c2 = Hex(0x707370, 6), $c3 = Hex(0xBFC0BF, 6) + For $i = 1 To 3 + Local $pixel1[3] = [$x + 3, $y + 1, $c1], $pixel2[3] = [$x + 5, $y + 4, $c2], $pixel3[3] = [$x + 6, $y + 1, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then + $x += $width + Return "N" + Else + $x += 1 + EndIf + Next + $x -= 3 + + ;search for 'n' + $width = 6 + Local $c1 = Hex(0xBEC0BE, 6), $c2 = Hex(0x8A8D8A, 6), $c3 = Hex(0x7A7D7A, 6) + For $i = 1 To 3 + Local $pixel1[3] = [$x + 5, $y + 3, $c1], $pixel2[3] = [$x + 4, $y + 8, $c2], $pixel3[3] = [$x + 2, $y + 5, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then + $x += $width + Return "n" + Else + $x += 1 + EndIf + Next + $x -= 3 + + ;search for 'O' + $width = 6 + Local $c1 = Hex(0xBBBDBB, 6), $c2 = Hex(0x888A88, 6), $c3 = Hex(0xD9DAD9, 6) + For $i = 1 To 3 + Local $pixel1[3] = [$x + 2, $y + 6, $c1], $pixel2[3] = [$x + 2, $y + 0, $c2], $pixel3[3] = [$x + 5, $y + 6, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then + $x += $width + Return "O" + Else + $x += 1 + EndIf + Next + $x -= 3 + + ;search for 'o' + $width = 6 + Local $c1 = Hex(0x888A88, 6), $c2 = Hex(0xA9ABA9, 6), $c3 = Hex(0x585C58, 6) + For $i = 1 To 3 + Local $pixel1[3] = [$x + 2, $y + 4, $c1], $pixel2[3] = [$x + 4, $y + 5, $c2], $pixel3[3] = [$x + 3, $y + 2, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then + $x += $width + Return "o" + Else + $x += 1 + EndIf + Next + $x -= 3 + + ;search for 'P' + $width = 6 + Local $c1 = Hex(0x636663, 6), $c2 = Hex(0x858785, 6), $c3 = Hex(0xE6E7E6, 6) + For $i = 1 To 3 + Local $pixel1[3] = [$x + 4, $y + 2, $c1], $pixel2[3] = [$x + 2, $y + 8, $c2], $pixel3[3] = [$x + 5, $y + 3, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then + $x += $width + Return "P" + Else + $x += 1 + EndIf + Next + $x -= 3 + + ;search for 'p' + $width = 5 + Local $c1 = Hex(0x8D908D, 6), $c2 = Hex(0xFFFFFF, 6), $c3 = Hex(0x898B89, 6) + For $i = 1 To 3 + Local $pixel1[3] = [$x + 2, $y + 4, $c1], $pixel2[3] = [$x + 1, $y + 10, $c2], $pixel3[3] = [$x + 5, $y + 3, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then + $x += $width + Return "p" + Else + $x += 1 + EndIf + Next + $x -= 3 + + ;search for 'Q' + $width = 7 + Local $c1 = Hex(0xE6E7E6, 6), $c2 = Hex(0xABADAB, 6), $c3 = Hex(0xFFFFFF, 6) + For $i = 1 To 3 + Local $pixel1[3] = [$x + 4, $y + 9, $c1], $pixel2[3] = [$x + 2, $y + 2, $c2], $pixel3[3] = [$x + 6, $y + 4, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then + $x += $width + Return "Q" + Else + $x += 1 + EndIf + Next + $x -= 3 + + ;search for 'q' + $width = 6 + Local $c1 = Hex(0x696C69, 6), $c2 = Hex(0xFFFFFF, 6), $c3 = Hex(0xC1C2C1, 6) + For $i = 1 To 3 + Local $pixel1[3] = [$x + 3, $y + 4, $c1], $pixel2[3] = [$x + 4, $y + 8, $c2], $pixel3[3] = [$x + 4, $y + 10, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then + $x += $width + Return "q" + Else + $x += 1 + EndIf + Next + $x -= 3 + + ;search for 'R' + $width = 7 + Local $c1 = Hex(0x575A57, 6), $c2 = Hex(0x939593, 6), $c3 = Hex(0xB8BAB8, 6) + For $i = 1 To 3 + Local $pixel1[3] = [$x + 4, $y + 2, $c1], $pixel2[3] = [$x + 3, $y + 6, $c2], $pixel3[3] = [$x + 6, $y + 1, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then + $x += $width + Return "R" + Else + $x += 1 + EndIf + Next + $x -= 3 + + ;search for 'r' + $width = 5 + Local $c1 = Hex(0x747774, 6), $c2 = Hex(0x5F635F, 6), $c3 = Hex(0x464A46, 6) + For $i = 1 To 3 + Local $pixel1[3] = [$x + 4, $y + 5, $c1], $pixel2[3] = [$x + 2, $y + 6, $c2], $pixel3[3] = [$x + 2, $y + 2, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then + $x += $width + Return "r" + Else + $x += 1 + EndIf + Next + $x -= 3 + + ;search for 'S' + $width = 7 + Local $c1 = Hex(0x8E908E, 6), $c2 = Hex(0x9C9E9C, 6), $c3 = Hex(0x7C7F7C, 6) + For $i = 1 To 3 + Local $pixel1[3] = [$x + 2, $y + 0, $c1], $pixel2[3] = [$x + 5, $y + 4, $c2], $pixel3[3] = [$x + 3, $y + 7, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then + $x += $width + Return "S" + Else + $x += 1 + EndIf + Next + $x -= 3 + + ;search for 's' + $width = 6 + Local $c1 = Hex(0x707370, 6), $c2 = Hex(0xC3C4C3, 6), $c3 = Hex(0x909290, 6) + For $i = 1 To 3 + Local $pixel1[3] = [$x + 2, $y + 2, $c1], $pixel2[3] = [$x + 4, $y + 4, $c2], $pixel3[3] = [$x + 2, $y + 7, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then + $x += $width + Return "s" + Else + $x += 1 + EndIf + Next + $x -= 3 + + ;search for 'T' + $width = 6 + $x -= 2 + Local $c1 = Hex(0x707370, 6), $c2 = Hex(0xB7B8B7, 6), $c3 = Hex(0x969896, 6) + For $i = 1 To 5 + Local $pixel1[3] = [$x + 1, $y + 0, $c1], $pixel2[3] = [$x + 4, $y + 2, $c2], $pixel3[3] = [$x + 2, $y + 8, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then + $x += $width + Return "T" + Else + $x += 1 + EndIf + Next + $x -= 3 + + ;search for 't' + $width = 6 + Local $c1 = Hex(0x767976, 6), $c2 = Hex(0xB6B8B6, 6), $c3 = Hex(0xA6A8A6, 6) + For $i = 1 To 3 + Local $pixel1[3] = [$x + 2, $y + 1, $c1], $pixel2[3] = [$x + 1, $y + 8, $c2], $pixel3[3] = [$x + 4, $y + 6, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then + $x += $width + Return "t" + Else + $x += 1 + EndIf + Next + $x -= 3 + + ;search for 'U' + $width = 7 + Local $c1 = Hex(0xFBFBFB, 6), $c2 = Hex(0x626562, 6), $c3 = Hex(0xBFC0BF, 6) + For $i = 1 To 3 + Local $pixel1[3] = [$x + 1, $y + 1, $c1], $pixel2[3] = [$x + 1, $y + 8, $c2], $pixel3[3] = [$x + 5, $y + 1, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then + $x += $width + Return "U" + Else + $x += 1 + EndIf + Next + $x -= 3 + + ;search for 'u' + $width = 6 + Local $c1 = Hex(0x525652, 6), $c2 = Hex(0xCBCCCB, 6), $c3 = Hex(0x888A88, 6) + For $i = 1 To 3 + Local $pixel1[3] = [$x + 2, $y + 3, $c1], $pixel2[3] = [$x + 2, $y + 7, $c2], $pixel3[3] = [$x + 4, $y + 3, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then + $x += $width + Return "u" + Else + $x += 1 + EndIf + Next + $x -= 3 + + ;search for 'V' + $width = 7 + Local $c1 = Hex(0x898C89, 6), $c2 = Hex(0x707370, 6), $c3 = Hex(0xE1E2E1, 6) + For $i = 1 To 3 + Local $pixel1[3] = [$x + 2, $y + 2, $c1], $pixel2[3] = [$x + 3, $y + 5, $c2], $pixel3[3] = [$x + 5, $y + 7, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then + $x += $width + Return "V" + Else + $x += 1 + EndIf + Next + $x -= 3 + + ;search for 'v' + $width = 6 + Local $c1 = Hex(0x595C59, 6), $c2 = Hex(0x525652, 6), $c3 = Hex(0xEEEEEE, 6) + For $i = 1 To 3 + Local $pixel1[3] = [$x + 2, $y + 3, $c1], $pixel2[3] = [$x + 3, $y + 6, $c2], $pixel3[3] = [$x + 5, $y + 3, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then + $x += $width + Return "v" + Else + $x += 1 + EndIf + Next + $x -= 3 + + ;search for 'W' + $width = 11 + Local $c1 = Hex(0xAEB0AE, 6), $c2 = Hex(0xC5C6C5, 6), $c3 = Hex(0x989A98, 6) + For $i = 1 To 3 + Local $pixel1[3] = [$x + 2, $y + 3, $c1], $pixel2[3] = [$x + 6, $y + 1, $c2], $pixel3[3] = [$x + 9, $y + 8, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then + $x += $width + Return "W" + Else + $x += 1 + EndIf + Next + $x -= 3 + + ;search for 'w' + $width = 9 + Local $c1 = Hex(0x8E918E, 6), $c2 = Hex(0x747674, 6), $c3 = Hex(0x797C79, 6) + For $i = 1 To 3 + Local $pixel1[3] = [$x + 3, $y + 5, $c1], $pixel2[3] = [$x + 5, $y + 7, $c2], $pixel3[3] = [$x + 8, $y + 8, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then + $x += $width + Return "w" + Else + $x += 1 + EndIf + Next + $x -= 3 + + ;search for 'X' + $width = 7 + Local $c1 = Hex(0x989B98, 6), $c2 = Hex(0x939593, 6), $c3 = Hex(0xB6B8B6, 6) + For $i = 1 To 3 + Local $pixel1[3] = [$x + 1, $y + 2, $c1], $pixel2[3] = [$x + 3, $y + 7, $c2], $pixel3[3] = [$x + 5, $y + 4, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then + $x += $width + Return "X" + Else + $x += 1 + EndIf + Next + $x -= 3 + + ;search for 'x' + $width = 6 + Local $c1 = Hex(0x8C8E8C, 6), $c2 = Hex(0x9EA09E, 6), $c3 = Hex(0x4C4F4C, 6) + For $i = 1 To 3 + Local $pixel1[3] = [$x + 1, $y + 4, $c1], $pixel2[3] = [$x + 2, $y + 8, $c2], $pixel3[3] = [$x + 5, $y + 6, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then + $x += $width + Return "x" + Else + $x += 1 + EndIf + Next + $x -= 3 + + ;search for 'Y' + $width = 7 + Local $c1 = Hex(0xA1A3A1, 6), $c2 = Hex(0x8C8E8C, 6), $c3 = Hex(0xD5D6D5, 6) + For $i = 1 To 3 + Local $pixel1[3] = [$x + 2, $y + 1, $c1], $pixel2[3] = [$x + 5, $y + 5, $c2], $pixel3[3] = [$x + 3, $y + 8, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then + $x += $width + Return "Y" + Else + $x += 1 + EndIf + Next + $x -= 3 + + ;search for 'y' + $width = 6 + Local $c1 = Hex(0x5D615D, 6), $c2 = Hex(0xEEEEEE, 6), $c3 = Hex(0xE8E9E8, 6) + For $i = 1 To 3 + Local $pixel1[3] = [$x + 1, $y + 8, $c1], $pixel2[3] = [$x + 3, $y + 7, $c2], $pixel3[3] = [$x + 3, $y + 10, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then + $x += $width + Return "y" + Else + $x += 1 + EndIf + Next + $x -= 3 + + ;search for 'Z' + $width = 7 + Local $c1 = Hex(0x505450, 6), $c2 = Hex(0x707370, 6), $c3 = Hex(0x888B88, 6) + For $i = 1 To 3 + Local $pixel1[3] = [$x + 2, $y + 2, $c1], $pixel2[3] = [$x + 1, $y + 7, $c2], $pixel3[3] = [$x + 5, $y + 7, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then + $x += $width + Return "Z" + Else + $x += 1 + EndIf + Next + $x -= 3 + + ;search for 'z' + $width = 4 + Local $c1 = Hex(0x757775, 6), $c2 = Hex(0x757875, 6), $c3 = Hex(0xDADBDA, 6) + For $i = 1 To 3 + Local $pixel1[3] = [$x + 1, $y + 4, $c1], $pixel2[3] = [$x + 3, $y + 5, $c2], $pixel3[3] = [$x + 2, $y + 8, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then + $x += $width + Return "z" + Else + $x += 1 + EndIf + Next + $x -= 3 + + ;search for ',' + $width = 3 + Local $c1 = Hex(0xE8E8E8, 6), $c2 = Hex(0xFEFEFE, 6), $c3 = Hex(0xA5A7A5, 6) + For $i = 1 To 3 + Local $pixel1[3] = [$x + 1, $y + 7, $c1], $pixel2[3] = [$x + 1, $y + 8, $c2], $pixel3[3] = [$x + 1, $y + 9, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then + $x += $width + Return "," + Else + $x += 1 + EndIf + Next + $x -= 3 + + ;search for '{space}' + $width = 2 + ;Local $c1 = Hex(0x404440, 6), $c2 = Hex(0x404440, 6), $c3 = Hex(0x404440, 6) + Local $c1 = Hex(0x3F4440, 6), $c2 = Hex(0x3F4440, 6), $c3 = Hex(0x3F4440, 6) + For $i = 1 To 3 + Local $pixel1[3] = [$x + 1, $y + 3, $c1], $pixel2[3] = [$x + 1, $y + 7, $c2], $pixel3[3] = [$x + 2, $y + 5, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then + $x += $width + Return " " + Else + $x += 1 + EndIf + Next + $x -= 3 + + ;============================Numbers on requests as strings ====================================================== + ;search for '1' + $width = 2 + Local $c1 = Hex(0xFBFBFB, 6), $c2 = Hex(0xBBBCBB, 6), $c3 = Hex(0xFFFFFF, 6) + For $i = 1 To 3 + Local $pixel1[3] = [$x + 1, $y + 1, $c1], $pixel2[3] = [$x + 1, $y + 6, $c2], $pixel3[3] = [$x + 2, $y + 4, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then + $x += $width + Return "1" + Else + $x += 1 + EndIf + Next + $x -= 3 + + ;search for '2 Not at the beginning of the line !' + $width = 7 + Local $c1 = Hex(0xBEBFBE, 6), $c2 = Hex(0xFFFFFF, 6), $c3 = Hex(0x8F918F, 6) + For $i = 1 To 3 + Local $pixel1[3] = [$x + 3, $y + 2, $c1], $pixel2[3] = [$x + 2, $y + 7, $c2], $pixel3[3] = [$x + 7, $y + 1, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then + $x += $width + Return "2" + Else + $x += 1 + EndIf + Next + $x -= 3 + + + $width = 6 + Local $c1 = Hex(0xBEBFBE, 6), $c2 = Hex(0xFFFFFF, 6), $c3 = Hex(0x8F918F, 6) + For $i = 1 To 3 + Local $pixel1[3] = [$x + 2, $y + 2, $c1], $pixel2[3] = [$x + 1, $y + 7, $c2], $pixel3[3] = [$x + 6, $y + 1, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then + $x += $width + Return "2" + Else + $x += 1 + EndIf + Next + $x -= 3 + + ;search for '3' + $width = 6 + Local $c1 = Hex(0xFEFEFE, 6), $c2 = Hex(0x888A88, 6), $c3 = Hex(0xF8F8F8, 6) + For $i = 1 To 3 + Local $pixel1[3] = [$x + 1, $y + 2, $c1], $pixel2[3] = [$x + 4, $y + 3, $c2], $pixel3[3] = [$x + 5, $y + 2, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then + $x += $width + Return "3" + Else + $x += 1 + EndIf + Next + $x -= 3 + + ;search for '4' + $width = 7 + Local $c1 = Hex(0xA0A2A0, 6), $c2 = Hex(0xFBFBFB, 6), $c3 = Hex(0x7E817E, 6) + For $i = 1 To 3 + Local $pixel1[3] = [$x + 2, $y + 3, $c1], $pixel2[3] = [$x + 4, $y + 1, $c2], $pixel3[3] = [$x + 7, $y + 3, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then + $x += $width + Return "4" + Else + $x += 1 + EndIf + Next + $x -= 3 + + ;search for '5' + $width = 6 + Local $c1 = Hex(0xFEFEFE, 6), $c2 = Hex(0x777A77, 6), $c3 = Hex(0xE6E7E6, 6) + For $i = 1 To 3 + Local $pixel1[3] = [$x + 1, $y + 3, $c1], $pixel2[3] = [$x + 3, $y + 3, $c2], $pixel3[3] = [$x + 5, $y + 6, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 1) Then + $x += $width + Return "5" + Else + $x += 1 + EndIf + Next + $x -= 3 + + + + Return "|" +EndFunc ;==>getChar diff --git a/COCBot/functions/Read Text/getDarkElixir.au3 b/COCBot/functions/Read Text/getDarkElixir.au3 index f5dbb3c..18fd9a3 100644 --- a/COCBot/functions/Read Text/getDarkElixir.au3 +++ b/COCBot/functions/Read Text/getDarkElixir.au3 @@ -1,21 +1,21 @@ -;Returns complete value of dark elixir xxx,xxx - -Func getDarkElixir($x_start, $y_start) - _CaptureRegion(0, 0, $x_start + 90, $y_start + 20) - ;----------------------------------------------------------------------------- - Local $x = $x_start, $y = $y_start - Local $DarkElixir, $i = 0 - While getDigit($x, $y + $i, "DarkElixir") = "" - If $i >= 15 Then ExitLoop - $i += 1 - WEnd - $x = $x_start - $DarkElixir &= getDigit($x, $y + $i, "DarkElixir") - $DarkElixir &= getDigit($x, $y + $i, "DarkElixir") - $DarkElixir &= getDigit($x, $y + $i, "DarkElixir") - $x += 6 - $DarkElixir &= getDigit($x, $y + $i, "DarkElixir") - $DarkElixir &= getDigit($x, $y + $i, "DarkElixir") - $DarkElixir &= getDigit($x, $y + $i, "DarkElixir") - Return $DarkElixir -EndFunc ;==>getDarkElixir +;Returns complete value of dark elixir xxx,xxx + +Func getDarkElixir($x_start, $y_start) + _CaptureRegion(0, 0, $x_start + 90, $y_start + 20) + ;----------------------------------------------------------------------------- + Local $x = $x_start, $y = $y_start + Local $DarkElixir, $i = 0 + While getDigit($x, $y + $i, "DarkElixir") = "" + If $i >= 15 Then ExitLoop + $i += 1 + WEnd + $x = $x_start + $DarkElixir &= getDigit($x, $y + $i, "DarkElixir") + $DarkElixir &= getDigit($x, $y + $i, "DarkElixir") + $DarkElixir &= getDigit($x, $y + $i, "DarkElixir") + $x += 6 + $DarkElixir &= getDigit($x, $y + $i, "DarkElixir") + $DarkElixir &= getDigit($x, $y + $i, "DarkElixir") + $DarkElixir &= getDigit($x, $y + $i, "DarkElixir") + Return $DarkElixir +EndFunc ;==>getDarkElixir diff --git a/COCBot/functions/Read Text/getDigit.au3 b/COCBot/functions/Read Text/getDigit.au3 index ccb8774..27dee8e 100644 --- a/COCBot/functions/Read Text/getDigit.au3 +++ b/COCBot/functions/Read Text/getDigit.au3 @@ -1,395 +1,395 @@ -;============================================================================================================== -;===Get Digit============================================================================================= -;-------------------------------------------------------------------------------------------------------------- -;Finds pixel color pattern of specific X and Y values, returns digit if pixel color pattern found. -;-------------------------------------------------------------------------------------------------------------- - -Func getDigit(ByRef $x, $y, $type) - Local $width = 0 - - ;Search for digit 0 - $width = 13 - Select - Case $type = "Gold" - Local $c1 = Hex(0x989579, 6), $c2 = Hex(0x39382E, 6), $c3 = Hex(0x272720, 6) - Case $type = "Elixir" - Local $c1 = Hex(0x978A96, 6), $c2 = Hex(0x393439, 6), $c3 = Hex(0x272427, 6) - Case $type = "DarkElixir" - Local $c1 = Hex(0x909090, 6), $c2 = Hex(0x363636, 6), $c3 = Hex(0x262626, 6) - Case $type = "Builder" - Local $c1 = Hex(0x979797, 6), $c2 = Hex(0x373737, 6), $c3 = Hex(0x262626, 6) - Case $type = "Resource" - Local $c1 = Hex(0x919191, 6), $c2 = Hex(0x373737, 6), $c3 = Hex(0x272727, 6) - Case Else - Local $c1 = Hex(0x979797, 6), $c2 = Hex(0x393939, 6), $c3 = Hex(0x272727, 6) - EndSelect - Local $pixel1[3] = [$x + 6, $y + 4, $c1], $pixel2[3] = [$x + 7, $y + 7, $c2], $pixel3[3] = [$x + 10, $y + 13, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3) Then - $x += $width ;Adds to x coordinate to get the next digit - Return "0" - Else - $x -= 1 ;Solves the problem when the spaces between the middle goes from 6 to 5 pixels - Local $pixel1[3] = [$x + 6, $y + 4, $c1], $pixel2[3] = [$x + 7, $y + 7, $c2], $pixel3[3] = [$x + 10, $y + 13, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3) Then - $x += $width ;Changes x coordinate for the next digit. - Return "0" - Else - $x += 2 ;Solves the problem when there is 1 pixel space between a set of numbers - Local $pixel1[3] = [$x + 6, $y + 4, $c1], $pixel2[3] = [$x + 7, $y + 7, $c2], $pixel3[3] = [$x + 10, $y + 13, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3) Then - $x += $width - Return "0" - Else - $x -= 1 - EndIf - EndIf - EndIf - - ;Search for digit 1 - $width = 6 - Select - Case $type = "Gold" - Local $c1 = Hex(0x979478, 6), $c2 = Hex(0x313127, 6), $c3 = Hex(0xD7D4AC, 6) - Case $type = "Elixir" - Local $c1 = Hex(0x968895, 6), $c2 = Hex(0x312D31, 6), $c3 = Hex(0xD8C4D6, 6) - Case $type = "DarkElixir" - Local $c1 = Hex(0x8F8F8F, 6), $c2 = Hex(0x2F2F2F, 6), $c3 = Hex(0xCDCDCD, 6) - Case $type = "Resource" - Local $c1 = Hex(0x919191, 6), $c2 = Hex(0x303030, 6), $c3 = Hex(0xD0D0D0, 6) - Case Else - Local $c1 = Hex(0x969696, 6), $c2 = Hex(0x313131, 6), $c3 = Hex(0xD8D8D8, 6) - EndSelect - Local $pixel1[3] = [$x + 1, $y + 1, $c1], $pixel2[3] = [$x + 1, $y + 12, $c2], $pixel3[3] = [$x + 4, $y + 12, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3) Then - $x += $width - Return 1 - Else - $x -= 1 - Local $pixel1[3] = [$x + 1, $y + 1, $c1], $pixel2[3] = [$x + 1, $y + 12, $c2], $pixel3[3] = [$x + 4, $y + 12, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3) Then - $x += $width - Return 1 - Else - $x += 2 - Local $pixel1[3] = [$x + 1, $y + 1, $c1], $pixel2[3] = [$x + 1, $y + 12, $c2], $pixel3[3] = [$x + 4, $y + 12, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3) Then - $x += $width - Return 1 - Else - $x -= 1 - EndIf - EndIf - EndIf - - ;Search for digit 2 - $width = 10 - Select - Case $type = "Gold" - Local $c1 = Hex(0xA09E80, 6), $c2 = Hex(0xD8D4AC, 6), $c3 = Hex(0x979579, 6) - Case $type = "Elixir" - Local $c1 = Hex(0xA0919F, 6), $c2 = Hex(0xD8C4D6, 6), $c3 = Hex(0x978A96, 6) - Case $type = "DarkElixir" - Local $c1 = Hex(0x989898, 6), $c2 = Hex(0xCDCDCD, 6), $c3 = Hex(0x909090, 6) - Case $type = "Resource" - Local $c1 = Hex(0x9E99A0, 6), $c2 = Hex(0xD3D3D3, 6), $c3 = Hex(0x919191, 6) - Case Else - Local $c1 = Hex(0xA0A0A0, 6), $c2 = Hex(0xD8D8D8, 6), $c3 = Hex(0x979797, 6) - EndSelect - Local $pixel1[3] = [$x + 1, $y + 7, $c1], $pixel2[3] = [$x + 3, $y + 6, $c2], $pixel3[3] = [$x + 7, $y + 7, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3) Then - $x += $width - Return 2 - Else - $x -= 1 - Local $pixel1[3] = [$x + 1, $y + 7, $c1], $pixel2[3] = [$x + 3, $y + 6, $c2], $pixel3[3] = [$x + 7, $y + 7, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3) Then - $x += $width - Return 2 - Else - $x += 2 - Local $pixel1[3] = [$x + 1, $y + 7, $c1], $pixel2[3] = [$x + 3, $y + 6, $c2], $pixel3[3] = [$x + 7, $y + 7, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3) Then - $x += $width - Return 2 - Else - $x -= 1 - EndIf - EndIf - EndIf - - ;Search for digit 3 - $width = 10 - Select - Case $type = "Gold" - Local $c1 = Hex(0x7F7D65, 6), $c2 = Hex(0x070706, 6), $c3 = Hex(0x37362C, 6) - Case $type = "Elixir" - Local $c1 = Hex(0x7F737E, 6), $c2 = Hex(0x070607, 6), $c3 = Hex(0x373236, 6) - Case $type = "DarkElixir" - Local $c1 = Hex(0x797979, 6), $c2 = Hex(0x070707, 6), $c3 = Hex(0x343434, 6) - Case $type = "Resource" - Local $c1 = Hex(0x7A7A7A, 6), $c2 = Hex(0x070707, 6), $c3 = Hex(0x373737, 6) - Case Else - Local $c1 = Hex(0x7F7F7F, 6), $c2 = Hex(0x070707, 6), $c3 = Hex(0x373737, 6) - EndSelect - Local $pixel1[3] = [$x + 2, $y + 3, $c1], $pixel2[3] = [$x + 4, $y + 8, $c2], $pixel3[3] = [$x + 5, $y + 13, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3) Then - $x += $width - Return 3 - Else - $x -= 1 - Local $pixel1[3] = [$x + 2, $y + 3, $c1], $pixel2[3] = [$x + 4, $y + 8, $c2], $pixel3[3] = [$x + 5, $y + 13, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3) Then - $x += $width - Return 3 - Else - $x += 2 - Local $pixel1[3] = [$x + 2, $y + 3, $c1], $pixel2[3] = [$x + 4, $y + 8, $c2], $pixel3[3] = [$x + 5, $y + 13, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3) Then - $x += $width - Return 3 - Else - $x -= 1 - EndIf - EndIf - EndIf - - ;Search for digit 4 - $width = 12 - Select - Case $type = "Gold" - Local $c1 = Hex(0x282720, 6), $c2 = Hex(0x080806, 6), $c3 = Hex(0x403F33, 6) - Case $type = "Elixir" - Local $c1 = Hex(0x282428, 6), $c2 = Hex(0x080708, 6), $c3 = Hex(0x403A40, 6) - Case $type = "DarkElixir" - Local $c1 = Hex(0x262626, 6), $c2 = Hex(0x070707, 6), $c3 = Hex(0x3D3D3D, 6) - Case Else - Local $c1 = Hex(0x282828, 6), $c2 = Hex(0x080808, 6), $c3 = Hex(0x404040, 6) - EndSelect - Local $pixel1[3] = [$x + 2, $y + 3, $c1], $pixel2[3] = [$x + 3, $y + 1, $c2], $pixel3[3] = [$x + 1, $y + 5, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3) Then - $x += $width - Return 4 - Else - $x -= 1 - Local $pixel1[3] = [$x + 2, $y + 3, $c1], $pixel2[3] = [$x + 3, $y + 1, $c2], $pixel3[3] = [$x + 1, $y + 5, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3) Then - $x += $width - Return 4 - Else - $x += 2 - Local $pixel1[3] = [$x + 2, $y + 3, $c1], $pixel2[3] = [$x + 3, $y + 1, $c2], $pixel3[3] = [$x + 1, $y + 5, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3) Then - $x += $width - Return 4 - Else - $x -= 1 - EndIf - EndIf - EndIf - - ;Search for digit 5 - $width = 10 - Select - Case $type = "Gold" - Local $c1 = Hex(0x060604, 6), $c2 = Hex(0x040403, 6), $c3 = Hex(0xB7B492, 6) - Case $type = "Elixir" - Local $c1 = Hex(0x060606, 6), $c2 = Hex(0x040404, 6), $c3 = Hex(0xB7A7B6, 6) - Case $type = "DarkElixir" - Local $c1 = Hex(0x060606, 6), $c2 = Hex(0x040404, 6), $c3 = Hex(0xAFAFAF, 6) - Case Else - Local $c1 = Hex(0x060606, 6), $c2 = Hex(0x040404, 6), $c3 = Hex(0xB7B7B7, 6) - EndSelect - Local $pixel1[3] = [$x + 5, $y + 4, $c1], $pixel2[3] = [$x + 4, $y + 9, $c2], $pixel3[3] = [$x + 6, $y + 12, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3) Then - $x += $width - Return 5 - Else - $x -= 1 - Local $pixel1[3] = [$x + 5, $y + 4, $c1], $pixel2[3] = [$x + 4, $y + 9, $c2], $pixel3[3] = [$x + 6, $y + 12, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3) Then - $x += $width - Return 5 - Else - $x += 2 - Local $pixel1[3] = [$x + 5, $y + 4, $c1], $pixel2[3] = [$x + 4, $y + 9, $c2], $pixel3[3] = [$x + 6, $y + 12, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3) Then - $x += $width - Return 5 - Else - $x -= 1 - EndIf - EndIf - EndIf - - ;Search for digit 6 - $width = 11 - Select - Case $type = "Gold" - Local $c1 = Hex(0x070605, 6), $c2 = Hex(0x040403, 6), $c3 = Hex(0x181713, 6) - Case $type = "Elixir" - Local $c1 = Hex(0x070707, 6), $c2 = Hex(0x040404, 6), $c3 = Hex(0x181618, 6) - Case $type = "DarkElixir" - Local $c1 = Hex(0x060606, 6), $c2 = Hex(0x030303, 6), $c3 = Hex(0x161616, 6) - Case Else - Local $c1 = Hex(0x070707, 6), $c2 = Hex(0x040404, 6), $c3 = Hex(0x181818, 6) - EndSelect - Local $pixel1[3] = [$x + 5, $y + 4, $c1], $pixel2[3] = [$x + 5, $y + 9, $c2], $pixel3[3] = [$x + 8, $y + 5, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3) Then - $x += $width - Return 6 - Else - $x -= 1 - Local $pixel1[3] = [$x + 5, $y + 4, $c1], $pixel2[3] = [$x + 5, $y + 9, $c2], $pixel3[3] = [$x + 8, $y + 5, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3) Then - $x += $width - Return 6 - Else - $x += 2 - Local $pixel1[3] = [$x + 5, $y + 4, $c1], $pixel2[3] = [$x + 5, $y + 9, $c2], $pixel3[3] = [$x + 8, $y + 5, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3) Then - $x += $width - Return 6 - Else - $x -= 1 - EndIf - EndIf - EndIf - - ;Search for digit 74 - $width = 21 - Select - Case $type = "Gold" - Local $c1 = Hex(0x414034, 6), $c2 = Hex(0x4C4B3D, 6), $c3 = Hex(0xD3D0A9, 6) - Case $type = "Elixir" - Local $c1 = Hex(0x413E38, 6), $c2 = Hex(0x4C4941, 6), $c3 = Hex(0xD3CEAB, 6) - Case $type = "DarkElixir" - Local $c1 = Hex(0x3F3F3F, 6), $c2 = Hex(0x4A4A4A, 6), $c3 = Hex(0xD1D1D1, 6) - Case Else - Local $c1 = Hex(0x414141, 6), $c2 = Hex(0x4C4C4C, 6), $c3 = Hex(0xD3D3D3, 6) - EndSelect - Local $pixel1[3] = [$x + 13, $y + 7, $c1], $pixel2[3] = [$x + 7, $y + 7, $c2], $pixel3[3] = [$x + 1, $y + 12, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3) Then - $x += $width - Return 74 - Else - $x -= 1 - Local $pixel1[3] = [$x + 13, $y + 7, $c1], $pixel2[3] = [$x + 7, $y + 7, $c2], $pixel3[3] = [$x + 1, $y + 12, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3) Then - $x += $width - Return 74 - Else - $x += 2 - Local $pixel1[3] = [$x + 13, $y + 7, $c1], $pixel2[3] = [$x + 7, $y + 7, $c2], $pixel3[3] = [$x + 1, $y + 12, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3) Then - $x += $width - Return 74 - Else - $x -= 1 - EndIf - EndIf - EndIf - - ;Search for digit 7 - $width = 10 - Select - Case $type = "Gold" - Local $c1 = Hex(0x5E5C4B, 6), $c2 = Hex(0x87856C, 6), $c3 = Hex(0x5D5C4B, 6) - Case $type = "Elixir" - Local $c1 = Hex(0x5F565E, 6), $c2 = Hex(0x877B86, 6), $c3 = Hex(0x5F565E, 6) - Case $type = "DarkElixir" - Local $c1 = Hex(0x5A5A5A, 6), $c2 = Hex(0x818181, 6), $c3 = Hex(0x5A5A5A, 6) - Case Else - Local $c1 = Hex(0x5F5F5F, 6), $c2 = Hex(0x878787, 6), $c3 = Hex(0x5F5F5F, 6) - EndSelect - Local $pixel1[3] = [$x + 5, $y + 11, $c1], $pixel2[3] = [$x + 4, $y + 3, $c2], $pixel3[3] = [$x + 7, $y + 7, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3) Then - $x += $width - Return 7 - Else - $x -= 1 - Local $pixel1[3] = [$x + 5, $y + 11, $c1], $pixel2[3] = [$x + 4, $y + 3, $c2], $pixel3[3] = [$x + 7, $y + 7, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3) Then - $x += $width - Return 7 - Else - $x += 2 - Local $pixel1[3] = [$x + 5, $y + 11, $c1], $pixel2[3] = [$x + 4, $y + 3, $c2], $pixel3[3] = [$x + 7, $y + 7, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3) Then - $x += $width - Return 7 - Else - $x -= 1 - EndIf - EndIf - EndIf - - ;Search for digit 8 - $width = 11 - Select - Case $type = "Gold" - Local $c1 = Hex(0x27261F, 6), $c2 = Hex(0x302F26, 6), $c3 = Hex(0x26261F, 6) - Case $type = "Elixir" - Local $c1 = Hex(0x272427, 6), $c2 = Hex(0x302B2F, 6), $c3 = Hex(0x26261F, 6) - Case $type = "DarkElixir" - Local $c1 = Hex(0x252525, 6), $c2 = Hex(0x2D2D2D, 6), $c3 = Hex(0x242424, 6) - Case Else - Local $c1 = Hex(0x272727, 6), $c2 = Hex(0x303030, 6), $c3 = Hex(0x262626, 6) - EndSelect - Local $pixel1[3] = [$x + 5, $y + 3, $c1], $pixel2[3] = [$x + 5, $y + 10, $c2], $pixel3[3] = [$x + 1, $y + 6, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3) Then - $x += $width - Return 8 - Else - $x -= 1 - Local $pixel1[3] = [$x + 5, $y + 3, $c1], $pixel2[3] = [$x + 5, $y + 10, $c2], $pixel3[3] = [$x + 1, $y + 6, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3) Then - $x += $width - Return 8 - Else - $x += 2 - Local $pixel1[3] = [$x + 5, $y + 3, $c1], $pixel2[3] = [$x + 5, $y + 10, $c2], $pixel3[3] = [$x + 1, $y + 6, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3) Then - $x += $width - Return 8 - Else - $x -= 1 - EndIf - EndIf - EndIf - - ;Search for digit 9 - $width = 11 - Select - Case $type = "Gold" - Local $c1 = Hex(0x302F26, 6), $c2 = Hex(0x050504, 6), $c3 = Hex(0x272720, 6) - Case $type = "Elixir" - Local $c1 = Hex(0x302C30, 6), $c2 = Hex(0x050505, 6), $c3 = Hex(0x282427, 6) - Case $type = "DarkElixir" - Local $c1 = Hex(0x2E2E2E, 6), $c2 = Hex(0x050505, 6), $c3 = Hex(0x262626, 6) - Case Else - Local $c1 = Hex(0x303030, 6), $c2 = Hex(0x050505, 6), $c3 = Hex(0x272727, 6) - EndSelect - Local $pixel1[3] = [$x + 5, $y + 5, $c1], $pixel2[3] = [$x + 5, $y + 9, $c2], $pixel3[3] = [$x + 8, $y + 12, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3) Then - $x += $width - Return 9 - Else - $x -= 1 - Local $pixel1[3] = [$x + 5, $y + 5, $c1], $pixel2[3] = [$x + 5, $y + 9, $c2], $pixel3[3] = [$x + 8, $y + 12, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3) Then - $x += $width - Return 9 - Else - $x += 2 - Local $pixel1[3] = [$x + 5, $y + 5, $c1], $pixel2[3] = [$x + 5, $y + 9, $c2], $pixel3[3] = [$x + 8, $y + 12, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3) Then - $x += $width - Return 9 - Else - $x -= 1 - EndIf - EndIf - EndIf - - Return "" -EndFunc ;==>getDigit +;============================================================================================================== +;===Get Digit============================================================================================= +;-------------------------------------------------------------------------------------------------------------- +;Finds pixel color pattern of specific X and Y values, returns digit if pixel color pattern found. +;-------------------------------------------------------------------------------------------------------------- + +Func getDigit(ByRef $x, $y, $type) + Local $width = 0 + + ;Search for digit 0 + $width = 13 + Select + Case $type = "Gold" + Local $c1 = Hex(0x989579, 6), $c2 = Hex(0x39382E, 6), $c3 = Hex(0x272720, 6) + Case $type = "Elixir" + Local $c1 = Hex(0x978A96, 6), $c2 = Hex(0x393439, 6), $c3 = Hex(0x272427, 6) + Case $type = "DarkElixir" + Local $c1 = Hex(0x909090, 6), $c2 = Hex(0x363636, 6), $c3 = Hex(0x262626, 6) + Case $type = "Builder" + Local $c1 = Hex(0x979797, 6), $c2 = Hex(0x373737, 6), $c3 = Hex(0x262626, 6) + Case $type = "Resource" + Local $c1 = Hex(0x919191, 6), $c2 = Hex(0x373737, 6), $c3 = Hex(0x272727, 6) + Case Else + Local $c1 = Hex(0x979797, 6), $c2 = Hex(0x393939, 6), $c3 = Hex(0x272727, 6) + EndSelect + Local $pixel1[3] = [$x + 6, $y + 4, $c1], $pixel2[3] = [$x + 7, $y + 7, $c2], $pixel3[3] = [$x + 10, $y + 13, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3) Then + $x += $width ;Adds to x coordinate to get the next digit + Return "0" + Else + $x -= 1 ;Solves the problem when the spaces between the middle goes from 6 to 5 pixels + Local $pixel1[3] = [$x + 6, $y + 4, $c1], $pixel2[3] = [$x + 7, $y + 7, $c2], $pixel3[3] = [$x + 10, $y + 13, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3) Then + $x += $width ;Changes x coordinate for the next digit. + Return "0" + Else + $x += 2 ;Solves the problem when there is 1 pixel space between a set of numbers + Local $pixel1[3] = [$x + 6, $y + 4, $c1], $pixel2[3] = [$x + 7, $y + 7, $c2], $pixel3[3] = [$x + 10, $y + 13, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3) Then + $x += $width + Return "0" + Else + $x -= 1 + EndIf + EndIf + EndIf + + ;Search for digit 1 + $width = 6 + Select + Case $type = "Gold" + Local $c1 = Hex(0x979478, 6), $c2 = Hex(0x313127, 6), $c3 = Hex(0xD7D4AC, 6) + Case $type = "Elixir" + Local $c1 = Hex(0x968895, 6), $c2 = Hex(0x312D31, 6), $c3 = Hex(0xD8C4D6, 6) + Case $type = "DarkElixir" + Local $c1 = Hex(0x8F8F8F, 6), $c2 = Hex(0x2F2F2F, 6), $c3 = Hex(0xCDCDCD, 6) + Case $type = "Resource" + Local $c1 = Hex(0x919191, 6), $c2 = Hex(0x303030, 6), $c3 = Hex(0xD0D0D0, 6) + Case Else + Local $c1 = Hex(0x969696, 6), $c2 = Hex(0x313131, 6), $c3 = Hex(0xD8D8D8, 6) + EndSelect + Local $pixel1[3] = [$x + 1, $y + 1, $c1], $pixel2[3] = [$x + 1, $y + 12, $c2], $pixel3[3] = [$x + 4, $y + 12, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3) Then + $x += $width + Return 1 + Else + $x -= 1 + Local $pixel1[3] = [$x + 1, $y + 1, $c1], $pixel2[3] = [$x + 1, $y + 12, $c2], $pixel3[3] = [$x + 4, $y + 12, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3) Then + $x += $width + Return 1 + Else + $x += 2 + Local $pixel1[3] = [$x + 1, $y + 1, $c1], $pixel2[3] = [$x + 1, $y + 12, $c2], $pixel3[3] = [$x + 4, $y + 12, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3) Then + $x += $width + Return 1 + Else + $x -= 1 + EndIf + EndIf + EndIf + + ;Search for digit 2 + $width = 10 + Select + Case $type = "Gold" + Local $c1 = Hex(0xA09E80, 6), $c2 = Hex(0xD8D4AC, 6), $c3 = Hex(0x979579, 6) + Case $type = "Elixir" + Local $c1 = Hex(0xA0919F, 6), $c2 = Hex(0xD8C4D6, 6), $c3 = Hex(0x978A96, 6) + Case $type = "DarkElixir" + Local $c1 = Hex(0x989898, 6), $c2 = Hex(0xCDCDCD, 6), $c3 = Hex(0x909090, 6) + Case $type = "Resource" + Local $c1 = Hex(0x9E99A0, 6), $c2 = Hex(0xD3D3D3, 6), $c3 = Hex(0x919191, 6) + Case Else + Local $c1 = Hex(0xA0A0A0, 6), $c2 = Hex(0xD8D8D8, 6), $c3 = Hex(0x979797, 6) + EndSelect + Local $pixel1[3] = [$x + 1, $y + 7, $c1], $pixel2[3] = [$x + 3, $y + 6, $c2], $pixel3[3] = [$x + 7, $y + 7, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3) Then + $x += $width + Return 2 + Else + $x -= 1 + Local $pixel1[3] = [$x + 1, $y + 7, $c1], $pixel2[3] = [$x + 3, $y + 6, $c2], $pixel3[3] = [$x + 7, $y + 7, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3) Then + $x += $width + Return 2 + Else + $x += 2 + Local $pixel1[3] = [$x + 1, $y + 7, $c1], $pixel2[3] = [$x + 3, $y + 6, $c2], $pixel3[3] = [$x + 7, $y + 7, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3) Then + $x += $width + Return 2 + Else + $x -= 1 + EndIf + EndIf + EndIf + + ;Search for digit 3 + $width = 10 + Select + Case $type = "Gold" + Local $c1 = Hex(0x7F7D65, 6), $c2 = Hex(0x070706, 6), $c3 = Hex(0x37362C, 6) + Case $type = "Elixir" + Local $c1 = Hex(0x7F737E, 6), $c2 = Hex(0x070607, 6), $c3 = Hex(0x373236, 6) + Case $type = "DarkElixir" + Local $c1 = Hex(0x797979, 6), $c2 = Hex(0x070707, 6), $c3 = Hex(0x343434, 6) + Case $type = "Resource" + Local $c1 = Hex(0x7A7A7A, 6), $c2 = Hex(0x070707, 6), $c3 = Hex(0x373737, 6) + Case Else + Local $c1 = Hex(0x7F7F7F, 6), $c2 = Hex(0x070707, 6), $c3 = Hex(0x373737, 6) + EndSelect + Local $pixel1[3] = [$x + 2, $y + 3, $c1], $pixel2[3] = [$x + 4, $y + 8, $c2], $pixel3[3] = [$x + 5, $y + 13, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3) Then + $x += $width + Return 3 + Else + $x -= 1 + Local $pixel1[3] = [$x + 2, $y + 3, $c1], $pixel2[3] = [$x + 4, $y + 8, $c2], $pixel3[3] = [$x + 5, $y + 13, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3) Then + $x += $width + Return 3 + Else + $x += 2 + Local $pixel1[3] = [$x + 2, $y + 3, $c1], $pixel2[3] = [$x + 4, $y + 8, $c2], $pixel3[3] = [$x + 5, $y + 13, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3) Then + $x += $width + Return 3 + Else + $x -= 1 + EndIf + EndIf + EndIf + + ;Search for digit 4 + $width = 12 + Select + Case $type = "Gold" + Local $c1 = Hex(0x282720, 6), $c2 = Hex(0x080806, 6), $c3 = Hex(0x403F33, 6) + Case $type = "Elixir" + Local $c1 = Hex(0x282428, 6), $c2 = Hex(0x080708, 6), $c3 = Hex(0x403A40, 6) + Case $type = "DarkElixir" + Local $c1 = Hex(0x262626, 6), $c2 = Hex(0x070707, 6), $c3 = Hex(0x3D3D3D, 6) + Case Else + Local $c1 = Hex(0x282828, 6), $c2 = Hex(0x080808, 6), $c3 = Hex(0x404040, 6) + EndSelect + Local $pixel1[3] = [$x + 2, $y + 3, $c1], $pixel2[3] = [$x + 3, $y + 1, $c2], $pixel3[3] = [$x + 1, $y + 5, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3) Then + $x += $width + Return 4 + Else + $x -= 1 + Local $pixel1[3] = [$x + 2, $y + 3, $c1], $pixel2[3] = [$x + 3, $y + 1, $c2], $pixel3[3] = [$x + 1, $y + 5, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3) Then + $x += $width + Return 4 + Else + $x += 2 + Local $pixel1[3] = [$x + 2, $y + 3, $c1], $pixel2[3] = [$x + 3, $y + 1, $c2], $pixel3[3] = [$x + 1, $y + 5, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3) Then + $x += $width + Return 4 + Else + $x -= 1 + EndIf + EndIf + EndIf + + ;Search for digit 5 + $width = 10 + Select + Case $type = "Gold" + Local $c1 = Hex(0x060604, 6), $c2 = Hex(0x040403, 6), $c3 = Hex(0xB7B492, 6) + Case $type = "Elixir" + Local $c1 = Hex(0x060606, 6), $c2 = Hex(0x040404, 6), $c3 = Hex(0xB7A7B6, 6) + Case $type = "DarkElixir" + Local $c1 = Hex(0x060606, 6), $c2 = Hex(0x040404, 6), $c3 = Hex(0xAFAFAF, 6) + Case Else + Local $c1 = Hex(0x060606, 6), $c2 = Hex(0x040404, 6), $c3 = Hex(0xB7B7B7, 6) + EndSelect + Local $pixel1[3] = [$x + 5, $y + 4, $c1], $pixel2[3] = [$x + 4, $y + 9, $c2], $pixel3[3] = [$x + 6, $y + 12, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3) Then + $x += $width + Return 5 + Else + $x -= 1 + Local $pixel1[3] = [$x + 5, $y + 4, $c1], $pixel2[3] = [$x + 4, $y + 9, $c2], $pixel3[3] = [$x + 6, $y + 12, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3) Then + $x += $width + Return 5 + Else + $x += 2 + Local $pixel1[3] = [$x + 5, $y + 4, $c1], $pixel2[3] = [$x + 4, $y + 9, $c2], $pixel3[3] = [$x + 6, $y + 12, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3) Then + $x += $width + Return 5 + Else + $x -= 1 + EndIf + EndIf + EndIf + + ;Search for digit 6 + $width = 11 + Select + Case $type = "Gold" + Local $c1 = Hex(0x070605, 6), $c2 = Hex(0x040403, 6), $c3 = Hex(0x181713, 6) + Case $type = "Elixir" + Local $c1 = Hex(0x070707, 6), $c2 = Hex(0x040404, 6), $c3 = Hex(0x181618, 6) + Case $type = "DarkElixir" + Local $c1 = Hex(0x060606, 6), $c2 = Hex(0x030303, 6), $c3 = Hex(0x161616, 6) + Case Else + Local $c1 = Hex(0x070707, 6), $c2 = Hex(0x040404, 6), $c3 = Hex(0x181818, 6) + EndSelect + Local $pixel1[3] = [$x + 5, $y + 4, $c1], $pixel2[3] = [$x + 5, $y + 9, $c2], $pixel3[3] = [$x + 8, $y + 5, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3) Then + $x += $width + Return 6 + Else + $x -= 1 + Local $pixel1[3] = [$x + 5, $y + 4, $c1], $pixel2[3] = [$x + 5, $y + 9, $c2], $pixel3[3] = [$x + 8, $y + 5, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3) Then + $x += $width + Return 6 + Else + $x += 2 + Local $pixel1[3] = [$x + 5, $y + 4, $c1], $pixel2[3] = [$x + 5, $y + 9, $c2], $pixel3[3] = [$x + 8, $y + 5, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3) Then + $x += $width + Return 6 + Else + $x -= 1 + EndIf + EndIf + EndIf + + ;Search for digit 74 + $width = 21 + Select + Case $type = "Gold" + Local $c1 = Hex(0x414034, 6), $c2 = Hex(0x4C4B3D, 6), $c3 = Hex(0xD3D0A9, 6) + Case $type = "Elixir" + Local $c1 = Hex(0x413E38, 6), $c2 = Hex(0x4C4941, 6), $c3 = Hex(0xD3CEAB, 6) + Case $type = "DarkElixir" + Local $c1 = Hex(0x3F3F3F, 6), $c2 = Hex(0x4A4A4A, 6), $c3 = Hex(0xD1D1D1, 6) + Case Else + Local $c1 = Hex(0x414141, 6), $c2 = Hex(0x4C4C4C, 6), $c3 = Hex(0xD3D3D3, 6) + EndSelect + Local $pixel1[3] = [$x + 13, $y + 7, $c1], $pixel2[3] = [$x + 7, $y + 7, $c2], $pixel3[3] = [$x + 1, $y + 12, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3) Then + $x += $width + Return 74 + Else + $x -= 1 + Local $pixel1[3] = [$x + 13, $y + 7, $c1], $pixel2[3] = [$x + 7, $y + 7, $c2], $pixel3[3] = [$x + 1, $y + 12, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3) Then + $x += $width + Return 74 + Else + $x += 2 + Local $pixel1[3] = [$x + 13, $y + 7, $c1], $pixel2[3] = [$x + 7, $y + 7, $c2], $pixel3[3] = [$x + 1, $y + 12, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3) Then + $x += $width + Return 74 + Else + $x -= 1 + EndIf + EndIf + EndIf + + ;Search for digit 7 + $width = 10 + Select + Case $type = "Gold" + Local $c1 = Hex(0x5E5C4B, 6), $c2 = Hex(0x87856C, 6), $c3 = Hex(0x5D5C4B, 6) + Case $type = "Elixir" + Local $c1 = Hex(0x5F565E, 6), $c2 = Hex(0x877B86, 6), $c3 = Hex(0x5F565E, 6) + Case $type = "DarkElixir" + Local $c1 = Hex(0x5A5A5A, 6), $c2 = Hex(0x818181, 6), $c3 = Hex(0x5A5A5A, 6) + Case Else + Local $c1 = Hex(0x5F5F5F, 6), $c2 = Hex(0x878787, 6), $c3 = Hex(0x5F5F5F, 6) + EndSelect + Local $pixel1[3] = [$x + 5, $y + 11, $c1], $pixel2[3] = [$x + 4, $y + 3, $c2], $pixel3[3] = [$x + 7, $y + 7, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3) Then + $x += $width + Return 7 + Else + $x -= 1 + Local $pixel1[3] = [$x + 5, $y + 11, $c1], $pixel2[3] = [$x + 4, $y + 3, $c2], $pixel3[3] = [$x + 7, $y + 7, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3) Then + $x += $width + Return 7 + Else + $x += 2 + Local $pixel1[3] = [$x + 5, $y + 11, $c1], $pixel2[3] = [$x + 4, $y + 3, $c2], $pixel3[3] = [$x + 7, $y + 7, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3) Then + $x += $width + Return 7 + Else + $x -= 1 + EndIf + EndIf + EndIf + + ;Search for digit 8 + $width = 11 + Select + Case $type = "Gold" + Local $c1 = Hex(0x27261F, 6), $c2 = Hex(0x302F26, 6), $c3 = Hex(0x26261F, 6) + Case $type = "Elixir" + Local $c1 = Hex(0x272427, 6), $c2 = Hex(0x302B2F, 6), $c3 = Hex(0x26261F, 6) + Case $type = "DarkElixir" + Local $c1 = Hex(0x252525, 6), $c2 = Hex(0x2D2D2D, 6), $c3 = Hex(0x242424, 6) + Case Else + Local $c1 = Hex(0x272727, 6), $c2 = Hex(0x303030, 6), $c3 = Hex(0x262626, 6) + EndSelect + Local $pixel1[3] = [$x + 5, $y + 3, $c1], $pixel2[3] = [$x + 5, $y + 10, $c2], $pixel3[3] = [$x + 1, $y + 6, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3) Then + $x += $width + Return 8 + Else + $x -= 1 + Local $pixel1[3] = [$x + 5, $y + 3, $c1], $pixel2[3] = [$x + 5, $y + 10, $c2], $pixel3[3] = [$x + 1, $y + 6, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3) Then + $x += $width + Return 8 + Else + $x += 2 + Local $pixel1[3] = [$x + 5, $y + 3, $c1], $pixel2[3] = [$x + 5, $y + 10, $c2], $pixel3[3] = [$x + 1, $y + 6, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3) Then + $x += $width + Return 8 + Else + $x -= 1 + EndIf + EndIf + EndIf + + ;Search for digit 9 + $width = 11 + Select + Case $type = "Gold" + Local $c1 = Hex(0x302F26, 6), $c2 = Hex(0x050504, 6), $c3 = Hex(0x272720, 6) + Case $type = "Elixir" + Local $c1 = Hex(0x302C30, 6), $c2 = Hex(0x050505, 6), $c3 = Hex(0x282427, 6) + Case $type = "DarkElixir" + Local $c1 = Hex(0x2E2E2E, 6), $c2 = Hex(0x050505, 6), $c3 = Hex(0x262626, 6) + Case Else + Local $c1 = Hex(0x303030, 6), $c2 = Hex(0x050505, 6), $c3 = Hex(0x272727, 6) + EndSelect + Local $pixel1[3] = [$x + 5, $y + 5, $c1], $pixel2[3] = [$x + 5, $y + 9, $c2], $pixel3[3] = [$x + 8, $y + 12, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3) Then + $x += $width + Return 9 + Else + $x -= 1 + Local $pixel1[3] = [$x + 5, $y + 5, $c1], $pixel2[3] = [$x + 5, $y + 9, $c2], $pixel3[3] = [$x + 8, $y + 12, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3) Then + $x += $width + Return 9 + Else + $x += 2 + Local $pixel1[3] = [$x + 5, $y + 5, $c1], $pixel2[3] = [$x + 5, $y + 9, $c2], $pixel3[3] = [$x + 8, $y + 12, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3) Then + $x += $width + Return 9 + Else + $x -= 1 + EndIf + EndIf + EndIf + + Return "" +EndFunc ;==>getDigit diff --git a/COCBot/functions/Read Text/getDigitLarge.au3 b/COCBot/functions/Read Text/getDigitLarge.au3 index 399ce46..952952e 100644 --- a/COCBot/functions/Read Text/getDigitLarge.au3 +++ b/COCBot/functions/Read Text/getDigitLarge.au3 @@ -1,291 +1,291 @@ -;============================================================================================================== -;=== Get Digit Large ========================================================================================== -;-------------------------------------------------------------------------------------------------------------- -;Finds pixel color pattern of specific X and Y values, returns digit if pixel color pattern found. -;-------------------------------------------------------------------------------------------------------------- - -Func getDigitLarge(ByRef $x, $y, $type) - Local $width = 0 - - ;Search for digit 0 - $width = 17 - Select - Case $type = "ReturnHome" - Local $c1 = Hex(0x484848, 10), $c2 = Hex(0x050505, 10), $c3 = Hex(0x4C4442, 10) - EndSelect - Local $pixel1[3] = [$x + 9, $y + 6, $c1], $pixel2[3] = [$x + 9, $y + 9, $c2], $pixel3[3] = [$x + 14, $y + 18, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then - $x += $width ;Adds to x coordinate to get the next digit - Return "0" - Else - $x -= 1 ;Solves the problem when the spaces between the middle goes from 6 to 5 pixels - Local $pixel1[3] = [$x + 9, $y + 6, $c1], $pixel2[3] = [$x + 9, $y + 9, $c2], $pixel3[3] = [$x + 14, $y + 18, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then - $x += $width ;Changes x coordinate for the next digit. - Return "0" - Else - $x += 2 ;Solves the problem when there is 1 pixel space between a set of numbers - Local $pixel1[3] = [$x + 9, $y + 6, $c1], $pixel2[3] = [$x + 9, $y + 9, $c2], $pixel3[3] = [$x + 14, $y + 18, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then - $x += $width - Return "0" - Else - $x -= 1 - EndIf - EndIf - EndIf - - ;Search for digit 1 - $width = 7 - Select - Case $type = "ReturnHome" - Local $c1 = Hex(0x231C24, 10), $c2 = Hex(0x707863, 20), $c3 = Hex(0xCBCBC9, 10) - EndSelect - Local $pixel1[3] = [$x + 2, $y + 1, $c1], $pixel2[3] = [$x + 2, $y + 17, $c2], $pixel3[3] = [$x + 6, $y + 17, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then - $x += $width - Return 1 - Else - $x -= 1 - Local $pixel1[3] = [$x + 2, $y + 1, $c1], $pixel2[3] = [$x + 2, $y + 17, $c2], $pixel3[3] = [$x + 6, $y + 17, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then - $x += $width - Return 1 - Else - $x += 2 - Local $pixel1[3] = [$x + 2, $y + 1, $c1], $pixel2[3] = [$x + 2, $y + 17, $c2], $pixel3[3] = [$x + 6, $y + 17, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then - $x += $width - Return 1 - Else - $x -= 1 - EndIf - EndIf - EndIf - - ;Search for digit 2 - $width = 13 - Select - Case $type = "ReturnHome" - Local $c1 = Hex(0x737C69, 10), $c2 = Hex(0xE2E2E2, 10), $c3 = Hex(0xB8B8B8, 10) - EndSelect - Local $pixel1[3] = [$x + 1, $y + 10, $c1], $pixel2[3] = [$x + 5, $y + 8, $c2], $pixel3[3] = [$x + 8, $y + 11, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then - $x += $width - Return 2 - Else - $x -= 1 - Local $pixel1[3] = [$x + 1, $y + 10, $c1], $pixel2[3] = [$x + 5, $y + 8, $c2], $pixel3[3] = [$x + 8, $y + 11, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then - $x += $width - Return 2 - Else - $x += 2 - Local $pixel1[3] = [$x + 1, $y + 10, $c1], $pixel2[3] = [$x + 5, $y + 8, $c2], $pixel3[3] = [$x + 8, $y + 11, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then - $x += $width - Return 2 - Else - $x -= 1 - EndIf - EndIf - EndIf - - ;Search for digit 3 - $width = 14 - Select - Case $type = "ReturnHome" - Local $c1 = Hex(0xD9D9DB, 10), $c2 = Hex(0x050505, 10), $c3 = Hex(0x4E4F54, 10) - EndSelect - Local $pixel1[3] = [$x + 4, $y + 4, $c1], $pixel2[3] = [$x + 5, $y + 11, $c2], $pixel3[3] = [$x + 7, $y + 18, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then - $x += $width - Return 3 - Else - $x -= 1 - Local $pixel1[3] = [$x + 4, $y + 4, $c1], $pixel2[3] = [$x + 5, $y + 11, $c2], $pixel3[3] = [$x + 7, $y + 18, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then - $x += $width - Return 3 - Else - $x += 2 - Local $pixel1[3] = [$x + 4, $y + 4, $c1], $pixel2[3] = [$x + 5, $y + 11, $c2], $pixel3[3] = [$x + 7, $y + 18, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then - $x += $width - Return 3 - Else - $x -= 1 - EndIf - EndIf - EndIf - - ;Search for digit 4 - $width = 16 - Select - Case $type = "ReturnHome" - Local $c1 = Hex(0x050505, 10), $c2 = Hex(0x050505, 10), $c3 = Hex(0x878684, 10) - EndSelect - Local $pixel1[3] = [$x + 3, $y + 4, $c1], $pixel2[3] = [$x + 4, $y + 2, $c2], $pixel3[3] = [$x + 2, $y + 7, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then - $x += $width - Return 4 - Else - $x -= 1 - Local $pixel1[3] = [$x + 3, $y + 4, $c1], $pixel2[3] = [$x + 4, $y + 2, $c2], $pixel3[3] = [$x + 2, $y + 7, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then - $x += $width - Return 4 - Else - $x += 2 - Local $pixel1[3] = [$x + 3, $y + 4, $c1], $pixel2[3] = [$x + 4, $y + 2, $c2], $pixel3[3] = [$x + 2, $y + 7, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then - $x += $width - Return 4 - Else - $x -= 1 - EndIf - EndIf - EndIf - - ;Search for digit 5 - $width = 13 - Select - Case $type = "ReturnHome" - Local $c1 = Hex(0xA19D9E, 10), $c2 = Hex(0x121210, 10), $c3 = Hex(0xB2B1AD, 10) - EndSelect - Local $pixel1[3] = [$x + 6, $y + 5, $c1], $pixel2[3] = [$x + 6, $y + 12, $c2], $pixel3[3] = [$x + 8, $y + 17, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then - $x += $width - Return 5 - Else - $x -= 1 - Local $pixel1[3] = [$x + 6, $y + 5, $c1], $pixel2[3] = [$x + 6, $y + 12, $c2], $pixel3[3] = [$x + 8, $y + 17, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then - $x += $width - Return 5 - Else - $x += 2 - Local $pixel1[3] = [$x + 6, $y + 5, $c1], $pixel2[3] = [$x + 6, $y + 12, $c2], $pixel3[3] = [$x + 8, $y + 17, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then - $x += $width - Return 5 - Else - $x -= 1 - EndIf - EndIf - EndIf - - ;Search for digit 6 - $width = 15 - Select - Case $type = "ReturnHome" - Local $c1 = Hex(0x000000, 6), $c2 = Hex(0x000000, 6), $c3 = Hex(0x000000, 6) - EndSelect - Local $pixel1[3] = [$x + 7, $y + 6, $c1], $pixel2[3] = [$x + 7, $y + 12, $c2], $pixel3[3] = [$x + 11, $y + 7, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then - $x += $width - Return 6 - Else - $x -= 1 - Local $pixel1[3] = [$x + 7, $y + 6, $c1], $pixel2[3] = [$x + 7, $y + 12, $c2], $pixel3[3] = [$x + 11, $y + 7, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then - $x += $width - Return 6 - Else - $x += 2 - Local $pixel1[3] = [$x + 7, $y + 6, $c1], $pixel2[3] = [$x + 7, $y + 12, $c2], $pixel3[3] = [$x + 11, $y + 7, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then - $x += $width - Return 6 - Else - $x -= 1 - EndIf - EndIf - EndIf - - ;Search for digit 7 - $width = 13 - Select - Case $type = "ReturnHome" - Local $c1 = Hex(0xB1AFB0, 10), $c2 = Hex(0x8A8B83, 10), $c3 = Hex(0xAEACB1, 10) - EndSelect - Local $pixel1[3] = [$x + 7, $y + 15, $c1], $pixel2[3] = [$x + 6, $y + 5, $c2], $pixel3[3] = [$x + 10, $y + 9, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then - $x += $width - Return 7 - Else - $x -= 1 - Local $pixel1[3] = [$x + 7, $y + 15, $c1], $pixel2[3] = [$x + 6, $y + 5, $c2], $pixel3[3] = [$x + 10, $y + 9, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then - $x += $width - Return 7 - Else - $x += 2 - Local $pixel1[3] = [$x + 7, $y + 15, $c1], $pixel2[3] = [$x + 6, $y + 5, $c2], $pixel3[3] = [$x + 10, $y + 9, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then - $x += $width - Return 7 - Else - $x -= 1 - EndIf - EndIf - EndIf - - ;Search for digit 8 - $width = 16 - Select - Case $type = "ReturnHome" - Local $c1 = Hex(0x5B5A5F, 10), $c2 = Hex(0x0E0E18, 10), $c3 = Hex(0x000000, 6) - EndSelect - Local $pixel1[3] = [$x + 8, $y + 4, $c1], $pixel2[3] = [$x + 7, $y + 14, $c2], $pixel3[3] = [$x + 2, $y + 9, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then - $x += $width - Return 8 - Else - $x -= 1 - Local $pixel1[3] = [$x + 8, $y + 4, $c1], $pixel2[3] = [$x + 7, $y + 14, $c2], $pixel3[3] = [$x + 2, $y + 9, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then - $x += $width - Return 8 - Else - $x += 2 - Local $pixel1[3] = [$x + 8, $y + 4, $c1], $pixel2[3] = [$x + 7, $y + 14, $c2], $pixel3[3] = [$x + 2, $y + 9, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then - $x += $width - Return 8 - Else - $x -= 1 - EndIf - EndIf - EndIf - - ;Search for digit 9 - $width = 14 - Select - Case $type = "ReturnHome" - Local $c1 = Hex(0x050505, 6), $c2 = Hex(0x101010, 6), $c3 = Hex(0x121212, 6) - EndSelect - Local $pixel1[3] = [$x + 7, $y + 6, $c1], $pixel2[3] = [$x + 7, $y + 12, $c2], $pixel3[3] = [$x + 11, $y + 17, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then - $x += $width - Return 9 - Else - $x -= 1 - Local $pixel1[3] = [$x + 5, $y + 5, $c1], $pixel2[3] = [$x + 5, $y + 9, $c2], $pixel3[3] = [$x + 8, $y + 12, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then - $x += $width - Return 9 - Else - $x += 2 - Local $pixel1[3] = [$x + 5, $y + 5, $c1], $pixel2[3] = [$x + 5, $y + 9, $c2], $pixel3[3] = [$x + 8, $y + 12, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then - $x += $width - Return 9 - Else - $x -= 1 - EndIf - EndIf - EndIf - - Return "" -EndFunc ;==>getDigitLarge +;============================================================================================================== +;=== Get Digit Large ========================================================================================== +;-------------------------------------------------------------------------------------------------------------- +;Finds pixel color pattern of specific X and Y values, returns digit if pixel color pattern found. +;-------------------------------------------------------------------------------------------------------------- + +Func getDigitLarge(ByRef $x, $y, $type) + Local $width = 0 + + ;Search for digit 0 + $width = 17 + Select + Case $type = "ReturnHome" + Local $c1 = Hex(0x484848, 10), $c2 = Hex(0x050505, 10), $c3 = Hex(0x4C4442, 10) + EndSelect + Local $pixel1[3] = [$x + 9, $y + 6, $c1], $pixel2[3] = [$x + 9, $y + 9, $c2], $pixel3[3] = [$x + 14, $y + 18, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then + $x += $width ;Adds to x coordinate to get the next digit + Return "0" + Else + $x -= 1 ;Solves the problem when the spaces between the middle goes from 6 to 5 pixels + Local $pixel1[3] = [$x + 9, $y + 6, $c1], $pixel2[3] = [$x + 9, $y + 9, $c2], $pixel3[3] = [$x + 14, $y + 18, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then + $x += $width ;Changes x coordinate for the next digit. + Return "0" + Else + $x += 2 ;Solves the problem when there is 1 pixel space between a set of numbers + Local $pixel1[3] = [$x + 9, $y + 6, $c1], $pixel2[3] = [$x + 9, $y + 9, $c2], $pixel3[3] = [$x + 14, $y + 18, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then + $x += $width + Return "0" + Else + $x -= 1 + EndIf + EndIf + EndIf + + ;Search for digit 1 + $width = 7 + Select + Case $type = "ReturnHome" + Local $c1 = Hex(0x231C24, 10), $c2 = Hex(0x707863, 20), $c3 = Hex(0xCBCBC9, 10) + EndSelect + Local $pixel1[3] = [$x + 2, $y + 1, $c1], $pixel2[3] = [$x + 2, $y + 17, $c2], $pixel3[3] = [$x + 6, $y + 17, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then + $x += $width + Return 1 + Else + $x -= 1 + Local $pixel1[3] = [$x + 2, $y + 1, $c1], $pixel2[3] = [$x + 2, $y + 17, $c2], $pixel3[3] = [$x + 6, $y + 17, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then + $x += $width + Return 1 + Else + $x += 2 + Local $pixel1[3] = [$x + 2, $y + 1, $c1], $pixel2[3] = [$x + 2, $y + 17, $c2], $pixel3[3] = [$x + 6, $y + 17, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then + $x += $width + Return 1 + Else + $x -= 1 + EndIf + EndIf + EndIf + + ;Search for digit 2 + $width = 13 + Select + Case $type = "ReturnHome" + Local $c1 = Hex(0x737C69, 10), $c2 = Hex(0xE2E2E2, 10), $c3 = Hex(0xB8B8B8, 10) + EndSelect + Local $pixel1[3] = [$x + 1, $y + 10, $c1], $pixel2[3] = [$x + 5, $y + 8, $c2], $pixel3[3] = [$x + 8, $y + 11, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then + $x += $width + Return 2 + Else + $x -= 1 + Local $pixel1[3] = [$x + 1, $y + 10, $c1], $pixel2[3] = [$x + 5, $y + 8, $c2], $pixel3[3] = [$x + 8, $y + 11, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then + $x += $width + Return 2 + Else + $x += 2 + Local $pixel1[3] = [$x + 1, $y + 10, $c1], $pixel2[3] = [$x + 5, $y + 8, $c2], $pixel3[3] = [$x + 8, $y + 11, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then + $x += $width + Return 2 + Else + $x -= 1 + EndIf + EndIf + EndIf + + ;Search for digit 3 + $width = 14 + Select + Case $type = "ReturnHome" + Local $c1 = Hex(0xD9D9DB, 10), $c2 = Hex(0x050505, 10), $c3 = Hex(0x4E4F54, 10) + EndSelect + Local $pixel1[3] = [$x + 4, $y + 4, $c1], $pixel2[3] = [$x + 5, $y + 11, $c2], $pixel3[3] = [$x + 7, $y + 18, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then + $x += $width + Return 3 + Else + $x -= 1 + Local $pixel1[3] = [$x + 4, $y + 4, $c1], $pixel2[3] = [$x + 5, $y + 11, $c2], $pixel3[3] = [$x + 7, $y + 18, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then + $x += $width + Return 3 + Else + $x += 2 + Local $pixel1[3] = [$x + 4, $y + 4, $c1], $pixel2[3] = [$x + 5, $y + 11, $c2], $pixel3[3] = [$x + 7, $y + 18, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then + $x += $width + Return 3 + Else + $x -= 1 + EndIf + EndIf + EndIf + + ;Search for digit 4 + $width = 16 + Select + Case $type = "ReturnHome" + Local $c1 = Hex(0x050505, 10), $c2 = Hex(0x050505, 10), $c3 = Hex(0x878684, 10) + EndSelect + Local $pixel1[3] = [$x + 3, $y + 4, $c1], $pixel2[3] = [$x + 4, $y + 2, $c2], $pixel3[3] = [$x + 2, $y + 7, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then + $x += $width + Return 4 + Else + $x -= 1 + Local $pixel1[3] = [$x + 3, $y + 4, $c1], $pixel2[3] = [$x + 4, $y + 2, $c2], $pixel3[3] = [$x + 2, $y + 7, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then + $x += $width + Return 4 + Else + $x += 2 + Local $pixel1[3] = [$x + 3, $y + 4, $c1], $pixel2[3] = [$x + 4, $y + 2, $c2], $pixel3[3] = [$x + 2, $y + 7, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then + $x += $width + Return 4 + Else + $x -= 1 + EndIf + EndIf + EndIf + + ;Search for digit 5 + $width = 13 + Select + Case $type = "ReturnHome" + Local $c1 = Hex(0xA19D9E, 10), $c2 = Hex(0x121210, 10), $c3 = Hex(0xB2B1AD, 10) + EndSelect + Local $pixel1[3] = [$x + 6, $y + 5, $c1], $pixel2[3] = [$x + 6, $y + 12, $c2], $pixel3[3] = [$x + 8, $y + 17, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then + $x += $width + Return 5 + Else + $x -= 1 + Local $pixel1[3] = [$x + 6, $y + 5, $c1], $pixel2[3] = [$x + 6, $y + 12, $c2], $pixel3[3] = [$x + 8, $y + 17, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then + $x += $width + Return 5 + Else + $x += 2 + Local $pixel1[3] = [$x + 6, $y + 5, $c1], $pixel2[3] = [$x + 6, $y + 12, $c2], $pixel3[3] = [$x + 8, $y + 17, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then + $x += $width + Return 5 + Else + $x -= 1 + EndIf + EndIf + EndIf + + ;Search for digit 6 + $width = 15 + Select + Case $type = "ReturnHome" + Local $c1 = Hex(0x000000, 6), $c2 = Hex(0x000000, 6), $c3 = Hex(0x000000, 6) + EndSelect + Local $pixel1[3] = [$x + 7, $y + 6, $c1], $pixel2[3] = [$x + 7, $y + 12, $c2], $pixel3[3] = [$x + 11, $y + 7, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then + $x += $width + Return 6 + Else + $x -= 1 + Local $pixel1[3] = [$x + 7, $y + 6, $c1], $pixel2[3] = [$x + 7, $y + 12, $c2], $pixel3[3] = [$x + 11, $y + 7, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then + $x += $width + Return 6 + Else + $x += 2 + Local $pixel1[3] = [$x + 7, $y + 6, $c1], $pixel2[3] = [$x + 7, $y + 12, $c2], $pixel3[3] = [$x + 11, $y + 7, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then + $x += $width + Return 6 + Else + $x -= 1 + EndIf + EndIf + EndIf + + ;Search for digit 7 + $width = 13 + Select + Case $type = "ReturnHome" + Local $c1 = Hex(0xB1AFB0, 10), $c2 = Hex(0x8A8B83, 10), $c3 = Hex(0xAEACB1, 10) + EndSelect + Local $pixel1[3] = [$x + 7, $y + 15, $c1], $pixel2[3] = [$x + 6, $y + 5, $c2], $pixel3[3] = [$x + 10, $y + 9, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then + $x += $width + Return 7 + Else + $x -= 1 + Local $pixel1[3] = [$x + 7, $y + 15, $c1], $pixel2[3] = [$x + 6, $y + 5, $c2], $pixel3[3] = [$x + 10, $y + 9, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then + $x += $width + Return 7 + Else + $x += 2 + Local $pixel1[3] = [$x + 7, $y + 15, $c1], $pixel2[3] = [$x + 6, $y + 5, $c2], $pixel3[3] = [$x + 10, $y + 9, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then + $x += $width + Return 7 + Else + $x -= 1 + EndIf + EndIf + EndIf + + ;Search for digit 8 + $width = 16 + Select + Case $type = "ReturnHome" + Local $c1 = Hex(0x5B5A5F, 10), $c2 = Hex(0x0E0E18, 10), $c3 = Hex(0x000000, 6) + EndSelect + Local $pixel1[3] = [$x + 8, $y + 4, $c1], $pixel2[3] = [$x + 7, $y + 14, $c2], $pixel3[3] = [$x + 2, $y + 9, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then + $x += $width + Return 8 + Else + $x -= 1 + Local $pixel1[3] = [$x + 8, $y + 4, $c1], $pixel2[3] = [$x + 7, $y + 14, $c2], $pixel3[3] = [$x + 2, $y + 9, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then + $x += $width + Return 8 + Else + $x += 2 + Local $pixel1[3] = [$x + 8, $y + 4, $c1], $pixel2[3] = [$x + 7, $y + 14, $c2], $pixel3[3] = [$x + 2, $y + 9, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then + $x += $width + Return 8 + Else + $x -= 1 + EndIf + EndIf + EndIf + + ;Search for digit 9 + $width = 14 + Select + Case $type = "ReturnHome" + Local $c1 = Hex(0x050505, 6), $c2 = Hex(0x101010, 6), $c3 = Hex(0x121212, 6) + EndSelect + Local $pixel1[3] = [$x + 7, $y + 6, $c1], $pixel2[3] = [$x + 7, $y + 12, $c2], $pixel3[3] = [$x + 11, $y + 17, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then + $x += $width + Return 9 + Else + $x -= 1 + Local $pixel1[3] = [$x + 5, $y + 5, $c1], $pixel2[3] = [$x + 5, $y + 9, $c2], $pixel3[3] = [$x + 8, $y + 12, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then + $x += $width + Return 9 + Else + $x += 2 + Local $pixel1[3] = [$x + 5, $y + 5, $c1], $pixel2[3] = [$x + 5, $y + 9, $c2], $pixel3[3] = [$x + 8, $y + 12, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then + $x += $width + Return 9 + Else + $x -= 1 + EndIf + EndIf + EndIf + + Return "" +EndFunc ;==>getDigitLarge diff --git a/COCBot/functions/Read Text/getDigitLastRaid.au3 b/COCBot/functions/Read Text/getDigitLastRaid.au3 index 3df7c25..feed304 100644 --- a/COCBot/functions/Read Text/getDigitLastRaid.au3 +++ b/COCBot/functions/Read Text/getDigitLastRaid.au3 @@ -1,136 +1,136 @@ -;============================================================================================================== -;===Get Digit LastRaid========================================================================================= -;-------------------------------------------------------------------------------------------------------------- -;Finds pixel color pattern of specific X and Y values, returns digit if pixel color pattern found. -;-------------------------------------------------------------------------------------------------------------- - -Func getDigitLastRaid(ByRef $x, $y, $type) - - Local $Resource = "" - - While $x <> 440 - $x += 1 - - ;Check for Negative sign - If $type = "LastRaidTrophy" Then - ;Done - ;Search for negative sign - Local $c1 = Hex(0x979797, 6), $c2 = Hex(0x474747, 6), $c3 = Hex(0xFFFFFF, 6) - Local $pixel1[3] = [$x + 1, $y + 9, $c1], $pixel2[3] = [$x + 5, $y + 13, $c2], $pixel3[3] = [$x + 3, $y + 11, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3) Then - $x += 5 - $Resource &= "-" - ContinueLoop - EndIf - EndIf - - ;Done - ;Search for digit 9 - Local $c1 = Hex(0xA6A6A6, 6), $c2 = Hex(0x414141, 6), $c3 = Hex(0x8F8F8F, 6) - Local $pixel1[3] = [$x + 6, $y + 5, $c1], $pixel2[3] = [$x + 8, $y + 13, $c2], $pixel3[3] = [$x + 9, $y + 17, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3) Then - $x += 5 - $Resource &= 9 - ContinueLoop - EndIf - - ;Done - ;Search for digit 8 - Local $c1 = Hex(0x575757, 6), $c2 = Hex(0xB7B7B7, 6), $c3 = Hex(0xA7A7A7, 6) - Local $pixel1[3] = [$x + 7, $y + 4, $c1], $pixel2[3] = [$x + 7, $y + 11, $c2], $pixel3[3] = [$x + 12, $y + 8, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3) Then - $x += 5 - $Resource &= 8 - ContinueLoop - EndIf - - ;Done - ;Search for digit 7 - Local $c1 = Hex(0xB8B8B8, 6), $c2 = Hex(0xC1C1C1, 6), $c3 = Hex(0x808080, 6) - Local $pixel1[3] = [$x + 11, $y + 1, $c1], $pixel2[3] = [$x + 5, $y + 8, $c2], $pixel3[3] = [$x + 2, $y + 14, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3) Then - $x += 5 - $Resource &= 7 - ContinueLoop - EndIf - - ;Done - ;Search for digit 6 - Local $c1 = Hex(0xB4B4B4, 6), $c2 = Hex(0x7D7D7D, 6), $c3 = Hex(0xB9B9B9, 6) - Local $pixel1[3] = [$x, $y + 5, $c1], $pixel2[3] = [$x + 5, $y + 6, $c2], $pixel3[3] = [$x + 5, $y + 14, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3) Then - $x += 5 - $Resource &= 6 - ContinueLoop - EndIf - - ;Done - ;Search for digit 5 - Local $c1 = Hex(0x9F9F9F, 6), $c2 = Hex(0xB7B7B7, 6), $c3 = Hex(0x6F6F6F, 6) - Local $pixel1[3] = [$x + 6, $y + 5, $c1], $pixel2[3] = [$x + 7, $y + 12, $c2], $pixel3[3] = [$x + 9, $y + 17, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3) Then - $x += 5 - $Resource &= 5 - ContinueLoop - EndIf - - ;Done - ;Search for digit 4 - Local $c1 = Hex(0x818181, 6), $c2 = Hex(0x686868, 6), $c3 = Hex(0x979797, 6) - Local $pixel1[3] = [$x + 10, $y + 1, $c1], $pixel2[3] = [$x + 8, $y + 10, $c2], $pixel3[3] = [$x + 8, $y + 14, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3) Then - $x += 5 - $Resource &= 4 - ContinueLoop - EndIf - - ;Done - ;Search for digit 3 - Local $c1 = Hex(0xB1B1B1, 6), $c2 = Hex(0xCECECE, 6), $c3 = Hex(0x909090, 6) - Local $pixel1[3] = [$x + 9, $y + 1, $c1], $pixel2[3] = [$x + 7, $y + 6, $c2], $pixel3[3] = [$x + 5, $y + 14, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3) Then - $x += 5 - $Resource &= 3 - ContinueLoop - EndIf - - ;Done - ;Search for digit 2 - Local $c1 = Hex(0x292929, 6), $c2 = Hex(0x464646, 6), $c3 = Hex(0xB8B8B8, 6) - Local $pixel1[3] = [$x + 7, $y + 6, $c1], $pixel2[3] = [$x + 6, $y + 13, $c2], $pixel3[3] = [$x + 7, $y + 14, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3) Then - $x += 5 - $Resource &= 2 - ContinueLoop - EndIf - - ;Done - ;Search for digit 1 - Local $c1 = Hex(0x888888, 6), $c2 = Hex(0x7B7B7B, 6), $c3 = Hex(0xBFBFBF, 6) - Local $pixel1[3] = [$x + 5, $y + 1, $c1], $pixel2[3] = [$x + 2, $y + 17, $c2], $pixel3[3] = [$x + 6, $y + 17, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3) Then - $x += 5 - $Resource &= 1 - ContinueLoop - EndIf - - ;Done - ;Search for digit 0 - Local $c1 = Hex(0x9E9E9E, 6), $c2 = Hex(0x8F8F8F, 6), $c3 = Hex(0xD6D6D6, 6) - Local $pixel1[3] = [$x + 3, $y + 2, $c1], $pixel2[3] = [$x + 10, $y + 6, $c2], $pixel3[3] = [$x + 6, $y + 14, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3) Then - $x += 5 - $Resource &= 0 - ContinueLoop - EndIf - - ;For Dark Elixir, if there is a digit 1 $y set pixel offset - If $x = 440 And $Resource = "" And $type = "LastRaidDarkElixir" Then - $x = 330 - $y += 1 - EndIf - WEnd - - Return $Resource - -EndFunc ;==>getDigitLastRaid +;============================================================================================================== +;===Get Digit LastRaid========================================================================================= +;-------------------------------------------------------------------------------------------------------------- +;Finds pixel color pattern of specific X and Y values, returns digit if pixel color pattern found. +;-------------------------------------------------------------------------------------------------------------- + +Func getDigitLastRaid(ByRef $x, $y, $type) + + Local $Resource = "" + + While $x <> 440 + $x += 1 + + ;Check for Negative sign + If $type = "LastRaidTrophy" Then + ;Done + ;Search for negative sign + Local $c1 = Hex(0x979797, 6), $c2 = Hex(0x474747, 6), $c3 = Hex(0xFFFFFF, 6) + Local $pixel1[3] = [$x + 1, $y + 9, $c1], $pixel2[3] = [$x + 5, $y + 13, $c2], $pixel3[3] = [$x + 3, $y + 11, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3) Then + $x += 5 + $Resource &= "-" + ContinueLoop + EndIf + EndIf + + ;Done + ;Search for digit 9 + Local $c1 = Hex(0xA6A6A6, 6), $c2 = Hex(0x414141, 6), $c3 = Hex(0x8F8F8F, 6) + Local $pixel1[3] = [$x + 6, $y + 5, $c1], $pixel2[3] = [$x + 8, $y + 13, $c2], $pixel3[3] = [$x + 9, $y + 17, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3) Then + $x += 5 + $Resource &= 9 + ContinueLoop + EndIf + + ;Done + ;Search for digit 8 + Local $c1 = Hex(0x575757, 6), $c2 = Hex(0xB7B7B7, 6), $c3 = Hex(0xA7A7A7, 6) + Local $pixel1[3] = [$x + 7, $y + 4, $c1], $pixel2[3] = [$x + 7, $y + 11, $c2], $pixel3[3] = [$x + 12, $y + 8, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3) Then + $x += 5 + $Resource &= 8 + ContinueLoop + EndIf + + ;Done + ;Search for digit 7 + Local $c1 = Hex(0xB8B8B8, 6), $c2 = Hex(0xC1C1C1, 6), $c3 = Hex(0x808080, 6) + Local $pixel1[3] = [$x + 11, $y + 1, $c1], $pixel2[3] = [$x + 5, $y + 8, $c2], $pixel3[3] = [$x + 2, $y + 14, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3) Then + $x += 5 + $Resource &= 7 + ContinueLoop + EndIf + + ;Done + ;Search for digit 6 + Local $c1 = Hex(0xB4B4B4, 6), $c2 = Hex(0x7D7D7D, 6), $c3 = Hex(0xB9B9B9, 6) + Local $pixel1[3] = [$x, $y + 5, $c1], $pixel2[3] = [$x + 5, $y + 6, $c2], $pixel3[3] = [$x + 5, $y + 14, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3) Then + $x += 5 + $Resource &= 6 + ContinueLoop + EndIf + + ;Done + ;Search for digit 5 + Local $c1 = Hex(0x9F9F9F, 6), $c2 = Hex(0xB7B7B7, 6), $c3 = Hex(0x6F6F6F, 6) + Local $pixel1[3] = [$x + 6, $y + 5, $c1], $pixel2[3] = [$x + 7, $y + 12, $c2], $pixel3[3] = [$x + 9, $y + 17, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3) Then + $x += 5 + $Resource &= 5 + ContinueLoop + EndIf + + ;Done + ;Search for digit 4 + Local $c1 = Hex(0x818181, 6), $c2 = Hex(0x686868, 6), $c3 = Hex(0x979797, 6) + Local $pixel1[3] = [$x + 10, $y + 1, $c1], $pixel2[3] = [$x + 8, $y + 10, $c2], $pixel3[3] = [$x + 8, $y + 14, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3) Then + $x += 5 + $Resource &= 4 + ContinueLoop + EndIf + + ;Done + ;Search for digit 3 + Local $c1 = Hex(0xB1B1B1, 6), $c2 = Hex(0xCECECE, 6), $c3 = Hex(0x909090, 6) + Local $pixel1[3] = [$x + 9, $y + 1, $c1], $pixel2[3] = [$x + 7, $y + 6, $c2], $pixel3[3] = [$x + 5, $y + 14, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3) Then + $x += 5 + $Resource &= 3 + ContinueLoop + EndIf + + ;Done + ;Search for digit 2 + Local $c1 = Hex(0x292929, 6), $c2 = Hex(0x464646, 6), $c3 = Hex(0xB8B8B8, 6) + Local $pixel1[3] = [$x + 7, $y + 6, $c1], $pixel2[3] = [$x + 6, $y + 13, $c2], $pixel3[3] = [$x + 7, $y + 14, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3) Then + $x += 5 + $Resource &= 2 + ContinueLoop + EndIf + + ;Done + ;Search for digit 1 + Local $c1 = Hex(0x888888, 6), $c2 = Hex(0x7B7B7B, 6), $c3 = Hex(0xBFBFBF, 6) + Local $pixel1[3] = [$x + 5, $y + 1, $c1], $pixel2[3] = [$x + 2, $y + 17, $c2], $pixel3[3] = [$x + 6, $y + 17, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3) Then + $x += 5 + $Resource &= 1 + ContinueLoop + EndIf + + ;Done + ;Search for digit 0 + Local $c1 = Hex(0x9E9E9E, 6), $c2 = Hex(0x8F8F8F, 6), $c3 = Hex(0xD6D6D6, 6) + Local $pixel1[3] = [$x + 3, $y + 2, $c1], $pixel2[3] = [$x + 10, $y + 6, $c2], $pixel3[3] = [$x + 6, $y + 14, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3) Then + $x += 5 + $Resource &= 0 + ContinueLoop + EndIf + + ;For Dark Elixir, if there is a digit 1 $y set pixel offset + If $x = 440 And $Resource = "" And $type = "LastRaidDarkElixir" Then + $x = 330 + $y += 1 + EndIf + WEnd + + Return $Resource + +EndFunc ;==>getDigitLastRaid diff --git a/COCBot/functions/Read Text/getDigitSmall.au3 b/COCBot/functions/Read Text/getDigitSmall.au3 index 2424f21..3f7fb9e 100644 --- a/COCBot/functions/Read Text/getDigitSmall.au3 +++ b/COCBot/functions/Read Text/getDigitSmall.au3 @@ -1,300 +1,300 @@ -;============================================================================================================== -;===Get Digit Small============================================================================================= -;-------------------------------------------------------------------------------------------------------------- -;Finds pixel color pattern of specific X and Y values, returns digit if pixel color pattern found. -;-------------------------------------------------------------------------------------------------------------- - -Func getDigitSmall(ByRef $x, $y, $type) - Local $width = 0 - - ;Search for digit 0 - $width = 10 - Select - Case $type = "Camp" - Local $c1 = Hex(0x979797, 6), $c2 = Hex(0x050505, 6), $c3 = Hex(0xD8D8D8, 6) - EndSelect - - For $i = 0 To 1 - Local $pixel1[3] = [$x + 5, $y + 3, $c1], $pixel2[3] = [$x + 5, $y + 4, $c2], $pixel3[3] = [$x + 6, $y + 8, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then - $x += $width ;Adds to x coordinate to get the next digit - Return "0" - Else - $x -= 1 ;Solves the problem when the spaces between the middle goes from 6 to 5 pixels - Local $pixel1[3] = [$x + 5, $y + 3, $c1], $pixel2[3] = [$x + 5, $y + 4, $c2], $pixel3[3] = [$x + 6, $y + 8, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then - $x += $width ;Changes x coordinate for the next digit. - Return "0" - Else - $x += 2 ;Solves the problem when there is 1 pixel space between a set of numbers - Local $pixel1[3] = [$x + 5, $y + 3, $c1], $pixel2[3] = [$x + 5, $y + 4, $c2], $pixel3[3] = [$x + 6, $y + 8, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then - $x += $width - Return "0" - Else - $x -= 1 - EndIf - EndIf - EndIf - If $i = 0 Then $x -= 1 - Next - $x += 1 - - ;Search for digit 1 - $width = 4 - Select - Case $type = "Camp" - Local $c1 = Hex(0xBEBEBE, 6), $c2 = Hex(0x9C9C9C, 6), $c3 = Hex(0x070707, 6) - EndSelect - Local $pixel1[3] = [$x + 1, $y + 3, $c1], $pixel2[3] = [$x + 1, $y + 9, $c2], $pixel3[3] = [$x + 2, $y + 10, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then - $x += $width - Return 1 - Else - $x -= 1 - Local $pixel1[3] = [$x + 1, $y + 3, $c1], $pixel2[3] = [$x + 1, $y + 9, $c2], $pixel3[3] = [$x + 2, $y + 10, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then - $x += $width - Return 1 - Else - $x += 2 - Local $pixel1[3] = [$x + 1, $y + 3, $c1], $pixel2[3] = [$x + 1, $y + 9, $c2], $pixel3[3] = [$x + 2, $y + 10, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then - $x += $width - Return 1 - Else - $x -= 1 - EndIf - EndIf - EndIf - - ;Search for digit 2 - $width = 8 - Select - Case $type = "Camp" - Local $c1 = Hex(0x000000, 6), $c2 = Hex(0xC7C7C7, 6), $c3 = Hex(0x9F9F9F, 6) - EndSelect - Local $pixel1[3] = [$x + 1, $y + 4, $c1], $pixel2[3] = [$x + 3, $y + 2, $c2], $pixel3[3] = [$x + 3, $y + 7, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then - $x += $width - Return 2 - Else - $x -= 1 - Local $pixel1[3] = [$x + 1, $y + 4, $c1], $pixel2[3] = [$x + 3, $y + 2, $c2], $pixel3[3] = [$x + 3, $y + 7, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then - $x += $width - Return 2 - Else - $x += 2 - Local $pixel1[3] = [$x + 1, $y + 4, $c1], $pixel2[3] = [$x + 3, $y + 2, $c2], $pixel3[3] = [$x + 3, $y + 7, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then - $x += $width - Return 2 - Else - $x -= 1 - EndIf - EndIf - EndIf - - ;Search for digit 3 - $width = 8 - Select - Case $type = "Camp" - Local $c1 = Hex(0xA1A1A1, 6), $c2 = Hex(0xF9F9F9, 6), $c3 = Hex(0x1E1E1E, 6) - EndSelect - Local $pixel1[3] = [$x + 6, $y + 1, $c1], $pixel2[3] = [$x + 3, $y + 8, $c2], $pixel3[3] = [$x + 4, $y + 10, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then - $x += $width - Return 3 - Else - $x -= 1 - Local $pixel1[3] = [$x + 6, $y + 1, $c1], $pixel2[3] = [$x + 3, $y + 8, $c2], $pixel3[3] = [$x + 4, $y + 10, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then - $x += $width - Return 3 - Else - $x += 2 - Local $pixel1[3] = [$x + 6, $y + 1, $c1], $pixel2[3] = [$x + 3, $y + 8, $c2], $pixel3[3] = [$x + 4, $y + 10, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then - $x += $width - Return 3 - Else - $x -= 1 - EndIf - EndIf - EndIf - - ;Search for digit 4 - For $i = 0 To 1 - $width = 9 - Select - Case $type = "Camp" - Local $c1 = Hex(0xC9C9C9, 6), $c2 = Hex(0x202020, 6), $c3 = Hex(0x1E1E1E, 6) - EndSelect - Local $pixel1[3] = [$x + 2, $y + 4, $c1], $pixel2[3] = [$x + 3, $y + 1, $c2], $pixel3[3] = [$x + 2, $y + 8, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then - $x += $width - Return 4 - Else - $x -= 1 - Local $pixel1[3] = [$x + 2, $y + 4, $c1], $pixel2[3] = [$x + 3, $y + 1, $c2], $pixel3[3] = [$x + 2, $y + 8, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then - $x += $width - Return 4 - Else - $x += 2 - Local $pixel1[3] = [$x + 2, $y + 4, $c1], $pixel2[3] = [$x + 3, $y + 1, $c2], $pixel3[3] = [$x + 2, $y + 8, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then - $x += $width - Return 4 - Else - $x -= 1 - EndIf - EndIf - EndIf - If $i = 0 Then $x -= 3 - Next - $x += 3 - - ;Search for digit 5 - $width = 8 - Select - Case $type = "Camp" - Local $c1 = Hex(0xE8E8E8, 6), $c2 = Hex(0x242424, 6), $c3 = Hex(0x9F9F9F, 6) - EndSelect - Local $pixel1[3] = [$x + 5, $y + 2, $c1], $pixel2[3] = [$x + 4, $y + 7, $c2], $pixel3[3] = [$x + 6, $y + 9, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then - $x += $width - Return 5 - Else - $x -= 1 - Local $pixel1[3] = [$x + 5, $y + 2, $c1], $pixel2[3] = [$x + 4, $y + 7, $c2], $pixel3[3] = [$x + 6, $y + 9, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then - $x += $width - Return 5 - Else - $x += 2 - Local $pixel1[3] = [$x + 5, $y + 2, $c1], $pixel2[3] = [$x + 4, $y + 7, $c2], $pixel3[3] = [$x + 6, $y + 9, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then - $x += $width - Return 5 - Else - $x -= 1 - EndIf - EndIf - EndIf - - ;Search for digit 6 - $width = 8 - Select - Case $type = "Camp" - Local $c1 = Hex(0xAFAFAF, 6), $c2 = Hex(0x878787, 6), $c3 = Hex(0x070707, 6) - EndSelect - Local $pixel1[3] = [$x + 5, $y + 2, $c1], $pixel2[3] = [$x + 4, $y + 6, $c2], $pixel3[3] = [$x + 7, $y + 10, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then - $x += $width - Return 6 - Else - $x -= 1 - Local $pixel1[3] = [$x + 5, $y + 2, $c1], $pixel2[3] = [$x + 4, $y + 6, $c2], $pixel3[3] = [$x + 7, $y + 10, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then - $x += $width - Return 6 - Else - $x += 2 - Local $pixel1[3] = [$x + 5, $y + 2, $c1], $pixel2[3] = [$x + 4, $y + 6, $c2], $pixel3[3] = [$x + 7, $y + 10, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then - $x += $width - Return 6 - Else - $x -= 1 - EndIf - EndIf - EndIf - - ;Search for digit 7 - $width = 8 - Select - Case $type = "Camp" - Local $c1 = Hex(0xCFCFCF, 6), $c2 = Hex(0xAFAFAF, 6), $c3 = Hex(0xBFBFBF, 6) - EndSelect - Local $pixel1[3] = [$x + 4, $y + 7, $c1], $pixel2[3] = [$x + 2, $y + 2, $c2], $pixel3[3] = [$x + 3, $y + 2, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then - $x += $width - Return 7 - Else - $x -= 1 - Local $pixel1[3] = [$x + 4, $y + 7, $c1], $pixel2[3] = [$x + 2, $y + 2, $c2], $pixel3[3] = [$x + 3, $y + 2, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then - $x += $width - Return 7 - Else - $x += 2 - Local $pixel1[3] = [$x + 4, $y + 7, $c1], $pixel2[3] = [$x + 2, $y + 2, $c2], $pixel3[3] = [$x + 3, $y + 2, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then - $x += $width - Return 7 - Else - $x -= 1 - EndIf - EndIf - EndIf - - ;Search for digit 8 - $width = 9 - Select - Case $type = "Camp" - Local $c1 = Hex(0x6F6F6F, 6), $c2 = Hex(0x959595, 6), $c3 = Hex(0x7D7D7D, 6) - EndSelect - Local $pixel1[3] = [$x + 4, $y + 2, $c1], $pixel2[3] = [$x + 5, $y + 7, $c2], $pixel3[3] = [$x + 1, $y + 5, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then - $x += $width - Return 8 - Else - $x -= 1 - Local $pixel1[3] = [$x + 4, $y + 2, $c1], $pixel2[3] = [$x + 5, $y + 7, $c2], $pixel3[3] = [$x + 1, $y + 5, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then - $x += $width - Return 8 - Else - $x += 2 - Local $pixel1[3] = [$x + 4, $y + 2, $c1], $pixel2[3] = [$x + 5, $y + 7, $c2], $pixel3[3] = [$x + 1, $y + 5, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then - $x += $width - Return 8 - Else - $x -= 1 - EndIf - EndIf - EndIf - - ;Search for digit 9 - $width = 9 - Select - Case $type = "Camp" - Local $c1 = Hex(0x070707, 6), $c2 = Hex(0xAFAFAF, 6), $c3 = Hex(0x5F5F5F, 6) - EndSelect - Local $pixel1[3] = [$x + 4, $y + 3, $c1], $pixel2[3] = [$x + 5, $y + 9, $c2], $pixel3[3] = [$x + 6, $y + 9, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then - $x += $width - Return 9 - Else - $x -= 1 - Local $pixel1[3] = [$x + 4, $y + 3, $c1], $pixel2[3] = [$x + 5, $y + 9, $c2], $pixel3[3] = [$x + 6, $y + 9, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then - $x += $width - Return 9 - Else - $x += 2 - Local $pixel1[3] = [$x + 4, $y + 3, $c1], $pixel2[3] = [$x + 5, $y + 9, $c2], $pixel3[3] = [$x + 6, $y + 9, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then - $x += $width - Return 9 - Else - $x -= 1 - EndIf - EndIf - EndIf - - Return "" -EndFunc ;==>getDigitSmall +;============================================================================================================== +;===Get Digit Small============================================================================================= +;-------------------------------------------------------------------------------------------------------------- +;Finds pixel color pattern of specific X and Y values, returns digit if pixel color pattern found. +;-------------------------------------------------------------------------------------------------------------- + +Func getDigitSmall(ByRef $x, $y, $type) + Local $width = 0 + + ;Search for digit 0 + $width = 10 + Select + Case $type = "Camp" + Local $c1 = Hex(0x979797, 6), $c2 = Hex(0x050505, 6), $c3 = Hex(0xD8D8D8, 6) + EndSelect + + For $i = 0 To 1 + Local $pixel1[3] = [$x + 5, $y + 3, $c1], $pixel2[3] = [$x + 5, $y + 4, $c2], $pixel3[3] = [$x + 6, $y + 8, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then + $x += $width ;Adds to x coordinate to get the next digit + Return "0" + Else + $x -= 1 ;Solves the problem when the spaces between the middle goes from 6 to 5 pixels + Local $pixel1[3] = [$x + 5, $y + 3, $c1], $pixel2[3] = [$x + 5, $y + 4, $c2], $pixel3[3] = [$x + 6, $y + 8, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then + $x += $width ;Changes x coordinate for the next digit. + Return "0" + Else + $x += 2 ;Solves the problem when there is 1 pixel space between a set of numbers + Local $pixel1[3] = [$x + 5, $y + 3, $c1], $pixel2[3] = [$x + 5, $y + 4, $c2], $pixel3[3] = [$x + 6, $y + 8, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then + $x += $width + Return "0" + Else + $x -= 1 + EndIf + EndIf + EndIf + If $i = 0 Then $x -= 1 + Next + $x += 1 + + ;Search for digit 1 + $width = 4 + Select + Case $type = "Camp" + Local $c1 = Hex(0xBEBEBE, 6), $c2 = Hex(0x9C9C9C, 6), $c3 = Hex(0x070707, 6) + EndSelect + Local $pixel1[3] = [$x + 1, $y + 3, $c1], $pixel2[3] = [$x + 1, $y + 9, $c2], $pixel3[3] = [$x + 2, $y + 10, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then + $x += $width + Return 1 + Else + $x -= 1 + Local $pixel1[3] = [$x + 1, $y + 3, $c1], $pixel2[3] = [$x + 1, $y + 9, $c2], $pixel3[3] = [$x + 2, $y + 10, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then + $x += $width + Return 1 + Else + $x += 2 + Local $pixel1[3] = [$x + 1, $y + 3, $c1], $pixel2[3] = [$x + 1, $y + 9, $c2], $pixel3[3] = [$x + 2, $y + 10, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then + $x += $width + Return 1 + Else + $x -= 1 + EndIf + EndIf + EndIf + + ;Search for digit 2 + $width = 8 + Select + Case $type = "Camp" + Local $c1 = Hex(0x000000, 6), $c2 = Hex(0xC7C7C7, 6), $c3 = Hex(0x9F9F9F, 6) + EndSelect + Local $pixel1[3] = [$x + 1, $y + 4, $c1], $pixel2[3] = [$x + 3, $y + 2, $c2], $pixel3[3] = [$x + 3, $y + 7, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then + $x += $width + Return 2 + Else + $x -= 1 + Local $pixel1[3] = [$x + 1, $y + 4, $c1], $pixel2[3] = [$x + 3, $y + 2, $c2], $pixel3[3] = [$x + 3, $y + 7, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then + $x += $width + Return 2 + Else + $x += 2 + Local $pixel1[3] = [$x + 1, $y + 4, $c1], $pixel2[3] = [$x + 3, $y + 2, $c2], $pixel3[3] = [$x + 3, $y + 7, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then + $x += $width + Return 2 + Else + $x -= 1 + EndIf + EndIf + EndIf + + ;Search for digit 3 + $width = 8 + Select + Case $type = "Camp" + Local $c1 = Hex(0xA1A1A1, 6), $c2 = Hex(0xF9F9F9, 6), $c3 = Hex(0x1E1E1E, 6) + EndSelect + Local $pixel1[3] = [$x + 6, $y + 1, $c1], $pixel2[3] = [$x + 3, $y + 8, $c2], $pixel3[3] = [$x + 4, $y + 10, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then + $x += $width + Return 3 + Else + $x -= 1 + Local $pixel1[3] = [$x + 6, $y + 1, $c1], $pixel2[3] = [$x + 3, $y + 8, $c2], $pixel3[3] = [$x + 4, $y + 10, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then + $x += $width + Return 3 + Else + $x += 2 + Local $pixel1[3] = [$x + 6, $y + 1, $c1], $pixel2[3] = [$x + 3, $y + 8, $c2], $pixel3[3] = [$x + 4, $y + 10, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then + $x += $width + Return 3 + Else + $x -= 1 + EndIf + EndIf + EndIf + + ;Search for digit 4 + For $i = 0 To 1 + $width = 9 + Select + Case $type = "Camp" + Local $c1 = Hex(0xC9C9C9, 6), $c2 = Hex(0x202020, 6), $c3 = Hex(0x1E1E1E, 6) + EndSelect + Local $pixel1[3] = [$x + 2, $y + 4, $c1], $pixel2[3] = [$x + 3, $y + 1, $c2], $pixel3[3] = [$x + 2, $y + 8, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then + $x += $width + Return 4 + Else + $x -= 1 + Local $pixel1[3] = [$x + 2, $y + 4, $c1], $pixel2[3] = [$x + 3, $y + 1, $c2], $pixel3[3] = [$x + 2, $y + 8, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then + $x += $width + Return 4 + Else + $x += 2 + Local $pixel1[3] = [$x + 2, $y + 4, $c1], $pixel2[3] = [$x + 3, $y + 1, $c2], $pixel3[3] = [$x + 2, $y + 8, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then + $x += $width + Return 4 + Else + $x -= 1 + EndIf + EndIf + EndIf + If $i = 0 Then $x -= 3 + Next + $x += 3 + + ;Search for digit 5 + $width = 8 + Select + Case $type = "Camp" + Local $c1 = Hex(0xE8E8E8, 6), $c2 = Hex(0x242424, 6), $c3 = Hex(0x9F9F9F, 6) + EndSelect + Local $pixel1[3] = [$x + 5, $y + 2, $c1], $pixel2[3] = [$x + 4, $y + 7, $c2], $pixel3[3] = [$x + 6, $y + 9, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then + $x += $width + Return 5 + Else + $x -= 1 + Local $pixel1[3] = [$x + 5, $y + 2, $c1], $pixel2[3] = [$x + 4, $y + 7, $c2], $pixel3[3] = [$x + 6, $y + 9, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then + $x += $width + Return 5 + Else + $x += 2 + Local $pixel1[3] = [$x + 5, $y + 2, $c1], $pixel2[3] = [$x + 4, $y + 7, $c2], $pixel3[3] = [$x + 6, $y + 9, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then + $x += $width + Return 5 + Else + $x -= 1 + EndIf + EndIf + EndIf + + ;Search for digit 6 + $width = 8 + Select + Case $type = "Camp" + Local $c1 = Hex(0xAFAFAF, 6), $c2 = Hex(0x878787, 6), $c3 = Hex(0x070707, 6) + EndSelect + Local $pixel1[3] = [$x + 5, $y + 2, $c1], $pixel2[3] = [$x + 4, $y + 6, $c2], $pixel3[3] = [$x + 7, $y + 10, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then + $x += $width + Return 6 + Else + $x -= 1 + Local $pixel1[3] = [$x + 5, $y + 2, $c1], $pixel2[3] = [$x + 4, $y + 6, $c2], $pixel3[3] = [$x + 7, $y + 10, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then + $x += $width + Return 6 + Else + $x += 2 + Local $pixel1[3] = [$x + 5, $y + 2, $c1], $pixel2[3] = [$x + 4, $y + 6, $c2], $pixel3[3] = [$x + 7, $y + 10, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then + $x += $width + Return 6 + Else + $x -= 1 + EndIf + EndIf + EndIf + + ;Search for digit 7 + $width = 8 + Select + Case $type = "Camp" + Local $c1 = Hex(0xCFCFCF, 6), $c2 = Hex(0xAFAFAF, 6), $c3 = Hex(0xBFBFBF, 6) + EndSelect + Local $pixel1[3] = [$x + 4, $y + 7, $c1], $pixel2[3] = [$x + 2, $y + 2, $c2], $pixel3[3] = [$x + 3, $y + 2, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then + $x += $width + Return 7 + Else + $x -= 1 + Local $pixel1[3] = [$x + 4, $y + 7, $c1], $pixel2[3] = [$x + 2, $y + 2, $c2], $pixel3[3] = [$x + 3, $y + 2, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then + $x += $width + Return 7 + Else + $x += 2 + Local $pixel1[3] = [$x + 4, $y + 7, $c1], $pixel2[3] = [$x + 2, $y + 2, $c2], $pixel3[3] = [$x + 3, $y + 2, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then + $x += $width + Return 7 + Else + $x -= 1 + EndIf + EndIf + EndIf + + ;Search for digit 8 + $width = 9 + Select + Case $type = "Camp" + Local $c1 = Hex(0x6F6F6F, 6), $c2 = Hex(0x959595, 6), $c3 = Hex(0x7D7D7D, 6) + EndSelect + Local $pixel1[3] = [$x + 4, $y + 2, $c1], $pixel2[3] = [$x + 5, $y + 7, $c2], $pixel3[3] = [$x + 1, $y + 5, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then + $x += $width + Return 8 + Else + $x -= 1 + Local $pixel1[3] = [$x + 4, $y + 2, $c1], $pixel2[3] = [$x + 5, $y + 7, $c2], $pixel3[3] = [$x + 1, $y + 5, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then + $x += $width + Return 8 + Else + $x += 2 + Local $pixel1[3] = [$x + 4, $y + 2, $c1], $pixel2[3] = [$x + 5, $y + 7, $c2], $pixel3[3] = [$x + 1, $y + 5, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then + $x += $width + Return 8 + Else + $x -= 1 + EndIf + EndIf + EndIf + + ;Search for digit 9 + $width = 9 + Select + Case $type = "Camp" + Local $c1 = Hex(0x070707, 6), $c2 = Hex(0xAFAFAF, 6), $c3 = Hex(0x5F5F5F, 6) + EndSelect + Local $pixel1[3] = [$x + 4, $y + 3, $c1], $pixel2[3] = [$x + 5, $y + 9, $c2], $pixel3[3] = [$x + 6, $y + 9, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then + $x += $width + Return 9 + Else + $x -= 1 + Local $pixel1[3] = [$x + 4, $y + 3, $c1], $pixel2[3] = [$x + 5, $y + 9, $c2], $pixel3[3] = [$x + 6, $y + 9, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then + $x += $width + Return 9 + Else + $x += 2 + Local $pixel1[3] = [$x + 4, $y + 3, $c1], $pixel2[3] = [$x + 5, $y + 9, $c2], $pixel3[3] = [$x + 6, $y + 9, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3, 7) Then + $x += $width + Return 9 + Else + $x -= 1 + EndIf + EndIf + EndIf + + Return "" +EndFunc ;==>getDigitSmall diff --git a/COCBot/functions/Read Text/getDigitTH.au3 b/COCBot/functions/Read Text/getDigitTH.au3 index 7484e03..3d02b7c 100644 --- a/COCBot/functions/Read Text/getDigitTH.au3 +++ b/COCBot/functions/Read Text/getDigitTH.au3 @@ -1,74 +1,74 @@ -Func getDigitTH(ByRef $x, $y) - - ;Search for digit 10 - Local $c1 = Hex(0x0A0A0A, 6), $c2 = Hex(0x07090A, 6), $c3 = Hex(0x1C1C1C, 6) - Local $pixel1[3] = [$x + 1, $y + 1, $c1], $pixel2[3] = [$x + 4, $y + 16, $c2], $pixel3[3] = [$x + 19, $y + 9, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3) Then - Return 10 - EndIf - - ;Search for digit 9 - Local $c1 = Hex(0x060606, 6), $c2 = Hex(0x4F4F4F, 6), $c3 = Hex(0x6F6F6F, 6) - Local $pixel1[3] = [$x + 6, $y + 6, $c1], $pixel2[3] = [$x + 4, $y + 11, $c2], $pixel3[3] = [$x + 8, $y + 16, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3) Then - Return 9 - EndIf - - ;Search for digit 8 - Local $c1 = Hex(0x050505, 6), $c2 = Hex(0x060606, 6), $c3 = Hex(0x6A6A6A, 6) - Local $pixel1[3] = [$x + 6, $y + 4, $c1], $pixel2[3] = [$x + 6, $y + 10, $c2], $pixel3[3] = [$x + 1, $y + 8, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3) Then - Return 8 - EndIf - - ;Search for digit 7 - Local $c1 = Hex(0x6E6E6E, 6), $c2 = Hex(0x202020, 6), $c3 = Hex(0x6E6E6E, 6) - Local $pixel1[3] = [$x + 8, $y + 10, $c1], $pixel2[3] = [$x + 5, $y + 4, $c2], $pixel3[3] = [$x + 10, $y + 6, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3) Then - Return 7 - EndIf - - ;Search for digit 6 - Local $c1 = Hex(0xC7C7C7, 6), $c2 = Hex(0x757575, 6), $c3 = Hex(0x969696, 6) - Local $pixel1[3] = [$x + 6, $y + 4, $c1], $pixel2[3] = [$x + 5, $y + 11, $c2], $pixel3[3] = [$x + 2, $y + 15, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3) Then - Return 6 - EndIf - - ;Search for digit 5 - Local $c1 = Hex(0xAFAFAF, 6), $c2 = Hex(0xBFBFBF, 6), $c3 = Hex(0x7F7F7F, 6) - Local $pixel1[3] = [$x + 6, $y + 4, $c1], $pixel2[3] = [$x + 2, $y + 13, $c2], $pixel3[3] = [$x + 10, $y + 4, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3) Then - Return 5 - EndIf - - ;Search for digit 4 - Local $c1 = Hex(0x181818, 6), $c2 = Hex(0x080808, 6), $c3 = Hex(0x0E0E0E, 6) - Local $pixel1[3] = [$x + 3, $y + 3, $c1], $pixel2[3] = [$x + 7, $y + 8, $c2], $pixel3[3] = [$x + 7, $y + 13, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3) Then - Return 4 - EndIf - - ;Search for digit 3 - Local $c1 = Hex(0xA6A6A6, 6), $c2 = Hex(0x909090, 6), $c3 = Hex(0x212121, 6) - Local $pixel1[3] = [$x + 6, $y + 5, $c1], $pixel2[3] = [$x + 9, $y + 7, $c2], $pixel3[3] = [$x + 6, $y + 11, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3) Then - Return 3 - EndIf - - ;Search for digit 2 - Local $c1 = Hex(0x777777, 6), $c2 = Hex(0x1F1F1F, 6), $c3 = Hex(0x989898, 6) - Local $pixel1[3] = [$x + 6, $y + 4, $c1], $pixel2[3] = [$x + 6, $y + 11, $c2], $pixel3[3] = [$x + 4, $y + 7, $c3] - If boolPixelSearch($pixel1, $pixel2, $pixel3) Then - Return 2 - EndIf - - ;Search for digit 1 - ;Local $c1 = Hex(0x383838, 6), $c2 = Hex(0x171615, 6), $c3 = Hex(0x060606, 6) - ;Local $pixel1[3] = [$x + 1, $y + 1, $c1], $pixel2[3] = [$x + 1, $y + 16, $c2], $pixel3[3] = [$x + 4, $y + 16, $c3] - ;If boolPixelSearch($pixel1, $pixel2, $pixel3) Then - ; Return 1 - ;EndIf - - Return "" -EndFunc ;==>getDigitTH +Func getDigitTH(ByRef $x, $y) + + ;Search for digit 10 + Local $c1 = Hex(0x0A0A0A, 6), $c2 = Hex(0x07090A, 6), $c3 = Hex(0x1C1C1C, 6) + Local $pixel1[3] = [$x + 1, $y + 1, $c1], $pixel2[3] = [$x + 4, $y + 16, $c2], $pixel3[3] = [$x + 19, $y + 9, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3) Then + Return 10 + EndIf + + ;Search for digit 9 + Local $c1 = Hex(0x060606, 6), $c2 = Hex(0x4F4F4F, 6), $c3 = Hex(0x6F6F6F, 6) + Local $pixel1[3] = [$x + 6, $y + 6, $c1], $pixel2[3] = [$x + 4, $y + 11, $c2], $pixel3[3] = [$x + 8, $y + 16, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3) Then + Return 9 + EndIf + + ;Search for digit 8 + Local $c1 = Hex(0x050505, 6), $c2 = Hex(0x060606, 6), $c3 = Hex(0x6A6A6A, 6) + Local $pixel1[3] = [$x + 6, $y + 4, $c1], $pixel2[3] = [$x + 6, $y + 10, $c2], $pixel3[3] = [$x + 1, $y + 8, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3) Then + Return 8 + EndIf + + ;Search for digit 7 + Local $c1 = Hex(0x6E6E6E, 6), $c2 = Hex(0x202020, 6), $c3 = Hex(0x6E6E6E, 6) + Local $pixel1[3] = [$x + 8, $y + 10, $c1], $pixel2[3] = [$x + 5, $y + 4, $c2], $pixel3[3] = [$x + 10, $y + 6, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3) Then + Return 7 + EndIf + + ;Search for digit 6 + Local $c1 = Hex(0xC7C7C7, 6), $c2 = Hex(0x757575, 6), $c3 = Hex(0x969696, 6) + Local $pixel1[3] = [$x + 6, $y + 4, $c1], $pixel2[3] = [$x + 5, $y + 11, $c2], $pixel3[3] = [$x + 2, $y + 15, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3) Then + Return 6 + EndIf + + ;Search for digit 5 + Local $c1 = Hex(0xAFAFAF, 6), $c2 = Hex(0xBFBFBF, 6), $c3 = Hex(0x7F7F7F, 6) + Local $pixel1[3] = [$x + 6, $y + 4, $c1], $pixel2[3] = [$x + 2, $y + 13, $c2], $pixel3[3] = [$x + 10, $y + 4, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3) Then + Return 5 + EndIf + + ;Search for digit 4 + Local $c1 = Hex(0x181818, 6), $c2 = Hex(0x080808, 6), $c3 = Hex(0x0E0E0E, 6) + Local $pixel1[3] = [$x + 3, $y + 3, $c1], $pixel2[3] = [$x + 7, $y + 8, $c2], $pixel3[3] = [$x + 7, $y + 13, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3) Then + Return 4 + EndIf + + ;Search for digit 3 + Local $c1 = Hex(0xA6A6A6, 6), $c2 = Hex(0x909090, 6), $c3 = Hex(0x212121, 6) + Local $pixel1[3] = [$x + 6, $y + 5, $c1], $pixel2[3] = [$x + 9, $y + 7, $c2], $pixel3[3] = [$x + 6, $y + 11, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3) Then + Return 3 + EndIf + + ;Search for digit 2 + Local $c1 = Hex(0x777777, 6), $c2 = Hex(0x1F1F1F, 6), $c3 = Hex(0x989898, 6) + Local $pixel1[3] = [$x + 6, $y + 4, $c1], $pixel2[3] = [$x + 6, $y + 11, $c2], $pixel3[3] = [$x + 4, $y + 7, $c3] + If boolPixelSearch($pixel1, $pixel2, $pixel3) Then + Return 2 + EndIf + + ;Search for digit 1 + ;Local $c1 = Hex(0x383838, 6), $c2 = Hex(0x171615, 6), $c3 = Hex(0x060606, 6) + ;Local $pixel1[3] = [$x + 1, $y + 1, $c1], $pixel2[3] = [$x + 1, $y + 16, $c2], $pixel3[3] = [$x + 4, $y + 16, $c3] + ;If boolPixelSearch($pixel1, $pixel2, $pixel3) Then + ; Return 1 + ;EndIf + + Return "" +EndFunc ;==>getDigitTH diff --git a/COCBot/functions/Read Text/getElixir.au3 b/COCBot/functions/Read Text/getElixir.au3 index b63e08f..b96544c 100644 --- a/COCBot/functions/Read Text/getElixir.au3 +++ b/COCBot/functions/Read Text/getElixir.au3 @@ -1,21 +1,21 @@ -;Returns complete Value of elixir xxx,xxx - -Func getElixir($x_start, $y_start) - _CaptureRegion(0, 0, $x_start + 90, $y_start + 20) - ;----------------------------------------------------------------------------- - Local $x = $x_start, $y = $y_start - Local $Elixir, $i = 0 - While getDigit($x, $y + $i, "Elixir") = "" - If $i >= 15 Then ExitLoop - $i += 1 - WEnd - $x = $x_start - $Elixir &= getDigit($x, $y + $i, "Elixir") - $Elixir &= getDigit($x, $y + $i, "Elixir") - $Elixir &= getDigit($x, $y + $i, "Elixir") - $x += 6 - $Elixir &= getDigit($x, $y + $i, "Elixir") - $Elixir &= getDigit($x, $y + $i, "Elixir") - $Elixir &= getDigit($x, $y + $i, "Elixir") - Return $Elixir -EndFunc ;==>getElixir +;Returns complete Value of elixir xxx,xxx + +Func getElixir($x_start, $y_start) + _CaptureRegion(0, 0, $x_start + 90, $y_start + 20) + ;----------------------------------------------------------------------------- + Local $x = $x_start, $y = $y_start + Local $Elixir, $i = 0 + While getDigit($x, $y + $i, "Elixir") = "" + If $i >= 15 Then ExitLoop + $i += 1 + WEnd + $x = $x_start + $Elixir &= getDigit($x, $y + $i, "Elixir") + $Elixir &= getDigit($x, $y + $i, "Elixir") + $Elixir &= getDigit($x, $y + $i, "Elixir") + $x += 6 + $Elixir &= getDigit($x, $y + $i, "Elixir") + $Elixir &= getDigit($x, $y + $i, "Elixir") + $Elixir &= getDigit($x, $y + $i, "Elixir") + Return $Elixir +EndFunc ;==>getElixir diff --git a/COCBot/functions/Read Text/getGold.au3 b/COCBot/functions/Read Text/getGold.au3 index ee2f870..f787e1a 100644 --- a/COCBot/functions/Read Text/getGold.au3 +++ b/COCBot/functions/Read Text/getGold.au3 @@ -1,21 +1,21 @@ -;Gets complete value of gold xxx,xxx - -Func getGold($x_start, $y_start) - _CaptureRegion(0, 0, $x_start + 90, $y_start + 20) - ;----------------------------------------------------------------------------- - Local $x = $x_start, $y = $y_start - Local $Gold, $i = 0 - While getDigit($x, $y + $i, "Gold") = "" - If $i >= 15 Then ExitLoop - $i += 1 - WEnd - $x = $x_start - $Gold &= getDigit($x, $y + $i, "Gold") - $Gold &= getDigit($x, $y + $i, "Gold") - $Gold &= getDigit($x, $y + $i, "Gold") - $x += 6 - $Gold &= getDigit($x, $y + $i, "Gold") - $Gold &= getDigit($x, $y + $i, "Gold") - $Gold &= getDigit($x, $y + $i, "Gold") - Return $Gold -EndFunc ;==>getGold +;Gets complete value of gold xxx,xxx + +Func getGold($x_start, $y_start) + _CaptureRegion(0, 0, $x_start + 90, $y_start + 20) + ;----------------------------------------------------------------------------- + Local $x = $x_start, $y = $y_start + Local $Gold, $i = 0 + While getDigit($x, $y + $i, "Gold") = "" + If $i >= 15 Then ExitLoop + $i += 1 + WEnd + $x = $x_start + $Gold &= getDigit($x, $y + $i, "Gold") + $Gold &= getDigit($x, $y + $i, "Gold") + $Gold &= getDigit($x, $y + $i, "Gold") + $x += 6 + $Gold &= getDigit($x, $y + $i, "Gold") + $Gold &= getDigit($x, $y + $i, "Gold") + $Gold &= getDigit($x, $y + $i, "Gold") + Return $Gold +EndFunc ;==>getGold diff --git a/COCBot/functions/Read Text/getNormal.au3 b/COCBot/functions/Read Text/getNormal.au3 index 5775a8b..7f7e42b 100644 --- a/COCBot/functions/Read Text/getNormal.au3 +++ b/COCBot/functions/Read Text/getNormal.au3 @@ -1,22 +1,22 @@ -;Returns complete value of normal xxx - -Func getNormal($x_start, $y_start) - _CaptureRegion(0, 0, $x_start + 90, $y_start + 20) - ;----------------------------------------------------------------------------- - Local $x = $x_start, $y = $y_start - Local $Normal, $i = 0 - - $Normal = getDigit($x, $y, "Normal") - - While $Normal = "" - If $i >= 50 Then ExitLoop - $i += 1 - $x += 1 - $Normal = getDigit($x, $y, "Normal") - WEnd - - $Normal &= getDigit($x, $y, "Normal") - $Normal &= getDigit($x, $y, "Normal") - - Return $Normal -EndFunc ;==>getNormal +;Returns complete value of normal xxx + +Func getNormal($x_start, $y_start) + _CaptureRegion(0, 0, $x_start + 90, $y_start + 20) + ;----------------------------------------------------------------------------- + Local $x = $x_start, $y = $y_start + Local $Normal, $i = 0 + + $Normal = getDigit($x, $y, "Normal") + + While $Normal = "" + If $i >= 50 Then ExitLoop + $i += 1 + $x += 1 + $Normal = getDigit($x, $y, "Normal") + WEnd + + $Normal &= getDigit($x, $y, "Normal") + $Normal &= getDigit($x, $y, "Normal") + + Return $Normal +EndFunc ;==>getNormal diff --git a/COCBot/functions/Read Text/getOther.au3 b/COCBot/functions/Read Text/getOther.au3 index c136138..d3eb4ff 100644 --- a/COCBot/functions/Read Text/getOther.au3 +++ b/COCBot/functions/Read Text/getOther.au3 @@ -1,138 +1,138 @@ -;Returns complete value of other - -Func getOther($x_start, $y_start, $type, $totalcamp = False) - _CaptureRegion(0, 0, $x_start + 120, $y_start + 20) - ;----------------------------------------------------------------------------- - Local $x = $x_start, $y = $y_start - Local $Number, $i = 0 - - Switch $type - Case "Trophy" - $Number = getDigit($x, $y, "Other") - - While $Number = "" - If $i >= 50 Then ExitLoop - $i += 1 - $x += 1 - $Number = getDigit($x, $y, "Other") - WEnd - - $Number &= getDigit($x, $y, "Other") - $Number &= getDigit($x, $y, "Other") - $Number &= getDigit($x, $y, "Other") - - Case "LastRaidGold" - $Number = getDigitlastRaid($x, $y, "LastRaidGold") - - Case "LastRaidElixir" - $Number = getDigitlastRaid($x, $y, "LastRaidElixir") - - Case "LastRaidDarkElixir" - $Number = getDigitlastRaid($x, $y, "LastRaidDarkElixir") - - Case "LastRaidTrophy" - $Number = getDigitlastRaid($x, $y, "LastRaidTrophy") - - Case "Townhall" - $Number = getDigitTH($x, $y) - - While $Number = "" - If $i >= 50 Then ExitLoop - $i += 1 - $x += 1 - $Number = getDigitTH($x, $y) - WEnd - - Case "Builder" - $Number = getDigit($x, $y, "Builder") - - While $Number = "" - If $i >= 10 Then ExitLoop - $i += 1 - $x += 1 - $Number = getDigit($x, $y, "Builder") - WEnd - - Case "Gems" - $Number = getDigit($x, $y, "Other") - - While $Number = "" - If $i >= 90 Then ExitLoop - $i += 1 - $x += 1 - $Number = getDigit($x, $y, "Other") - WEnd - - $Number &= getDigit($x, $y, "Other") - $Number &= getDigit($x, $y, "Other") - $Number &= getDigit($x, $y, "Other") - $x += 6 - $Number &= getDigit($x, $y, "Other") - $Number &= getDigit($x, $y, "Other") - $Number &= getDigit($x, $y, "Other") - - Case "Resource" - $Number = getDigit($x, $y, "Resource") - - While $Number = "" - If $i >= 120 Then ExitLoop - $i += 1 - $x += 1 - $Number = getDigit($x, $y, "Resource") - WEnd - - $Number &= getDigit($x, $y, "Resource") - $Number &= getDigit($x, $y, "Resource") - $Number &= getDigit($x, $y, "Resource") - $x += 6 - $Number &= getDigit($x, $y, "Resource") - $Number &= getDigit($x, $y, "Resource") - $Number &= getDigit($x, $y, "Resource") - $x += 6 - $Number &= getDigit($x, $y, "Resource") - $Number &= getDigit($x, $y, "Resource") - $Number &= getDigit($x, $y, "Resource") - - Case "Camp" - $Number = getDigitSmall($x, $y, "Camp") - - While $Number = "" - If $i >= 20 Then ExitLoop - $i += 1 - $x += 1 - $Number = getDigitSmall($x, $y, "Camp") - WEnd - - $Number &= getDigitSmall($x, $y, "Camp") - $Number &= getDigitSmall($x, $y, "Camp") - - If $totalcamp Then - $x += 6 - $Number = "" - While $Number = "" - If $i >= 20 Then ExitLoop - $i += 1 - $x += 1 - $Number = getDigitSmall($x, $y, "Camp") - WEnd - - $Number &= getDigitSmall($x, $y, "Camp") - $Number &= getDigitSmall($x, $y, "Camp") - EndIf - Case "Barrack" - $Number = getDigit($x, $y, "Other") - - While $Number = "" - If $i >= 20 Then ExitLoop - $i += 1 - $x += 1 - $Number = getDigit($x, $y, "Other") - WEnd - - $Number &= getDigit($x, $y, "Other") - $Number &= getDigit($x, $y, "Other") - $Number &= getDigit($x, $y, "Other") - EndSwitch - - Return $Number -EndFunc ;==>getOther +;Returns complete value of other + +Func getOther($x_start, $y_start, $type, $totalcamp = False) + _CaptureRegion(0, 0, $x_start + 120, $y_start + 20) + ;----------------------------------------------------------------------------- + Local $x = $x_start, $y = $y_start + Local $Number, $i = 0 + + Switch $type + Case "Trophy" + $Number = getDigit($x, $y, "Other") + + While $Number = "" + If $i >= 50 Then ExitLoop + $i += 1 + $x += 1 + $Number = getDigit($x, $y, "Other") + WEnd + + $Number &= getDigit($x, $y, "Other") + $Number &= getDigit($x, $y, "Other") + $Number &= getDigit($x, $y, "Other") + + Case "LastRaidGold" + $Number = getDigitlastRaid($x, $y, "LastRaidGold") + + Case "LastRaidElixir" + $Number = getDigitlastRaid($x, $y, "LastRaidElixir") + + Case "LastRaidDarkElixir" + $Number = getDigitlastRaid($x, $y, "LastRaidDarkElixir") + + Case "LastRaidTrophy" + $Number = getDigitlastRaid($x, $y, "LastRaidTrophy") + + Case "Townhall" + $Number = getDigitTH($x, $y) + + While $Number = "" + If $i >= 50 Then ExitLoop + $i += 1 + $x += 1 + $Number = getDigitTH($x, $y) + WEnd + + Case "Builder" + $Number = getDigit($x, $y, "Builder") + + While $Number = "" + If $i >= 10 Then ExitLoop + $i += 1 + $x += 1 + $Number = getDigit($x, $y, "Builder") + WEnd + + Case "Gems" + $Number = getDigit($x, $y, "Other") + + While $Number = "" + If $i >= 90 Then ExitLoop + $i += 1 + $x += 1 + $Number = getDigit($x, $y, "Other") + WEnd + + $Number &= getDigit($x, $y, "Other") + $Number &= getDigit($x, $y, "Other") + $Number &= getDigit($x, $y, "Other") + $x += 6 + $Number &= getDigit($x, $y, "Other") + $Number &= getDigit($x, $y, "Other") + $Number &= getDigit($x, $y, "Other") + + Case "Resource" + $Number = getDigit($x, $y, "Resource") + + While $Number = "" + If $i >= 120 Then ExitLoop + $i += 1 + $x += 1 + $Number = getDigit($x, $y, "Resource") + WEnd + + $Number &= getDigit($x, $y, "Resource") + $Number &= getDigit($x, $y, "Resource") + $Number &= getDigit($x, $y, "Resource") + $x += 6 + $Number &= getDigit($x, $y, "Resource") + $Number &= getDigit($x, $y, "Resource") + $Number &= getDigit($x, $y, "Resource") + $x += 6 + $Number &= getDigit($x, $y, "Resource") + $Number &= getDigit($x, $y, "Resource") + $Number &= getDigit($x, $y, "Resource") + + Case "Camp" + $Number = getDigitSmall($x, $y, "Camp") + + While $Number = "" + If $i >= 20 Then ExitLoop + $i += 1 + $x += 1 + $Number = getDigitSmall($x, $y, "Camp") + WEnd + + $Number &= getDigitSmall($x, $y, "Camp") + $Number &= getDigitSmall($x, $y, "Camp") + + If $totalcamp Then + $x += 6 + $Number = "" + While $Number = "" + If $i >= 20 Then ExitLoop + $i += 1 + $x += 1 + $Number = getDigitSmall($x, $y, "Camp") + WEnd + + $Number &= getDigitSmall($x, $y, "Camp") + $Number &= getDigitSmall($x, $y, "Camp") + EndIf + Case "Barrack" + $Number = getDigit($x, $y, "Other") + + While $Number = "" + If $i >= 20 Then ExitLoop + $i += 1 + $x += 1 + $Number = getDigit($x, $y, "Other") + WEnd + + $Number &= getDigit($x, $y, "Other") + $Number &= getDigit($x, $y, "Other") + $Number &= getDigit($x, $y, "Other") + EndSwitch + + Return $Number +EndFunc ;==>getOther diff --git a/COCBot/functions/Read Text/getString.au3 b/COCBot/functions/Read Text/getString.au3 index 02186b6..f94674a 100644 --- a/COCBot/functions/Read Text/getString.au3 +++ b/COCBot/functions/Read Text/getString.au3 @@ -1,21 +1,21 @@ -;Uses getChar to get the characters of the donation and gets all of the character into a string. - -Func getString($y) - For $i = 0 To 3 - Local $x_Temp = 35 - If getChar($x_Temp, $y) = " " Or getChar($x_Temp, $y) = "|" Then - $y += 1 - Else - ExitLoop - EndIf - Next - Local $x = 35 - Local $String = "" - Do - $String &= getChar($x, $y) - Until (StringMid($String, StringLen($String) - 1, 2) = " " Or StringMid($String, StringLen($String), 1) = "|") - $String = StringReplace($String, " ", Null) - $String = StringReplace($String, "|", Null) - - Return $String -EndFunc ;==>getString +;Uses getChar to get the characters of the donation and gets all of the character into a string. + +Func getString($y) + For $i = 0 To 3 + Local $x_Temp = 35 + If getChar($x_Temp, $y) = " " Or getChar($x_Temp, $y) = "|" Then + $y += 1 + Else + ExitLoop + EndIf + Next + Local $x = 35 + Local $String = "" + Do + $String &= getChar($x, $y) + Until (StringMid($String, StringLen($String) - 1, 2) = " " Or StringMid($String, StringLen($String), 1) = "|") + $String = StringReplace($String, " ", Null) + $String = StringReplace($String, "|", Null) + + Return $String +EndFunc ;==>getString diff --git a/COCBot/functions/Read Text/getTrophy.au3 b/COCBot/functions/Read Text/getTrophy.au3 index 912f398..e0d8ff9 100644 --- a/COCBot/functions/Read Text/getTrophy.au3 +++ b/COCBot/functions/Read Text/getTrophy.au3 @@ -1,16 +1,16 @@ -;Returns complete value of Trophy xx - -Func getTrophy($x_start, $y_start) - _CaptureRegion(0, 0, $x_start + 90, $y_start + 20) - ;----------------------------------------------------------------------------- - Local $x = $x_start, $y = $y_start - Local $Trophy, $i = 0 - While getDigit($x, $y + $i, "Trophy") = "" - If $i >= 15 Then ExitLoop - $i += 1 - WEnd - $x = $x_start - $Trophy &= getDigit($x, $y + $i, "Trophy") - $Trophy &= getDigit($x, $y + $i, "Trophy") - Return $Trophy -EndFunc ;==>getTrophy +;Returns complete value of Trophy xx + +Func getTrophy($x_start, $y_start) + _CaptureRegion(0, 0, $x_start + 90, $y_start + 20) + ;----------------------------------------------------------------------------- + Local $x = $x_start, $y = $y_start + Local $Trophy, $i = 0 + While getDigit($x, $y + $i, "Trophy") = "" + If $i >= 15 Then ExitLoop + $i += 1 + WEnd + $x = $x_start + $Trophy &= getDigit($x, $y + $i, "Trophy") + $Trophy &= getDigit($x, $y + $i, "Trophy") + Return $Trophy +EndFunc ;==>getTrophy diff --git a/COCBot/functions/Search/GetResources.au3 b/COCBot/functions/Search/GetResources.au3 index f8eea4e..e2685b2 100644 --- a/COCBot/functions/Search/GetResources.au3 +++ b/COCBot/functions/Search/GetResources.au3 @@ -1,92 +1,92 @@ -;Uses the getGold,getElixir... functions and uses CompareResources until it meets conditions. -;Will wait ten seconds until getGold returns a value other than "", if longer than 10 seconds - calls checkNextButton -;-clicks next if checkNextButton returns true, otherwise will restart the bot. - -Func GetResources($MidAttack = 0) ;Reads resources - Local $RetVal[6] - Local $i = 0 - Local $x = 0 - Local $txtDead = "Live" - - If $MidAttack = 0 And ChkDisconnection() Then - SetLog(GetLangText("msgNoNextButton"), $COLOR_RED) - Return False - EndIf - - If $MidAttack > 0 Then - $RetVal[0] = "" - $RetVal[1] = "" - Else - $fdiffReadGold = TimerDiff($hTimerClickNext) - $RetVal[0] = checkDeadBase() - If $RetVal[0] Then $txtDead = GetLangText("msgDeadInitial") - - $RetVal[1] = checkTownhall() - If $RetVal[1] = "-" Then - $THLoc = "-" - $THquadrant = "-" - $THx = 0 - $THy = 0 - Else - $THquadrant = 0 - If $WideEdge = 1 Then - If ((((85 - 389) / (528 - 131)) * ($THx - 131)) + 389 > $THy) Then - $THquadrant = 1 - ElseIf ((((237 - 538) / (723 - 337)) * ($THx - 337)) + 538 > $THy) Then - $THquadrant = 4 - Else - $THquadrant = 7 - EndIf - If ((((388 - 85) / (725 - 330)) * ($THx - 330)) + 85 > $THy) Then - $THquadrant = $THquadrant + 2 - ElseIf ((((537 - 238) / (535 - 129)) * ($THx - 129)) + 238 > $THy) Then - $THquadrant = $THquadrant + 1 - EndIf - Else - If ((((70 - 374) / (508 - 110)) * ($THx - 110)) + 374 > $THy) Then - $THquadrant = 1 - ElseIf ((((252 - 552) / (742 - 358)) * ($THx - 358)) + 552 > $THy) Then - $THquadrant = 4 - Else - $THquadrant = 7 - EndIf - If ((((373 - 70) / (744 - 350)) * ($THx - 350)) + 70 > $THy) Then - $THquadrant = $THquadrant + 2 - ElseIf ((((552 - 253) / (516 - 108)) * ($THx - 108)) + 253 > $THy) Then - $THquadrant = $THquadrant + 1 - EndIf - EndIf - If GUICtrlRead($sldAcc) > -1 Then - If $THquadrant >= 1 And $THquadrant <= 4 Then $THLoc = "Out" - If $THquadrant = 5 Then $THLoc = "In" - If $THquadrant >= 6 And $THquadrant <= 9 Then $THLoc = "Out" - Else - ; Future implementation...better determination of outside TH - SeekEdges() - If CloseToEdge($Thx, $Thy, 80) Then - $THLoc = "Out" - Else - $THLoc = "In" - EndIf - EndIf - EndIf - EndIf - - $RetVal[2] = ReadText(50, 70, 150, $textVillageSearch) - $RetVal[3] = ReadText(50, 99, 150, $textVillageSearch) - If _ColorCheck(_GetPixelColor(38, 136), Hex(0xD3CADA, 6), 40) Then - $RetVal[4] = ReadText(50, 128, 80, $textVillageSearch) - $RetVal[5] = ReadText(50, 170, 67, $textVillageSearch) - Else - $RetVal[4] = 0 - $RetVal[5] = ReadText(50, 140, 67, $textVillageSearch) - EndIf - - If $MidAttack = 1 Then - SetLog(GetLangText("msgMidAttack") & " [" & GetLangText("msgGoldinitial") & "]: " & $RetVal[2] & Tab($RetVal[2], 7) & "[" & GetLangText("msgElixirinitial") & "]: " & $RetVal[3] & Tab($RetVal[3], 7) & "[" & GetLangText("msgDarkElixinitial") & "]: " & $RetVal[4] & Tab($RetVal[4], 4) & "[" & GetLangText("msgTrophyInitial") & "]: " & $RetVal[5] & Tab($RetVal[5], 3) & "[" & GetLangText("msgTHInitial") & "]: " & $RetVal[1] & (($RetVal[1] <> "-") ? ("-Q" & $THquadrant) : ("")) & ", " & $THLoc & ", " & $txtDead, $COLOR_BLUE) - ElseIf $MidAttack = 0 Then - $SearchCount += 1 ; Counter for number of searches - SetLog("(" & $SearchCount & ") [" & GetLangText("msgGoldinitial") & "]: " & $RetVal[2] & Tab($RetVal[2], 7) & "[" & GetLangText("msgElixirinitial") & "]: " & $RetVal[3] & Tab($RetVal[3], 7) & "[" & GetLangText("msgDarkElixinitial") & "]: " & $RetVal[4] & Tab($RetVal[4], 4) & "[" & GetLangText("msgTrophyInitial") & "]: " & $RetVal[5] & Tab($RetVal[5], 3) & "[" & GetLangText("msgTHInitial") & "]: " & $RetVal[1] & (($RetVal[1] <> "-") ? ("-Q" & $THquadrant) : ("")) & ", " & $THLoc & ", " & $txtDead, $COLOR_BLUE) - EndIf - Return $RetVal -EndFunc ;==>GetResources +;Uses the getGold,getElixir... functions and uses CompareResources until it meets conditions. +;Will wait ten seconds until getGold returns a value other than "", if longer than 10 seconds - calls checkNextButton +;-clicks next if checkNextButton returns true, otherwise will restart the bot. + +Func GetResources($MidAttack = 0) ;Reads resources + Local $RetVal[6] + Local $i = 0 + Local $x = 0 + Local $txtDead = "Live" + + If $MidAttack = 0 And ChkDisconnection() Then + SetLog(GetLangText("msgNoNextButton"), $COLOR_RED) + Return False + EndIf + + If $MidAttack > 0 Then + $RetVal[0] = "" + $RetVal[1] = "" + Else + $fdiffReadGold = TimerDiff($hTimerClickNext) + $RetVal[0] = checkDeadBase() + If $RetVal[0] Then $txtDead = GetLangText("msgDeadInitial") + + $RetVal[1] = checkTownhall() + If $RetVal[1] = "-" Then + $THLoc = "-" + $THquadrant = "-" + $THx = 0 + $THy = 0 + Else + $THquadrant = 0 + If $WideEdge = 1 Then + If ((((85 - 389) / (528 - 131)) * ($THx - 131)) + 389 > $THy) Then + $THquadrant = 1 + ElseIf ((((237 - 538) / (723 - 337)) * ($THx - 337)) + 538 > $THy) Then + $THquadrant = 4 + Else + $THquadrant = 7 + EndIf + If ((((388 - 85) / (725 - 330)) * ($THx - 330)) + 85 > $THy) Then + $THquadrant = $THquadrant + 2 + ElseIf ((((537 - 238) / (535 - 129)) * ($THx - 129)) + 238 > $THy) Then + $THquadrant = $THquadrant + 1 + EndIf + Else + If ((((70 - 374) / (508 - 110)) * ($THx - 110)) + 374 > $THy) Then + $THquadrant = 1 + ElseIf ((((252 - 552) / (742 - 358)) * ($THx - 358)) + 552 > $THy) Then + $THquadrant = 4 + Else + $THquadrant = 7 + EndIf + If ((((373 - 70) / (744 - 350)) * ($THx - 350)) + 70 > $THy) Then + $THquadrant = $THquadrant + 2 + ElseIf ((((552 - 253) / (516 - 108)) * ($THx - 108)) + 253 > $THy) Then + $THquadrant = $THquadrant + 1 + EndIf + EndIf + If GUICtrlRead($sldAcc) > -1 Then + If $THquadrant >= 1 And $THquadrant <= 4 Then $THLoc = "Out" + If $THquadrant = 5 Then $THLoc = "In" + If $THquadrant >= 6 And $THquadrant <= 9 Then $THLoc = "Out" + Else + ; Future implementation...better determination of outside TH + SeekEdges() + If CloseToEdge($Thx, $Thy, 80) Then + $THLoc = "Out" + Else + $THLoc = "In" + EndIf + EndIf + EndIf + EndIf + + $RetVal[2] = ReadText(50, 70, 150, $textVillageSearch) + $RetVal[3] = ReadText(50, 99, 150, $textVillageSearch) + If _ColorCheck(_GetPixelColor(38, 136), Hex(0xD3CADA, 6), 40) Then + $RetVal[4] = ReadText(50, 128, 80, $textVillageSearch) + $RetVal[5] = ReadText(50, 170, 67, $textVillageSearch) + Else + $RetVal[4] = 0 + $RetVal[5] = ReadText(50, 140, 67, $textVillageSearch) + EndIf + + If $MidAttack = 1 Then + SetLog(GetLangText("msgMidAttack") & " [" & GetLangText("msgGoldinitial") & "]: " & $RetVal[2] & Tab($RetVal[2], 7) & "[" & GetLangText("msgElixirinitial") & "]: " & $RetVal[3] & Tab($RetVal[3], 7) & "[" & GetLangText("msgDarkElixinitial") & "]: " & $RetVal[4] & Tab($RetVal[4], 4) & "[" & GetLangText("msgTrophyInitial") & "]: " & $RetVal[5] & Tab($RetVal[5], 3) & "[" & GetLangText("msgTHInitial") & "]: " & $RetVal[1] & (($RetVal[1] <> "-") ? ("-Q" & $THquadrant) : ("")) & ", " & $THLoc & ", " & $txtDead, $COLOR_BLUE) + ElseIf $MidAttack = 0 Then + $SearchCount += 1 ; Counter for number of searches + SetLog("(" & $SearchCount & ") [" & GetLangText("msgGoldinitial") & "]: " & $RetVal[2] & Tab($RetVal[2], 7) & "[" & GetLangText("msgElixirinitial") & "]: " & $RetVal[3] & Tab($RetVal[3], 7) & "[" & GetLangText("msgDarkElixinitial") & "]: " & $RetVal[4] & Tab($RetVal[4], 4) & "[" & GetLangText("msgTrophyInitial") & "]: " & $RetVal[5] & Tab($RetVal[5], 3) & "[" & GetLangText("msgTHInitial") & "]: " & $RetVal[1] & (($RetVal[1] <> "-") ? ("-Q" & $THquadrant) : ("")) & ", " & $THLoc & ", " & $txtDead, $COLOR_BLUE) + EndIf + Return $RetVal +EndFunc ;==>GetResources diff --git a/COCBot/functions/Search/PrepareSearch.au3 b/COCBot/functions/Search/PrepareSearch.au3 index 4ccee03..1474125 100644 --- a/COCBot/functions/Search/PrepareSearch.au3 +++ b/COCBot/functions/Search/PrepareSearch.au3 @@ -1,16 +1,19 @@ -;Goes into a match, breaks shield if it has to -; Returns True if successful, otherwise False after 10 failed attempts -Func PrepareSearch() ;Click attack button and find match button, will break shield - - Click(60, 614);Click Attack Button - SetLog(GetLangText("msgSearchingMatch")) - If _WaitForColor(287, 494, Hex(0xEEAC28, 6), 50) Then - Click(217, 510);Click Find a Match Button - ; Is shield active? - If _WaitForColor(513, 416, Hex(0x5DAC10, 6), 50, 1) Then - Click(513, 416) - EndIf - If _WaitForColor(36, 523, Hex(0xEE5056, 6), 50, 10) Then Return True - EndIf - Return False -EndFunc ;==>PrepareSearch +;Goes into a match, breaks shield if it has to +; Returns True if successful, otherwise False after 10 failed attempts +Func PrepareSearch() ;Click attack button and find match button, will break shield + + Click(60, 614);Click Attack Button + SetLog(GetLangText("msgSearchingMatch")) + If _WaitForColorArea(287, 494, 5, 5, Hex(0xEEAC28, 6), 50) Then + Click(217, 510);Click Find a Match Button + ; Is shield active? + If _WaitForColorArea(513, 416, 5, 5, Hex(0x5DAC10, 6), 50, 1) Then + Click(513, 416) + EndIf + If _WaitForColorArea(23, 523, 25, 10, Hex(0xEE5056, 6), 50, 10) Then Return True + Else + ;Something is wrong here, restart bluestack + restartBlueStack() + EndIf + Return False +EndFunc ;==>PrepareSearch diff --git a/COCBot/functions/Search/checkNextButton.au3 b/COCBot/functions/Search/checkNextButton.au3 index 4a55ee9..f00b3d7 100644 --- a/COCBot/functions/Search/checkNextButton.au3 +++ b/COCBot/functions/Search/checkNextButton.au3 @@ -1,11 +1,11 @@ -;Checks for error message (outof sync, inactivity, ect..) -;Returns False if no error message - -Func checkNextButton() ;Checks for Out of Sync or Connection Lost errors - $Message = _PixelSearch(457, 300, 458, 330, Hex(0x33B5E5, 6), 10) ;Check for out of sync or inactivity - If IsArray($Message) = False Then - Return True ;Button available - Else - Return False ;Out of sync or inactivity error. - EndIf -EndFunc ;==>checkNextButton +;Checks for error message (outof sync, inactivity, ect..) +;Returns False if no error message + +Func checkNextButton() ;Checks for Out of Sync or Connection Lost errors + $Message = _PixelSearch(457, 300, 458, 330, Hex(0x33B5E5, 6), 10) ;Check for out of sync or inactivity + If IsArray($Message) = False Then + Return True ;Button available + Else + Return False ;Out of sync or inactivity error. + EndIf +EndFunc ;==>checkNextButton diff --git a/COCBot/functions/Strategies/Standard/AdjustCollPos.au3 b/COCBot/functions/Strategies/Standard/AdjustCollPos.au3 index 41b9160..1e5a977 100644 --- a/COCBot/functions/Strategies/Standard/AdjustCollPos.au3 +++ b/COCBot/functions/Strategies/Standard/AdjustCollPos.au3 @@ -1,20 +1,20 @@ -Func Standard_RemoveInsideCollectors(ByRef $count, ByRef $arCollectors, $maxDistance) - ; From each collector we will check in 8 directions for closest point outside red lines - ; If further than $maxDistance then we will drop this collector from the list - Local $colindex = 0 - Do - If CloseToEdge($arCollectors[$colindex][1], $arCollectors[$colindex][2], $maxDistance) Then - $colindex += 1 - Else - ; This wasn't a close enough collector so remove it - OverlayX($arCollectors[$colindex][1] - 20, $arCollectors[$colindex][2] - 20, 40, 40, 0xFFFF0000, 3) - If $DebugMode = 1 Then SetLog(GetLangText("msgRemoveCol") & (($arCollectors[$colindex][0] = 14) ? (GetLangText("msgColGM")) : (($arCollectors[$colindex][0] = 15) ? (GetLangText("msgColElix")) : (GetLangText("msgColDE")))) & " (" & $arCollectors[$colindex][1] & ", " & $arCollectors[$colindex][2] & ")") - For $move = $colindex + 1 To $count - 1 - $arCollectors[$move - 1][0] = $arCollectors[$move][0] - $arCollectors[$move - 1][1] = $arCollectors[$move][1] - $arCollectors[$move - 1][2] = $arCollectors[$move][2] - Next - $count -= 1 - EndIf - Until $colindex >= $count -EndFunc ;==>Standard_RemoveInsideCollectors +Func Standard_RemoveInsideCollectors(ByRef $count, ByRef $arCollectors, $maxDistance) + ; From each collector we will check in 8 directions for closest point outside red lines + ; If further than $maxDistance then we will drop this collector from the list + Local $colindex = 0 + Do + If CloseToEdge($arCollectors[$colindex][1], $arCollectors[$colindex][2], $maxDistance) Then + $colindex += 1 + Else + ; This wasn't a close enough collector so remove it + OverlayX($arCollectors[$colindex][1] - 20, $arCollectors[$colindex][2] - 20, 40, 40, 0xFFFF0000, 3) + If $DebugMode = 1 Then SetLog(GetLangText("msgRemoveCol") & (($arCollectors[$colindex][0] = 14) ? (GetLangText("msgColGM")) : (($arCollectors[$colindex][0] = 15) ? (GetLangText("msgColElix")) : (GetLangText("msgColDE")))) & " (" & $arCollectors[$colindex][1] & ", " & $arCollectors[$colindex][2] & ")") + For $move = $colindex + 1 To $count - 1 + $arCollectors[$move - 1][0] = $arCollectors[$move][0] + $arCollectors[$move - 1][1] = $arCollectors[$move][1] + $arCollectors[$move - 1][2] = $arCollectors[$move][2] + Next + $count -= 1 + EndIf + Until $colindex >= $count +EndFunc ;==>Standard_RemoveInsideCollectors diff --git a/COCBot/functions/Strategies/Standard/Attack.au3 b/COCBot/functions/Strategies/Standard/Attack.au3 index 5843913..f6088d2 100644 --- a/COCBot/functions/Strategies/Standard/Attack.au3 +++ b/COCBot/functions/Strategies/Standard/Attack.au3 @@ -1,1567 +1,1528 @@ -; Improved attack algorithm, using Barbarians, Archers, Goblins, Giants and Wallbreakers as they are available -; Create by Fast French, edited by safar46 - -Func Wave_Sleep($type) - Switch $type - Case 0 - $delay = (_GUICtrlComboBox_GetCurSel($cmbUnitDelay) + 1) * 20 ;Random Gaussian is always positive, compensate for that - Case 1 - $delay = (_GUICtrlComboBox_GetCurSel($cmbWaveDelay) + 1) * 200 - EndSwitch - $delay = _Random_Gaussian($delay, $delay / 6) - If $delay < 1 Then $delay = 1 - While TimerDiff($hWaveTimer) < $delay - If _Sleep(1, False) Then Return True - WEnd - $hWaveTimer = TimerInit() - Return False -EndFunc ;==>Wave_Sleep - -; Old mecanism, not used anymore -Func Standard_OldDropTroop($troup, $position, $nbperspot) - SelectDropTroupe($troup) ;Select Troop - If _Sleep(100) Then Return - For $i = 0 To 4 - Click($position[$i][0], $position[$i][1], $nbperspot, 0, 1) - If _Sleep(50) Then Return - Next -EndFunc ;==>Standard_OldDropTroop - -; improved function, that avoids to only drop on 5 discret drop points : -Func Standard_DropOnEdge($troop, $edge, $number, $slotsPerEdge = 0, $edge2 = -1, $x = -1, $Center = 1) - $BufferDist = _Random_Gaussian(20, 6) - If $BufferDist < 2 Then $BufferDist = 2 - - If $number = 0 Then Return - SelectDropTroupe($troop) ;Select Troop - If _Sleep(100) Then Return - If $slotsPerEdge = 0 Or $number < $slotsPerEdge Then $slotsPerEdge = $number - If $number = 1 Or $slotsPerEdge = 1 Then ; Drop on a random point per edge => centered on the middle - $Clickx = Round(_Random_Gaussian(((($edge[4][0] - $edge[0][0]) / 2) + $edge[0][0]), (($edge[4][0] - $edge[0][0]) / 7))) - $Clicky = Round((($edge[4][1] - $edge[0][1]) / ($edge[4][0] - $edge[0][0])) * ($Clickx - $edge[0][0])) + $edge[0][1] - Click($Clickx, $Clicky, $number, 0, $Center, $BufferDist) - If $edge2 <> -1 Then - If Wave_Sleep(1) Then Return - $Clickx = Round(_Random_Gaussian(((($edge2[4][0] - $edge2[0][0]) / 2) + $edge2[0][0]), (($edge2[4][0] - $edge2[0][0]) / 7))) - $Clicky = Round((($edge2[4][1] - $edge2[0][1]) / ($edge2[4][0] - $edge2[0][0])) * ($Clickx - $edge2[0][0])) + $edge2[0][1] - Click($Clickx, $Clicky, $number, 0, $Center, $BufferDist) - EndIf - ElseIf $slotsPerEdge = 2 Then ; Drop on 2 randomly spaced points per edge - Local $half = Ceiling($number / 2) - $Clickx = Round(_Random_Gaussian(((($edge[4][0] - $edge[0][0]) / 3) + $edge[0][0]), (($edge[4][0] - $edge[0][0]) / 10))) - $Clicky = Round((($edge[4][1] - $edge[0][1]) / ($edge[4][0] - $edge[0][0])) * ($Clickx - $edge[0][0])) + $edge[0][1] - Click($Clickx, $Clicky, $half, 0, $Center, $BufferDist) - If GUICtrlRead($sldAcc) < 100 Then - If Wave_Sleep(0) Then Return - EndIf - $Clickx = Round(_Random_Gaussian(((($edge[4][0] - $edge[0][0]) * 2 / 3) + $edge[0][0]), (($edge[4][0] - $edge[0][0]) / 10))) - $Clicky = Round((($edge[4][1] - $edge[0][1]) / ($edge[4][0] - $edge[0][0])) * ($Clickx - $edge[0][0])) + $edge[0][1] - Click($Clickx, $Clicky, $number - $half, 0, $Center, $BufferDist) - If $edge2 <> -1 Then - If Wave_Sleep(1) Then Return - $Clickx = Round(_Random_Gaussian(((($edge2[4][0] - $edge2[0][0]) / 3) + $edge2[0][0]), (($edge2[4][0] - $edge2[0][0]) / 10))) - $Clicky = Round((($edge2[4][1] - $edge2[0][1]) / ($edge2[4][0] - $edge2[0][0])) * ($Clickx - $edge2[0][0])) + $edge2[0][1] - Click($Clickx, $Clicky, $half, 0, $Center, $BufferDist) - If GUICtrlRead($sldAcc) < 100 Then - If Wave_Sleep(0) Then Return - EndIf - $Clickx = Round(_Random_Gaussian(((($edge2[4][0] - $edge2[0][0]) * 2 / 3) + $edge2[0][0]), (($edge2[4][0] - $edge2[0][0]) / 10))) - $Clicky = Round((($edge2[4][1] - $edge2[0][1]) / ($edge2[4][0] - $edge2[0][0])) * ($Clickx - $edge2[0][0])) + $edge2[0][1] - Click($Clickx, $Clicky, $number - $half, 0, $Center, $BufferDist) - EndIf - Else - If ($slotsPerEdge = $number) And ($slotsPerEdge > 10) Then - $slotsPerEdge = Int($number / Random(1.8, 2.8)) - If $slotsPerEdge < 9 Then $slotsPerEdge = Random(9, 11, 1) - EndIf - Local $minX = $edge[0][0] - Local $maxX = $edge[4][0] - Local $minY = $edge[0][1] - Local $maxY = $edge[4][1] - If $edge2 <> -1 Then - Local $minX2 = $edge2[0][0] - Local $maxX2 = $edge2[4][0] - Local $minY2 = $edge2[0][1] - Local $maxY2 = $edge2[4][1] - EndIf - Local $nbTroopsGoneDec = 0 - Local $nbTroopsGoneRound = 0 - Local $nbTroopPerRound = $number / $slotsPerEdge - For $i = 0 To $slotsPerEdge - 1 - $nbTroopsGoneDec += $nbTroopPerRound - Local $posX = $minX + (($maxX - $minX) * $i) / ($slotsPerEdge - 1) - Local $posY = $minY + (($maxY - $minY) * $i) / ($slotsPerEdge - 1) - ; Randomize the drop points a bit more - $posX = Round(_Random_Gaussian($posX, 3)) - $posY = Round(_Random_Gaussian($posY, 3)) - Click($posX, $posY, Ceiling($nbTroopsGoneDec - $nbTroopsGoneRound), 0, $Center, $BufferDist) - $nbTroopsGoneRound += Ceiling($nbTroopsGoneDec - $nbTroopsGoneRound) - If GUICtrlRead($sldAcc) < 100 Then - If Wave_Sleep(0) Then Return - EndIf - Next - If $edge2 <> -1 Then - If Wave_Sleep(1) Then Return - Local $nbTroopsGoneDec = 0 - Local $nbTroopsGoneRound = 0 - Local $nbTroopPerRound = $number / $slotsPerEdge - For $i = 0 To $slotsPerEdge - 1 - $nbTroopsGoneDec += $nbTroopPerRound - Local $posX2 = $maxX2 - (($maxX2 - $minX2) * $i) / ($slotsPerEdge - 1) - Local $posY2 = $maxY2 - (($maxY2 - $minY2) * $i) / ($slotsPerEdge - 1) - ; Randomize the drop points a bit more - $posX2 = Round(_Random_Gaussian($posX2, 3)) - $posY2 = Round(_Random_Gaussian($posY2, 3)) - Click($posX2, $posY2, Ceiling($nbTroopsGoneDec - $nbTroopsGoneRound), 0, $Center, $BufferDist) - $nbTroopsGoneRound += Ceiling($nbTroopsGoneDec - $nbTroopsGoneRound) - If GUICtrlRead($sldAcc) < 100 Then - If Wave_Sleep(0) Then Return - EndIf - Next - EndIf - EndIf -EndFunc ;==>Standard_DropOnEdge - -Func Standard_DropOnEdges($troop, $nbSides, $number, $slotsPerEdge = 0, $miniEdge = False) - If $nbSides = 0 Or $number = 1 Then - Standard_OldDropTroop($troop, $Edges[0], $number); - Return - EndIf - If $nbSides < -1 Then Return - Local $nbTroopsLeft = $number - If Not $miniEdge Then - If $nbSides = 4 Then - For $i = 0 To $nbSides - 3 - Local $nbTroopsPerEdge = Round($nbTroopsLeft / ($nbSides - $i * 2)) - Standard_DropOnEdge($troop, $Edges[$i], $nbTroopsPerEdge, $slotsPerEdge, $Edges[$i + 2], $i) - $nbTroopsLeft -= $nbTroopsPerEdge * 2 - Next - Return - EndIf - For $i = 0 To $nbSides - 1 - If $nbSides = 1 Or ($nbSides = 3 And $i = 2) Then - Local $nbTroopsPerEdge = Round($nbTroopsLeft / ($nbSides - $i)) - Standard_DropOnEdge($troop, $Edges[$i], $nbTroopsPerEdge, $slotsPerEdge) - $nbTroopsLeft -= $nbTroopsPerEdge - ElseIf ($nbSides = 2 And $i = 0) Or ($nbSides = 3 And $i <> 1) Then - Local $nbTroopsPerEdge = Round($nbTroopsLeft / ($nbSides - $i * 2)) - Standard_DropOnEdge($troop, $Edges[$i + 3], $nbTroopsPerEdge, $slotsPerEdge, $Edges[$i + 1]) - $nbTroopsLeft -= $nbTroopsPerEdge * 2 - EndIf - Next - Else - Switch $THquadrant - Case 1 - Local $edgeA[5][2] = [[$FurthestTopLeft[0][0], $FurthestTopLeft[0][1]], [0, 0], [0, 0], [0, 0], [Round(($FurthestTopLeft[4][0] - $FurthestTopLeft[0][0]) / _Random_Gaussian(4.5, .25)) + $FurthestTopLeft[0][0], Round(($FurthestTopLeft[4][1] - $FurthestTopLeft[0][1]) / _Random_Gaussian(4.5, .25)) + $FurthestTopLeft[0][1]]] - Local $edgeB[5][2] = [[$FurthestBottomLeft[0][0], $FurthestBottomLeft[0][1]], [0, 0], [0, 0], [0, 0], [Round(($FurthestBottomLeft[4][0] - $FurthestBottomLeft[0][0]) / _Random_Gaussian(4.5, .25)) + $FurthestBottomLeft[0][0], Round(($FurthestBottomLeft[4][1] - $FurthestBottomLeft[0][1]) / _Random_Gaussian(4.5, .25)) + $FurthestBottomLeft[0][1]]] - $nbSides = 2 - Case 2 - $m = (537 - 238) / (535 - 128) - $m2 = (9 - 314) / (430 - 28) - $b = $THy - ($m * $THx) - $b2 = 314 - ($m2 * 28) - $CenterX = ($b - $b2) / ($m2 - $m) - $LeftX = Round(_Random_Gaussian($CenterX - 20, 3)) - $RightX = Round(_Random_Gaussian($CenterX + 20, 3)) - If $LeftX < $FurthestTopLeft[0][0] Then $LeftX = $FurthestTopLeft[0][0] - If $RightX > $FurthestTopLeft[4][0] Then $RightX = $FurthestTopLeft[4][0] - $LeftY = Round($m2 * $LeftX + $b2) - $RightY = Round($m2 * $RightX + $b2) - Local $edgeA[5][2] = [[$LeftX, $LeftY], [0, 0], [0, 0], [0, 0], [$RightX, $RightY]] - Local $edgeB = -1 - $nbSides = 1 - Case 3 - Local $edgeA[5][2] = [[$FurthestTopLeft[4][0], $FurthestTopLeft[4][1]], [0, 0], [0, 0], [0, 0], [$FurthestTopLeft[4][0] - Round(($FurthestTopLeft[4][0] - $FurthestTopLeft[0][0]) / _Random_Gaussian(4.5, .25)), $FurthestTopLeft[4][1] - Round(($FurthestTopLeft[4][1] - $FurthestTopLeft[0][1]) / _Random_Gaussian(4.5, .25))]] - Local $edgeB[5][2] = [[$FurthestTopRight[0][0], $FurthestTopRight[0][1]], [0, 0], [0, 0], [0, 0], [Round(($FurthestTopRight[4][0] - $FurthestTopRight[0][0]) / _Random_Gaussian(4.5, .25)) + $FurthestTopRight[0][0], Round(($FurthestTopRight[4][1] - $FurthestTopRight[0][1]) / _Random_Gaussian(4.5, .25)) + $FurthestTopRight[0][1]]] - $nbSides = 2 - Case 4 - $m = (85 - 388) / (527 - 130) - $m2 = (612 - 314) / (440 - 28) - $b = $THy - ($m * $THx) - $b2 = 314 - ($m2 * 28) - $CenterX = ($b - $b2) / ($m2 - $m) - $LeftX = Round(_Random_Gaussian($CenterX - 20, 3)) - $RightX = Round(_Random_Gaussian($CenterX + 20, 3)) - If $LeftX < $FurthestBottomLeft[0][0] Then $LeftX = $FurthestBottomLeft[0][0] - If $RightX > (.75 * ($FurthestBottomLeft[4][0] - $FurthestBottomLeft[0][0])) + $FurthestBottomLeft[0][0] Then $RightX = Round((.75 * ($FurthestBottomLeft[4][0] - $FurthestBottomLeft[0][0])) + $FurthestBottomLeft[0][0]) - $LeftY = Round($m2 * $LeftX + $b2) - $RightY = Round($m2 * $RightX + $b2) - Local $edgeA[5][2] = [[$LeftX, $LeftY], [0, 0], [0, 0], [0, 0], [$RightX, $RightY]] - Local $edgeB = -1 - $nbSides = 1 - Case 6 - $m = (85 - 388) / (527 - 130) - $m2 = (313 - 9) / (820 - 430) - $b = $THy - ($m * $THx) - $b2 = 9 - ($m2 * 430) - $CenterX = ($b - $b2) / ($m2 - $m) - $LeftX = Round(_Random_Gaussian($CenterX - 20, 3)) - $RightX = Round(_Random_Gaussian($CenterX + 20, 3)) - If $LeftX < $FurthestTopRight[0][0] Then $LeftX = $FurthestTopRight[0][0] - If $RightX > $FurthestTopRight[4][0] Then $RightX = $FurthestTopRight[4][0] - $LeftY = Round($m2 * $LeftX + $b2) - $RightY = Round($m2 * $RightX + $b2) - Local $edgeA[5][2] = [[$LeftX, $LeftY], [0, 0], [0, 0], [0, 0], [$RightX, $RightY]] - Local $edgeB = -1 - $nbSides = 1 - Case 7 - Local $edgeA[5][2] = [[Round(($FurthestBottomRight[4][0] - $FurthestBottomRight[0][0]) / 3.5) + $FurthestBottomRight[0][0], Round(($FurthestBottomRight[4][1] - $FurthestBottomRight[0][1]) / 3.5) + $FurthestBottomRight[0][1]], [0, 0], [0, 0], [0, 0], [Round(($FurthestBottomRight[4][0] - $FurthestBottomRight[0][0]) / 4) + $FurthestBottomRight[0][0], Round(($FurthestBottomRight[4][1] - $FurthestBottomRight[0][1]) / 4) + $FurthestBottomRight[0][1]]] - Local $edgeB[5][2] = [[$FurthestBottomLeft[4][0] - Round(($FurthestBottomLeft[4][0] - $FurthestBottomLeft[0][0]) / 3.5), $FurthestBottomLeft[4][1] - Round(($FurthestBottomLeft[4][1] - $FurthestBottomLeft[0][1]) / 3.5)], [0, 0], [0, 0], [0, 0], [$FurthestBottomLeft[4][0] - Round(($FurthestBottomLeft[4][0] - $FurthestBottomLeft[0][0]) / 4), $FurthestBottomLeft[4][1] - Round(($FurthestBottomLeft[4][1] - $FurthestBottomLeft[0][1]) / 4)]] - $nbSides = 2 - Case 8 - $m = (537 - 238) / (535 - 128) - $m2 = (9 - 314) / (430 - 28) - If $m = $m2 Then $m2 = $m2 + 0.00000001 - $b = $THy - ($m * $THx) - $b2 = 612 - ($m2 * 440) - $CenterX = ($b - $b2) / ($m2 - $m) - $LeftX = Round(_Random_Gaussian($CenterX - 20, 3)) - $RightX = Round(_Random_Gaussian($CenterX + 20, 3)) - If $LeftX < ((.25 * ($FurthestBottomRight[4][0] - $FurthestBottomRight[0][0])) + $FurthestBottomRight[0][0]) Then $LeftX = Round(((.25 * ($FurthestBottomRight[4][0] - $FurthestBottomRight[0][0])) + $FurthestBottomRight[0][0])) - If $RightX > $FurthestBottomRight[4][0] Then $RightX = $FurthestBottomRight[4][0] - $LeftY = Round($m2 * $LeftX + $b2) - $RightY = Round($m2 * $RightX + $b2) - Local $edgeA[5][2] = [[$LeftX, $LeftY], [0, 0], [0, 0], [0, 0], [$RightX, $RightY]] - Local $edgeB = -1 - $nbSides = 1 - Case 9 - Local $edgeA[5][2] = [[$FurthestTopRight[4][0], $FurthestTopRight[4][1]], [0, 0], [0, 0], [0, 0], [$FurthestTopRight[4][0] - Round(($FurthestTopRight[4][0] - $FurthestTopRight[0][0]) / _Random_Gaussian(4.5, .25)), $FurthestTopRight[4][1] - Round(($FurthestTopRight[4][1] - $FurthestTopRight[0][1]) / _Random_Gaussian(4.5, .25))]] - Local $edgeB[5][2] = [[$FurthestBottomRight[4][0], $FurthestBottomRight[4][1]], [0, 0], [0, 0], [0, 0], [$FurthestBottomRight[4][0] - Round(($FurthestBottomRight[4][0] - $FurthestBottomRight[0][0]) / _Random_Gaussian(4.5, .25)), $FurthestBottomRight[4][1] - Round(($FurthestBottomRight[4][1] - $FurthestBottomRight[0][1]) / _Random_Gaussian(4.5, .25))]] - $nbSides = 2 - Case Else - Return - EndSwitch - $edgeA[2][0] = Round(($edgeA[0][0] + $edgeA[4][0]) / 2) - $edgeA[2][1] = Round(($edgeA[0][1] + $edgeA[4][1]) / 2) - $edgeA[1][0] = Round(($edgeA[0][0] + $edgeA[2][0]) / 2) - $edgeA[1][1] = Round(($edgeA[0][1] + $edgeA[2][1]) / 2) - $edgeA[3][0] = Round(($edgeA[2][0] + $edgeA[4][0]) / 2) - $edgeA[3][1] = Round(($edgeA[2][1] + $edgeA[4][1]) / 2) - If $edgeB <> -1 Then - $edgeB[2][0] = Round(($edgeB[0][0] + $edgeB[4][0]) / 2) - $edgeB[2][1] = Round(($edgeB[0][1] + $edgeB[4][1]) / 2) - $edgeB[1][0] = Round(($edgeB[0][0] + $edgeB[2][0]) / 2) - $edgeB[1][1] = Round(($edgeB[0][1] + $edgeB[2][1]) / 2) - $edgeB[3][0] = Round(($edgeB[2][0] + $edgeB[4][0]) / 2) - $edgeB[3][1] = Round(($edgeB[2][1] + $edgeB[4][1]) / 2) - EndIf - If $nbSides = 1 Then - Standard_DropOnEdge($troop, $edgeA, $nbTroopsLeft, $slotsPerEdge, -1, -1, $AimTH) - $nbTroopsLeft = 0 - Else - $nbTroopsPerEdge = Round($nbTroopsLeft / 2) - Standard_DropOnEdge($troop, $edgeA, $nbTroopsPerEdge, $slotsPerEdge, $edgeB, -1, $AimTH) - EndIf - EndIf -EndFunc ;==>Standard_DropOnEdges - -Func Standard_LaunchTroop($troopKind, $nbSides, $waveNb, $maxWaveNb, $slotsPerEdge = 0, $miniEdge = False) - Local $troop = -1 - Local $troopNb = 0 - Local $name = "" - For $i = 0 To 8 ; identify the position of this kind of troop - If $atkTroops[$i][0] = $troopKind Then - $troop = $i - $troopNb = Ceiling($atkTroops[$i][1] / $maxWaveNb) - Local $plural = 0 - If $troopNb > 1 Then $plural = 1 - $name = NameOfTroop($troopKind, $plural) - EndIf - Next - - If ($troop = -1) Or ($troopNb = 0) Then - Return False; nothing to do => skip this wave - EndIf - - Local $waveName = "first" - If $waveNb = 2 Then $waveName = "second" - If $waveNb = 3 Then $waveName = "third" - If $maxWaveNb = 1 Then $waveName = "only" - If $waveNb = 0 Then $waveName = "last" - SetLog(GetLangText("msgDropping") & $waveName & GetLangText("msgWaveOf") & $troopNb & " " & $name, $COLOR_BLUE) - Standard_DropOnEdges($troop, $nbSides, $troopNb, $slotsPerEdge, $miniEdge) - Return True -EndFunc ;==>Standard_LaunchTroop - -Func Standard_Attack($AttackMethod = 1) - - _CaptureRegion() - $hAttackBitmap = _GDIPlus_BitmapCloneArea($hBitmap, 0, 0, 860, 720, _GDIPlus_ImageGetPixelFormat($hBitmap)) - $Buffer = _GDIPlus_ImageGetGraphicsContext($hAttackBitmap) - If $DebugMode = 1 And $Hide = False Then ActivateOverlay() - $BufferAvailable = True - - SeekEdges() - - $FasterExit = False - - If $AttackMethod = 2 Then - ; Nuke the DE - SetLog(GetLangText("msgNuking"), $COLOR_BLUE) - Standard_DropNukes() - If _Sleep(4000) Then Return - $FasterExit = True - Else - $King = -1 - $Queen = -1 - $CC = -1 - $Barb = -1 - $Arch = -1 - $Giant = -1 - $WB = -1 - $Gob = -1 - $Hog = -1 - $Minion = -1 - $Valk = -1 - $LSpell = -1 - $SpellQty = 0 - $KingWasHere = False - $QueenWasHere = False - For $i = 0 To 8 - If $atkTroops[$i][0] = $eBarbarian Then - $Barb = $i - ElseIf $atkTroops[$i][0] = $eArcher Then - $Arch = $i - ElseIf $atkTroops[$i][0] = $eGiant Then - $Giant = $i - ElseIf $atkTroops[$i][0] = $eWallbreaker Then - $WB = $i - ElseIf $atkTroops[$i][0] = $eGoblin Then - $Gob = $i - ElseIf $atkTroops[$i][0] = $eHog Then - $Hog = $i - ElseIf $atkTroops[$i][0] = $eMinion Then - $Minion = $i - ElseIf $atkTroops[$i][0] = $eValkyrie Then - $Valk = $i - ElseIf $atkTroops[$i][0] = $eCastle Then - $CC = $i - ElseIf $atkTroops[$i][0] = $eKing Then - $King = $i - $KingWasHere = True - ElseIf $atkTroops[$i][0] = $eQueen Then - $Queen = $i - $QueenWasHere = True - ElseIf $atkTroops[$i][0] = $eLSpell Then - $LSpell = $i - $SpellQty = $atkTroops[$i][1] - EndIf - Next - $KingPowerCollector = False - $QueenPowerCollector = False - $KingUsedSnipe = False - $QueenUsedSnipe = False - $KingPowerSnipe = False - $QueenPowerSnipe = False - Local $CollectorDeployOrder[11] = [$Giant, $Hog, $Valk, $WB, $Barb, $Arch, $Gob, $Minion, $King, $Queen, $CC] - Local $SnipeWaveMax = 6 - Local $SnipeWaveSizes[5] = [5, 5, 15, 15, 15] - Local $SnipeWaves[6][11] = [[-1, -1, -1, -1, $Barb, $Arch, -1, -1, -1, -1, -1], _ - [-1, -1, -1, -1, $Barb, $Arch, -1, -1, -1, -1, -1], _ - [$Giant, -1, -1, $WB, $Barb, $Arch, -1, -1, -1, -1, -1], _ - [$Giant, $Hog, -1, $WB, $Barb, $Arch, -1, $Minion, -1, -1, -1], _ - [$Giant, $Hog, $Valk, $WB, $Barb, $Arch, -1, $Minion, -1, -1, -1], _ - [$Giant, $Hog, $Valk, $WB, $Barb, $Arch, $Gob, $Minion, $King, $Queen, $CC]] - Local $SnipeDeployOrder[11] = [$Giant, $Hog, $Valk, $WB, $Barb, $Arch, $Gob, $Minion, $King, $Queen, $CC] - - Local $nbSides = 0 - Local $mixedMode = False - Local $collectorMode = False - Local $EarlyExit = False - - $attackTH = ($AttackMethod = 0) ? _GUICtrlComboBox_GetCurSel($cmbDeadAttackTH) : _GUICtrlComboBox_GetCurSel($cmbAttackTH) - Local $OuterQuad - $OuterQuad = False - If $THquadrant >= 1 And $THquadrant <= 4 Then $OuterQuad = True - If $THquadrant >= 6 And $THquadrant <= 9 Then $OuterQuad = True - If $AttackMethod = 3 Then - SetLog(GetLangText("msgSnipeMode")) - ElseIf ($OuterQuad And $attackTH = 2) Then - SetLog(GetLangText("msgAttackingTH")) - $nbSides = -1 - Else - If $AttackMethod = 0 Then - Switch _GUICtrlComboBox_GetCurSel($cmbDeadDeploy) - Case 0 ;Single sides ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - SetLog(GetLangText("msgSingleSide")) - $nbSides = 1 - Case 1 ;Two sides ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - SetLog(GetLangText("msgTwoSides")) - $nbSides = 2 - Case 2 ;Three sides ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - SetLog(GetLangText("msgThreeSides")) - $nbSides = 3 - Case 3 ;Four sides ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - SetLog(GetLangText("msgAllSides")) - $nbSides = 4 - Case 4 - SetLog(GetLangText("msgMixedMode")) - $nbSides = 4 - $mixedMode = True - Case 5 - SetLog(GetLangText("msgCollectorMode")) - $collectorMode = True - Case 6 - SetLog(GetLangText("msgCollectorMode")) - SetLog(GetLangText("msgCollectorSave")) - $collectorMode = True - $EarlyExit = True - EndSwitch - Else - Switch _GUICtrlComboBox_GetCurSel($cmbDeploy) - Case 0 ;Single sides ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - SetLog(GetLangText("msgSingleSide")) - $nbSides = 1 - Case 1 ;Two sides ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - SetLog(GetLangText("msgTwoSides")) - $nbSides = 2 - Case 2 ;Three sides ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - SetLog(GetLangText("msgThreeSides")) - $nbSides = 3 - Case 3 ;Four sides ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - SetLog(GetLangText("msgAllSides")) - $nbSides = 4 - Case 4 - SetLog(GetLangText("msgMixedMode")) - $nbSides = 4 - $mixedMode = True - Case 5 - SetLog(GetLangText("msgCollectorMode")) - $collectorMode = True - Case 6 - SetLog(GetLangText("msgCollectorMode")) - SetLog(GetLangText("msgCollectorSave")) - $collectorMode = True - $EarlyExit = True - EndSwitch - EndIf - If ($OuterQuad And $attackTH = 1 And Not $collectorMode) Then SetLog(GetLangText("msgLimitedTH")) - EndIf - - If $AttackMethod = 3 Then - ; Snipe mode - ; Make our curve - Local $DropCurve[240][2] - $AngleTrue = PolarCoord($THx, $THy, $BaseCenter[0], $BaseCenter[1]) -;~ $AngleA = PolarCoord($THx - 16, $THy + 16, $BaseCenter[0], $BaseCenter[1]) -;~ $AngleB = PolarCoord($THx + 16, $THy - 16, $BaseCenter[0], $BaseCenter[1]) -;~ $AngleC = PolarCoord($THx + 16, $THy + 16, $BaseCenter[0], $BaseCenter[1]) -;~ $AngleD = PolarCoord($THx - 16, $THy - 16, $BaseCenter[0], $BaseCenter[1]) -;~ $DiffAB = SmallerAngleBetween($AngleA[1], $AngleB[1]) -;~ $DiffAC = SmallerAngleBetween($AngleA[1], $AngleC[1]) -;~ $DiffAD = SmallerAngleBetween($AngleA[1], $AngleD[1]) -;~ $DiffBC = SmallerAngleBetween($AngleB[1], $AngleC[1]) -;~ $DiffBD = SmallerAngleBetween($AngleB[1], $AngleD[1]) -;~ $DiffCD = SmallerAngleBetween($AngleC[1], $AngleD[1]) -;~ $BiggestAngle = 0 -;~ If $DiffAB > $BiggestAngle Then $BiggestAngle = $DiffAB -;~ If $DiffAC > $BiggestAngle Then $BiggestAngle = $DiffAC -;~ If $DiffAD > $BiggestAngle Then $BiggestAngle = $DiffAD -;~ If $DiffBC > $BiggestAngle Then $BiggestAngle = $DiffBC -;~ If $DiffBD > $BiggestAngle Then $BiggestAngle = $DiffBD -;~ If $DiffCD > $BiggestAngle Then $BiggestAngle = $DiffCD -;~ $curveLimits = $BiggestAngle - $curveLimits = _Random_Gaussian(0.5236, 0.12) - $direction = ((Random(0, 1, 1) - .5) * 2) - $steppingangle = $AngleTrue[1] - (($curveLimits / 2) * $direction) - ; Make the curve of points - For $step = 0 To 239 - $DeltaPos = CartCoord(860, $steppingangle) - $DropCurve[$step][0] = $THx + $DeltaPos[0] - $DropCurve[$step][1] = $THy + $DeltaPos[1] - $steppingangle = $steppingangle + (($curveLimits / 240) * $direction) - Next - For $step = 0 To 239 - FixDropCurvePos($DropCurve, $step, $THx, $THy) - Next - For $step = 0 To 238 - OverlayLine($DropCurve[$step][0], $DropCurve[$step][1], $DropCurve[$step + 1][0], $DropCurve[$step + 1][1], 0xFF0000FF, 2) - Next - OverlayLine($DropCurve[0][0], $DropCurve[0][1], $THx, $THy, 0xFF0000FF, 2) - OverlayLine($DropCurve[239][0], $DropCurve[239][1], $THx, $THy, 0xFF0000FF, 2) - - ; Assign waves of troops - Local $TroopBins[$SnipeWaveMax][9] - For $Waves = 0 To $SnipeWaveMax - 1 - For $troop = 0 To 8 - $TroopBins[$Waves][$troop] = 0 - Next - If $Waves < ($SnipeWaveMax - 1) Then - $TroopsAdded = 0 - $TroopsLeft = True - While ($TroopsAdded < $SnipeWaveSizes[$Waves]) And $TroopsLeft - For $WaveTroop = 0 to 10 - If $SnipeWaves[$Waves][$WaveTroop] > -1 Then - If $atkTroops[$SnipeWaves[$Waves][$WaveTroop]][1] > 0 Then - $TroopBins[$Waves][$SnipeWaves[$Waves][$WaveTroop]] += 1 - $atkTroops[$SnipeWaves[$Waves][$WaveTroop]][1] -= 1 - $TroopsAdded += 1 - If $TroopsAdded = $SnipeWaveSizes[$Waves] Then ExitLoop - EndIf - EndIf - Next - For $NumCheck = 0 to 8 - If $atkTroops[$NumCheck][1] = 1 Then $TroopsLeft = True - Next - WEnd - Else - For $WaveTroop = 0 to 10 - If $SnipeWaves[$Waves][$WaveTroop] > -1 Then - If $atkTroops[$SnipeWaves[$Waves][$WaveTroop]][1] > 0 Then - $TroopBins[$Waves][$SnipeWaves[$Waves][$WaveTroop]] += $atkTroops[$SnipeWaves[$Waves][$WaveTroop]][1] - $atkTroops[$SnipeWaves[$Waves][$WaveTroop]][1] = 0 - EndIf - EndIf - Next - EndIf - Next - - $KingUsedSnipe = False - $QueenUsedSnipe = False - $AllDone = False - $Wave = 0 - While Not $AllDone - ; Deploy next wave of troops - Do - $AllGone = True - For $SnipeTroop In $SnipeDeployOrder - If $SnipeTroop > -1 Then - If $TroopBins[$Wave][$SnipeTroop] > 0 Then - Switch $SnipeTroop - Case $King - $hHeroTimer = TimerInit() - $KingUsedSnipe = True - Case $Queen - $hHeroTimer = TimerInit() - $QueenUsedSnipe = True - EndSwitch - - If Wave_Sleep(1) Then Return - SelectDropTroupe($SnipeTroop) - - _CaptureRegion() - If _ColorCheck(_GetPixelColor(714, 538), Hex(0xC0C8C0, 6), 30) Then ExitLoop(3) - - ; Random wave distance - $BufferDist = _Random_Gaussian(20, 6) - If $BufferDist < 2 Then $BufferDist = 2 - - If $TroopBins[$Wave][$SnipeTroop] = 1 Then - ; Only a single unit, drop in middle - $Clickx = Round(_Random_Gaussian($DropCurve[119][0], 3)) - $Clicky = Round(_Random_Gaussian($DropCurve[119][1], 3)) - RedLineDeploy($Clickx, $Clicky, 1, 0, $AimPoint, $BufferDist, $THx, $THy) - $TroopBins[$Wave][$SnipeTroop] -= 1 - ElseIf $TroopBins[$Wave][$SnipeTroop] = 2 Then - ; Drop 2 units - $Clickx = Round(_Random_Gaussian($DropCurve[89][0], 3)) - $Clicky = Round(_Random_Gaussian($DropCurve[89][1], 3)) - RedLineDeploy($Clickx, $Clicky, 1, 0, $AimPoint, $BufferDist, $THx, $THy) - If Wave_Sleep(0) Then Return - $Clickx = Round(_Random_Gaussian($DropCurve[149][0], 3)) - $Clicky = Round(_Random_Gaussian($DropCurve[149][1], 3)) - RedLineDeploy($Clickx, $Clicky, 1, 0, $AimPoint, $BufferDist, $THx, $THy) - $TroopBins[$Wave][$SnipeTroop] -= 2 - Else - ; Many troops so spread out, deploy in waves - $WaveMax = 5 - $WaveSize = $TroopBins[$Wave][$SnipeTroop] - If $WaveSize > $WaveMax Then $WaveSize = $WaveMax - For $TroopCount = 1 To $WaveSize - _CaptureRegion() - If _ColorCheck(_GetPixelColor(714, 538), Hex(0xC0C8C0, 6), 30) Then ExitLoop(4) - $curvepoint = Floor((($TroopCount - 1) / ($WaveSize - 1)) * 239) - $Clickx = Round(_Random_Gaussian($DropCurve[$curvepoint][0], 3)) - $Clicky = Round(_Random_Gaussian($DropCurve[$curvepoint][1], 3)) - RedLineDeploy($Clickx, $Clicky, 1, 0, $AimPoint, $BufferDist, $THx, $THy) - If Wave_Sleep(0) Then Return - Next - $TroopBins[$Wave][$SnipeTroop] -= $WaveSize - If $TroopBins[$Wave][$SnipeTroop] > 0 Then $AllGone = False - EndIf - EndIf - EndIf - - ; All this looping around takes a while, so check for hero activation - If $KingUsedSnipe And Not $KingPowerSnipe And TimerDiff($hHeroTimer) > 3000 Then - If GUICtrlRead($txtKingSkill) = 0 Then - _CaptureRegion() - If (checkHealth($King) Or (TimerDiff($hHeroTimer) / 1000) > 60) Then - SetLog(GetLangText("msgActivateKing"), $COLOR_AQUA) - SelectDropTroupe($King) - $KingPowerSnipe = True - EndIf - Else - If ((TimerDiff($hHeroTimer) / 1000) > Number(GUICtrlRead($txtKingSkill))) Then - SetLog(GetLangText("msgActivateKing"), $COLOR_BLUE) - SelectDropTroupe($King) - $KingPowerSnipe = True - EndIf - EndIf - EndIf - If $QueenUsedSnipe And Not $QueenPowerSnipe And TimerDiff($hHeroTimer) > 3000 Then - If GUICtrlRead($txtQueenSkill) = 0 Then - _CaptureRegion() - If (checkHealth($Queen) Or (TimerDiff($hHeroTimer) / 1000) > 60) Then - SetLog(GetLangText("msgActivateQueen"), $COLOR_AQUA) - SelectDropTroupe($Queen) - $QueenPowerSnipe = True - EndIf - Else - If ((TimerDiff($hHeroTimer) / 1000) > Number(GUICtrlRead($txtQueenSkill))) Then - SetLog(GetLangText("msgActivateQueen"), $COLOR_BLUE) - SelectDropTroupe($Queen) - $QueenPowerSnipe = True - EndIf - EndIf - EndIf - Next - Until $AllGone - - ; Wait until income stopped, 45 seconds have passed, or we have a star - SetLog(GetLangText("msgSnipeWaveWait")) - $incomecheck = 0 - $incomestopped = False - $WaveTimer = TimerInit() - Do - If $incomecheck = 0 Then $origresources = GetResources(2) - If _Sleep(100) Then Return - If $KingUsedSnipe And Not $KingPowerSnipe And TimerDiff($hHeroTimer) > 3000 Then - If GUICtrlRead($txtKingSkill) = 0 Then - _CaptureRegion() - If (checkHealth($King) Or (TimerDiff($hHeroTimer) / 1000) > 60) Then - SetLog(GetLangText("msgActivateKing"), $COLOR_AQUA) - SelectDropTroupe($King) - $KingPowerSnipe = True - EndIf - Else - If ((TimerDiff($hHeroTimer) / 1000) > Number(GUICtrlRead($txtKingSkill))) Then - SetLog(GetLangText("msgActivateKing"), $COLOR_BLUE) - SelectDropTroupe($King) - $KingPowerSnipe = True - EndIf - EndIf - EndIf - If $QueenUsedSnipe And Not $QueenPowerSnipe And TimerDiff($hHeroTimer) > 3000 Then - If GUICtrlRead($txtQueenSkill) = 0 Then - _CaptureRegion() - If (checkHealth($Queen) Or (TimerDiff($hHeroTimer) / 1000) > 60) Then - SetLog(GetLangText("msgActivateQueen"), $COLOR_AQUA) - SelectDropTroupe($Queen) - $QueenPowerSnipe = True - EndIf - Else - If ((TimerDiff($hHeroTimer) / 1000) > Number(GUICtrlRead($txtQueenSkill))) Then - SetLog(GetLangText("msgActivateQueen"), $COLOR_BLUE) - SelectDropTroupe($Queen) - $QueenPowerSnipe = True - EndIf - EndIf - EndIf - $incomecheck += 1 - If $incomecheck = 25 Then - $incomecheck = 0 - $compresources = GetResources(2) - If $origresources[2] = $compresources[2] And $origresources[3] = $compresources[3] Then $incomestopped = True - EndIf - _CaptureRegion() - If _ColorCheck(_GetPixelColor(714, 538), Hex(0xC0C8C0, 6), 30) Then $AllDone = True - Until $incomestopped Or (TimerDiff($WaveTimer) > 45000) Or $AllDone - - $Wave += 1 - If $Wave = $SnipeWaveMax Then $AllDone = True - WEnd - SetLog(GetLangText("msgSnipeAttackDone")) - ElseIf $collectorMode Then - ; Collect red line data even if it is turned off - - $RedLineWasOff = False - If GUICtrlRead($sldAcc) = 100 Then - $RedLineWasOff = True - GUICtrlSetData($sldAcc, 90) - SeekEdges() - EndIf - - ; Find all the collectors - SetLog(GetLangText("msgFindColl")) - _CaptureRegion(0, 0, 860, 720, False, True) - Local $AllCollectors[18][7] - ; 0 = type - ; 1 = X - ; 2 = Y - ; 3 = Angle - ; 4 = Deployed - ; 5 = Still standing - ; 6 = Deploy Timer - Local $CollectorCount = 0 - $hDll = DllOpen(@ScriptDir & "\BrokenBot.org\BrokenBot32.dll") - For $collector = 14 To 16 - $res = Null - $res = "" - $expRet = "" - $hCheckHBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap) - $max = ($collector = 16) ? (3) : (7) - $res = DllCall($hDll, "str", "BrokenBotMatchBuilding", "ptr", $hCheckHBitmap, "int", $collector, "int", 3, "int", $max, "int", 1, "int", (IsChecked($chkSpeedBoost) ? (1) : (0))) - If IsArray($res) Then - If $res[0] = -2 Then - SetLog(GetLangText("msgLicense"), $COLOR_RED) - ElseIf $res[0] <> -1 And StringLen($res[0]) > 2 Then - $expRet = StringSplit($res[0], "|", 2) - If $DebugMode = 1 Then SetLog($expRet[0] & " " & (($collector = 14) ? (GetLangText("msgColGM")) : (($collector = 15) ? (GetLangText("msgColElix")) : (GetLangText("msgColDE"))))) - $i = 0 - While $i < $expRet[0] - If ($i * 6 + 2) <= UBound($expRet) Then - $AllCollectors[$CollectorCount][0] = $collector - $AllCollectors[$CollectorCount][1] = $expRet[$i * 6 + 1] - $AllCollectors[$CollectorCount][2] = $expRet[$i * 6 + 2] - $AllCollectors[$CollectorCount][4] = False - $AllCollectors[$CollectorCount][5] = True - $AllCollectors[$CollectorCount][6] = -1 - $CollectorCount += 1 - If $DebugMode = 1 Then SetLog((($collector = 14) ? (GetLangText("msgColGM")) : (($collector = 15) ? (GetLangText("msgColElix")) : (GetLangText("msgColDE")))) & " (" & $expRet[$i * 6 + 1] & ", " & $expRet[$i * 6 + 2] & ")") - EndIf - $i += 1 - WEnd - EndIf - EndIf - Next - _WinAPI_DeleteObject($hCheckHBitmap) - DllClose($hDll) - ; Find a good location to drop troops at - ; Function will reduce $CollectorCount for those that are deemed too far away to attempt attacking - $OutsideCollector = 125 - If $CollectorCount > 0 Then - SetLog(GetLangText("msgFoundCol") & $CollectorCount) - SetLog(GetLangText("msgFindPos")) - Standard_RemoveInsideCollectors($CollectorCount, $AllCollectors, $OutsideCollector) - EndIf - - If $CollectorCount = 0 Then - ; Finding collectors failed - ; Fall back to attacking on 4 sides - SetLog(GetLangText("msgFindColFailed")) - If ($OuterQuad And $attackTH = 1) Then SetLog(GetLangText("msgLimitedTH")) - $collectorMode = False - $nbSides = 4 - Else - SetLog(GetLangText("msgRemainCol") & $CollectorCount) - ; Randomly spread out troops to each collector - Local $TroopBins[$CollectorCount][9] - For $collector = 0 To $CollectorCount - 1 - OverlayCircle($AllCollectors[$collector][1], $AllCollectors[$collector][2], 20, 0xFF00FF00, 3) - If $DebugMode = 1 Then SetLog((($AllCollectors[$collector][0] = 14) ? (GetLangText("msgColGM")) : (($AllCollectors[$collector][0] = 15) ? (GetLangText("msgColElix")) : (GetLangText("msgColDE")))) & " (" & $AllCollectors[$collector][1] & ", " & $AllCollectors[$collector][2] & ")") - For $troop = 0 To 8 - $TroopBins[$collector][$troop] = 0 - Next - Next - For $troop = 0 To 8 - For $drop = 1 To $atkTroops[$troop][1] - $TroopBins[Random(0, $CollectorCount - 1, 1)][$troop] += 1 - Next - Next - - ; Sort collectors - For $collector = 0 To $CollectorCount - 1 - $Coord = PolarCoord($AllCollectors[$collector][1], $AllCollectors[$collector][2], $BaseCenter[0], $BaseCenter[1]) - $AllCollectors[$collector][3] = $Coord[1] - Next - _ArraySort($AllCollectors, Random(0, 1, 1), 0, $CollectorCount - 1, 3) - - ; Drop at each collector in sequence - $hHeroTimer = "" - $collector = Random(1, $CollectorCount, 1) - 1 - $firstcollector = -1 - Local $DropCurve[240][2] - $ExitOkay = False - $KingUsedCol = False - $QueenUsedCol = False - Do - If $firstcollector = -1 Then - $GoodCollector = True - $firstcollector = $collector - Else - If $EarlyExit Then - $GoodCollector = True - ; If any collectors near this have been deployed recently then skip this one - If $AllCollectors[$collector][4] Or Not $AllCollectors[$collector][5] Then - $GoodCollector = False - Else - For $check = 0 To $CollectorCount - 1 - If $AllCollectors[$check][4] Then - $DeltaAngle = Max($AllCollectors[$check][3], $AllCollectors[$collector][3]) - Min($AllCollectors[$check][3], $AllCollectors[$collector][3]) - If $DeltaAngle > $pi Then $DeltaAngle = (2 * $pi) - $DeltaAngle - If $DeltaAngle < ($pi / 6) And TimerDiff($AllCollectors[$check][6]) < 15000 Then $GoodCollector = False - EndIf - Next - EndIf - EndIf - EndIf - - If Not $EarlyExit Or $GoodCollector Then - ; Create a curve to drop along, then we'll have our redline code do the work of getting a good drop point - ; How big will curve be? - $curveLimits = _Random_Gaussian(0.5236, 0.12) - $direction = ((Random(0, 1, 1) - .5) * 2) - $steppingangle = $AllCollectors[$collector][3] - (($curveLimits / 2) * $direction) - ; Make the curve of points - For $step = 0 To 239 - $DeltaPos = CartCoord(860, $steppingangle) - $DropCurve[$step][0] = $AllCollectors[$collector][1] + $DeltaPos[0] - $DropCurve[$step][1] = $AllCollectors[$collector][2] + $DeltaPos[1] - $steppingangle = $steppingangle + (($curveLimits / 240) * $direction) - Next - If $OverlayVisible Then - For $step = 0 To 239 - FixDropCurvePos($DropCurve, $step, $AllCollectors[$collector][1], $AllCollectors[$collector][2]) - Next - For $step = 0 To 238 - OverlayLine($DropCurve[$step][0], $DropCurve[$step][1], $DropCurve[$step + 1][0], $DropCurve[$step + 1][1], 0xFF0000FF, 2) - Next - OverlayLine($DropCurve[0][0], $DropCurve[0][1], $AllCollectors[$collector][1], $AllCollectors[$collector][2], 0xFF0000FF, 2) - OverlayLine($DropCurve[239][0], $DropCurve[239][1], $AllCollectors[$collector][1], $AllCollectors[$collector][2], 0xFF0000FF, 2) - EndIf - OverlayCircle($AllCollectors[$collector][1], $AllCollectors[$collector][2], 20, 0xFFFFFF99, 3) - - Do - $AllGone = True - For $ColTroop In $CollectorDeployOrder - If $ColTroop > -1 Then - If $TroopBins[$collector][$ColTroop] > 0 Then - Switch $ColTroop - Case $King - Local $useKing = ($AttackMethod = 0) ? (IsChecked($chkDeadUseKing) ? (1) : (0)) : (IsChecked($chkUseKing) ? (1) : (0)) - If $useKing = 1 Then - $hHeroTimer = TimerInit() - $KingUsedCol = True - Else - ContinueLoop - EndIf - Case $Queen - Local $useQueen = ($AttackMethod = 0) ? (IsChecked($chkDeadUseQueen) ? (1) : (0)) : (IsChecked($chkUseQueen) ? (1) : (0)) - If $useQueen = 1 Then - $hHeroTimer = TimerInit() - $QueenUsedCol = True - Else - ContinueLoop - EndIf - Case $CC - Local $useCastle = ($AttackMethod = 0) ? (IsChecked($chkDeadUseClanCastle) ? (1) : (0)) : (IsChecked($chkUseClanCastle) ? (1) : (0)) - If $useCastle = 0 Then ContinueLoop - EndSwitch - - If Wave_Sleep(1) Then Return - SelectDropTroupe($ColTroop) - - ; Random wave distance - $BufferDist = _Random_Gaussian(20, 6) - If $BufferDist < 2 Then $BufferDist = 2 - - If $TroopBins[$collector][$ColTroop] = 1 Then - ; Only a single unit, drop in middle - FixDropCurvePos($DropCurve, 119, $AllCollectors[$collector][1], $AllCollectors[$collector][2]) - $Clickx = Round(_Random_Gaussian($DropCurve[119][0], 3)) - $Clicky = Round(_Random_Gaussian($DropCurve[119][1], 3)) - RedLineDeploy($Clickx, $Clicky, 1, 0, $AimPoint, $BufferDist, $AllCollectors[$collector][1], $AllCollectors[$collector][2]) - $TroopBins[$collector][$ColTroop] -= 1 - ElseIf $TroopBins[$collector][$ColTroop] = 2 Then - ; Drop 2 units - FixDropCurvePos($DropCurve, 89, $AllCollectors[$collector][1], $AllCollectors[$collector][2]) - FixDropCurvePos($DropCurve, 149, $AllCollectors[$collector][1], $AllCollectors[$collector][2]) - $Clickx = Round(_Random_Gaussian($DropCurve[89][0], 3)) - $Clicky = Round(_Random_Gaussian($DropCurve[89][1], 3)) - RedLineDeploy($Clickx, $Clicky, 1, 0, $AimPoint, $BufferDist, $AllCollectors[$collector][1], $AllCollectors[$collector][2]) - If Wave_Sleep(0) Then Return - $Clickx = Round(_Random_Gaussian($DropCurve[149][0], 3)) - $Clicky = Round(_Random_Gaussian($DropCurve[149][1], 3)) - RedLineDeploy($Clickx, $Clicky, 1, 0, $AimPoint, $BufferDist, $AllCollectors[$collector][1], $AllCollectors[$collector][2]) - $TroopBins[$collector][$ColTroop] -= 2 - Else - ; Many troops so spread out, deploy in waves - $WaveMax = 5 - $WaveSize = $TroopBins[$collector][$ColTroop] - If $WaveSize > $WaveMax Then $WaveSize = $WaveMax - For $TroopCount = 1 To $WaveSize - $curvepoint = Floor((($TroopCount - 1) / ($WaveSize - 1)) * 239) - FixDropCurvePos($DropCurve, $curvepoint, $AllCollectors[$collector][1], $AllCollectors[$collector][2]) - $Clickx = Round(_Random_Gaussian($DropCurve[$curvepoint][0], 3)) - $Clicky = Round(_Random_Gaussian($DropCurve[$curvepoint][1], 3)) - RedLineDeploy($Clickx, $Clicky, 1, 0, $AimPoint, $BufferDist, $AllCollectors[$collector][1], $AllCollectors[$collector][2]) - If Wave_Sleep(0) Then Return - Next - $TroopBins[$collector][$ColTroop] -= $WaveSize - If $TroopBins[$collector][$ColTroop] > 0 Then $AllGone = False - EndIf - EndIf - EndIf - - ; All this looping around takes a while, so check for hero activation - If $KingUsedCol And Not $KingPowerCollector And TimerDiff($hHeroTimer) > 3000 Then - If GUICtrlRead($txtKingSkill) = 0 Then - _CaptureRegion() - If (checkHealth($King) Or (TimerDiff($hHeroTimer) / 1000) > 60) Then - SetLog(GetLangText("msgActivateKing"), $COLOR_AQUA) - SelectDropTroupe($King) - $KingPowerCollector = True - EndIf - Else - If ((TimerDiff($hHeroTimer) / 1000) > Number(GUICtrlRead($txtKingSkill))) Then - SetLog(GetLangText("msgActivateKing"), $COLOR_BLUE) - SelectDropTroupe($King) - $KingPowerCollector = True - EndIf - EndIf - EndIf - If $QueenUsedCol And Not $QueenPowerCollector And TimerDiff($hHeroTimer) > 3000 Then - If GUICtrlRead($txtQueenSkill) = 0 Then - _CaptureRegion() - If (checkHealth($Queen) Or (TimerDiff($hHeroTimer) / 1000) > 60) Then - SetLog(GetLangText("msgActivateQueen"), $COLOR_AQUA) - SelectDropTroupe($Queen) - $QueenPowerCollector = True - EndIf - Else - If ((TimerDiff($hHeroTimer) / 1000) > Number(GUICtrlRead($txtQueenSkill))) Then - SetLog(GetLangText("msgActivateQueen"), $COLOR_BLUE) - SelectDropTroupe($Queen) - $QueenPowerCollector = True - EndIf - EndIf - EndIf - Next - Until $AllGone - $AllCollectors[$collector][4] = True - $AllCollectors[$collector][6] = TimerInit() - EndIf - $collector += 1 - If $collector = $CollectorCount Then $collector = 0 - If $collector = $firstcollector Then $ExitOkay = True - If $EarlyExit And $ExitOkay Then - ; Even if we haven't deployed troops there yet, if the collector is gone then skip it - - ; First wait until income stops - SetLog(GetLangText("msgRoundDoneIncomeWait")) - $incomecheck = 0 - $incomestopped = False - Do - If $incomecheck = 0 Then $origresources = GetResources(2) - If _Sleep(100) Then Return - ; All this looping around takes a while, so check for hero activation - If $KingUsedCol And Not $KingPowerCollector And TimerDiff($hHeroTimer) > 3000 Then - If GUICtrlRead($txtKingSkill) = 0 Then - _CaptureRegion() - If (checkHealth($King) Or (TimerDiff($hHeroTimer) / 1000) > 60) Then - SetLog(GetLangText("msgActivateKing"), $COLOR_AQUA) - SelectDropTroupe($King) - $KingPowerCollector = True - EndIf - Else - If ((TimerDiff($hHeroTimer) / 1000) > Number(GUICtrlRead($txtKingSkill))) Then - SetLog(GetLangText("msgActivateKing"), $COLOR_BLUE) - SelectDropTroupe($King) - $KingPowerCollector = True - EndIf - EndIf - EndIf - If $QueenUsedCol And Not $QueenPowerCollector And TimerDiff($hHeroTimer) > 3000 Then - If GUICtrlRead($txtQueenSkill) = 0 Then - _CaptureRegion() - If (checkHealth($Queen) Or (TimerDiff($hHeroTimer) / 1000) > 60) Then - SetLog(GetLangText("msgActivateQueen"), $COLOR_AQUA) - SelectDropTroupe($Queen) - $QueenPowerCollector = True - EndIf - Else - If ((TimerDiff($hHeroTimer) / 1000) > Number(GUICtrlRead($txtQueenSkill))) Then - SetLog(GetLangText("msgActivateQueen"), $COLOR_BLUE) - SelectDropTroupe($Queen) - $QueenPowerCollector = True - EndIf - EndIf - EndIf - $incomecheck += 1 - If $incomecheck = 25 Then - $incomecheck = 0 - $compresources = GetResources(2) - If $origresources[2] = $compresources[2] And $origresources[3] = $compresources[3] And $origresources[4] = $compresources[4] Then $incomestopped = True - EndIf - Until $incomestopped - - For $check = 0 To $CollectorCount - 1 - $AllCollectors[$check][5] = False - Next - SetLog(GetLangText("msgRecheckCollectors")) - _CaptureRegion(0, 0, 860, 720, False, True) - $hDll = DllOpen(@ScriptDir & "\BrokenBot.org\BrokenBot32.dll") - For $recheck = 14 To 16 - $res = Null - $res = "" - $expRet = "" - $hCheckHBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap) - $max = ($recheck = 16) ? (3) : (7) - $res = DllCall($hDll, "str", "BrokenBotMatchBuilding", "ptr", $hCheckHBitmap, "int", $recheck, "int", 3, "int", $max, "int", 1, "int", (IsChecked($chkSpeedBoost) ? (1) : (0))) - If IsArray($res) Then - If $res[0] = -2 Then - SetLog(GetLangText("msgLicense"), $COLOR_RED) - ElseIf $res[0] <> -1 And StringLen($res[0]) > 2 Then - $expRet = StringSplit($res[0], "|", 2) - If $DebugMode = 1 Then SetLog($expRet[0] & " " & (($recheck = 14) ? (GetLangText("msgColGM")) : (($recheck = 15) ? (GetLangText("msgColElix")) : (GetLangText("msgColDE"))))) - $i = 0 - While $i < $expRet[0] - If ($i * 6 + 2) <= UBound($expRet) Then - For $check = 0 To $CollectorCount - 1 - If Abs($AllCollectors[$check][1] - $expRet[$i * 6 + 1]) < 5 And Abs($AllCollectors[$check][2] - $expRet[$i * 6 + 2]) < 5 Then $AllCollectors[$check][5] = True - Next - If $DebugMode = 1 Then SetLog((($recheck = 14) ? (GetLangText("msgColGM")) : (($recheck = 15) ? (GetLangText("msgColElix")) : (GetLangText("msgColDE")))) & " (" & $expRet[$i * 6 + 1] & ", " & $expRet[$i * 6 + 2] & ")") - EndIf - $i += 1 - WEnd - EndIf - EndIf - ; All this looping around takes a while, so check for hero activation - If $KingUsedCol And Not $KingPowerCollector And TimerDiff($hHeroTimer) > 3000 Then - If GUICtrlRead($txtKingSkill) = 0 Then - _CaptureRegion() - If (checkHealth($King) Or (TimerDiff($hHeroTimer) / 1000) > 60) Then - SetLog(GetLangText("msgActivateKing"), $COLOR_AQUA) - SelectDropTroupe($King) - $KingPowerCollector = True - EndIf - Else - If ((TimerDiff($hHeroTimer) / 1000) > Number(GUICtrlRead($txtKingSkill))) Then - SetLog(GetLangText("msgActivateKing"), $COLOR_BLUE) - SelectDropTroupe($King) - $KingPowerCollector = True - EndIf - EndIf - EndIf - If $QueenUsedCol And Not $QueenPowerCollector And TimerDiff($hHeroTimer) > 3000 Then - If GUICtrlRead($txtQueenSkill) = 0 Then - _CaptureRegion() - If (checkHealth($Queen) Or (TimerDiff($hHeroTimer) / 1000) > 60) Then - SetLog(GetLangText("msgActivateQueen"), $COLOR_AQUA) - SelectDropTroupe($Queen) - $QueenPowerCollector = True - EndIf - Else - If ((TimerDiff($hHeroTimer) / 1000) > Number(GUICtrlRead($txtQueenSkill))) Then - SetLog(GetLangText("msgActivateQueen"), $COLOR_BLUE) - SelectDropTroupe($Queen) - $QueenPowerCollector = True - EndIf - EndIf - EndIf - Next - _WinAPI_DeleteObject($hCheckHBitmap) - DllClose($hDll) - - ; If a collector is still standing, but has been deployed, take troops from one that is gone if possible - For $check = 0 To $CollectorCount - 1 - If $AllCollectors[$check][5] = False Then OverlayCircle($AllCollectors[$check][1], $AllCollectors[$check][2], 20, 0xFF778899, 3) -;~ If $AllCollectors[$check][4] = True And $AllCollectors[$check][5] = True Then -;~ For $findavailable = 0 To $CollectorCount - 1 -;~ If $AllCollectors[$findavailable][4] = False And $AllCollectors[$findavailable][5] = False Then -;~ ; We found a collector that hasn't deployed yet but already destroyed -;~ For $MoveTroop = 0 To 8 -;~ $TroopBins[$check][$MoveTroop] = $TroopBins[$findavailable][$MoveTroop] -;~ Next -;~ OverlayCircle($AllCollectors[$check][1], $AllCollectors[$check][2], 20, 0xFF00FF00, 3) -;~ $AllCollectors[$check][4] = False -;~ $AllCollectors[$findavailable][4] = True -;~ ExitLoop -;~ EndIf -;~ Next -;~ EndIf - Next - - For $check = 0 To $CollectorCount - 1 - If $AllCollectors[$check][4] = False And $AllCollectors[$check][5] = True Then $ExitOkay = False - Next - EndIf - Until $ExitOkay = True - SetLog(GetLangText("msgCollectAttackDone")) - EndIf - If $RedLineWasOff Then - GUICtrlSetData($sldAcc, 100) - EndIf - EndIf - - ; ================================================================================? - ; ========= Here is coded the main attack strategy =============================== - ; ========= Feel free to experiment something else =============================== - ; ================================================================================? - If Not $collectorMode And $AttackMethod <> 3 Then - If Standard_LaunchTroop($eGiant, (($mixedMode) ? 1 : $nbSides), 1, 1, 1, ($OuterQuad And $attackTH = 2)) Then - If Wave_Sleep(1) Then Return - EndIf - If Standard_LaunchTroop($eHog, (($mixedMode) ? 1 : $nbSides), 1, 1, 1, ($OuterQuad And $attackTH = 2)) Then - If Wave_Sleep(1) Then Return - EndIf - If Not $mixedMode Then - If Standard_LaunchTroop($eValkyrie, $nbSides, 1, 1, 1, ($OuterQuad And $attackTH = 2)) Then - If Wave_Sleep(1) Then Return - EndIf - EndIf - If Standard_LaunchTroop($eBarbarian, $nbSides, 1, 2, 0, ($OuterQuad And $attackTH = 2)) Then - If Wave_Sleep(1) Then Return - EndIf - If Standard_LaunchTroop($eWallbreaker, (($mixedMode) ? 1 : $nbSides), 1, (($mixedMode) ? 3 : 1), 1, ($OuterQuad And $attackTH = 2)) Then - If Wave_Sleep(1) Then Return - EndIf - If Standard_LaunchTroop($eArcher, $nbSides, 1, 2, 0, ($OuterQuad And $attackTH = 2)) Then - If Wave_Sleep(1) Then Return - EndIf - If Standard_LaunchTroop($eBarbarian, (($mixedMode) ? 1 : $nbSides), 2, 2, 0, ($OuterQuad And $attackTH >= 1)) Then - If Wave_Sleep(1) Then Return - EndIf - If Standard_LaunchTroop($eGoblin, $nbSides, 1, 2, 0, ($OuterQuad And $attackTH = 2)) Then - If Wave_Sleep(1) Then Return - EndIf - If $mixedMode Then - If Standard_LaunchTroop($eWallbreaker, 1, 2, 3, 1) Then - If _Sleep(Wave_Sleep(1), False) Then Return - EndIf - Else - If Standard_LaunchTroop($eArcher, $nbSides, 2, 2, 0, ($OuterQuad And $attackTH >= 1)) Then - If Wave_Sleep(1) Then Return - EndIf - If Standard_LaunchTroop($eGoblin, $nbSides, 2, 2, 0, ($OuterQuad And $attackTH = 2)) Then - If Wave_Sleep(1) Then Return - EndIf - If Standard_LaunchTroop($eMinion, $nbSides, 1, 1, 0, ($OuterQuad And $attackTH = 2)) Then - If Wave_Sleep(1) Then Return - EndIf - EndIf - ; ================================================================================? - - $hHeroTimer = "" - ; Deploy CC and Heroes behind troops - If ($OuterQuad And $attackTH = 2) Then - Switch $THquadrant - Case 1 - $DropX = $FurthestTopLeft[0][0] - $DropY = $FurthestTopLeft[0][1] - Local $DropArray[5][2] = [[$DropX, $DropY], [0, 0], [0, 0], [0, 0], [$DropX, $DropY]] - Case 2 - $m = (537 - 238) / (535 - 128) - $m2 = (9 - 314) / (430 - 28) - $b = $THy - ($m * $THx) - $b2 = 314 - ($m2 * 28) - $DropXa = (($b - $b2) / ($m2 - $m)) - 20 - $DropYa = Round($m2 * $DropXa + $b2) - $DropXb = (($b - $b2) / ($m2 - $m)) + 20 - $DropYb = Round($m2 * $DropXb + $b2) - Local $DropArray[5][2] = [[$DropXa, $DropYa], [0, 0], [0, 0], [0, 0], [$DropXb, $DropYb]] - Case 3 - $DropX = $FurthestTopLeft[4][0] - $DropY = $FurthestTopLeft[4][1] - Local $DropArray[5][2] = [[$DropX, $DropY], [0, 0], [0, 0], [0, 0], [$DropX, $DropY]] - Case 4 - $m = (85 - 388) / (527 - 130) - $m2 = (612 - 314) / (440 - 28) - $b = $THy - ($m * $THx) - $b2 = 314 - ($m2 * 28) - $DropXa = (($b - $b2) / ($m2 - $m)) - 20 - $DropYa = Round($m2 * $DropXa + $b2) - $DropXb = (($b - $b2) / ($m2 - $m)) + 20 - $DropYb = Round($m2 * $DropXb + $b2) - Local $DropArray[5][2] = [[$DropXa, $DropYa], [0, 0], [0, 0], [0, 0], [$DropXb, $DropYb]] - Case 6 - $m = (85 - 388) / (527 - 130) - $m2 = (612 - 314) / (440 - 28) - $b = $THy - ($m * $THx) - $b2 = 9 - ($m2 * 430) - $DropXa = (($b - $b2) / ($m2 - $m)) - 20 - $DropYa = Round($m2 * $DropXa + $b2) - $DropXb = (($b - $b2) / ($m2 - $m)) + 20 - $DropYb = Round($m2 * $DropXb + $b2) - Local $DropArray[5][2] = [[$DropXa, $DropYa], [0, 0], [0, 0], [0, 0], [$DropXb, $DropYb]] - Case 7 - $DropX = Round(($FurthestBottomRight[4][0] - $FurthestBottomRight[0][0]) / 4) + $FurthestBottomRight[0][0] - $DropY = Round(($FurthestBottomRight[4][1] - $FurthestBottomRight[0][1]) / 4) + $FurthestBottomRight[0][1] - Local $DropArray[5][2] = [[$DropX, $DropY], [0, 0], [0, 0], [0, 0], [$DropX, $DropY]] - Case 8 - $m = (537 - 238) / (535 - 128) - $m2 = (9 - 314) / (430 - 28) - $b = $THy - ($m * $THx) - $b2 = 612 - ($m2 * 440) - $DropXa = (($b - $b2) / ($m2 - $m)) - 20 - $DropYa = Round($m2 * $DropXa + $b2) - $DropXb = (($b - $b2) / ($m2 - $m)) + 20 - $DropYb = Round($m2 * $DropXb + $b2) - Local $DropArray[5][2] = [[$DropXa, $DropYa], [0, 0], [0, 0], [0, 0], [$DropXb, $DropYb]] - Case 9 - $DropX = $FurthestBottomRight[4][0] - $DropY = $FurthestBottomRight[4][1] - Local $DropArray[5][2] = [[$DropX, $DropY], [0, 0], [0, 0], [0, 0], [$DropX, $DropY]] - EndSwitch - Standard_dropCC($DropArray, $CC, $AttackMethod, $AimTH) - If _Sleep(100) Then Return - If Not $mixedMode Then - Standard_dropHeroes($DropArray, $King, $Queen, $AttackMethod, $AimTH) - $hHeroTimer = TimerInit() - EndIf - Else - If $nbSides = 1 Then - Standard_dropCC($BottomRight, $CC, $AttackMethod) - Else - Standard_dropCC($TopLeft, $CC, $AttackMethod) - EndIf - If _Sleep(100) Then Return - If Not $mixedMode Then - If $nbSides = 1 Then - Standard_dropHeroes($BottomRight, $King, $Queen, $AttackMethod) - $hHeroTimer = TimerInit() - Else - Standard_dropHeroes($TopLeft, $King, $Queen, $AttackMethod) - $hHeroTimer = TimerInit() - EndIf - EndIf - EndIf - - If $mixedMode Then - If Standard_LaunchTroop($eValkyrie, 1, 1, 1, 1, ($OuterQuad And $attackTH = 2)) Then - If Wave_Sleep(1) Then Return - EndIf - If Standard_LaunchTroop($eArcher, 1, 2, 2, 0, ($OuterQuad And $attackTH = 2)) Then - If Wave_Sleep(1) Then Return - EndIf - If Standard_LaunchTroop($eGoblin, 1, 2, 2, 0, ($OuterQuad And $attackTH = 2)) Then - If Wave_Sleep(1) Then Return - EndIf - If Standard_LaunchTroop($eMinion, 1, 1, 1, 0, ($OuterQuad And $attackTH = 2)) Then - If Wave_Sleep(1) Then Return - EndIf - If _Sleep(100) Then Return - If ($OuterQuad And $attackTH = 2) Then - Standard_dropHeroes($DropArray, $King, $Queen, $AttackMethod, $AimTH) - $hHeroTimer = TimerInit() - Else - Standard_dropHeroes($BottomRight, $King, $Queen, $AttackMethod) - $hHeroTimer = TimerInit() - EndIf - If Standard_LaunchTroop($eWallbreaker, 1, 3, 3, 1) Then - If _Sleep(Wave_Sleep(1), False) Then Return - EndIf - EndIf - EndIf - - ; Check resources - If Not $EarlyExit Then - $Resources = GetResources(1) - Else - $Resources = GetResources(2) - EndIf - - ; Nuke DE if desired - If ($LastAttackDead = "0") And ($SpellQty >= GUICtrlRead($txtSpellNumber)) And Number($Resources[4]) >= Number(GUICtrlRead($txtDENukeLimit)) And IsChecked($chkNukeAttacking) Then - SetLog(GetLangText("msgNuking"), $COLOR_BLUE) - Standard_DropNukes() - EndIf - - If Wave_Sleep(1) Then Return - - If Not $EarlyExit And $AttackMethod <> 3 Then - SetLog(GetLangText("msgDropLeftover"), $COLOR_BLUE) - $gone = True - $loop = 0 - Local $useCastle = ($AttackMethod = 0) ? (IsChecked($chkDeadUseClanCastle) ? (1) : (0)) : (IsChecked($chkUseClanCastle) ? (1) : (0)) - Local $useKing = ($AttackMethod = 0) ? (IsChecked($chkDeadUseKing) ? (1) : (0)) : (IsChecked($chkUseKing) ? (1) : (0)) - Local $useQueen = ($AttackMethod = 0) ? (IsChecked($chkDeadUseQueen) ? (1) : (0)) : (IsChecked($chkUseQueen) ? (1) : (0)) - Do - $loop += 1 - $gone = True - If $loop = 1 Then - Standard_PrepareAttack(True) ;Check remaining quantities - Else - Standard_PrepareAttack(True, 1, True) - EndIf - For $i = 0 To 8 - If $atkTroops[$i][0] <> -1 Then - If $atkTroops[$i][0] = $eCastle And $useCastle <> 1 Then ContinueLoop - If $atkTroops[$i][0] = $eKing And $useKing <> 1 Then ContinueLoop - If $atkTroops[$i][0] = $eQueen And $useQueen <> 1 Then ContinueLoop - If $atkTroops[$i][1] > 0 Then $gone = False - EndIf - Next - For $i = $eBarbarian To $eMinion ; lauch all remaining troops - If $i = $eBarbarian Or $i = $eArcher Or $i = $eMinion Or $i = $eHog Or $i = $eValkyrie Then - Standard_LaunchTroop($i, (($mixedMode) ? 1 : $nbSides), 0, 1) - Else - If $i <> $eLSpell Then Standard_LaunchTroop($i, $nbSides, 0, 1, 2) - EndIf - Next - If _Sleep(500) Then Return - Until $gone Or $loop > 10 - - ;Activate KQ's power if deployed - Local $QueenUsed = ($AttackMethod = 0) ? (IsChecked($chkDeadUseQueen) ? (True) : (False)) : (IsChecked($chkUseQueen) ? (True) : (False)) - If $QueenUsedSnipe Then $QueenUsed = True - Local $KingUsed = ($AttackMethod = 0) ? (IsChecked($chkDeadUseKing) ? (True) : (False)) : (IsChecked($chkUseKing) ? (True) : (False)) - If $KingUsedSnipe Then $KingUsed = True - If ($KingUsed And $KingWasHere) Or ($QueenUsed And $QueenWasHere) Then - $KingGone = True - $QueenGone = True - If $KingUsed And $KingWasHere Then $KingGone = False - If $QueenUsed And $QueenWasHere Then $QueenGone = False - If $KingPowerCollector Or $KingPowerSnipe Then $KingGone = True - If $QueenPowerCollector Or $QueenPowerSnipe Then $QueenGone = True - Do - If $KingWasHere And TimerDiff($hHeroTimer) > 3000 Then - If GUICtrlRead($txtKingSkill) = 0 Then - _CaptureRegion() - If (checkHealth($King) Or (TimerDiff($hHeroTimer) / 1000) > 60) And Not $KingGone Then - SetLog(GetLangText("msgActivateKing"), $COLOR_AQUA) - SelectDropTroupe($King) - $KingGone = True - EndIf - Else - If ((TimerDiff($hHeroTimer) / 1000) > Number(GUICtrlRead($txtKingSkill))) And Not $KingGone Then - SetLog(GetLangText("msgActivateKing"), $COLOR_BLUE) - SelectDropTroupe($King) - $KingGone = True - EndIf - EndIf - EndIf - If $QueenWasHere And TimerDiff($hHeroTimer) > 3000 Then - If GUICtrlRead($txtQueenSkill) = 0 Then - _CaptureRegion() - If (checkHealth($Queen) Or (TimerDiff($hHeroTimer) / 1000) > 60) And Not $QueenGone Then - SetLog(GetLangText("msgActivateQueen"), $COLOR_AQUA) - SelectDropTroupe($Queen) - $QueenGone = True - EndIf - Else - If ((TimerDiff($hHeroTimer) / 1000) > Number(GUICtrlRead($txtQueenSkill))) And Not $QueenGone Then - SetLog(GetLangText("msgActivateQueen"), $COLOR_BLUE) - SelectDropTroupe($Queen) - $QueenGone = True - EndIf - EndIf - EndIf - If _Sleep(250) Then ExitLoop - Until $KingGone And $QueenGone - EndIf - SetLog(GetLangText("msgFinishedWait"), $COLOR_GREEN) - Else - ; Wait just a few seconds in case we nuked the DE - If _Sleep(3000) Then Return - - ; Use K/Q power if not used yet - If $AttackMethod <> 3 Then - Local $QueenUsed = ($AttackMethod = 0) ? (IsChecked($chkDeadUseQueen) ? (True) : (False)) : (IsChecked($chkUseQueen) ? (True) : (False)) - Local $KingUsed = ($AttackMethod = 0) ? (IsChecked($chkDeadUseKing) ? (True) : (False)) : (IsChecked($chkUseKing) ? (True) : (False)) - Else - Local $QueenUsed = False - If $QueenUsedSnipe Then $QueenUsed = True - Local $KingUsed = False - If $KingUsedSnipe Then $KingUsed = True - EndIf - If ($KingUsed And $KingWasHere) Or ($QueenUsed And $QueenWasHere) Then - $KingGone = False - $QueenGone = False - If $KingPowerCollector Or $KingPowerSnipe Then $KingGone = True - If $QueenPowerCollector Or $QueenPowerSnipe Then $QueenGone = True - If $KingUsed And Not $KingGone Then - SelectDropTroupe($King) - EndIf - If $QueenUsed And Not $QueenGone Then - SelectDropTroupe($Queen) - EndIf - EndIf - - If $EarlyExit Then $FasterExit = True - EndIf - - EndIf - - If $TakeAttackSnapShot = 1 Then - $AttackFile = @YEAR & @MON & @MDAY & @HOUR & @MIN & @SEC & "-TH-" & $THLoc & ((($THquadrant > 0) And ($THquadrant < 10)) ? ("-Q" & $THquadrant) : ("")) & (($AttackMethod = 0) ? ("-Dead-") : ("-Live")) & ".jpg" - _GDIPlus_ImageSaveToFile($hAttackBitmap, $dirAttack & $AttackFile) - If _Sleep(500) Then Return - If $PushBulletEnabled = 1 And $PushBulletattacktype = 1 Then - _PushFile($AttackFile, "Attacks", "image/jpeg", "Last Raid", $AttackFile) - EndIf - EndIf - $BufferAvailable = False - _GDIPlus_ImageDispose($hAttackBitmap) -EndFunc ;==>Standard_Attack - -Func Standard_DropNukes() - $nLSpell = -1 - $nSpellQty = 0 - For $i = 0 To 8 - If $atkTroops[$i][0] = $eLSpell Then - $nLSpell = $i - $nSpellQty = $atkTroops[$i][1] - EndIf - Next - If $nSpellQty > 0 Then - $hDll = DllOpen(@ScriptDir & "\BrokenBot.org\BrokenBot32.dll") - _CaptureRegion() - $res = Null - $res = "" - $DEDrills = "" - $hCheckHBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap) - $res = DllCall($hDll, "str", "BrokenBotMatchBuilding", "ptr", $hCheckHBitmap, "int", 16, "int", 3, "int", 3, "int", 1, "int", (IsChecked($chkSpeedBoost) ? (1) : (0))) - If IsArray($res) Then - If $res[0] = -2 Then - SetLog(GetLangText("msgLicense"), $COLOR_RED) - ElseIf $res[0] <> -1 Then - SelectDropTroupe($nLSpell) - If _Sleep(200) Then Return - $DEDrills = StringSplit($res[0], "|", 2) - $i = 0 - $loops = 0 - While $i < $DEDrills[0] - If ($nSpellQty <= 0) Or ($loops > 20) Then ExitLoop - If ($i * 6 + 2) <= UBound($DEDrills) Then - Click(Round(_Random_Gaussian($DEDrills[$i * 6 + 1], 2)), Round(_Random_Gaussian($DEDrills[$i * 6 + 2], 2))) - OverlayCircle(Round(_Random_Gaussian($DEDrills[$i * 6 + 1], 2)) - 2, Round(_Random_Gaussian($DEDrills[$i * 6 + 2], 2)) - 2, 4, $GlobalColor, 1) - If _Sleep(200) Then Return - $nSpellQty = ReadTroopQuantity($nLSpell) - Else - $i = -1 - EndIf - $i += 1 - $loops += 1 - WEnd - EndIf - EndIf - _WinAPI_DeleteObject($hCheckHBitmap) - DllClose($hDll) - EndIf -EndFunc ;==>Standard_DropNukes - -;Drops Clan Castle troops, given the slot and x, y coordinates. - -Func Standard_dropCC($edge, $slot, $AttackMethod = 1, $CenterLoc = 1) ;Drop clan castle - Local $useCastle = ($AttackMethod = 0) ? (IsChecked($chkDeadUseClanCastle) ? (1) : (0)) : (IsChecked($chkUseClanCastle) ? (1) : (0)) - If $slot <> -1 And $useCastle = 1 Then - SetLog(GetLangText("msgDroppingCC"), $COLOR_BLUE) - Click(68 + (72 * $slot), 595) - If _Sleep(200) Then Return - $x = Round(_Random_Gaussian(((($edge[4][0] - $edge[0][0]) / 2) + $edge[0][0]), (($edge[4][0] - $edge[0][0]) / 8))) - $y = Round((($edge[4][1] - $edge[0][1]) / ($edge[4][0] - $edge[0][0])) * ($x - $edge[0][0])) + $edge[0][1] - Click($x, $y, 1, 0, $CenterLoc) - _GDIPlus_GraphicsDrawEllipse($Buffer, $x - 4, $y - 4, 8, 8, $pCC) - EndIf -EndFunc ;==>Standard_dropCC - -;Will drop heroes in a specific coordinates, only if slot is not -1 -;Only drops when option is clicked. - -Func Standard_dropHeroes($edge, $KingSlot = -1, $QueenSlot = -1, $AttackMethod = 1, $CenterLoc = 1) ;Drops for king and queen - While 1 - - Local $useKing = ($AttackMethod = 0) ? (IsChecked($chkDeadUseKing) ? (1) : (0)) : (IsChecked($chkUseKing) ? (1) : (0)) - Local $useQueen = ($AttackMethod = 0) ? (IsChecked($chkDeadUseQueen) ? (1) : (0)) : (IsChecked($chkUseQueen) ? (1) : (0)) - - If $KingSlot <> -1 And $useKing = 1 Then - SetLog(GetLangText("msgDroppingKing"), $COLOR_BLUE) - Click(68 + (72 * $KingSlot), 595) ;Select King - If _Sleep(200) Then Return - $x = Round(_Random_Gaussian(((($edge[4][0] - $edge[0][0]) / 2) + $edge[0][0]), (($edge[4][0] - $edge[0][0]) / 8))) - $y = Round((($edge[4][1] - $edge[0][1]) / ($edge[4][0] - $edge[0][0])) * ($x - $edge[0][0])) + $edge[0][1] - Click($x, $y, 1, 0, $CenterLoc) - _GDIPlus_GraphicsDrawEllipse($Buffer, $x - 6, $y - 6, 12, 12, $pKing) - $checkKPower = True - EndIf - - If _Sleep(Wave_Sleep(1)) Then ExitLoop - - If $QueenSlot <> -1 And $useQueen = 1 Then - SetLog(GetLangText("msgDroppingQueen"), $COLOR_BLUE) - Click(68 + (72 * $QueenSlot), 595) ;Select Queen - If _Sleep(200) Then Return - $x = Round(_Random_Gaussian(((($edge[4][0] - $edge[0][0]) / 2) + $edge[0][0]), (($edge[4][0] - $edge[0][0]) / 8))) - $y = Round((($edge[4][1] - $edge[0][1]) / ($edge[4][0] - $edge[0][0])) * ($x - $edge[0][0])) + $edge[0][1] - Click($x, $y, 1, 0, $CenterLoc) - _GDIPlus_GraphicsDrawEllipse($Buffer, $x - 5, $y - 5, 10, 10, $pQueen) - $checkQPower = True - EndIf - - ExitLoop - WEnd -EndFunc ;==>Standard_dropHeroes - -Func checkHealth($troop) - If isColorBetween(_GetPixelColor(68 + (72 * $troop), 572), Hex(0x18BD02, 6), Hex(0x4AD505, 6)) Then - Return False - EndIf - Return True -EndFunc ;==>checkHealth - -Func isColorBetween($nColor1, $nColorLow, $nColorHigh) - Local $Red1, $Red2, $Red3, $Blue1, $Blue2, $Blue3, $Green1, $Green2, $Green3 - - $Red1 = Dec(StringMid(String($nColor1), 1, 2)) - $Blue1 = Dec(StringMid(String($nColor1), 3, 2)) - $Green1 = Dec(StringMid(String($nColor1), 5, 2)) - - $Red2 = Dec(StringMid(String($nColorLow), 1, 2)) - $Blue2 = Dec(StringMid(String($nColorLow), 3, 2)) - $Green2 = Dec(StringMid(String($nColorLow), 5, 2)) - - $Red3 = Dec(StringMid(String($nColorHigh), 1, 2)) - $Blue3 = Dec(StringMid(String($nColorHigh), 3, 2)) - $Green3 = Dec(StringMid(String($nColorHigh), 5, 2)) - - If $Red1 < $Red2 Or $Red1 > $Red3 Then Return False - If $Green1 < $Green2 Or $Green1 > $Green3 Then Return False - If $Blue1 < $Blue2 Or $Blue1 > $Blue3 Then Return False - - Return True -EndFunc ;==>isColorBetween - -Func FixDropCurvePos(ByRef $arCurve, $index, $x, $y) - ; If they are outside of bounds of base then move them back in - For $rotate = 0 To 3 - Switch $rotate - Case 0 - If SegmentIntersect($arCurve[$index][0], $arCurve[$index][1], $x, $y, $FurthestTopLeft[0][0], $FurthestTopLeft[0][1], $FurthestTopLeft[4][0], $FurthestTopLeft[4][1]) Then - $BetterSpot = FindIntersection($arCurve[$index][0], $arCurve[$index][1], $x, $y, $FurthestTopLeft[0][0], $FurthestTopLeft[0][1], $FurthestTopLeft[4][0], $FurthestTopLeft[4][1]) - $arCurve[$index][0] = $BetterSpot[0] - $arCurve[$index][1] = $BetterSpot[1] - ExitLoop - EndIf - Case 1 - If SegmentIntersect($arCurve[$index][0], $arCurve[$index][1], $x, $y, $FurthestTopRight[0][0], $FurthestTopRight[0][1], $FurthestTopRight[4][0], $FurthestTopRight[4][1]) Then - $BetterSpot = FindIntersection($arCurve[$index][0], $arCurve[$index][1], $x, $y, $FurthestTopRight[0][0], $FurthestTopRight[0][1], $FurthestTopRight[4][0], $FurthestTopRight[4][1]) - $arCurve[$index][0] = $BetterSpot[0] - $arCurve[$index][1] = $BetterSpot[1] - ExitLoop - EndIf - Case 2 - If SegmentIntersect($arCurve[$index][0], $arCurve[$index][1], $x, $y, $FurthestBottomLeft[0][0], $FurthestBottomLeft[0][1], $FurthestBottomLeft[4][0], $FurthestBottomLeft[4][1]) Then - $BetterSpot = FindIntersection($arCurve[$index][0], $arCurve[$index][1], $x, $y, $FurthestBottomLeft[0][0], $FurthestBottomLeft[0][1], $FurthestBottomLeft[4][0], $FurthestBottomLeft[4][1]) - $arCurve[$index][0] = $BetterSpot[0] - $arCurve[$index][1] = $BetterSpot[1] - ExitLoop - EndIf - Case 3 - If SegmentIntersect($arCurve[$index][0], $arCurve[$index][1], $x, $y, $FurthestBottomRight[0][0], $FurthestBottomRight[0][1], $FurthestBottomRight[4][0], $FurthestBottomRight[4][1]) Then - $BetterSpot = FindIntersection($arCurve[$index][0], $arCurve[$index][1], $x, $y, $FurthestBottomRight[0][0], $FurthestBottomRight[0][1], $FurthestBottomRight[4][0], $FurthestBottomRight[4][1]) - $arCurve[$index][0] = $BetterSpot[0] - $arCurve[$index][1] = $BetterSpot[1] - ExitLoop - EndIf - EndSwitch - Next - ; Move points that are too low up - If $arCurve[$index][1] > 538 Then - $arCurve[$index][1] = 538 - If $arCurve[$index][0] <= 402 Then - $GetPoint = GetPointDist(342, 538, 402, 538) - $NewPoint = $GetPoint[1] - $NewPoint -= 5 - If $NewPoint < 342 Then $NewPoint = 342 - If $NewPoint < $arCurve[$index][0] Then $arCurve[$index][0] = $NewPoint - Else - $GetPoint = GetPointDist(518, 538, 402, 538) - $NewPoint = $GetPoint[1] - $NewPoint += 5 - If $NewPoint > 518 Then $NewPoint = 518 - If $NewPoint > $arCurve[$index][0] Then $arCurve[$index][0] = $NewPoint - EndIf - EndIf -EndFunc ;==>FixDropCurvePos +; Improved attack algorithm, using Barbarians, Archers, Goblins, Giants and Wallbreakers as they are available +; Create by Fast French, edited by safar46 +Global $EdgeOrder[4] + +Func Wave_Sleep($type) + Switch $type + Case 0 + $delay = (_GUICtrlComboBox_GetCurSel($cmbUnitDelay) + 1) * 20 + Case 1 + $delay = (_GUICtrlComboBox_GetCurSel($cmbWaveDelay) + 1) * 200 + EndSwitch + $delay = _Random_Gaussian($delay, $delay / 6) + If $delay < 1 Then $delay = 1 + While TimerDiff($hWaveTimer) < $delay + If _Sleep(1, False) Then Return True + WEnd + $hWaveTimer = TimerInit() + Return False +EndFunc ;==>Wave_Sleep + +; Old mecanism, not used anymore +Func Standard_OldDropTroop($troup, $position, $nbperspot) + SelectDropTroupe($troup) ;Select Troop + If _Sleep(100) Then Return + For $i = 0 To 4 + Click($position[$i][0], $position[$i][1], $nbperspot, 0, 1) + If _Sleep(50) Then Return + Next +EndFunc ;==>Standard_OldDropTroop + +; improved function, that avoids to only drop on 5 discret drop points : +Func Standard_DropOnEdge($troop, $edge, $number, $slotsPerEdge = 0, $edge2 = -1, $x = -1, $Center = 1) + $BufferDist = _Random_Gaussian(20, 6) + If $BufferDist < 2 Then $BufferDist = 2 + + If $number = 0 Then Return + SelectDropTroupe($troop) ;Select Troop + If _Sleep(100) Then Return + If $slotsPerEdge = 0 Or $number < $slotsPerEdge Then $slotsPerEdge = $number + If $number = 1 Or $slotsPerEdge = 1 Then ; Drop on a random point per edge => centered on the middle + $Clickx = Round(_Random_Gaussian(((($edge[4][0] - $edge[0][0]) / 2) + $edge[0][0]), (($edge[4][0] - $edge[0][0]) / 7))) + $Clicky = Round((($edge[4][1] - $edge[0][1]) / ($edge[4][0] - $edge[0][0])) * ($Clickx - $edge[0][0])) + $edge[0][1] + Click($Clickx, $Clicky, $number, 0, $Center, $BufferDist) + If $edge2 <> -1 Then + If Wave_Sleep(1) Then Return + $Clickx = Round(_Random_Gaussian(((($edge2[4][0] - $edge2[0][0]) / 2) + $edge2[0][0]), (($edge2[4][0] - $edge2[0][0]) / 7))) + $Clicky = Round((($edge2[4][1] - $edge2[0][1]) / ($edge2[4][0] - $edge2[0][0])) * ($Clickx - $edge2[0][0])) + $edge2[0][1] + Click($Clickx, $Clicky, $number, 0, $Center, $BufferDist) + EndIf + ElseIf $slotsPerEdge = 2 Then ; Drop on 2 randomly spaced points per edge + Local $half = Ceiling($number / 2) + $Clickx = Round(_Random_Gaussian(((($edge[4][0] - $edge[0][0]) / 3) + $edge[0][0]), (($edge[4][0] - $edge[0][0]) / 10))) + $Clicky = Round((($edge[4][1] - $edge[0][1]) / ($edge[4][0] - $edge[0][0])) * ($Clickx - $edge[0][0])) + $edge[0][1] + Click($Clickx, $Clicky, $half, 0, $Center, $BufferDist) + $Clickx = Round(_Random_Gaussian(((($edge[4][0] - $edge[0][0]) * 2 / 3) + $edge[0][0]), (($edge[4][0] - $edge[0][0]) / 10))) + $Clicky = Round((($edge[4][1] - $edge[0][1]) / ($edge[4][0] - $edge[0][0])) * ($Clickx - $edge[0][0])) + $edge[0][1] + Click($Clickx, $Clicky, $number - $half, 0, $Center, $BufferDist) + If $edge2 <> -1 Then + If Wave_Sleep(1) Then Return + $Clickx = Round(_Random_Gaussian(((($edge2[4][0] - $edge2[0][0]) / 3) + $edge2[0][0]), (($edge2[4][0] - $edge2[0][0]) / 10))) + $Clicky = Round((($edge2[4][1] - $edge2[0][1]) / ($edge2[4][0] - $edge2[0][0])) * ($Clickx - $edge2[0][0])) + $edge2[0][1] + Click($Clickx, $Clicky, $half, 0, $Center, $BufferDist) + $Clickx = Round(_Random_Gaussian(((($edge2[4][0] - $edge2[0][0]) * 2 / 3) + $edge2[0][0]), (($edge2[4][0] - $edge2[0][0]) / 10))) + $Clicky = Round((($edge2[4][1] - $edge2[0][1]) / ($edge2[4][0] - $edge2[0][0])) * ($Clickx - $edge2[0][0])) + $edge2[0][1] + Click($Clickx, $Clicky, $number - $half, 0, $Center, $BufferDist) + EndIf + Else + If ($slotsPerEdge = $number) And ($slotsPerEdge > 10) Then + $slotsPerEdge = Int($number / Random(1.8, 2.8)) + If $slotsPerEdge < 9 Then $slotsPerEdge = Random(9, 11, 1) + EndIf + Local $minX = $edge[0][0] + Local $maxX = $edge[4][0] + Local $minY = $edge[0][1] + Local $maxY = $edge[4][1] + If $edge2 <> -1 Then + Local $minX2 = $edge2[0][0] + Local $maxX2 = $edge2[4][0] + Local $minY2 = $edge2[0][1] + Local $maxY2 = $edge2[4][1] + EndIf + Local $nbTroopsGoneDec = 0 + Local $nbTroopsGoneRound = 0 + Local $nbTroopPerRound = $number / $slotsPerEdge + For $i = 0 To $slotsPerEdge - 1 + $nbTroopsGoneDec += $nbTroopPerRound + Local $posX = $minX + (($maxX - $minX) * $i) / ($slotsPerEdge - 1) + Local $posY = $minY + (($maxY - $minY) * $i) / ($slotsPerEdge - 1) + ; Randomize the drop points a bit more + $posX = Round(_Random_Gaussian($posX, 3)) + $posY = Round(_Random_Gaussian($posY, 3)) + Click($posX, $posY, Ceiling($nbTroopsGoneDec - $nbTroopsGoneRound), 0, $Center, $BufferDist) + $nbTroopsGoneRound += Ceiling($nbTroopsGoneDec - $nbTroopsGoneRound) + Next + If $edge2 <> -1 Then + If Wave_Sleep(1) Then Return + Local $nbTroopsGoneDec = 0 + Local $nbTroopsGoneRound = 0 + Local $nbTroopPerRound = $number / $slotsPerEdge + For $i = 0 To $slotsPerEdge - 1 + $nbTroopsGoneDec += $nbTroopPerRound + Local $posX2 = $maxX2 - (($maxX2 - $minX2) * $i) / ($slotsPerEdge - 1) + Local $posY2 = $maxY2 - (($maxY2 - $minY2) * $i) / ($slotsPerEdge - 1) + ; Randomize the drop points a bit more + $posX2 = Round(_Random_Gaussian($posX2, 3)) + $posY2 = Round(_Random_Gaussian($posY2, 3)) + Click($posX2, $posY2, Ceiling($nbTroopsGoneDec - $nbTroopsGoneRound), 0, $Center, $BufferDist) + $nbTroopsGoneRound += Ceiling($nbTroopsGoneDec - $nbTroopsGoneRound) + Next + EndIf + EndIf +EndFunc ;==>Standard_DropOnEdge + +Func Standard_DropOnEdges($troop, $nbSides, $number, $slotsPerEdge = 0, $miniEdge = False) + If $nbSides = 0 Or $number = 1 Then + Standard_OldDropTroop($troop, $Edges[0], $number); + Return + EndIf + If $nbSides < -1 Then Return + Local $nbTroopsLeft = $number + If Not $miniEdge Then + Local $nbTroopsPerEdge = Floor($number / $nbSides) + Switch $nbSides + Case 1 + Standard_DropOnEdge($troop, $Edges[$EdgeOrder[0]], $number, $slotsPerEdge) + Case 2 + Standard_DropOnEdge($troop, $Edges[$EdgeOrder[0]], Floor($number/2), $slotsPerEdge, $Edges[$EdgeOrder[1]]) + Case 3 + Standard_DropOnEdge($troop, $Edges[$EdgeOrder[0]], Floor($number/3), $slotsPerEdge, $Edges[$EdgeOrder[1]]) + Standard_DropOnEdge($troop, $Edges[$EdgeOrder[2]], $number - (2*Floor($number/3)), $slotsPerEdge) + Case 4 + Standard_DropOnEdge($troop, $Edges[$EdgeOrder[0]], Floor($number/4), $slotsPerEdge, $Edges[$EdgeOrder[1]]) + Standard_DropOnEdge($troop, $Edges[$EdgeOrder[2]], Floor(($number - (2*Floor($number/4)))/2), $slotsPerEdge, $Edges[$EdgeOrder[3]]) + EndSwitch + Else + Switch $THquadrant + Case 1 + Local $edgeA[5][2] = [[$FurthestTopLeft[0][0], $FurthestTopLeft[0][1]], [0, 0], [0, 0], [0, 0], [Round(($FurthestTopLeft[4][0] - $FurthestTopLeft[0][0]) / _Random_Gaussian(4.5, .25)) + $FurthestTopLeft[0][0], Round(($FurthestTopLeft[4][1] - $FurthestTopLeft[0][1]) / _Random_Gaussian(4.5, .25)) + $FurthestTopLeft[0][1]]] + Local $edgeB[5][2] = [[$FurthestBottomLeft[0][0], $FurthestBottomLeft[0][1]], [0, 0], [0, 0], [0, 0], [Round(($FurthestBottomLeft[4][0] - $FurthestBottomLeft[0][0]) / _Random_Gaussian(4.5, .25)) + $FurthestBottomLeft[0][0], Round(($FurthestBottomLeft[4][1] - $FurthestBottomLeft[0][1]) / _Random_Gaussian(4.5, .25)) + $FurthestBottomLeft[0][1]]] + $nbSides = 2 + Case 2 + $m = (537 - 238) / (535 - 128) + $m2 = (9 - 314) / (430 - 28) + $b = $THy - ($m * $THx) + $b2 = 314 - ($m2 * 28) + $CenterX = ($b - $b2) / ($m2 - $m) + $LeftX = Round(_Random_Gaussian($CenterX - 20, 3)) + $RightX = Round(_Random_Gaussian($CenterX + 20, 3)) + If $LeftX < $FurthestTopLeft[0][0] Then $LeftX = $FurthestTopLeft[0][0] + If $RightX > $FurthestTopLeft[4][0] Then $RightX = $FurthestTopLeft[4][0] + $LeftY = Round($m2 * $LeftX + $b2) + $RightY = Round($m2 * $RightX + $b2) + Local $edgeA[5][2] = [[$LeftX, $LeftY], [0, 0], [0, 0], [0, 0], [$RightX, $RightY]] + Local $edgeB = -1 + $nbSides = 1 + Case 3 + Local $edgeA[5][2] = [[$FurthestTopLeft[4][0], $FurthestTopLeft[4][1]], [0, 0], [0, 0], [0, 0], [$FurthestTopLeft[4][0] - Round(($FurthestTopLeft[4][0] - $FurthestTopLeft[0][0]) / _Random_Gaussian(4.5, .25)), $FurthestTopLeft[4][1] - Round(($FurthestTopLeft[4][1] - $FurthestTopLeft[0][1]) / _Random_Gaussian(4.5, .25))]] + Local $edgeB[5][2] = [[$FurthestTopRight[0][0], $FurthestTopRight[0][1]], [0, 0], [0, 0], [0, 0], [Round(($FurthestTopRight[4][0] - $FurthestTopRight[0][0]) / _Random_Gaussian(4.5, .25)) + $FurthestTopRight[0][0], Round(($FurthestTopRight[4][1] - $FurthestTopRight[0][1]) / _Random_Gaussian(4.5, .25)) + $FurthestTopRight[0][1]]] + $nbSides = 2 + Case 4 + $m = (85 - 388) / (527 - 130) + $m2 = (612 - 314) / (440 - 28) + $b = $THy - ($m * $THx) + $b2 = 314 - ($m2 * 28) + $CenterX = ($b - $b2) / ($m2 - $m) + $LeftX = Round(_Random_Gaussian($CenterX - 20, 3)) + $RightX = Round(_Random_Gaussian($CenterX + 20, 3)) + If $LeftX < $FurthestBottomLeft[0][0] Then $LeftX = $FurthestBottomLeft[0][0] + If $RightX > (.75 * ($FurthestBottomLeft[4][0] - $FurthestBottomLeft[0][0])) + $FurthestBottomLeft[0][0] Then $RightX = Round((.75 * ($FurthestBottomLeft[4][0] - $FurthestBottomLeft[0][0])) + $FurthestBottomLeft[0][0]) + $LeftY = Round($m2 * $LeftX + $b2) + $RightY = Round($m2 * $RightX + $b2) + Local $edgeA[5][2] = [[$LeftX, $LeftY], [0, 0], [0, 0], [0, 0], [$RightX, $RightY]] + Local $edgeB = -1 + $nbSides = 1 + Case 6 + $m = (85 - 388) / (527 - 130) + $m2 = (313 - 9) / (820 - 430) + $b = $THy - ($m * $THx) + $b2 = 9 - ($m2 * 430) + $CenterX = ($b - $b2) / ($m2 - $m) + $LeftX = Round(_Random_Gaussian($CenterX - 20, 3)) + $RightX = Round(_Random_Gaussian($CenterX + 20, 3)) + If $LeftX < $FurthestTopRight[0][0] Then $LeftX = $FurthestTopRight[0][0] + If $RightX > $FurthestTopRight[4][0] Then $RightX = $FurthestTopRight[4][0] + $LeftY = Round($m2 * $LeftX + $b2) + $RightY = Round($m2 * $RightX + $b2) + Local $edgeA[5][2] = [[$LeftX, $LeftY], [0, 0], [0, 0], [0, 0], [$RightX, $RightY]] + Local $edgeB = -1 + $nbSides = 1 + Case 7 + Local $edgeA[5][2] = [[Round(($FurthestBottomRight[4][0] - $FurthestBottomRight[0][0]) / 3.5) + $FurthestBottomRight[0][0], Round(($FurthestBottomRight[4][1] - $FurthestBottomRight[0][1]) / 3.5) + $FurthestBottomRight[0][1]], [0, 0], [0, 0], [0, 0], [Round(($FurthestBottomRight[4][0] - $FurthestBottomRight[0][0]) / 4) + $FurthestBottomRight[0][0], Round(($FurthestBottomRight[4][1] - $FurthestBottomRight[0][1]) / 4) + $FurthestBottomRight[0][1]]] + Local $edgeB[5][2] = [[$FurthestBottomLeft[4][0] - Round(($FurthestBottomLeft[4][0] - $FurthestBottomLeft[0][0]) / 3.5), $FurthestBottomLeft[4][1] - Round(($FurthestBottomLeft[4][1] - $FurthestBottomLeft[0][1]) / 3.5)], [0, 0], [0, 0], [0, 0], [$FurthestBottomLeft[4][0] - Round(($FurthestBottomLeft[4][0] - $FurthestBottomLeft[0][0]) / 4), $FurthestBottomLeft[4][1] - Round(($FurthestBottomLeft[4][1] - $FurthestBottomLeft[0][1]) / 4)]] + $nbSides = 2 + Case 8 + $m = (537 - 238) / (535 - 128) + $m2 = (9 - 314) / (430 - 28) + If $m = $m2 Then $m2 = $m2 + 0.00000001 + $b = $THy - ($m * $THx) + $b2 = 612 - ($m2 * 440) + $CenterX = ($b - $b2) / ($m2 - $m) + $LeftX = Round(_Random_Gaussian($CenterX - 20, 3)) + $RightX = Round(_Random_Gaussian($CenterX + 20, 3)) + If $LeftX < ((.25 * ($FurthestBottomRight[4][0] - $FurthestBottomRight[0][0])) + $FurthestBottomRight[0][0]) Then $LeftX = Round(((.25 * ($FurthestBottomRight[4][0] - $FurthestBottomRight[0][0])) + $FurthestBottomRight[0][0])) + If $RightX > $FurthestBottomRight[4][0] Then $RightX = $FurthestBottomRight[4][0] + $LeftY = Round($m2 * $LeftX + $b2) + $RightY = Round($m2 * $RightX + $b2) + Local $edgeA[5][2] = [[$LeftX, $LeftY], [0, 0], [0, 0], [0, 0], [$RightX, $RightY]] + Local $edgeB = -1 + $nbSides = 1 + Case 9 + Local $edgeA[5][2] = [[$FurthestTopRight[4][0], $FurthestTopRight[4][1]], [0, 0], [0, 0], [0, 0], [$FurthestTopRight[4][0] - Round(($FurthestTopRight[4][0] - $FurthestTopRight[0][0]) / _Random_Gaussian(4.5, .25)), $FurthestTopRight[4][1] - Round(($FurthestTopRight[4][1] - $FurthestTopRight[0][1]) / _Random_Gaussian(4.5, .25))]] + Local $edgeB[5][2] = [[$FurthestBottomRight[4][0], $FurthestBottomRight[4][1]], [0, 0], [0, 0], [0, 0], [$FurthestBottomRight[4][0] - Round(($FurthestBottomRight[4][0] - $FurthestBottomRight[0][0]) / _Random_Gaussian(4.5, .25)), $FurthestBottomRight[4][1] - Round(($FurthestBottomRight[4][1] - $FurthestBottomRight[0][1]) / _Random_Gaussian(4.5, .25))]] + $nbSides = 2 + Case Else + Return + EndSwitch + $edgeA[2][0] = Round(($edgeA[0][0] + $edgeA[4][0]) / 2) + $edgeA[2][1] = Round(($edgeA[0][1] + $edgeA[4][1]) / 2) + $edgeA[1][0] = Round(($edgeA[0][0] + $edgeA[2][0]) / 2) + $edgeA[1][1] = Round(($edgeA[0][1] + $edgeA[2][1]) / 2) + $edgeA[3][0] = Round(($edgeA[2][0] + $edgeA[4][0]) / 2) + $edgeA[3][1] = Round(($edgeA[2][1] + $edgeA[4][1]) / 2) + If $edgeB <> -1 Then + $edgeB[2][0] = Round(($edgeB[0][0] + $edgeB[4][0]) / 2) + $edgeB[2][1] = Round(($edgeB[0][1] + $edgeB[4][1]) / 2) + $edgeB[1][0] = Round(($edgeB[0][0] + $edgeB[2][0]) / 2) + $edgeB[1][1] = Round(($edgeB[0][1] + $edgeB[2][1]) / 2) + $edgeB[3][0] = Round(($edgeB[2][0] + $edgeB[4][0]) / 2) + $edgeB[3][1] = Round(($edgeB[2][1] + $edgeB[4][1]) / 2) + EndIf + If $nbSides = 1 Then + Standard_DropOnEdge($troop, $edgeA, $nbTroopsLeft, $slotsPerEdge, -1, -1, $AimTH) + $nbTroopsLeft = 0 + Else + $nbTroopsPerEdge = Round($nbTroopsLeft / 2) + Standard_DropOnEdge($troop, $edgeA, $nbTroopsPerEdge, $slotsPerEdge, $edgeB, -1, $AimTH) + EndIf + EndIf +EndFunc ;==>Standard_DropOnEdges + +Func Standard_LaunchTroop($troopKind, $nbSides, $waveNb, $maxWaveNb, $slotsPerEdge = 0, $miniEdge = False) + Local $troop = -1 + Local $troopNb = 0 + Local $name = "" + For $i = 0 To 8 ; identify the position of this kind of troop + If $atkTroops[$i][0] = $troopKind Then + $troop = $i + $troopNb = Ceiling($atkTroops[$i][1] / $maxWaveNb) + Local $plural = 0 + If $troopNb > 1 Then $plural = 1 + $name = NameOfTroop($troopKind, $plural) + EndIf + Next + + If ($troop = -1) Or ($troopNb = 0) Then + Return False; nothing to do => skip this wave + EndIf + + Local $waveName = "first" + If $waveNb = 2 Then $waveName = "second" + If $waveNb = 3 Then $waveName = "third" + If $maxWaveNb = 1 Then $waveName = "only" + If $waveNb = 0 Then $waveName = "last" + SetLog(GetLangText("msgDropping") & $waveName & GetLangText("msgWaveOf") & $troopNb & " " & $name, $COLOR_BLUE) + Standard_DropOnEdges($troop, $nbSides, $troopNb, $slotsPerEdge, $miniEdge) + Return True +EndFunc ;==>Standard_LaunchTroop + +Func Standard_Attack($AttackMethod = 1) + + _CaptureRegion() + $hAttackBitmap = _GDIPlus_BitmapCloneArea($hBitmap, 0, 0, 860, 720, _GDIPlus_ImageGetPixelFormat($hBitmap)) + $Buffer = _GDIPlus_ImageGetGraphicsContext($hAttackBitmap) + If $DebugMode = 1 And $Hide = False Then ActivateOverlay() + $BufferAvailable = True + + SeekEdges() + + $FasterExit = False + + If $AttackMethod = 2 Then + ; Nuke the DE + SetLog(GetLangText("msgNuking"), $COLOR_BLUE) + Standard_DropNukes() + If _Sleep(4000) Then Return + $FasterExit = True + Else + $King = -1 + $Queen = -1 + $CC = -1 + $Barb = -1 + $Arch = -1 + $Giant = -1 + $WB = -1 + $Gob = -1 + $Hog = -1 + $Minion = -1 + $Valk = -1 + $LSpell = -1 + $SpellQty = 0 + $KingWasHere = False + $QueenWasHere = False + For $i = 0 To 8 + If $atkTroops[$i][0] = $eBarbarian Then + $Barb = $i + ElseIf $atkTroops[$i][0] = $eArcher Then + $Arch = $i + ElseIf $atkTroops[$i][0] = $eGiant Then + $Giant = $i + ElseIf $atkTroops[$i][0] = $eWallbreaker Then + $WB = $i + ElseIf $atkTroops[$i][0] = $eGoblin Then + $Gob = $i + ElseIf $atkTroops[$i][0] = $eHog Then + $Hog = $i + ElseIf $atkTroops[$i][0] = $eMinion Then + $Minion = $i + ElseIf $atkTroops[$i][0] = $eValkyrie Then + $Valk = $i + ElseIf $atkTroops[$i][0] = $eCastle Then + $CC = $i + ElseIf $atkTroops[$i][0] = $eKing Then + $King = $i + $KingWasHere = True + ElseIf $atkTroops[$i][0] = $eQueen Then + $Queen = $i + $QueenWasHere = True + ElseIf $atkTroops[$i][0] = $eLSpell Then + $LSpell = $i + $SpellQty = $atkTroops[$i][1] + EndIf + Next + $KingPowerCollector = False + $QueenPowerCollector = False + $KingUsedSnipe = False + $QueenUsedSnipe = False + $KingPowerSnipe = False + $QueenPowerSnipe = False + Local $CollectorDeployOrder[11] = [$Giant, $Hog, $Valk, $WB, $Barb, $Arch, $Gob, $Minion, $King, $Queen, $CC] + Local $SnipeWaveMax = 6 + Local $SnipeWaveSizes[5] = [5, 5, 15, 15, 15] + Local $SnipeWaves[6][11] = [[-1, -1, -1, -1, $Barb, $Arch, -1, -1, -1, -1, -1], _ + [-1, -1, -1, -1, $Barb, $Arch, -1, -1, -1, -1, -1], _ + [$Giant, -1, -1, $WB, $Barb, $Arch, -1, -1, -1, -1, -1], _ + [$Giant, $Hog, -1, $WB, $Barb, $Arch, -1, $Minion, -1, -1, -1], _ + [$Giant, $Hog, $Valk, $WB, $Barb, $Arch, -1, $Minion, -1, -1, -1], _ + [$Giant, $Hog, $Valk, $WB, $Barb, $Arch, $Gob, $Minion, $King, $Queen, $CC]] + Local $SnipeDeployOrder[11] = [$Giant, $Hog, $Valk, $WB, $Barb, $Arch, $Gob, $Minion, $King, $Queen, $CC] + + Local $nbSides = 0 + Local $mixedMode = False + Local $collectorMode = False + Local $EarlyExit = False + + $attackTH = ($AttackMethod = 0) ? _GUICtrlComboBox_GetCurSel($cmbDeadAttackTH) : _GUICtrlComboBox_GetCurSel($cmbAttackTH) + Local $OuterQuad + $OuterQuad = False + If $THquadrant >= 1 And $THquadrant <= 4 Then $OuterQuad = True + If $THquadrant >= 6 And $THquadrant <= 9 Then $OuterQuad = True + If $AttackMethod = 3 Then + SetLog(GetLangText("msgSnipeMode")) + ElseIf ($OuterQuad And $attackTH = 2) Then + SetLog(GetLangText("msgAttackingTH")) + $nbSides = -1 + Else + If $AttackMethod = 0 Then + Switch _GUICtrlComboBox_GetCurSel($cmbDeadDeploy) + Case 0 ;Single sides ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + SetLog(GetLangText("msgSingleSide")) + $nbSides = 1 + Case 1 ;Two sides ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + SetLog(GetLangText("msgTwoSides")) + $nbSides = 2 + Case 2 ;Three sides ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + SetLog(GetLangText("msgThreeSides")) + $nbSides = 3 + Case 3 ;Four sides ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + SetLog(GetLangText("msgAllSides")) + $nbSides = 4 + Case 4 + SetLog(GetLangText("msgMixedMode")) + $nbSides = 4 + $mixedMode = True + Case 5 + SetLog(GetLangText("msgCollectorMode")) + $collectorMode = True + Case 6 + SetLog(GetLangText("msgCollectorMode")) + SetLog(GetLangText("msgCollectorSave")) + $collectorMode = True + $EarlyExit = True + EndSwitch + Else + Switch _GUICtrlComboBox_GetCurSel($cmbDeploy) + Case 0 ;Single sides ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + SetLog(GetLangText("msgSingleSide")) + $nbSides = 1 + Case 1 ;Two sides ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + SetLog(GetLangText("msgTwoSides")) + $nbSides = 2 + Case 2 ;Three sides ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + SetLog(GetLangText("msgThreeSides")) + $nbSides = 3 + Case 3 ;Four sides ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + SetLog(GetLangText("msgAllSides")) + $nbSides = 4 + Case 4 + SetLog(GetLangText("msgMixedMode")) + $nbSides = 4 + $mixedMode = True + Case 5 + SetLog(GetLangText("msgCollectorMode")) + $collectorMode = True + Case 6 + SetLog(GetLangText("msgCollectorMode")) + SetLog(GetLangText("msgCollectorSave")) + $collectorMode = True + $EarlyExit = True + EndSwitch + EndIf + If ($OuterQuad And $attackTH = 1 And Not $collectorMode) Then SetLog(GetLangText("msgLimitedTH")) + EndIf + + If $AttackMethod = 3 Then + ; Snipe mode + ; Make our curve + Local $DropCurve[240][2] + $AngleTrue = PolarCoord($THx, $THy, $BaseCenter[0], $BaseCenter[1]) +;~ $AngleA = PolarCoord($THx - 16, $THy + 16, $BaseCenter[0], $BaseCenter[1]) +;~ $AngleB = PolarCoord($THx + 16, $THy - 16, $BaseCenter[0], $BaseCenter[1]) +;~ $AngleC = PolarCoord($THx + 16, $THy + 16, $BaseCenter[0], $BaseCenter[1]) +;~ $AngleD = PolarCoord($THx - 16, $THy - 16, $BaseCenter[0], $BaseCenter[1]) +;~ $DiffAB = SmallerAngleBetween($AngleA[1], $AngleB[1]) +;~ $DiffAC = SmallerAngleBetween($AngleA[1], $AngleC[1]) +;~ $DiffAD = SmallerAngleBetween($AngleA[1], $AngleD[1]) +;~ $DiffBC = SmallerAngleBetween($AngleB[1], $AngleC[1]) +;~ $DiffBD = SmallerAngleBetween($AngleB[1], $AngleD[1]) +;~ $DiffCD = SmallerAngleBetween($AngleC[1], $AngleD[1]) +;~ $BiggestAngle = 0 +;~ If $DiffAB > $BiggestAngle Then $BiggestAngle = $DiffAB +;~ If $DiffAC > $BiggestAngle Then $BiggestAngle = $DiffAC +;~ If $DiffAD > $BiggestAngle Then $BiggestAngle = $DiffAD +;~ If $DiffBC > $BiggestAngle Then $BiggestAngle = $DiffBC +;~ If $DiffBD > $BiggestAngle Then $BiggestAngle = $DiffBD +;~ If $DiffCD > $BiggestAngle Then $BiggestAngle = $DiffCD +;~ $curveLimits = $BiggestAngle + $curveLimits = _Random_Gaussian(0.5236, 0.12) + $direction = ((Random(0, 1, 1) - .5) * 2) + $steppingangle = $AngleTrue[1] - (($curveLimits / 2) * $direction) + ; Make the curve of points + For $step = 0 To 239 + $DeltaPos = CartCoord(860, $steppingangle) + $DropCurve[$step][0] = $THx + $DeltaPos[0] + $DropCurve[$step][1] = $THy + $DeltaPos[1] + $steppingangle = $steppingangle + (($curveLimits / 240) * $direction) + Next + For $step = 0 To 239 + FixDropCurvePos($DropCurve, $step, $THx, $THy) + Next + For $step = 0 To 238 + OverlayLine($DropCurve[$step][0], $DropCurve[$step][1], $DropCurve[$step + 1][0], $DropCurve[$step + 1][1], 0xFF0000FF, 2) + Next + OverlayLine($DropCurve[0][0], $DropCurve[0][1], $THx, $THy, 0xFF0000FF, 2) + OverlayLine($DropCurve[239][0], $DropCurve[239][1], $THx, $THy, 0xFF0000FF, 2) + + ; Assign waves of troops + Local $TroopBins[$SnipeWaveMax][9] + For $Waves = 0 To $SnipeWaveMax - 1 + For $troop = 0 To 8 + $TroopBins[$Waves][$troop] = 0 + Next + If $Waves < ($SnipeWaveMax - 1) Then + $TroopsAdded = 0 + $TroopsLeft = True + $protection = 0 + While ($TroopsAdded < $SnipeWaveSizes[$Waves]) And $TroopsLeft And $protection < 10000 + For $WaveTroop = 0 to 10 + If $SnipeWaves[$Waves][$WaveTroop] > -1 Then + If $atkTroops[$SnipeWaves[$Waves][$WaveTroop]][1] > 0 Then + $TroopBins[$Waves][$SnipeWaves[$Waves][$WaveTroop]] += 1 + $atkTroops[$SnipeWaves[$Waves][$WaveTroop]][1] -= 1 + $TroopsAdded += 1 + If $TroopsAdded = $SnipeWaveSizes[$Waves] Then ExitLoop + EndIf + EndIf + Next + For $NumCheck = 0 to 8 + If $atkTroops[$NumCheck][1] = 1 Then $TroopsLeft = True + Next + $protection += 1 + WEnd + Else + For $WaveTroop = 0 to 10 + If $SnipeWaves[$Waves][$WaveTroop] > -1 Then + If $atkTroops[$SnipeWaves[$Waves][$WaveTroop]][1] > 0 Then + $TroopBins[$Waves][$SnipeWaves[$Waves][$WaveTroop]] += $atkTroops[$SnipeWaves[$Waves][$WaveTroop]][1] + $atkTroops[$SnipeWaves[$Waves][$WaveTroop]][1] = 0 + EndIf + EndIf + Next + EndIf + Next + + $KingUsedSnipe = False + $QueenUsedSnipe = False + $AllDone = False + $Wave = 0 + $protection = 0 + While Not $AllDone And $protection < 200 + $protection += 1 + ; Deploy next wave of troops + $protect2 = 0 + Do + $protect2 += 1 + $AllGone = True + For $SnipeTroop In $SnipeDeployOrder + If $SnipeTroop > -1 Then + If $TroopBins[$Wave][$SnipeTroop] > 0 Then + Switch $SnipeTroop + Case $King + $hHeroTimer = TimerInit() + $KingUsedSnipe = True + Case $Queen + $hHeroTimer = TimerInit() + $QueenUsedSnipe = True + EndSwitch + + If Wave_Sleep(1) Then Return + SelectDropTroupe($SnipeTroop) + + _CaptureRegion() + If _ColorCheck(_GetPixelColor(714, 538), Hex(0xC0C8C0, 6), 30) Then ExitLoop(3) + + ; Random wave distance + $BufferDist = _Random_Gaussian(20, 6) + If $BufferDist < 2 Then $BufferDist = 2 + + If $TroopBins[$Wave][$SnipeTroop] = 1 Then + ; Only a single unit, drop in middle + $Clickx = Round(_Random_Gaussian($DropCurve[119][0], 3)) + $Clicky = Round(_Random_Gaussian($DropCurve[119][1], 3)) + RedLineDeploy($Clickx, $Clicky, 1, 0, $AimPoint, $BufferDist, $THx, $THy) + $TroopBins[$Wave][$SnipeTroop] -= 1 + ElseIf $TroopBins[$Wave][$SnipeTroop] = 2 Then + ; Drop 2 units + $Clickx = Round(_Random_Gaussian($DropCurve[89][0], 3)) + $Clicky = Round(_Random_Gaussian($DropCurve[89][1], 3)) + RedLineDeploy($Clickx, $Clicky, 1, 0, $AimPoint, $BufferDist, $THx, $THy) + $Clickx = Round(_Random_Gaussian($DropCurve[149][0], 3)) + $Clicky = Round(_Random_Gaussian($DropCurve[149][1], 3)) + RedLineDeploy($Clickx, $Clicky, 1, 0, $AimPoint, $BufferDist, $THx, $THy) + $TroopBins[$Wave][$SnipeTroop] -= 2 + Else + ; Many troops so spread out, deploy in waves + $WaveMax = 5 + $WaveSize = $TroopBins[$Wave][$SnipeTroop] + If $WaveSize > $WaveMax Then $WaveSize = $WaveMax + For $TroopCount = 1 To $WaveSize + _CaptureRegion() + If _ColorCheck(_GetPixelColor(714, 538), Hex(0xC0C8C0, 6), 30) Then ExitLoop(4) + $curvepoint = Floor((($TroopCount - 1) / ($WaveSize - 1)) * 239) + $Clickx = Round(_Random_Gaussian($DropCurve[$curvepoint][0], 3)) + $Clicky = Round(_Random_Gaussian($DropCurve[$curvepoint][1], 3)) + RedLineDeploy($Clickx, $Clicky, 1, 0, $AimPoint, $BufferDist, $THx, $THy) + Next + $TroopBins[$Wave][$SnipeTroop] -= $WaveSize + If $TroopBins[$Wave][$SnipeTroop] > 0 Then $AllGone = False + EndIf + EndIf + EndIf + + ; All this looping around takes a while, so check for hero activation + If $KingUsedSnipe And Not $KingPowerSnipe And TimerDiff($hHeroTimer) > 3000 Then + If GUICtrlRead($txtKingSkill) = 0 Then + _CaptureRegion() + If (checkHealth($King) Or (TimerDiff($hHeroTimer) / 1000) > 60) Then + SetLog(GetLangText("msgActivateKing"), $COLOR_AQUA) + SelectDropTroupe($King) + $KingPowerSnipe = True + EndIf + Else + If ((TimerDiff($hHeroTimer) / 1000) > Number(GUICtrlRead($txtKingSkill))) Then + SetLog(GetLangText("msgActivateKing"), $COLOR_BLUE) + SelectDropTroupe($King) + $KingPowerSnipe = True + EndIf + EndIf + EndIf + If $QueenUsedSnipe And Not $QueenPowerSnipe And TimerDiff($hHeroTimer) > 3000 Then + If GUICtrlRead($txtQueenSkill) = 0 Then + _CaptureRegion() + If (checkHealth($Queen) Or (TimerDiff($hHeroTimer) / 1000) > 60) Then + SetLog(GetLangText("msgActivateQueen"), $COLOR_AQUA) + SelectDropTroupe($Queen) + $QueenPowerSnipe = True + EndIf + Else + If ((TimerDiff($hHeroTimer) / 1000) > Number(GUICtrlRead($txtQueenSkill))) Then + SetLog(GetLangText("msgActivateQueen"), $COLOR_BLUE) + SelectDropTroupe($Queen) + $QueenPowerSnipe = True + EndIf + EndIf + EndIf + Next + Until $AllGone Or $protect2 > 200 + + ; Wait until income stopped, 45 seconds have passed, or we have a star + SetLog(GetLangText("msgSnipeWaveWait")) + $incomecheck = 0 + $incomestopped = False + $WaveTimer = TimerInit() + Do + If $incomecheck = 0 Then $origresources = GetResources(2) + If _Sleep(100) Then Return + If $KingUsedSnipe And Not $KingPowerSnipe And TimerDiff($hHeroTimer) > 3000 Then + If GUICtrlRead($txtKingSkill) = 0 Then + _CaptureRegion() + If (checkHealth($King) Or (TimerDiff($hHeroTimer) / 1000) > 60) Then + SetLog(GetLangText("msgActivateKing"), $COLOR_AQUA) + SelectDropTroupe($King) + $KingPowerSnipe = True + EndIf + Else + If ((TimerDiff($hHeroTimer) / 1000) > Number(GUICtrlRead($txtKingSkill))) Then + SetLog(GetLangText("msgActivateKing"), $COLOR_BLUE) + SelectDropTroupe($King) + $KingPowerSnipe = True + EndIf + EndIf + EndIf + If $QueenUsedSnipe And Not $QueenPowerSnipe And TimerDiff($hHeroTimer) > 3000 Then + If GUICtrlRead($txtQueenSkill) = 0 Then + _CaptureRegion() + If (checkHealth($Queen) Or (TimerDiff($hHeroTimer) / 1000) > 60) Then + SetLog(GetLangText("msgActivateQueen"), $COLOR_AQUA) + SelectDropTroupe($Queen) + $QueenPowerSnipe = True + EndIf + Else + If ((TimerDiff($hHeroTimer) / 1000) > Number(GUICtrlRead($txtQueenSkill))) Then + SetLog(GetLangText("msgActivateQueen"), $COLOR_BLUE) + SelectDropTroupe($Queen) + $QueenPowerSnipe = True + EndIf + EndIf + EndIf + $incomecheck += 1 + If $incomecheck = 25 Then + $incomecheck = 0 + $compresources = GetResources(2) + If $origresources[2] = $compresources[2] And $origresources[3] = $compresources[3] Then $incomestopped = True + EndIf + _CaptureRegion() + If _ColorCheck(_GetPixelColor(714, 538), Hex(0xC0C8C0, 6), 30) Then $AllDone = True + Until $incomestopped Or (TimerDiff($WaveTimer) > 45000) Or $AllDone + + $Wave += 1 + If $Wave = $SnipeWaveMax Then $AllDone = True + WEnd + SetLog(GetLangText("msgSnipeAttackDone")) + ElseIf $collectorMode Then + ; Collect red line data even if it is turned off + + $RedLineWasOff = False + If GUICtrlRead($sldAcc) = 100 Then + $RedLineWasOff = True + GUICtrlSetData($sldAcc, 90) + SeekEdges() + EndIf + + ; Find all the collectors + SetLog(GetLangText("msgFindColl")) + Local $AllCollectors[18][7] + ; 0 = type + ; 1 = X + ; 2 = Y + ; 3 = Angle + ; 4 = Deployed + ; 5 = Still standing + ; 6 = Deploy Timer + Local $CollectorCount = 0 + For $collector = 14 To 16 + $max = ($collector = 16) ? (3) : (7) + If $OverlayVisible And Not IsChecked($chkBackground) Then WinMove($frmOverlay, "", 10000, 10000, 860, 720) + $res = CallHelper("0 0 860 720 BrokenBotMatchBuilding " & $collector & " " & $max & " 1") + If $OverlayVisible And Not IsChecked($chkBackground) Then WinMove($frmOverlay, "", $BSpos[0], $BSpos[1], 860, 720) + + If $res <> $DLLFailed And $res <> $DLLTimeout Then + If $res = $DLLLicense Then + SetLog(GetLangText("msgLicense"), $COLOR_RED) + ElseIf $res <> $DLLNegative And StringLen($res) > 2 Then + $expRet = StringSplit($res, "|", 2) + If $DebugMode = 1 Then SetLog($expRet[0] & " " & (($collector = 14) ? (GetLangText("msgColGM")) : (($collector = 15) ? (GetLangText("msgColElix")) : (GetLangText("msgColDE"))))) + $i = 0 + While $i < $expRet[0] + If ($i * 6 + 2) <= UBound($expRet) Then + $AllCollectors[$CollectorCount][0] = $collector + $AllCollectors[$CollectorCount][1] = $expRet[$i * 6 + 1] + $AllCollectors[$CollectorCount][2] = $expRet[$i * 6 + 2] + $AllCollectors[$CollectorCount][4] = False + $AllCollectors[$CollectorCount][5] = True + $AllCollectors[$CollectorCount][6] = -1 + $CollectorCount += 1 + If $DebugMode = 1 Then SetLog((($collector = 14) ? (GetLangText("msgColGM")) : (($collector = 15) ? (GetLangText("msgColElix")) : (GetLangText("msgColDE")))) & " (" & $expRet[$i * 6 + 1] & ", " & $expRet[$i * 6 + 2] & ")") + EndIf + $i += 1 + WEnd + EndIf + EndIf + Next + ; Find a good location to drop troops at + ; Function will reduce $CollectorCount for those that are deemed too far away to attempt attacking + $OutsideCollector = 125 + If $CollectorCount > 0 Then + SetLog(GetLangText("msgFoundCol") & $CollectorCount) + SetLog(GetLangText("msgFindPos")) + Standard_RemoveInsideCollectors($CollectorCount, $AllCollectors, $OutsideCollector) + EndIf + + If $CollectorCount = 0 Then + ; Finding collectors failed + ; Fall back to attacking on 4 sides + SetLog(GetLangText("msgFindColFailed")) + If ($OuterQuad And $attackTH = 1) Then SetLog(GetLangText("msgLimitedTH")) + $collectorMode = False + $nbSides = 4 + Else + SetLog(GetLangText("msgRemainCol") & $CollectorCount) + ; Randomly spread out troops to each collector + Local $TroopBins[$CollectorCount][9] + For $collector = 0 To $CollectorCount - 1 + OverlayCircle($AllCollectors[$collector][1], $AllCollectors[$collector][2], 20, 0xFF00FF00, 3) + If $DebugMode = 1 Then SetLog((($AllCollectors[$collector][0] = 14) ? (GetLangText("msgColGM")) : (($AllCollectors[$collector][0] = 15) ? (GetLangText("msgColElix")) : (GetLangText("msgColDE")))) & " (" & $AllCollectors[$collector][1] & ", " & $AllCollectors[$collector][2] & ")") + For $troop = 0 To 8 + $TroopBins[$collector][$troop] = 0 + Next + Next + For $troop = 0 To 8 + For $drop = 1 To $atkTroops[$troop][1] + $TroopBins[Random(0, $CollectorCount - 1, 1)][$troop] += 1 + Next + Next + + ; Sort collectors + For $collector = 0 To $CollectorCount - 1 + $Coord = PolarCoord($AllCollectors[$collector][1], $AllCollectors[$collector][2], $BaseCenter[0], $BaseCenter[1]) + $AllCollectors[$collector][3] = $Coord[1] + Next + _ArraySort($AllCollectors, Random(0, 1, 1), 0, $CollectorCount - 1, 3) + + ; Drop at each collector in sequence + $hHeroTimer = "" + $collector = Random(1, $CollectorCount, 1) - 1 + $firstcollector = -1 + Local $DropCurve[240][2] + $ExitOkay = False + $KingUsedCol = False + $QueenUsedCol = False + Do + If $firstcollector = -1 Then + $GoodCollector = True + $firstcollector = $collector + Else + If $EarlyExit Then + $GoodCollector = True + ; If any collectors near this have been deployed recently then skip this one + If $AllCollectors[$collector][4] Or Not $AllCollectors[$collector][5] Then + $GoodCollector = False + Else + For $check = 0 To $CollectorCount - 1 + If $AllCollectors[$check][4] Then + $DeltaAngle = Max($AllCollectors[$check][3], $AllCollectors[$collector][3]) - Min($AllCollectors[$check][3], $AllCollectors[$collector][3]) + If $DeltaAngle > $pi Then $DeltaAngle = (2 * $pi) - $DeltaAngle + If $DeltaAngle < ($pi / 6) And TimerDiff($AllCollectors[$check][6]) < 15000 Then $GoodCollector = False + EndIf + Next + EndIf + EndIf + EndIf + + If Not $EarlyExit Or $GoodCollector Then + ; Create a curve to drop along, then we'll have our redline code do the work of getting a good drop point + ; How big will curve be? + $curveLimits = _Random_Gaussian(0.5236, 0.12) + $direction = ((Random(0, 1, 1) - .5) * 2) + $steppingangle = $AllCollectors[$collector][3] - (($curveLimits / 2) * $direction) + ; Make the curve of points + For $step = 0 To 239 + $DeltaPos = CartCoord(860, $steppingangle) + $DropCurve[$step][0] = $AllCollectors[$collector][1] + $DeltaPos[0] + $DropCurve[$step][1] = $AllCollectors[$collector][2] + $DeltaPos[1] + $steppingangle = $steppingangle + (($curveLimits / 240) * $direction) + Next + If $OverlayVisible Then + For $step = 0 To 239 + FixDropCurvePos($DropCurve, $step, $AllCollectors[$collector][1], $AllCollectors[$collector][2]) + Next + For $step = 0 To 238 + OverlayLine($DropCurve[$step][0], $DropCurve[$step][1], $DropCurve[$step + 1][0], $DropCurve[$step + 1][1], 0xFF0000FF, 2) + Next + OverlayLine($DropCurve[0][0], $DropCurve[0][1], $AllCollectors[$collector][1], $AllCollectors[$collector][2], 0xFF0000FF, 2) + OverlayLine($DropCurve[239][0], $DropCurve[239][1], $AllCollectors[$collector][1], $AllCollectors[$collector][2], 0xFF0000FF, 2) + EndIf + OverlayCircle($AllCollectors[$collector][1], $AllCollectors[$collector][2], 20, 0xFFFFFF99, 3) + + Do + $AllGone = True + For $ColTroop In $CollectorDeployOrder + If $ColTroop > -1 Then + If $TroopBins[$collector][$ColTroop] > 0 Then + Switch $ColTroop + Case $King + Local $useKing = ($AttackMethod = 0) ? (IsChecked($chkDeadUseKing) ? (1) : (0)) : (IsChecked($chkUseKing) ? (1) : (0)) + If $useKing = 1 Then + $hHeroTimer = TimerInit() + $KingUsedCol = True + Else + ContinueLoop + EndIf + Case $Queen + Local $useQueen = ($AttackMethod = 0) ? (IsChecked($chkDeadUseQueen) ? (1) : (0)) : (IsChecked($chkUseQueen) ? (1) : (0)) + If $useQueen = 1 Then + $hHeroTimer = TimerInit() + $QueenUsedCol = True + Else + ContinueLoop + EndIf + Case $CC + Local $useCastle = ($AttackMethod = 0) ? (IsChecked($chkDeadUseClanCastle) ? (1) : (0)) : (IsChecked($chkUseClanCastle) ? (1) : (0)) + If $useCastle = 0 Then ContinueLoop + EndSwitch + + If Wave_Sleep(1) Then Return + SelectDropTroupe($ColTroop) + + ; Random wave distance + $BufferDist = _Random_Gaussian(20, 6) + If $BufferDist < 2 Then $BufferDist = 2 + + If $TroopBins[$collector][$ColTroop] = 1 Then + ; Only a single unit, drop in middle + FixDropCurvePos($DropCurve, 119, $AllCollectors[$collector][1], $AllCollectors[$collector][2]) + $Clickx = Round(_Random_Gaussian($DropCurve[119][0], 3)) + $Clicky = Round(_Random_Gaussian($DropCurve[119][1], 3)) + RedLineDeploy($Clickx, $Clicky, 1, 0, $AimPoint, $BufferDist, $AllCollectors[$collector][1], $AllCollectors[$collector][2]) + $TroopBins[$collector][$ColTroop] -= 1 + ElseIf $TroopBins[$collector][$ColTroop] = 2 Then + ; Drop 2 units + FixDropCurvePos($DropCurve, 89, $AllCollectors[$collector][1], $AllCollectors[$collector][2]) + FixDropCurvePos($DropCurve, 149, $AllCollectors[$collector][1], $AllCollectors[$collector][2]) + $Clickx = Round(_Random_Gaussian($DropCurve[89][0], 3)) + $Clicky = Round(_Random_Gaussian($DropCurve[89][1], 3)) + RedLineDeploy($Clickx, $Clicky, 1, 0, $AimPoint, $BufferDist, $AllCollectors[$collector][1], $AllCollectors[$collector][2]) + $Clickx = Round(_Random_Gaussian($DropCurve[149][0], 3)) + $Clicky = Round(_Random_Gaussian($DropCurve[149][1], 3)) + RedLineDeploy($Clickx, $Clicky, 1, 0, $AimPoint, $BufferDist, $AllCollectors[$collector][1], $AllCollectors[$collector][2]) + $TroopBins[$collector][$ColTroop] -= 2 + Else + ; Many troops so spread out, deploy in waves + $WaveMax = 5 + $WaveSize = $TroopBins[$collector][$ColTroop] + If $WaveSize > $WaveMax Then $WaveSize = $WaveMax + For $TroopCount = 1 To $WaveSize + $curvepoint = Floor((($TroopCount - 1) / ($WaveSize - 1)) * 239) + FixDropCurvePos($DropCurve, $curvepoint, $AllCollectors[$collector][1], $AllCollectors[$collector][2]) + $Clickx = Round(_Random_Gaussian($DropCurve[$curvepoint][0], 3)) + $Clicky = Round(_Random_Gaussian($DropCurve[$curvepoint][1], 3)) + RedLineDeploy($Clickx, $Clicky, 1, 0, $AimPoint, $BufferDist, $AllCollectors[$collector][1], $AllCollectors[$collector][2]) + Next + $TroopBins[$collector][$ColTroop] -= $WaveSize + If $TroopBins[$collector][$ColTroop] > 0 Then $AllGone = False + EndIf + EndIf + EndIf + + ; All this looping around takes a while, so check for hero activation + If $KingUsedCol And Not $KingPowerCollector And TimerDiff($hHeroTimer) > 3000 Then + If GUICtrlRead($txtKingSkill) = 0 Then + _CaptureRegion() + If (checkHealth($King) Or (TimerDiff($hHeroTimer) / 1000) > 60) Then + SetLog(GetLangText("msgActivateKing"), $COLOR_AQUA) + SelectDropTroupe($King) + $KingPowerCollector = True + EndIf + Else + If ((TimerDiff($hHeroTimer) / 1000) > Number(GUICtrlRead($txtKingSkill))) Then + SetLog(GetLangText("msgActivateKing"), $COLOR_BLUE) + SelectDropTroupe($King) + $KingPowerCollector = True + EndIf + EndIf + EndIf + If $QueenUsedCol And Not $QueenPowerCollector And TimerDiff($hHeroTimer) > 3000 Then + If GUICtrlRead($txtQueenSkill) = 0 Then + _CaptureRegion() + If (checkHealth($Queen) Or (TimerDiff($hHeroTimer) / 1000) > 60) Then + SetLog(GetLangText("msgActivateQueen"), $COLOR_AQUA) + SelectDropTroupe($Queen) + $QueenPowerCollector = True + EndIf + Else + If ((TimerDiff($hHeroTimer) / 1000) > Number(GUICtrlRead($txtQueenSkill))) Then + SetLog(GetLangText("msgActivateQueen"), $COLOR_BLUE) + SelectDropTroupe($Queen) + $QueenPowerCollector = True + EndIf + EndIf + EndIf + Next + Until $AllGone + $AllCollectors[$collector][4] = True + $AllCollectors[$collector][6] = TimerInit() + EndIf + $collector += 1 + If $collector = $CollectorCount Then $collector = 0 + If $collector = $firstcollector Then $ExitOkay = True + If $EarlyExit And $ExitOkay Then + ; Even if we haven't deployed troops there yet, if the collector is gone then skip it + + ; First wait until income stops + SetLog(GetLangText("msgRoundDoneIncomeWait")) + $incomecheck = 0 + $incomestopped = False + Do + If $incomecheck = 0 Then $origresources = GetResources(2) + If _Sleep(100) Then Return + ; All this looping around takes a while, so check for hero activation + If $KingUsedCol And Not $KingPowerCollector And TimerDiff($hHeroTimer) > 3000 Then + If GUICtrlRead($txtKingSkill) = 0 Then + _CaptureRegion() + If (checkHealth($King) Or (TimerDiff($hHeroTimer) / 1000) > 60) Then + SetLog(GetLangText("msgActivateKing"), $COLOR_AQUA) + SelectDropTroupe($King) + $KingPowerCollector = True + EndIf + Else + If ((TimerDiff($hHeroTimer) / 1000) > Number(GUICtrlRead($txtKingSkill))) Then + SetLog(GetLangText("msgActivateKing"), $COLOR_BLUE) + SelectDropTroupe($King) + $KingPowerCollector = True + EndIf + EndIf + EndIf + If $QueenUsedCol And Not $QueenPowerCollector And TimerDiff($hHeroTimer) > 3000 Then + If GUICtrlRead($txtQueenSkill) = 0 Then + _CaptureRegion() + If (checkHealth($Queen) Or (TimerDiff($hHeroTimer) / 1000) > 60) Then + SetLog(GetLangText("msgActivateQueen"), $COLOR_AQUA) + SelectDropTroupe($Queen) + $QueenPowerCollector = True + EndIf + Else + If ((TimerDiff($hHeroTimer) / 1000) > Number(GUICtrlRead($txtQueenSkill))) Then + SetLog(GetLangText("msgActivateQueen"), $COLOR_BLUE) + SelectDropTroupe($Queen) + $QueenPowerCollector = True + EndIf + EndIf + EndIf + $incomecheck += 1 + If $incomecheck = 25 Then + $incomecheck = 0 + $compresources = GetResources(2) + If $origresources[2] = $compresources[2] And $origresources[3] = $compresources[3] And $origresources[4] = $compresources[4] Then $incomestopped = True + EndIf + Until $incomestopped + + For $check = 0 To $CollectorCount - 1 + $AllCollectors[$check][5] = False + Next + SetLog(GetLangText("msgRecheckCollectors")) + For $recheck = 14 To 16 + $max = ($recheck = 16) ? (3) : (7) + If $OverlayVisible And Not IsChecked($chkBackground) Then WinMove($frmOverlay, "", 10000, 10000, 860, 720) + $res = CallHelper("0 0 860 720 BrokenBotMatchBuilding " & $recheck & " " & $max & " 1") + If $OverlayVisible And Not IsChecked($chkBackground) Then WinMove($frmOverlay, "", $BSpos[0], $BSpos[1], 860, 720) + + If $res <> $DLLFailed And $res <> $DLLTimeout Then + If $res = $DLLLicense Then + SetLog(GetLangText("msgLicense"), $COLOR_RED) + ElseIf $res <> $DLLNegative And StringLen($res) > 2 Then + $expRet = StringSplit($res, "|", 2) + If $DebugMode = 1 Then SetLog($expRet[0] & " " & (($recheck = 14) ? (GetLangText("msgColGM")) : (($recheck = 15) ? (GetLangText("msgColElix")) : (GetLangText("msgColDE"))))) + $i = 0 + While $i < $expRet[0] + If ($i * 6 + 2) <= UBound($expRet) Then + For $check = 0 To $CollectorCount - 1 + If Abs($AllCollectors[$check][1] - $expRet[$i * 6 + 1]) < 5 And Abs($AllCollectors[$check][2] - $expRet[$i * 6 + 2]) < 5 Then $AllCollectors[$check][5] = True + Next + If $DebugMode = 1 Then SetLog((($recheck = 14) ? (GetLangText("msgColGM")) : (($recheck = 15) ? (GetLangText("msgColElix")) : (GetLangText("msgColDE")))) & " (" & $expRet[$i * 6 + 1] & ", " & $expRet[$i * 6 + 2] & ")") + EndIf + $i += 1 + WEnd + EndIf + EndIf + ; All this looping around takes a while, so check for hero activation + If $KingUsedCol And Not $KingPowerCollector And TimerDiff($hHeroTimer) > 3000 Then + If GUICtrlRead($txtKingSkill) = 0 Then + _CaptureRegion() + If (checkHealth($King) Or (TimerDiff($hHeroTimer) / 1000) > 60) Then + SetLog(GetLangText("msgActivateKing"), $COLOR_AQUA) + SelectDropTroupe($King) + $KingPowerCollector = True + EndIf + Else + If ((TimerDiff($hHeroTimer) / 1000) > Number(GUICtrlRead($txtKingSkill))) Then + SetLog(GetLangText("msgActivateKing"), $COLOR_BLUE) + SelectDropTroupe($King) + $KingPowerCollector = True + EndIf + EndIf + EndIf + If $QueenUsedCol And Not $QueenPowerCollector And TimerDiff($hHeroTimer) > 3000 Then + If GUICtrlRead($txtQueenSkill) = 0 Then + _CaptureRegion() + If (checkHealth($Queen) Or (TimerDiff($hHeroTimer) / 1000) > 60) Then + SetLog(GetLangText("msgActivateQueen"), $COLOR_AQUA) + SelectDropTroupe($Queen) + $QueenPowerCollector = True + EndIf + Else + If ((TimerDiff($hHeroTimer) / 1000) > Number(GUICtrlRead($txtQueenSkill))) Then + SetLog(GetLangText("msgActivateQueen"), $COLOR_BLUE) + SelectDropTroupe($Queen) + $QueenPowerCollector = True + EndIf + EndIf + EndIf + Next + + ; If a collector is still standing, but has been deployed, take troops from one that is gone if possible + For $check = 0 To $CollectorCount - 1 + If $AllCollectors[$check][5] = False Then OverlayCircle($AllCollectors[$check][1], $AllCollectors[$check][2], 20, 0xFF778899, 3) +;~ If $AllCollectors[$check][4] = True And $AllCollectors[$check][5] = True Then +;~ For $findavailable = 0 To $CollectorCount - 1 +;~ If $AllCollectors[$findavailable][4] = False And $AllCollectors[$findavailable][5] = False Then +;~ ; We found a collector that hasn't deployed yet but already destroyed +;~ For $MoveTroop = 0 To 8 +;~ $TroopBins[$check][$MoveTroop] = $TroopBins[$findavailable][$MoveTroop] +;~ Next +;~ OverlayCircle($AllCollectors[$check][1], $AllCollectors[$check][2], 20, 0xFF00FF00, 3) +;~ $AllCollectors[$check][4] = False +;~ $AllCollectors[$findavailable][4] = True +;~ ExitLoop +;~ EndIf +;~ Next +;~ EndIf + Next + + For $check = 0 To $CollectorCount - 1 + If $AllCollectors[$check][4] = False And $AllCollectors[$check][5] = True Then $ExitOkay = False + Next + EndIf + Until $ExitOkay = True + SetLog(GetLangText("msgCollectAttackDone")) + EndIf + If $RedLineWasOff Then + GUICtrlSetData($sldAcc, 100) + EndIf + EndIf + + ; ================================================================================? + ; ========= Here is coded the main attack strategy =============================== + ; ========= Feel free to experiment something else =============================== + ; ================================================================================? + If Not $collectorMode And $AttackMethod <> 3 Then + Local $EdgeUsed[4] + For $n=0 to 3 + $EdgeUsed[$n] = False + $EdgeOrder[$n] = -1 + Next + Local $EdgesFilled = 0 + While $EdgesFilled < $nbSides + $guess = Random(0, 3, 1) + If Not $EdgeUsed[$guess] Then + $EdgeOrder[$EdgesFilled] = $guess + $EdgeUsed[$guess] = True + $EdgesFilled += 1 + EndIf + WEnd + + If Standard_LaunchTroop($eGiant, (($mixedMode) ? 1 : $nbSides), 1, 1, 1, ($OuterQuad And $attackTH = 2)) Then + If Wave_Sleep(1) Then Return + EndIf + If Standard_LaunchTroop($eHog, (($mixedMode) ? 1 : $nbSides), 1, 1, 1, ($OuterQuad And $attackTH = 2)) Then + If Wave_Sleep(1) Then Return + EndIf + If Not $mixedMode Then + If Standard_LaunchTroop($eValkyrie, $nbSides, 1, 1, 1, ($OuterQuad And $attackTH = 2)) Then + If Wave_Sleep(1) Then Return + EndIf + EndIf + If Standard_LaunchTroop($eBarbarian, $nbSides, 1, 2, 0, ($OuterQuad And $attackTH = 2)) Then + If Wave_Sleep(1) Then Return + EndIf + If Standard_LaunchTroop($eWallbreaker, (($mixedMode) ? 1 : $nbSides), 1, (($mixedMode) ? 3 : 1), 1, ($OuterQuad And $attackTH = 2)) Then + If Wave_Sleep(1) Then Return + EndIf + If Standard_LaunchTroop($eArcher, $nbSides, 1, 2, 0, ($OuterQuad And $attackTH = 2)) Then + If Wave_Sleep(1) Then Return + EndIf + If Standard_LaunchTroop($eBarbarian, (($mixedMode) ? 1 : $nbSides), 2, 2, 0, ($OuterQuad And $attackTH >= 1)) Then + If Wave_Sleep(1) Then Return + EndIf + If Standard_LaunchTroop($eGoblin, $nbSides, 1, 2, 0, ($OuterQuad And $attackTH = 2)) Then + If Wave_Sleep(1) Then Return + EndIf + If $mixedMode Then + If Standard_LaunchTroop($eWallbreaker, 1, 2, 3, 1) Then + If _Sleep(Wave_Sleep(1), False) Then Return + EndIf + Else + If Standard_LaunchTroop($eArcher, $nbSides, 2, 2, 0, ($OuterQuad And $attackTH >= 1)) Then + If Wave_Sleep(1) Then Return + EndIf + If Standard_LaunchTroop($eGoblin, $nbSides, 2, 2, 0, ($OuterQuad And $attackTH = 2)) Then + If Wave_Sleep(1) Then Return + EndIf + If Standard_LaunchTroop($eMinion, $nbSides, 1, 1, 0, ($OuterQuad And $attackTH = 2)) Then + If Wave_Sleep(1) Then Return + EndIf + EndIf + ; ================================================================================? + + $hHeroTimer = "" + ; Deploy CC and Heroes behind troops + If ($OuterQuad And $attackTH = 2) Then + Switch $THquadrant + Case 1 + $DropX = $FurthestTopLeft[0][0] + $DropY = $FurthestTopLeft[0][1] + Local $DropArray[5][2] = [[$DropX, $DropY], [0, 0], [0, 0], [0, 0], [$DropX, $DropY]] + Case 2 + $m = (537 - 238) / (535 - 128) + $m2 = (9 - 314) / (430 - 28) + $b = $THy - ($m * $THx) + $b2 = 314 - ($m2 * 28) + $DropXa = (($b - $b2) / ($m2 - $m)) - 20 + $DropYa = Round($m2 * $DropXa + $b2) + $DropXb = (($b - $b2) / ($m2 - $m)) + 20 + $DropYb = Round($m2 * $DropXb + $b2) + Local $DropArray[5][2] = [[$DropXa, $DropYa], [0, 0], [0, 0], [0, 0], [$DropXb, $DropYb]] + Case 3 + $DropX = $FurthestTopLeft[4][0] + $DropY = $FurthestTopLeft[4][1] + Local $DropArray[5][2] = [[$DropX, $DropY], [0, 0], [0, 0], [0, 0], [$DropX, $DropY]] + Case 4 + $m = (85 - 388) / (527 - 130) + $m2 = (612 - 314) / (440 - 28) + $b = $THy - ($m * $THx) + $b2 = 314 - ($m2 * 28) + $DropXa = (($b - $b2) / ($m2 - $m)) - 20 + $DropYa = Round($m2 * $DropXa + $b2) + $DropXb = (($b - $b2) / ($m2 - $m)) + 20 + $DropYb = Round($m2 * $DropXb + $b2) + Local $DropArray[5][2] = [[$DropXa, $DropYa], [0, 0], [0, 0], [0, 0], [$DropXb, $DropYb]] + Case 6 + $m = (85 - 388) / (527 - 130) + $m2 = (612 - 314) / (440 - 28) + $b = $THy - ($m * $THx) + $b2 = 9 - ($m2 * 430) + $DropXa = (($b - $b2) / ($m2 - $m)) - 20 + $DropYa = Round($m2 * $DropXa + $b2) + $DropXb = (($b - $b2) / ($m2 - $m)) + 20 + $DropYb = Round($m2 * $DropXb + $b2) + Local $DropArray[5][2] = [[$DropXa, $DropYa], [0, 0], [0, 0], [0, 0], [$DropXb, $DropYb]] + Case 7 + $DropX = Round(($FurthestBottomRight[4][0] - $FurthestBottomRight[0][0]) / 4) + $FurthestBottomRight[0][0] + $DropY = Round(($FurthestBottomRight[4][1] - $FurthestBottomRight[0][1]) / 4) + $FurthestBottomRight[0][1] + Local $DropArray[5][2] = [[$DropX, $DropY], [0, 0], [0, 0], [0, 0], [$DropX, $DropY]] + Case 8 + $m = (537 - 238) / (535 - 128) + $m2 = (9 - 314) / (430 - 28) + $b = $THy - ($m * $THx) + $b2 = 612 - ($m2 * 440) + $DropXa = (($b - $b2) / ($m2 - $m)) - 20 + $DropYa = Round($m2 * $DropXa + $b2) + $DropXb = (($b - $b2) / ($m2 - $m)) + 20 + $DropYb = Round($m2 * $DropXb + $b2) + Local $DropArray[5][2] = [[$DropXa, $DropYa], [0, 0], [0, 0], [0, 0], [$DropXb, $DropYb]] + Case 9 + $DropX = $FurthestBottomRight[4][0] + $DropY = $FurthestBottomRight[4][1] + Local $DropArray[5][2] = [[$DropX, $DropY], [0, 0], [0, 0], [0, 0], [$DropX, $DropY]] + EndSwitch + If Wave_Sleep(1) Then Return + Standard_dropCC($DropArray, $CC, $AttackMethod, $AimTH) + If Not $mixedMode Then + Standard_dropHeroes($DropArray, $King, $Queen, $AttackMethod, $AimTH) + $hHeroTimer = TimerInit() + EndIf + Else + If $nbSides = 1 Then + Standard_dropCC($BottomRight, $CC, $AttackMethod) + Else + Standard_dropCC($TopLeft, $CC, $AttackMethod) + EndIf + If _Sleep(100) Then Return + If Not $mixedMode Then + If $nbSides = 1 Then + Standard_dropHeroes($BottomRight, $King, $Queen, $AttackMethod) + $hHeroTimer = TimerInit() + Else + Standard_dropHeroes($TopLeft, $King, $Queen, $AttackMethod) + $hHeroTimer = TimerInit() + EndIf + EndIf + EndIf + + If $mixedMode Then + If Standard_LaunchTroop($eValkyrie, 1, 1, 1, 1, ($OuterQuad And $attackTH = 2)) Then + If Wave_Sleep(1) Then Return + EndIf + If Standard_LaunchTroop($eArcher, 1, 2, 2, 0, ($OuterQuad And $attackTH = 2)) Then + If Wave_Sleep(1) Then Return + EndIf + If Standard_LaunchTroop($eGoblin, 1, 2, 2, 0, ($OuterQuad And $attackTH = 2)) Then + If Wave_Sleep(1) Then Return + EndIf + If Standard_LaunchTroop($eMinion, 1, 1, 1, 0, ($OuterQuad And $attackTH = 2)) Then + If Wave_Sleep(1) Then Return + EndIf + If _Sleep(100) Then Return + If ($OuterQuad And $attackTH = 2) Then + Standard_dropHeroes($DropArray, $King, $Queen, $AttackMethod, $AimTH) + $hHeroTimer = TimerInit() + Else + Standard_dropHeroes($BottomRight, $King, $Queen, $AttackMethod) + $hHeroTimer = TimerInit() + EndIf + If Standard_LaunchTroop($eWallbreaker, 1, 3, 3, 1) Then + If _Sleep(Wave_Sleep(1), False) Then Return + EndIf + EndIf + EndIf + + ; Check resources + If Not $EarlyExit Then + $Resources = GetResources(1) + Else + $Resources = GetResources(2) + EndIf + + ; Nuke DE if desired + If ($LastAttackDead = "0") And ($SpellQty >= GUICtrlRead($txtSpellNumber)) And ($SpellQty > 0) And Number($Resources[4]) >= Number(GUICtrlRead($txtDENukeLimit)) And IsChecked($chkNukeAttacking) Then + SetLog(GetLangText("msgNuking"), $COLOR_BLUE) + Standard_DropNukes() + EndIf + + If Wave_Sleep(1) Then Return + + If Not $EarlyExit And $AttackMethod <> 3 Then + SetLog(GetLangText("msgDropLeftover"), $COLOR_BLUE) + $gone = True + $loop = 0 + Local $useCastle = ($AttackMethod = 0) ? (IsChecked($chkDeadUseClanCastle) ? (1) : (0)) : (IsChecked($chkUseClanCastle) ? (1) : (0)) + Local $useKing = ($AttackMethod = 0) ? (IsChecked($chkDeadUseKing) ? (1) : (0)) : (IsChecked($chkUseKing) ? (1) : (0)) + Local $useQueen = ($AttackMethod = 0) ? (IsChecked($chkDeadUseQueen) ? (1) : (0)) : (IsChecked($chkUseQueen) ? (1) : (0)) + Do + $loop += 1 + $gone = True + If $loop = 1 Then + Standard_PrepareAttack(True) ;Check remaining quantities + Else + Standard_PrepareAttack(True, 1, True) + EndIf + For $i = 0 To 8 + If $atkTroops[$i][0] <> -1 Then + If $atkTroops[$i][0] = $eCastle And $useCastle <> 1 Then ContinueLoop + If $atkTroops[$i][0] = $eKing And $useKing <> 1 Then ContinueLoop + If $atkTroops[$i][0] = $eQueen And $useQueen <> 1 Then ContinueLoop + If $atkTroops[$i][1] > 0 Then $gone = False + EndIf + Next + For $i = $eBarbarian To $eMinion ; lauch all remaining troops + If $i = $eBarbarian Or $i = $eArcher Or $i = $eMinion Or $i = $eHog Or $i = $eValkyrie Then + Standard_LaunchTroop($i, (($mixedMode) ? 1 : $nbSides), 0, 1) + Else + If $i <> $eLSpell Then Standard_LaunchTroop($i, $nbSides, 0, 1, 2) + EndIf + Next + If _Sleep(500) Then Return + Until $gone Or $loop > 10 + + ;Activate KQ's power if deployed + Local $QueenUsed = ($AttackMethod = 0) ? (IsChecked($chkDeadUseQueen) ? (True) : (False)) : (IsChecked($chkUseQueen) ? (True) : (False)) + If $QueenUsedSnipe Then $QueenUsed = True + Local $KingUsed = ($AttackMethod = 0) ? (IsChecked($chkDeadUseKing) ? (True) : (False)) : (IsChecked($chkUseKing) ? (True) : (False)) + If $KingUsedSnipe Then $KingUsed = True + If ($KingUsed And $KingWasHere) Or ($QueenUsed And $QueenWasHere) Then + $KingGone = True + $QueenGone = True + If $KingUsed And $KingWasHere Then $KingGone = False + If $QueenUsed And $QueenWasHere Then $QueenGone = False + If $KingPowerCollector Or $KingPowerSnipe Then $KingGone = True + If $QueenPowerCollector Or $QueenPowerSnipe Then $QueenGone = True + Do + If $KingWasHere And TimerDiff($hHeroTimer) > 3000 Then + If GUICtrlRead($txtKingSkill) = 0 Then + _CaptureRegion() + If (checkHealth($King) Or (TimerDiff($hHeroTimer) / 1000) > 60) And Not $KingGone Then + SetLog(GetLangText("msgActivateKing"), $COLOR_AQUA) + SelectDropTroupe($King) + $KingGone = True + EndIf + Else + If ((TimerDiff($hHeroTimer) / 1000) > Number(GUICtrlRead($txtKingSkill))) And Not $KingGone Then + SetLog(GetLangText("msgActivateKing"), $COLOR_BLUE) + SelectDropTroupe($King) + $KingGone = True + EndIf + EndIf + EndIf + If $QueenWasHere And TimerDiff($hHeroTimer) > 3000 Then + If GUICtrlRead($txtQueenSkill) = 0 Then + _CaptureRegion() + If (checkHealth($Queen) Or (TimerDiff($hHeroTimer) / 1000) > 60) And Not $QueenGone Then + SetLog(GetLangText("msgActivateQueen"), $COLOR_AQUA) + SelectDropTroupe($Queen) + $QueenGone = True + EndIf + Else + If ((TimerDiff($hHeroTimer) / 1000) > Number(GUICtrlRead($txtQueenSkill))) And Not $QueenGone Then + SetLog(GetLangText("msgActivateQueen"), $COLOR_BLUE) + SelectDropTroupe($Queen) + $QueenGone = True + EndIf + EndIf + EndIf + If _Sleep(250) Then ExitLoop + Until $KingGone And $QueenGone + EndIf + SetLog(GetLangText("msgFinishedWait"), $COLOR_GREEN) + Else + ; Wait just a few seconds in case we nuked the DE + If _Sleep(3000) Then Return + + ; Use K/Q power if not used yet + If $AttackMethod <> 3 Then + Local $QueenUsed = ($AttackMethod = 0) ? (IsChecked($chkDeadUseQueen) ? (True) : (False)) : (IsChecked($chkUseQueen) ? (True) : (False)) + Local $KingUsed = ($AttackMethod = 0) ? (IsChecked($chkDeadUseKing) ? (True) : (False)) : (IsChecked($chkUseKing) ? (True) : (False)) + Else + Local $QueenUsed = False + If $QueenUsedSnipe Then $QueenUsed = True + Local $KingUsed = False + If $KingUsedSnipe Then $KingUsed = True + EndIf + If ($KingUsed And $KingWasHere) Or ($QueenUsed And $QueenWasHere) Then + $KingGone = False + $QueenGone = False + If $KingPowerCollector Or $KingPowerSnipe Then $KingGone = True + If $QueenPowerCollector Or $QueenPowerSnipe Then $QueenGone = True + If $KingUsed And Not $KingGone Then + SelectDropTroupe($King) + EndIf + If $QueenUsed And Not $QueenGone Then + SelectDropTroupe($Queen) + EndIf + EndIf + + If $EarlyExit Then $FasterExit = True + EndIf + + EndIf + + If $TakeAttackSnapShot = 1 Then + $AttackFile = @YEAR & @MON & @MDAY & @HOUR & @MIN & @SEC & "-TH-" & $THLoc & ((($THquadrant > 0) And ($THquadrant < 10)) ? ("-Q" & $THquadrant) : ("")) & (($AttackMethod = 0) ? ("-Dead-") : ("-Live")) & ".jpg" + _GDIPlus_ImageSaveToFile($hAttackBitmap, $dirAttack & $AttackFile) + If _Sleep(500) Then Return + If $PushBulletEnabled = 1 And $PushBulletattacktype = 1 Then + _PushFile($AttackFile, "Attacks", "image/jpeg", "Last Raid", $AttackFile) + EndIf + EndIf + $BufferAvailable = False + _GDIPlus_ImageDispose($hAttackBitmap) +EndFunc ;==>Standard_Attack + +Func Standard_DropNukes() + $nLSpell = -1 + $nSpellQty = 0 + For $i = 0 To 8 + If $atkTroops[$i][0] = $eLSpell Then + $nLSpell = $i + $nSpellQty = $atkTroops[$i][1] + EndIf + Next + If $nSpellQty > 0 Then + If $OverlayVisible And Not IsChecked($chkBackground) Then WinMove($frmOverlay, "", 10000, 10000, 860, 720) + $res = CallHelper("0 0 860 720 BrokenBotMatchBuilding 16 3 1") + If $OverlayVisible And Not IsChecked($chkBackground) Then WinMove($frmOverlay, "", $BSpos[0], $BSpos[1], 860, 720) + $DEDrills = "" + If $res <> $DLLFailed and $res <> $DLLTimeout Then + If $res = $DLLLicense Then + SetLog(GetLangText("msgLicense"), $COLOR_RED) + ElseIf $res <> $DLLNegative Then + SelectDropTroupe($nLSpell) + If _Sleep(200) Then Return + $DEDrills = StringSplit($res, "|", 2) + $i = 0 + $loops = 0 + While $i < $DEDrills[0] + If ($nSpellQty <= 0) Or ($loops > 20) Then ExitLoop + If ($i * 6 + 2) <= UBound($DEDrills) Then + Click(Round(_Random_Gaussian($DEDrills[$i * 6 + 1], 2)), Round(_Random_Gaussian($DEDrills[$i * 6 + 2], 2))) + OverlayCircle(Round(_Random_Gaussian($DEDrills[$i * 6 + 1], 2)) - 2, Round(_Random_Gaussian($DEDrills[$i * 6 + 2], 2)) - 2, 4, $GlobalColor, 1) + If _Sleep(200) Then Return + $nSpellQty = ReadTroopQuantity($nLSpell) + Else + $i = -1 + EndIf + $i += 1 + $loops += 1 + WEnd + EndIf + EndIf + EndIf +EndFunc ;==>Standard_DropNukes + +;Drops Clan Castle troops, given the slot and x, y coordinates. + +Func Standard_dropCC($edge, $slot, $AttackMethod = 1, $CenterLoc = 1) ;Drop clan castle + Local $useCastle = ($AttackMethod = 0) ? (IsChecked($chkDeadUseClanCastle) ? (1) : (0)) : (IsChecked($chkUseClanCastle) ? (1) : (0)) + If $slot <> -1 And $useCastle = 1 Then + SetLog(GetLangText("msgDroppingCC"), $COLOR_BLUE) + Click(68 + (72 * $slot), 595) + If _Sleep(200) Then Return + $x = Round(_Random_Gaussian(((($edge[4][0] - $edge[0][0]) / 2) + $edge[0][0]), (($edge[4][0] - $edge[0][0]) / 8))) + $y = Round((($edge[4][1] - $edge[0][1]) / ($edge[4][0] - $edge[0][0])) * ($x - $edge[0][0])) + $edge[0][1] + Click($x, $y, 1, 0, $CenterLoc) + _GDIPlus_GraphicsDrawEllipse($Buffer, $x - 4, $y - 4, 8, 8, $pCC) + EndIf +EndFunc ;==>Standard_dropCC + +;Will drop heroes in a specific coordinates, only if slot is not -1 +;Only drops when option is clicked. + +Func Standard_dropHeroes($edge, $KingSlot = -1, $QueenSlot = -1, $AttackMethod = 1, $CenterLoc = 1) ;Drops for king and queen + While 1 + + Local $useKing = ($AttackMethod = 0) ? (IsChecked($chkDeadUseKing) ? (1) : (0)) : (IsChecked($chkUseKing) ? (1) : (0)) + Local $useQueen = ($AttackMethod = 0) ? (IsChecked($chkDeadUseQueen) ? (1) : (0)) : (IsChecked($chkUseQueen) ? (1) : (0)) + + If $KingSlot <> -1 And $useKing = 1 Then + If Wave_Sleep(1) Then Return + SetLog(GetLangText("msgDroppingKing"), $COLOR_BLUE) + Click(68 + (72 * $KingSlot), 595) ;Select King + If _Sleep(200) Then Return + $x = Round(_Random_Gaussian(((($edge[4][0] - $edge[0][0]) / 2) + $edge[0][0]), (($edge[4][0] - $edge[0][0]) / 8))) + $y = Round((($edge[4][1] - $edge[0][1]) / ($edge[4][0] - $edge[0][0])) * ($x - $edge[0][0])) + $edge[0][1] + Click($x, $y, 1, 0, $CenterLoc) + _GDIPlus_GraphicsDrawEllipse($Buffer, $x - 6, $y - 6, 12, 12, $pKing) + $checkKPower = True + EndIf + + If $QueenSlot <> -1 And $useQueen = 1 Then + If Wave_Sleep(1) Then Return + SetLog(GetLangText("msgDroppingQueen"), $COLOR_BLUE) + Click(68 + (72 * $QueenSlot), 595) ;Select Queen + If _Sleep(200) Then Return + $x = Round(_Random_Gaussian(((($edge[4][0] - $edge[0][0]) / 2) + $edge[0][0]), (($edge[4][0] - $edge[0][0]) / 8))) + $y = Round((($edge[4][1] - $edge[0][1]) / ($edge[4][0] - $edge[0][0])) * ($x - $edge[0][0])) + $edge[0][1] + Click($x, $y, 1, 0, $CenterLoc) + _GDIPlus_GraphicsDrawEllipse($Buffer, $x - 5, $y - 5, 10, 10, $pQueen) + $checkQPower = True + EndIf + + ExitLoop + WEnd +EndFunc ;==>Standard_dropHeroes + +Func checkHealth($troop) + ; Returns true if King/Queen are low in health + Return Not _HueSearch(49 + (72 * $troop), 571, 2, 2, 24, 29) +EndFunc ;==>checkHealth + +Func FixDropCurvePos(ByRef $arCurve, $index, $x, $y) + ; If they are outside of bounds of base then move them back in + For $rotate = 0 To 3 + Switch $rotate + Case 0 + If SegmentIntersect($arCurve[$index][0], $arCurve[$index][1], $x, $y, $FurthestTopLeft[0][0], $FurthestTopLeft[0][1], $FurthestTopLeft[4][0], $FurthestTopLeft[4][1]) Then + $BetterSpot = FindIntersection($arCurve[$index][0], $arCurve[$index][1], $x, $y, $FurthestTopLeft[0][0], $FurthestTopLeft[0][1], $FurthestTopLeft[4][0], $FurthestTopLeft[4][1]) + $arCurve[$index][0] = $BetterSpot[0] + $arCurve[$index][1] = $BetterSpot[1] + ExitLoop + EndIf + Case 1 + If SegmentIntersect($arCurve[$index][0], $arCurve[$index][1], $x, $y, $FurthestTopRight[0][0], $FurthestTopRight[0][1], $FurthestTopRight[4][0], $FurthestTopRight[4][1]) Then + $BetterSpot = FindIntersection($arCurve[$index][0], $arCurve[$index][1], $x, $y, $FurthestTopRight[0][0], $FurthestTopRight[0][1], $FurthestTopRight[4][0], $FurthestTopRight[4][1]) + $arCurve[$index][0] = $BetterSpot[0] + $arCurve[$index][1] = $BetterSpot[1] + ExitLoop + EndIf + Case 2 + If SegmentIntersect($arCurve[$index][0], $arCurve[$index][1], $x, $y, $FurthestBottomLeft[0][0], $FurthestBottomLeft[0][1], $FurthestBottomLeft[4][0], $FurthestBottomLeft[4][1]) Then + $BetterSpot = FindIntersection($arCurve[$index][0], $arCurve[$index][1], $x, $y, $FurthestBottomLeft[0][0], $FurthestBottomLeft[0][1], $FurthestBottomLeft[4][0], $FurthestBottomLeft[4][1]) + $arCurve[$index][0] = $BetterSpot[0] + $arCurve[$index][1] = $BetterSpot[1] + ExitLoop + EndIf + Case 3 + If SegmentIntersect($arCurve[$index][0], $arCurve[$index][1], $x, $y, $FurthestBottomRight[0][0], $FurthestBottomRight[0][1], $FurthestBottomRight[4][0], $FurthestBottomRight[4][1]) Then + $BetterSpot = FindIntersection($arCurve[$index][0], $arCurve[$index][1], $x, $y, $FurthestBottomRight[0][0], $FurthestBottomRight[0][1], $FurthestBottomRight[4][0], $FurthestBottomRight[4][1]) + $arCurve[$index][0] = $BetterSpot[0] + $arCurve[$index][1] = $BetterSpot[1] + ExitLoop + EndIf + EndSwitch + Next + ; Move points that are too low up + If $arCurve[$index][1] > 560 Then + $arCurve[$index][1] = 560 + If $arCurve[$index][0] <= 402 Then + $GetPoint = GetPointDist(350, 560, 402, 560) + $NewPoint = $GetPoint[1] + $NewPoint -= 5 + If $NewPoint < 350 Then $NewPoint = 350 + If $NewPoint < $arCurve[$index][0] Then $arCurve[$index][0] = $NewPoint + Else + $GetPoint = GetPointDist(510, 560, 402, 560) + $NewPoint = $GetPoint[1] + $NewPoint += 5 + If $NewPoint > 510 Then $NewPoint = 510 + If $NewPoint > $arCurve[$index][0] Then $arCurve[$index][0] = $NewPoint + EndIf + EndIf +EndFunc ;==>FixDropCurvePos diff --git a/COCBot/functions/Strategies/Standard/Config.au3 b/COCBot/functions/Strategies/Standard/Config.au3 index 7e8057d..8456629 100644 --- a/COCBot/functions/Strategies/Standard/Config.au3 +++ b/COCBot/functions/Strategies/Standard/Config.au3 @@ -1,518 +1,533 @@ -Func Standard_LoadConfig() - $configFile = $dirStrat & GUICtrlRead($lstStrategies) & ".ini" - ;Search Settings------------------------------------------------------------------------ - If IniRead($configFile, "search", "DeadActivate", "0") = 1 Then - GUICtrlSetState($chkDeadActivate, $GUI_CHECKED) - Else - GUICtrlSetState($chkDeadActivate, $GUI_UNCHECKED) - EndIf - If IniRead($configFile, "search", "AnyActivate", "0") = 1 Then - GUICtrlSetState($chkAnyActivate, $GUI_CHECKED) - Else - GUICtrlSetState($chkAnyActivate, $GUI_UNCHECKED) - EndIf - GUICtrlSetData($txtDeadMinGold, IniRead($configFile, "search", "searchDeadGold", "50000")) - GUICtrlSetData($txtDeadMinElixir, IniRead($configFile, "search", "searchDeadElixir", "50000")) - GUICtrlSetData($txtDeadMinDarkElixir, IniRead($configFile, "search", "searchDeadDark", "0")) - GUICtrlSetData($txtDeadMinTrophy, IniRead($configFile, "search", "searchDeadTrophy", "0")) - GUICtrlSetData($txtMinGold, IniRead($configFile, "search", "searchGold", "80000")) - GUICtrlSetData($txtMinElixir, IniRead($configFile, "search", "searchElixir", "80000")) - GUICtrlSetData($txtMinDarkElixir, IniRead($configFile, "search", "searchDark", "0")) - GUICtrlSetData($txtMinTrophy, IniRead($configFile, "search", "searchTrophy", "0")) - _GUICtrlComboBox_SetCurSel($cmbAny, IniRead($configFile, "search", "AnyAndOr", "0")) - _GUICtrlComboBox_SetCurSel($cmbDead, IniRead($configFile, "search", "DeadAndOr", "0")) - - - If IniRead($configFile, "search", "conditionDeadKingAvail", "0") = 1 Then - GUICtrlSetState($chkDeadKingAvail, $GUI_CHECKED) - Else - GUICtrlSetState($chkDeadKingAvail, $GUI_UNCHECKED) - EndIf - - If IniRead($configFile, "search", "conditionDeadQueenAvail", "0") = 1 Then - GUICtrlSetState($chkDeadQueenAvail, $GUI_CHECKED) - Else - GUICtrlSetState($chkDeadQueenAvail, $GUI_UNCHECKED) - EndIf - - If IniRead($configFile, "search", "conditionDeadGoldElixir", "0") = 1 Then - GUICtrlSetState($chkDeadGE, $GUI_CHECKED) - Else - GUICtrlSetState($chkDeadGE, $GUI_UNCHECKED) - EndIf - - If IniRead($configFile, "search", "conditionDeadDark", "0") = 1 Then - GUICtrlSetState($chkDeadMeetDE, $GUI_CHECKED) - Else - GUICtrlSetState($chkDeadMeetDE, $GUI_UNCHECKED) - EndIf - - If IniRead($configFile, "search", "conditionDeadTrophy", "0") = 1 Then - GUICtrlSetState($chkDeadMeetTrophy, $GUI_CHECKED) - Else - GUICtrlSetState($chkDeadMeetTrophy, $GUI_UNCHECKED) - EndIf - - If IniRead($configFile, "search", "conditionDeadTHLevel", "0") = 1 Then - GUICtrlSetState($chkDeadMeetTH, $GUI_CHECKED) - Else - GUICtrlSetState($chkDeadMeetTH, $GUI_UNCHECKED) - EndIf - - If IniRead($configFile, "search", "conditionDeadTHOutside", "0") = 1 Then - GUICtrlSetState($chkDeadMeetTHO, $GUI_CHECKED) - Else - GUICtrlSetState($chkDeadMeetTHO, $GUI_UNCHECKED) - EndIf - - If IniRead($configFile, "search", "conditionKingAvail", "0") = 1 Then - GUICtrlSetState($chkKingAvail, $GUI_CHECKED) - Else - GUICtrlSetState($chkKingAvail, $GUI_UNCHECKED) - EndIf - - If IniRead($configFile, "search", "conditionQueenAvail", "0") = 1 Then - GUICtrlSetState($chkQueenAvail, $GUI_CHECKED) - Else - GUICtrlSetState($chkQueenAvail, $GUI_UNCHECKED) - EndIf - - If IniRead($configFile, "search", "conditionGoldElixir", "0") = 1 Then - GUICtrlSetState($chkMeetGE, $GUI_CHECKED) - Else - GUICtrlSetState($chkMeetGE, $GUI_UNCHECKED) - EndIf - - If IniRead($configFile, "search", "conditionDark", "0") = 1 Then - GUICtrlSetState($chkMeetDE, $GUI_CHECKED) - Else - GUICtrlSetState($chkMeetDE, $GUI_UNCHECKED) - EndIf - - If IniRead($configFile, "search", "conditionTrophy", "0") = 1 Then - GUICtrlSetState($chkMeetTrophy, $GUI_CHECKED) - Else - GUICtrlSetState($chkMeetTrophy, $GUI_UNCHECKED) - EndIf - - If IniRead($configFile, "search", "conditionTHLevel", "0") = 1 Then - GUICtrlSetState($chkMeetTH, $GUI_CHECKED) - Else - GUICtrlSetState($chkMeetTH, $GUI_UNCHECKED) - EndIf - - If IniRead($configFile, "search", "conditionTHOutside", "0") = 1 Then - GUICtrlSetState($chkMeetTHO, $GUI_CHECKED) - Else - GUICtrlSetState($chkMeetTHO, $GUI_UNCHECKED) - EndIf - - If IniRead($configFile, "search", "conditionDeadSnipe", "0") = 1 Then - GUICtrlSetState($chkDeadSnipe, $GUI_CHECKED) - Else - GUICtrlSetState($chkDeadSnipe, $GUI_UNCHECKED) - EndIf - - If IniRead($configFile, "search", "conditionSnipe", "0") = 1 Then - GUICtrlSetState($chkSnipe, $GUI_CHECKED) - Else - GUICtrlSetState($chkSnipe, $GUI_UNCHECKED) - EndIf - - _GUICtrlComboBox_SetCurSel($cmbTH, IniRead($configFile, "search", "AnyTHLvl", "0")) - _GUICtrlComboBox_SetCurSel($cmbDeadTH, IniRead($configFile, "search", "DeadTHLvl", "0")) - - 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")) - - If IniRead($configFile, "attack", "king-dead", "0") = 1 Then - GUICtrlSetState($chkDeadUseKing, $GUI_CHECKED) - Else - GUICtrlSetState($chkDeadUseKing, $GUI_UNCHECKED) - EndIf - - If IniRead($configFile, "attack", "queen-dead", "0") = 1 Then - GUICtrlSetState($chkDeadUseQueen, $GUI_CHECKED) - Else - GUICtrlSetState($chkDeadUseQueen, $GUI_UNCHECKED) - EndIf - - If IniRead($configFile, "attack", "use-cc-dead", "0") = 1 Then - GUICtrlSetState($chkDeadUseClanCastle, $GUI_CHECKED) - Else - GUICtrlSetState($chkDeadUseClanCastle, $GUI_UNCHECKED) - EndIf - - _GUICtrlComboBox_SetCurSel($cmbDeadAttackTH, IniRead($configFile, "attack", "townhall-dead", "0")) - - _GUICtrlComboBox_SetCurSel($cmbDeploy, IniRead($configFile, "attack", "deploy", "0")) - _GUICtrlComboBox_SetCurSel($cmbAlgorithm, IniRead($configFile, "attack", "algorithm", "0")) - - If IniRead($configFile, "attack", "king-all", "0") = 1 Then - GUICtrlSetState($chkUseKing, $GUI_CHECKED) - Else - GUICtrlSetState($chkUseKing, $GUI_UNCHECKED) - EndIf - - If IniRead($configFile, "attack", "queen-all", "0") = 1 Then - GUICtrlSetState($chkUseQueen, $GUI_CHECKED) - Else - GUICtrlSetState($chkUseQueen, $GUI_UNCHECKED) - EndIf - - If IniRead($configFile, "attack", "use-cc", "0") = 1 Then - GUICtrlSetState($chkUseClanCastle, $GUI_CHECKED) - Else - GUICtrlSetState($chkUseClanCastle, $GUI_UNCHECKED) - EndIf - - _GUICtrlComboBox_SetCurSel($cmbAttackTH, IniRead($configFile, "attack", "townhall", "0")) - - GUICtrlSetData($txtKingSkill, IniRead($configFile, "attack", "kingskilldelay", "10")) - GUICtrlSetData($txtQueenSkill, IniRead($configFile, "attack", "queenskilldelay", "10")) - - ;Troop Settings-------------------------------------------------------------------------- - _GUICtrlComboBox_SetCurSel($cmbTroopComp, IniRead($configFile, "troop", "composition", "0")) - _GUICtrlComboBox_SetCurSel($cmbRaidcap, IniRead($configFile, "troop", "raidcapacity", "9")) - GUICtrlSetData($txtBarbarians, IniRead($configFile, "troop", "barbarian", "0")) - GUICtrlSetData($txtArchers, IniRead($configFile, "troop", "archer", "0")) - GUICtrlSetData($txtNumGiants, IniRead($configFile, "troop", "giant", "0")) - GUICtrlSetData($txtGoblins, IniRead($configFile, "troop", "goblin", "0")) - GUICtrlSetData($txtNumWallbreakers, IniRead($configFile, "troop", "WB", "0")) - Standard_SetComboTroopComp() - - _GUICtrlComboBox_SetCurSel($cmbBarrack1, IniRead($configFile, "troop", "troop1", "0")) - _GUICtrlComboBox_SetCurSel($cmbBarrack2, IniRead($configFile, "troop", "troop2", "0")) - _GUICtrlComboBox_SetCurSel($cmbBarrack3, IniRead($configFile, "troop", "troop3", "0")) - _GUICtrlComboBox_SetCurSel($cmbBarrack4, IniRead($configFile, "troop", "troop4", "0")) - ;Dark Troops--------------------------------------------- -;~ _GUICtrlComboBox_SetCurSel($cmbDarkBarrack1, $DarkBarrackTroop[0]) -;~ _GUICtrlComboBox_SetCurSel($cmbDarkBarrack2, $DarkBarrackTroop[1]) -;~ GUICtrlSetData($txtDarkBarrack1, IniRead($configFile, "other", "DarkRax1", "0")) -;~ GUICtrlSetData($txtDarkBarrack2, IniRead($configFile, "other", "DarkRax2", "0")) - - ;Spell Settings-------------------------------------------------------------------------- - If IniRead($configFile, "spells", "chkMakeSpells", "0") = 1 Then - GUICtrlSetState($chkMakeSpells, $GUI_CHECKED) - GUICtrlSetState($cmbSpellCreate, $GUI_ENABLE) - GUICtrlSetState($txtDENukeLimit, $GUI_ENABLE) - GUICtrlSetState($txtSpellNumber, $GUI_ENABLE) - GUICtrlSetState($chkNukeAttacking, $GUI_ENABLE) - GUICtrlSetState($chkNukeOnly, $GUI_ENABLE) - GUICtrlSetState($chkNukeOnlyWithFullArmy, $GUI_ENABLE) - Else - GUICtrlSetState($chkMakeSpells, $GUI_UNCHECKED) - GUICtrlSetState($cmbSpellCreate, $GUI_DISABLE) - GUICtrlSetState($txtDENukeLimit, $GUI_DISABLE) - GUICtrlSetState($txtSpellNumber, $GUI_DISABLE) - GUICtrlSetState($chkNukeAttacking, $GUI_DISABLE) - GUICtrlSetState($chkNukeOnly, $GUI_DISABLE) - GUICtrlSetState($chkNukeOnlyWithFullArmy, $GUI_DISABLE) - EndIf - _GUICtrlComboBox_SetCurSel($cmbSpellCreate, IniRead($configFile, "spells", "spellname", "0")) - GUICtrlSetData($txtDENukeLimit, IniRead($configFile, "spells", "nukelimit", "2000")) - GUICtrlSetData($txtSpellNumber, IniRead($configFile, "spells", "spellnumber", "3")) - If IniRead($configFile, "spells", "chkNukeAttacking", "0") = 1 Then - GUICtrlSetState($chkNukeAttacking, $GUI_CHECKED) - GUICtrlSetState($txtSpellNumber, $GUI_ENABLE) - Else - GUICtrlSetState($chkNukeAttacking, $GUI_UNCHECKED) - GUICtrlSetState($txtSpellNumber, $GUI_DISABLE) - EndIf - If IniRead($configFile, "spells", "chkNukeOnly", "0") = 1 Then - GUICtrlSetState($chkNukeOnly, $GUI_CHECKED) - Else - GUICtrlSetState($chkNukeOnly, $GUI_UNCHECKED) - EndIf - If IniRead($configFile, "spells", "chkNukeOnlyWithFullArmy", "0") = 1 Then - GUICtrlSetState($chkNukeOnlyWithFullArmy, $GUI_CHECKED) - Else - GUICtrlSetState($chkNukeOnlyWithFullArmy, $GUI_UNCHECKED) - EndIf - -EndFunc ;==>Standard_LoadConfig - -Func Standard_SaveConfig($configFile) - IniWrite($configFile, "plugin", "name", "Standard") - ;Search Settings------------------------------------------------------------------------ - If IsChecked($chkDeadActivate) Then - IniWrite($configFile, "search", "DeadActivate", 1) - Else - IniWrite($configFile, "search", "DeadActivate", 0) - EndIf - If IsChecked($chkAnyActivate) Then - IniWrite($configFile, "search", "AnyActivate", 1) - Else - IniWrite($configFile, "search", "AnyActivate", 0) - EndIf - IniWrite($configFile, "search", "searchDeadGold", GUICtrlRead($txtDeadMinGold)) - IniWrite($configFile, "search", "searchDeadElixir", GUICtrlRead($txtDeadMinElixir)) - IniWrite($configFile, "search", "searchDeadDark", GUICtrlRead($txtDeadMinDarkElixir)) - IniWrite($configFile, "search", "searchDeadTrophy", GUICtrlRead($txtDeadMinTrophy)) - IniWrite($configFile, "search", "searchGold", GUICtrlRead($txtMinGold)) - IniWrite($configFile, "search", "searchElixir", GUICtrlRead($txtMinElixir)) - IniWrite($configFile, "search", "searchDark", GUICtrlRead($txtMinDarkElixir)) - IniWrite($configFile, "search", "searchTrophy", GUICtrlRead($txtMinTrophy)) - IniWrite($configFile, "search", "AnyAndOr", _GUICtrlComboBox_GetCurSel($cmbAny)) - IniWrite($configFile, "search", "DeadAndOr", _GUICtrlComboBox_GetCurSel($cmbDead)) - IniWrite($configFile, "search", "AnyTHLvl", _GUICtrlComboBox_GetCurSel($cmbTH)) - IniWrite($configFile, "search", "DeadTHLvl", _GUICtrlComboBox_GetCurSel($cmbDeadTH)) - - If IsChecked($chkDeadKingAvail) Then - IniWrite($configFile, "search", "conditionDeadKingAvail", 1) - Else - IniWrite($configFile, "search", "conditionDeadKingAvail", 0) - EndIf - - If IsChecked($chkDeadQueenAvail) Then - IniWrite($configFile, "search", "conditionDeadQueenAvail", 1) - Else - IniWrite($configFile, "search", "conditionDeadQueenAvail", 0) - EndIf - - If IsChecked($chkDeadGE) Then - IniWrite($configFile, "search", "conditionDeadGoldElixir", 1) - Else - IniWrite($configFile, "search", "conditionDeadGoldElixir", 0) - EndIf - - If IsChecked($chkDeadMeetDE) Then - IniWrite($configFile, "search", "conditionDeadDark", 1) - Else - IniWrite($configFile, "search", "conditionDeadDark", 0) - EndIf - - If IsChecked($chkDeadMeetTrophy) Then - IniWrite($configFile, "search", "conditionDeadTrophy", 1) - Else - IniWrite($configFile, "search", "conditionDeadTrophy", 0) - EndIf - - If IsChecked($chkDeadMeetTH) Then - IniWrite($configFile, "search", "conditionDeadTHLevel", 1) - Else - IniWrite($configFile, "search", "conditionDeadTHLevel", 0) - EndIf - - If IsChecked($chkDeadMeetTHO) Then - IniWrite($configFile, "search", "conditionDeadTHOutside", 1) - Else - IniWrite($configFile, "search", "conditionDeadTHOutside", 0) - EndIf - - If IsChecked($chkDeadSnipe) Then - IniWrite($configFile, "search", "conditionDeadSnipe", 1) - Else - IniWrite($configFile, "search", "conditionDeadSnipe", 0) - EndIf - - If IsChecked($chkKingAvail) Then - IniWrite($configFile, "search", "conditionKingAvail", 1) - Else - IniWrite($configFile, "search", "conditionKingAvail", 0) - EndIf - - If IsChecked($chkQueenAvail) Then - IniWrite($configFile, "search", "conditionQueenAvail", 1) - Else - IniWrite($configFile, "search", "conditionQueenAvail", 0) - EndIf - - If IsChecked($chkMeetGE) Then - IniWrite($configFile, "search", "conditionGoldElixir", 1) - Else - IniWrite($configFile, "search", "conditionGoldElixir", 0) - EndIf - - If IsChecked($chkMeetDE) Then - IniWrite($configFile, "search", "conditionDark", 1) - Else - IniWrite($configFile, "search", "conditionDark", 0) - EndIf - - If IsChecked($chkMeetTrophy) Then - IniWrite($configFile, "search", "conditionTrophy", 1) - Else - IniWrite($configFile, "search", "conditionTrophy", 0) - EndIf - - If IsChecked($chkMeetTH) Then - IniWrite($configFile, "search", "conditionTHLevel", 1) - Else - IniWrite($configFile, "search", "conditionTHLevel", 0) - EndIf - - If IsChecked($chkMeetTHO) Then - IniWrite($configFile, "search", "conditionTHOutside", 1) - Else - IniWrite($configFile, "search", "conditionTHOutside", 0) - EndIf - - If IsChecked($chkSnipe) Then - IniWrite($configFile, "search", "conditionSnipe", 1) - 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)) - IniWrite($configFile, "attack", "algorithm-dead", _GUICtrlComboBox_GetCurSel($cmbDeadAlgorithm)) - - If IsChecked($chkDeadUseKing) Then - IniWrite($configFile, "attack", "king-dead", 1) - Else - IniWrite($configFile, "attack", "king-dead", 0) - EndIf - - If IsChecked($chkDeadUseQueen) Then - IniWrite($configFile, "attack", "queen-dead", 1) - Else - IniWrite($configFile, "attack", "queen-dead", 0) - EndIf - - If IsChecked($chkDeadUseClanCastle) Then - IniWrite($configFile, "attack", "use-cc-dead", 1) - Else - IniWrite($configFile, "attack", "use-cc-dead", 0) - EndIf - - IniWrite($configFile, "attack", "townhall-dead", _GUICtrlComboBox_GetCurSel($cmbDeadAttackTH)) - - IniWrite($configFile, "attack", "deploy", _GUICtrlComboBox_GetCurSel($cmbDeploy)) - IniWrite($configFile, "attack", "algorithm", _GUICtrlComboBox_GetCurSel($cmbAlgorithm)) - - If IsChecked($chkUseKing) Then - IniWrite($configFile, "attack", "king-all", 1) - Else - IniWrite($configFile, "attack", "king-all", 0) - EndIf - - If IsChecked($chkUseQueen) Then - IniWrite($configFile, "attack", "queen-all", 1) - Else - IniWrite($configFile, "attack", "queen-all", 0) - EndIf - - If IsChecked($chkUseClanCastle) Then - IniWrite($configFile, "attack", "use-cc", 1) - Else - IniWrite($configFile, "attack", "use-cc", 0) - EndIf - - IniWrite($configFile, "attack", "townhall", _GUICtrlComboBox_GetCurSel($cmbAttackTH)) - - IniWrite($configFile, "attack", "kingskilldelay", GUICtrlRead($txtKingSkill)) - IniWrite($configFile, "attack", "queenskilldelay", GUICtrlRead($txtQueenSkill)) - ;Troop Settings-------------------------------------------------------------------------- - IniWrite($configFile, "troop", "raidcapacity", _GUICtrlComboBox_GetCurSel($cmbRaidcap)) - IniWrite($configFile, "troop", "composition", _GUICtrlComboBox_GetCurSel($cmbTroopComp)) - Switch _GUICtrlComboBox_GetCurSel($cmbTroopComp) - Case 3 - If (GUICtrlRead($txtBarbarians) + GUICtrlRead($txtArchers)) <> 100 Then - $newBarb = Round((GUICtrlRead($txtBarbarians) / (GUICtrlRead($txtBarbarians) + GUICtrlRead($txtArchers))) * 100) - $newArch = 100 - $newBarb - GUICtrlSetData($txtBarbarians, $newBarb) - GUICtrlSetData($txtArchers, $newArch) - SetLog(GetLangText("msgAdjustingB") & $newBarb & GetLangText("msgAdjustingA") & $newArch & "%", $COLOR_RED) - EndIf - Case 4 - If (GUICtrlRead($txtBarbarians) + GUICtrlRead($txtArchers) + GUICtrlRead($txtGoblins)) <> 100 Then - $newBarb = Round((GUICtrlRead($txtBarbarians) / (GUICtrlRead($txtBarbarians) + GUICtrlRead($txtArchers) + GUICtrlRead($txtGoblins))) * 100) - $newArch = Round((GUICtrlRead($txtArchers) / (GUICtrlRead($txtBarbarians) + GUICtrlRead($txtArchers) + GUICtrlRead($txtGoblins))) * 100) - $newGob = 100 - $newBarb - $newArch - GUICtrlSetData($txtBarbarians, $newBarb) - GUICtrlSetData($txtArchers, $newArch) - GUICtrlSetData($txtGoblins, $newGob) - SetLog(GetLangText("msgAdjustingB") & $newBarb & GetLangText("msgAdjustingA") & $newArch & GetLangText("msgAdjustingG") & $newGob & "%", $COLOR_RED) - EndIf - Case 5 - If (GUICtrlRead($txtBarbarians) + GUICtrlRead($txtArchers)) <> 100 Then - $newBarb = Round((GUICtrlRead($txtBarbarians) / (GUICtrlRead($txtBarbarians) + GUICtrlRead($txtArchers))) * 100) - $newArch = 100 - $newBarb - GUICtrlSetData($txtBarbarians, $newBarb) - GUICtrlSetData($txtArchers, $newArch) - SetLog(GetLangText("msgAdjustingB") & $newBarb & GetLangText("msgAdjustingA") & $newArch & "%", $COLOR_RED) - EndIf - Case 6 - If (GUICtrlRead($txtBarbarians) + GUICtrlRead($txtArchers) + GUICtrlRead($txtGoblins)) <> 100 Then - $newBarb = Round((GUICtrlRead($txtBarbarians) / (GUICtrlRead($txtBarbarians) + GUICtrlRead($txtArchers) + GUICtrlRead($txtGoblins))) * 100) - $newArch = Round((GUICtrlRead($txtArchers) / (GUICtrlRead($txtBarbarians) + GUICtrlRead($txtArchers) + GUICtrlRead($txtGoblins))) * 100) - $newGob = 100 - $newBarb - $newArch - GUICtrlSetData($txtBarbarians, $newBarb) - GUICtrlSetData($txtArchers, $newArch) - GUICtrlSetData($txtGoblins, $newGob) - SetLog(GetLangText("msgAdjustingB") & $newBarb & GetLangText("msgAdjustingA") & $newArch & GetLangText("msgAdjustingG") & $newGob & "%", $COLOR_RED) - EndIf - Case 7 - If (GUICtrlRead($txtBarbarians) + GUICtrlRead($txtArchers) + GUICtrlRead($txtGoblins)) <> 100 Then - $newBarb = Round((GUICtrlRead($txtBarbarians) / (GUICtrlRead($txtBarbarians) + GUICtrlRead($txtArchers) + GUICtrlRead($txtGoblins))) * 100) - $newArch = Round((GUICtrlRead($txtArchers) / (GUICtrlRead($txtBarbarians) + GUICtrlRead($txtArchers) + GUICtrlRead($txtGoblins))) * 100) - $newGob = 100 - $newBarb - $newArch - GUICtrlSetData($txtBarbarians, $newBarb) - GUICtrlSetData($txtArchers, $newArch) - GUICtrlSetData($txtGoblins, $newGob) - SetLog(GetLangText("msgAdjustingB") & $newBarb & GetLangText("msgAdjustingA") & $newArch & GetLangText("msgAdjustingG") & $newGob & "%", $COLOR_RED) - EndIf - EndSwitch - IniWrite($configFile, "troop", "barbarian", GUICtrlRead($txtBarbarians)) - IniWrite($configFile, "troop", "archer", GUICtrlRead($txtArchers)) - IniWrite($configFile, "troop", "goblin", GUICtrlRead($txtGoblins)) - IniWrite($configFile, "troop", "giant", GUICtrlRead($txtNumGiants)) - IniWrite($configFile, "troop", "WB", GUICtrlRead($txtNumWallbreakers)) - IniWrite($configFile, "troop", "troop1", _GUICtrlComboBox_GetCurSel($cmbBarrack1)) - IniWrite($configFile, "troop", "troop2", _GUICtrlComboBox_GetCurSel($cmbBarrack2)) - IniWrite($configFile, "troop", "troop3", _GUICtrlComboBox_GetCurSel($cmbBarrack3)) - IniWrite($configFile, "troop", "troop4", _GUICtrlComboBox_GetCurSel($cmbBarrack4)) - - ;Dark Barracks -;~ IniWrite($configFile, "other", "Darktroop1", _GUICtrlComboBox_GetCurSel($cmbDarkBarrack1)) -;~ IniWrite($configFile, "other", "Darktroop2", _GUICtrlComboBox_GetCurSel($cmbDarkBarrack2)) -;~ IniWrite($configFile, "other", "DarkRax1", GUICtrlRead($txtDarkBarrack1)) -;~ IniWrite($configFile, "other", "DarkRax2", GUICtrlRead($txtDarkBarrack2)) - - ;Spell Settings-------------------------------------------------------------------------- - If IsChecked($chkMakeSpells) Then - IniWrite($configFile, "spells", "chkMakeSpells", 1) - Else - IniWrite($configFile, "spells", "chkMakeSpells", 0) - EndIf - IniWrite($configFile, "spells", "spellname", _GUICtrlComboBox_GetCurSel($cmbSpellCreate)) - IniWrite($configFile, "spells", "nukelimit", GUICtrlRead($txtDENukeLimit)) - IniWrite($configFile, "spells", "spellnumber", GUICtrlRead($txtSpellNumber)) - If IsChecked($chkNukeAttacking) Then - IniWrite($configFile, "spells", "chkNukeAttacking", 1) - Else - IniWrite($configFile, "spells", "chkNukeAttacking", 0) - EndIf - If IsChecked($chkNukeOnly) Then - IniWrite($configFile, "spells", "chkNukeOnly", 1) - Else - IniWrite($configFile, "spells", "chkNukeOnly", 0) - EndIf - If IsChecked($chkNukeOnlyWithFullArmy) Then - IniWrite($configFile, "spells", "chkNukeOnlyWithFullArmy", 1) - Else - IniWrite($configFile, "spells", "chkNukeOnlyWithFullArmy", 0) - EndIf - -EndFunc ;==>Standard_SaveConfig +Func Standard_LoadConfig() + $configFile = $dirStrat & GUICtrlRead($lstStrategies) & ".ini" + ;Search Settings------------------------------------------------------------------------ + If IniRead($configFile, "search", "DeadActivate", "0") = 1 Then + GUICtrlSetState($chkDeadActivate, $GUI_CHECKED) + Else + GUICtrlSetState($chkDeadActivate, $GUI_UNCHECKED) + EndIf + If IniRead($configFile, "search", "AnyActivate", "0") = 1 Then + GUICtrlSetState($chkAnyActivate, $GUI_CHECKED) + Else + GUICtrlSetState($chkAnyActivate, $GUI_UNCHECKED) + EndIf + GUICtrlSetData($txtDeadMinGold, IniRead($configFile, "search", "searchDeadGold", "50000")) + GUICtrlSetData($txtDeadMinElixir, IniRead($configFile, "search", "searchDeadElixir", "50000")) + GUICtrlSetData($txtDeadMinDarkElixir, IniRead($configFile, "search", "searchDeadDark", "0")) + GUICtrlSetData($txtDeadMinTrophy, IniRead($configFile, "search", "searchDeadTrophy", "0")) + GUICtrlSetData($txtMinGold, IniRead($configFile, "search", "searchGold", "80000")) + GUICtrlSetData($txtMinElixir, IniRead($configFile, "search", "searchElixir", "80000")) + GUICtrlSetData($txtMinDarkElixir, IniRead($configFile, "search", "searchDark", "0")) + GUICtrlSetData($txtMinTrophy, IniRead($configFile, "search", "searchTrophy", "0")) + _GUICtrlComboBox_SetCurSel($cmbAny, IniRead($configFile, "search", "AnyAndOr", "0")) + _GUICtrlComboBox_SetCurSel($cmbDead, IniRead($configFile, "search", "DeadAndOr", "0")) + + + If IniRead($configFile, "search", "conditionDeadKingAvail", "0") = 1 Then + GUICtrlSetState($chkDeadKingAvail, $GUI_CHECKED) + Else + GUICtrlSetState($chkDeadKingAvail, $GUI_UNCHECKED) + EndIf + + If IniRead($configFile, "search", "conditionDeadQueenAvail", "0") = 1 Then + GUICtrlSetState($chkDeadQueenAvail, $GUI_CHECKED) + Else + GUICtrlSetState($chkDeadQueenAvail, $GUI_UNCHECKED) + EndIf + + If IniRead($configFile, "search", "conditionDeadGoldElixir", "0") = 1 Then + GUICtrlSetState($chkDeadGE, $GUI_CHECKED) + Else + GUICtrlSetState($chkDeadGE, $GUI_UNCHECKED) + EndIf + + If IniRead($configFile, "search", "conditionDeadDark", "0") = 1 Then + GUICtrlSetState($chkDeadMeetDE, $GUI_CHECKED) + Else + GUICtrlSetState($chkDeadMeetDE, $GUI_UNCHECKED) + EndIf + + If IniRead($configFile, "search", "conditionDeadTrophy", "0") = 1 Then + GUICtrlSetState($chkDeadMeetTrophy, $GUI_CHECKED) + Else + GUICtrlSetState($chkDeadMeetTrophy, $GUI_UNCHECKED) + EndIf + + If IniRead($configFile, "search", "conditionDeadTHLevel", "0") = 1 Then + GUICtrlSetState($chkDeadMeetTH, $GUI_CHECKED) + Else + GUICtrlSetState($chkDeadMeetTH, $GUI_UNCHECKED) + EndIf + + If IniRead($configFile, "search", "conditionDeadTHOutside", "0") = 1 Then + GUICtrlSetState($chkDeadMeetTHO, $GUI_CHECKED) + Else + GUICtrlSetState($chkDeadMeetTHO, $GUI_UNCHECKED) + EndIf + + If IniRead($configFile, "search", "conditionKingAvail", "0") = 1 Then + GUICtrlSetState($chkKingAvail, $GUI_CHECKED) + Else + GUICtrlSetState($chkKingAvail, $GUI_UNCHECKED) + EndIf + + If IniRead($configFile, "search", "conditionQueenAvail", "0") = 1 Then + GUICtrlSetState($chkQueenAvail, $GUI_CHECKED) + Else + GUICtrlSetState($chkQueenAvail, $GUI_UNCHECKED) + EndIf + + If IniRead($configFile, "search", "conditionGoldElixir", "0") = 1 Then + GUICtrlSetState($chkMeetGE, $GUI_CHECKED) + Else + GUICtrlSetState($chkMeetGE, $GUI_UNCHECKED) + EndIf + + If IniRead($configFile, "search", "conditionDark", "0") = 1 Then + GUICtrlSetState($chkMeetDE, $GUI_CHECKED) + Else + GUICtrlSetState($chkMeetDE, $GUI_UNCHECKED) + EndIf + + If IniRead($configFile, "search", "conditionTrophy", "0") = 1 Then + GUICtrlSetState($chkMeetTrophy, $GUI_CHECKED) + Else + GUICtrlSetState($chkMeetTrophy, $GUI_UNCHECKED) + EndIf + + If IniRead($configFile, "search", "conditionTHLevel", "0") = 1 Then + GUICtrlSetState($chkMeetTH, $GUI_CHECKED) + Else + GUICtrlSetState($chkMeetTH, $GUI_UNCHECKED) + EndIf + + If IniRead($configFile, "search", "conditionTHOutside", "0") = 1 Then + GUICtrlSetState($chkMeetTHO, $GUI_CHECKED) + Else + GUICtrlSetState($chkMeetTHO, $GUI_UNCHECKED) + EndIf + + If IniRead($configFile, "search", "conditionDeadSnipe", "0") = 1 Then + GUICtrlSetState($chkDeadSnipe, $GUI_CHECKED) + Else + GUICtrlSetState($chkDeadSnipe, $GUI_UNCHECKED) + EndIf + + If IniRead($configFile, "search", "conditionSnipe", "0") = 1 Then + GUICtrlSetState($chkSnipe, $GUI_CHECKED) + Else + GUICtrlSetState($chkSnipe, $GUI_UNCHECKED) + EndIf + + _GUICtrlComboBox_SetCurSel($cmbTH, IniRead($configFile, "search", "AnyTHLvl", "0")) + _GUICtrlComboBox_SetCurSel($cmbDeadTH, IniRead($configFile, "search", "DeadTHLvl", "0")) + + 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")) + + If IniRead($configFile, "attack", "king-dead", "0") = 1 Then + GUICtrlSetState($chkDeadUseKing, $GUI_CHECKED) + Else + GUICtrlSetState($chkDeadUseKing, $GUI_UNCHECKED) + EndIf + + If IniRead($configFile, "attack", "queen-dead", "0") = 1 Then + GUICtrlSetState($chkDeadUseQueen, $GUI_CHECKED) + Else + GUICtrlSetState($chkDeadUseQueen, $GUI_UNCHECKED) + EndIf + + If IniRead($configFile, "attack", "use-cc-dead", "0") = 1 Then + GUICtrlSetState($chkDeadUseClanCastle, $GUI_CHECKED) + Else + GUICtrlSetState($chkDeadUseClanCastle, $GUI_UNCHECKED) + EndIf + + _GUICtrlComboBox_SetCurSel($cmbDeadAttackTH, IniRead($configFile, "attack", "townhall-dead", "0")) + + _GUICtrlComboBox_SetCurSel($cmbDeploy, IniRead($configFile, "attack", "deploy", "0")) + _GUICtrlComboBox_SetCurSel($cmbAlgorithm, IniRead($configFile, "attack", "algorithm", "0")) + + If IniRead($configFile, "attack", "king-all", "0") = 1 Then + GUICtrlSetState($chkUseKing, $GUI_CHECKED) + Else + GUICtrlSetState($chkUseKing, $GUI_UNCHECKED) + EndIf + + If IniRead($configFile, "attack", "queen-all", "0") = 1 Then + GUICtrlSetState($chkUseQueen, $GUI_CHECKED) + Else + GUICtrlSetState($chkUseQueen, $GUI_UNCHECKED) + EndIf + + If IniRead($configFile, "attack", "use-cc", "0") = 1 Then + GUICtrlSetState($chkUseClanCastle, $GUI_CHECKED) + Else + GUICtrlSetState($chkUseClanCastle, $GUI_UNCHECKED) + EndIf + + _GUICtrlComboBox_SetCurSel($cmbAttackTH, IniRead($configFile, "attack", "townhall", "0")) + + GUICtrlSetData($txtKingSkill, IniRead($configFile, "attack", "kingskilldelay", "10")) + GUICtrlSetData($txtQueenSkill, IniRead($configFile, "attack", "queenskilldelay", "10")) + + ;Troop Settings-------------------------------------------------------------------------- + _GUICtrlComboBox_SetCurSel($cmbTroopComp, IniRead($configFile, "troop", "composition", "0")) + _GUICtrlComboBox_SetCurSel($cmbRaidcap, IniRead($configFile, "troop", "raidcapacity", "9")) + GUICtrlSetData($txtBarbarians, IniRead($configFile, "troop", "barbarian", "0")) + GUICtrlSetData($txtArchers, IniRead($configFile, "troop", "archer", "0")) + GUICtrlSetData($txtNumGiants, IniRead($configFile, "troop", "giant", "0")) + GUICtrlSetData($txtGoblins, IniRead($configFile, "troop", "goblin", "0")) + GUICtrlSetData($txtNumWallbreakers, IniRead($configFile, "troop", "WB", "0")) + Standard_SetComboTroopComp() + + _GUICtrlComboBox_SetCurSel($cmbBarrack1, IniRead($configFile, "troop", "troop1", "0")) + _GUICtrlComboBox_SetCurSel($cmbBarrack2, IniRead($configFile, "troop", "troop2", "0")) + _GUICtrlComboBox_SetCurSel($cmbBarrack3, IniRead($configFile, "troop", "troop3", "0")) + _GUICtrlComboBox_SetCurSel($cmbBarrack4, IniRead($configFile, "troop", "troop4", "0")) + ;Dark Troops--------------------------------------------- + ;_GUICtrlComboBox_SetCurSel($cmbDarkBarrack1, $DarkBarrackTroop[0]) + ;_GUICtrlComboBox_SetCurSel($cmbDarkBarrack2, $DarkBarrackTroop[1]) + _GUICtrlComboBox_SetCurSel($cmbDarkBarrack1, IniRead($configFile, "other", "Darktroop1", "0")) + _GUICtrlComboBox_SetCurSel($cmbDarkBarrack2, IniRead($configFile, "other", "Darktroop2", "0")) + GUICtrlSetData($txtDarkBarrack1, IniRead($configFile, "other", "DarkRax1", "0")) + GUICtrlSetData($txtDarkBarrack2, IniRead($configFile, "other", "DarkRax2", "0")) + + $DarkBarrackTroop[0] = _GUICtrlComboBox_GetCurSel($cmbDarkBarrack1) + $DarkBarrackTroop[1] = _GUICtrlComboBox_GetCurSel($cmbDarkBarrack2) + + _GUICtrlComboBox_SetCurSel($cmbDarkBarrack1Next, IniRead($configFile, "other", "Darktroop1Next", "0")) + _GUICtrlComboBox_SetCurSel($cmbDarkBarrack2Next, IniRead($configFile, "other", "Darktroop2Next", "0")) + GUICtrlSetData($txtDarkBarrack1Next, IniRead($configFile, "other", "DarkRax1Next", "0")) + GUICtrlSetData($txtDarkBarrack2Next, IniRead($configFile, "other", "DarkRax2Next", "0")) + + ;Spell Settings-------------------------------------------------------------------------- + If IniRead($configFile, "spells", "chkMakeSpells", "0") = 1 Then + GUICtrlSetState($chkMakeSpells, $GUI_CHECKED) + GUICtrlSetState($cmbSpellCreate, $GUI_ENABLE) + GUICtrlSetState($txtDENukeLimit, $GUI_ENABLE) + GUICtrlSetState($txtSpellNumber, $GUI_ENABLE) + GUICtrlSetState($chkNukeAttacking, $GUI_ENABLE) + GUICtrlSetState($chkNukeOnly, $GUI_ENABLE) + GUICtrlSetState($chkNukeOnlyWithFullArmy, $GUI_ENABLE) + Else + GUICtrlSetState($chkMakeSpells, $GUI_UNCHECKED) + GUICtrlSetState($cmbSpellCreate, $GUI_DISABLE) + GUICtrlSetState($txtDENukeLimit, $GUI_DISABLE) + GUICtrlSetState($txtSpellNumber, $GUI_DISABLE) + GUICtrlSetState($chkNukeAttacking, $GUI_DISABLE) + GUICtrlSetState($chkNukeOnly, $GUI_DISABLE) + GUICtrlSetState($chkNukeOnlyWithFullArmy, $GUI_DISABLE) + EndIf + _GUICtrlComboBox_SetCurSel($cmbSpellCreate, IniRead($configFile, "spells", "spellname", "0")) + GUICtrlSetData($txtDENukeLimit, IniRead($configFile, "spells", "nukelimit", "2000")) + GUICtrlSetData($txtSpellNumber, IniRead($configFile, "spells", "spellnumber", "3")) + If IniRead($configFile, "spells", "chkNukeAttacking", "0") = 1 Then + GUICtrlSetState($chkNukeAttacking, $GUI_CHECKED) + GUICtrlSetState($txtSpellNumber, $GUI_ENABLE) + Else + GUICtrlSetState($chkNukeAttacking, $GUI_UNCHECKED) + GUICtrlSetState($txtSpellNumber, $GUI_DISABLE) + EndIf + If IniRead($configFile, "spells", "chkNukeOnly", "0") = 1 Then + GUICtrlSetState($chkNukeOnly, $GUI_CHECKED) + Else + GUICtrlSetState($chkNukeOnly, $GUI_UNCHECKED) + EndIf + If IniRead($configFile, "spells", "chkNukeOnlyWithFullArmy", "0") = 1 Then + GUICtrlSetState($chkNukeOnlyWithFullArmy, $GUI_CHECKED) + Else + GUICtrlSetState($chkNukeOnlyWithFullArmy, $GUI_UNCHECKED) + EndIf + +EndFunc ;==>Standard_LoadConfig + +Func Standard_SaveConfig($configFile) + IniWrite($configFile, "plugin", "name", "Standard") + ;Search Settings------------------------------------------------------------------------ + If IsChecked($chkDeadActivate) Then + IniWrite($configFile, "search", "DeadActivate", 1) + Else + IniWrite($configFile, "search", "DeadActivate", 0) + EndIf + If IsChecked($chkAnyActivate) Then + IniWrite($configFile, "search", "AnyActivate", 1) + Else + IniWrite($configFile, "search", "AnyActivate", 0) + EndIf + IniWrite($configFile, "search", "searchDeadGold", GUICtrlRead($txtDeadMinGold)) + IniWrite($configFile, "search", "searchDeadElixir", GUICtrlRead($txtDeadMinElixir)) + IniWrite($configFile, "search", "searchDeadDark", GUICtrlRead($txtDeadMinDarkElixir)) + IniWrite($configFile, "search", "searchDeadTrophy", GUICtrlRead($txtDeadMinTrophy)) + IniWrite($configFile, "search", "searchGold", GUICtrlRead($txtMinGold)) + IniWrite($configFile, "search", "searchElixir", GUICtrlRead($txtMinElixir)) + IniWrite($configFile, "search", "searchDark", GUICtrlRead($txtMinDarkElixir)) + IniWrite($configFile, "search", "searchTrophy", GUICtrlRead($txtMinTrophy)) + IniWrite($configFile, "search", "AnyAndOr", _GUICtrlComboBox_GetCurSel($cmbAny)) + IniWrite($configFile, "search", "DeadAndOr", _GUICtrlComboBox_GetCurSel($cmbDead)) + IniWrite($configFile, "search", "AnyTHLvl", _GUICtrlComboBox_GetCurSel($cmbTH)) + IniWrite($configFile, "search", "DeadTHLvl", _GUICtrlComboBox_GetCurSel($cmbDeadTH)) + + If IsChecked($chkDeadKingAvail) Then + IniWrite($configFile, "search", "conditionDeadKingAvail", 1) + Else + IniWrite($configFile, "search", "conditionDeadKingAvail", 0) + EndIf + + If IsChecked($chkDeadQueenAvail) Then + IniWrite($configFile, "search", "conditionDeadQueenAvail", 1) + Else + IniWrite($configFile, "search", "conditionDeadQueenAvail", 0) + EndIf + + If IsChecked($chkDeadGE) Then + IniWrite($configFile, "search", "conditionDeadGoldElixir", 1) + Else + IniWrite($configFile, "search", "conditionDeadGoldElixir", 0) + EndIf + + If IsChecked($chkDeadMeetDE) Then + IniWrite($configFile, "search", "conditionDeadDark", 1) + Else + IniWrite($configFile, "search", "conditionDeadDark", 0) + EndIf + + If IsChecked($chkDeadMeetTrophy) Then + IniWrite($configFile, "search", "conditionDeadTrophy", 1) + Else + IniWrite($configFile, "search", "conditionDeadTrophy", 0) + EndIf + + If IsChecked($chkDeadMeetTH) Then + IniWrite($configFile, "search", "conditionDeadTHLevel", 1) + Else + IniWrite($configFile, "search", "conditionDeadTHLevel", 0) + EndIf + + If IsChecked($chkDeadMeetTHO) Then + IniWrite($configFile, "search", "conditionDeadTHOutside", 1) + Else + IniWrite($configFile, "search", "conditionDeadTHOutside", 0) + EndIf + + If IsChecked($chkDeadSnipe) Then + IniWrite($configFile, "search", "conditionDeadSnipe", 1) + Else + IniWrite($configFile, "search", "conditionDeadSnipe", 0) + EndIf + + If IsChecked($chkKingAvail) Then + IniWrite($configFile, "search", "conditionKingAvail", 1) + Else + IniWrite($configFile, "search", "conditionKingAvail", 0) + EndIf + + If IsChecked($chkQueenAvail) Then + IniWrite($configFile, "search", "conditionQueenAvail", 1) + Else + IniWrite($configFile, "search", "conditionQueenAvail", 0) + EndIf + + If IsChecked($chkMeetGE) Then + IniWrite($configFile, "search", "conditionGoldElixir", 1) + Else + IniWrite($configFile, "search", "conditionGoldElixir", 0) + EndIf + + If IsChecked($chkMeetDE) Then + IniWrite($configFile, "search", "conditionDark", 1) + Else + IniWrite($configFile, "search", "conditionDark", 0) + EndIf + + If IsChecked($chkMeetTrophy) Then + IniWrite($configFile, "search", "conditionTrophy", 1) + Else + IniWrite($configFile, "search", "conditionTrophy", 0) + EndIf + + If IsChecked($chkMeetTH) Then + IniWrite($configFile, "search", "conditionTHLevel", 1) + Else + IniWrite($configFile, "search", "conditionTHLevel", 0) + EndIf + + If IsChecked($chkMeetTHO) Then + IniWrite($configFile, "search", "conditionTHOutside", 1) + Else + IniWrite($configFile, "search", "conditionTHOutside", 0) + EndIf + + If IsChecked($chkSnipe) Then + IniWrite($configFile, "search", "conditionSnipe", 1) + 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)) + IniWrite($configFile, "attack", "algorithm-dead", _GUICtrlComboBox_GetCurSel($cmbDeadAlgorithm)) + + If IsChecked($chkDeadUseKing) Then + IniWrite($configFile, "attack", "king-dead", 1) + Else + IniWrite($configFile, "attack", "king-dead", 0) + EndIf + + If IsChecked($chkDeadUseQueen) Then + IniWrite($configFile, "attack", "queen-dead", 1) + Else + IniWrite($configFile, "attack", "queen-dead", 0) + EndIf + + If IsChecked($chkDeadUseClanCastle) Then + IniWrite($configFile, "attack", "use-cc-dead", 1) + Else + IniWrite($configFile, "attack", "use-cc-dead", 0) + EndIf + + IniWrite($configFile, "attack", "townhall-dead", _GUICtrlComboBox_GetCurSel($cmbDeadAttackTH)) + + IniWrite($configFile, "attack", "deploy", _GUICtrlComboBox_GetCurSel($cmbDeploy)) + IniWrite($configFile, "attack", "algorithm", _GUICtrlComboBox_GetCurSel($cmbAlgorithm)) + + If IsChecked($chkUseKing) Then + IniWrite($configFile, "attack", "king-all", 1) + Else + IniWrite($configFile, "attack", "king-all", 0) + EndIf + + If IsChecked($chkUseQueen) Then + IniWrite($configFile, "attack", "queen-all", 1) + Else + IniWrite($configFile, "attack", "queen-all", 0) + EndIf + + If IsChecked($chkUseClanCastle) Then + IniWrite($configFile, "attack", "use-cc", 1) + Else + IniWrite($configFile, "attack", "use-cc", 0) + EndIf + + IniWrite($configFile, "attack", "townhall", _GUICtrlComboBox_GetCurSel($cmbAttackTH)) + + IniWrite($configFile, "attack", "kingskilldelay", GUICtrlRead($txtKingSkill)) + IniWrite($configFile, "attack", "queenskilldelay", GUICtrlRead($txtQueenSkill)) + ;Troop Settings-------------------------------------------------------------------------- + IniWrite($configFile, "troop", "raidcapacity", _GUICtrlComboBox_GetCurSel($cmbRaidcap)) + IniWrite($configFile, "troop", "composition", _GUICtrlComboBox_GetCurSel($cmbTroopComp)) + Switch _GUICtrlComboBox_GetCurSel($cmbTroopComp) + Case 3 + If (GUICtrlRead($txtBarbarians) + GUICtrlRead($txtArchers)) <> 100 Then + $newBarb = Round((GUICtrlRead($txtBarbarians) / (GUICtrlRead($txtBarbarians) + GUICtrlRead($txtArchers))) * 100) + $newArch = 100 - $newBarb + GUICtrlSetData($txtBarbarians, $newBarb) + GUICtrlSetData($txtArchers, $newArch) + SetLog(GetLangText("msgAdjustingB") & $newBarb & GetLangText("msgAdjustingA") & $newArch & "%", $COLOR_RED) + EndIf + Case 4 + If (GUICtrlRead($txtBarbarians) + GUICtrlRead($txtArchers) + GUICtrlRead($txtGoblins)) <> 100 Then + $newBarb = Round((GUICtrlRead($txtBarbarians) / (GUICtrlRead($txtBarbarians) + GUICtrlRead($txtArchers) + GUICtrlRead($txtGoblins))) * 100) + $newArch = Round((GUICtrlRead($txtArchers) / (GUICtrlRead($txtBarbarians) + GUICtrlRead($txtArchers) + GUICtrlRead($txtGoblins))) * 100) + $newGob = 100 - $newBarb - $newArch + GUICtrlSetData($txtBarbarians, $newBarb) + GUICtrlSetData($txtArchers, $newArch) + GUICtrlSetData($txtGoblins, $newGob) + SetLog(GetLangText("msgAdjustingB") & $newBarb & GetLangText("msgAdjustingA") & $newArch & GetLangText("msgAdjustingG") & $newGob & "%", $COLOR_RED) + EndIf + Case 5 + If (GUICtrlRead($txtBarbarians) + GUICtrlRead($txtArchers)) <> 100 Then + $newBarb = Round((GUICtrlRead($txtBarbarians) / (GUICtrlRead($txtBarbarians) + GUICtrlRead($txtArchers))) * 100) + $newArch = 100 - $newBarb + GUICtrlSetData($txtBarbarians, $newBarb) + GUICtrlSetData($txtArchers, $newArch) + SetLog(GetLangText("msgAdjustingB") & $newBarb & GetLangText("msgAdjustingA") & $newArch & "%", $COLOR_RED) + EndIf + Case 6 + If (GUICtrlRead($txtBarbarians) + GUICtrlRead($txtArchers) + GUICtrlRead($txtGoblins)) <> 100 Then + $newBarb = Round((GUICtrlRead($txtBarbarians) / (GUICtrlRead($txtBarbarians) + GUICtrlRead($txtArchers) + GUICtrlRead($txtGoblins))) * 100) + $newArch = Round((GUICtrlRead($txtArchers) / (GUICtrlRead($txtBarbarians) + GUICtrlRead($txtArchers) + GUICtrlRead($txtGoblins))) * 100) + $newGob = 100 - $newBarb - $newArch + GUICtrlSetData($txtBarbarians, $newBarb) + GUICtrlSetData($txtArchers, $newArch) + GUICtrlSetData($txtGoblins, $newGob) + SetLog(GetLangText("msgAdjustingB") & $newBarb & GetLangText("msgAdjustingA") & $newArch & GetLangText("msgAdjustingG") & $newGob & "%", $COLOR_RED) + EndIf + Case 7 + If (GUICtrlRead($txtBarbarians) + GUICtrlRead($txtArchers) + GUICtrlRead($txtGoblins)) <> 100 Then + $newBarb = Round((GUICtrlRead($txtBarbarians) / (GUICtrlRead($txtBarbarians) + GUICtrlRead($txtArchers) + GUICtrlRead($txtGoblins))) * 100) + $newArch = Round((GUICtrlRead($txtArchers) / (GUICtrlRead($txtBarbarians) + GUICtrlRead($txtArchers) + GUICtrlRead($txtGoblins))) * 100) + $newGob = 100 - $newBarb - $newArch + GUICtrlSetData($txtBarbarians, $newBarb) + GUICtrlSetData($txtArchers, $newArch) + GUICtrlSetData($txtGoblins, $newGob) + SetLog(GetLangText("msgAdjustingB") & $newBarb & GetLangText("msgAdjustingA") & $newArch & GetLangText("msgAdjustingG") & $newGob & "%", $COLOR_RED) + EndIf + EndSwitch + IniWrite($configFile, "troop", "barbarian", GUICtrlRead($txtBarbarians)) + IniWrite($configFile, "troop", "archer", GUICtrlRead($txtArchers)) + IniWrite($configFile, "troop", "goblin", GUICtrlRead($txtGoblins)) + IniWrite($configFile, "troop", "giant", GUICtrlRead($txtNumGiants)) + IniWrite($configFile, "troop", "WB", GUICtrlRead($txtNumWallbreakers)) + IniWrite($configFile, "troop", "troop1", _GUICtrlComboBox_GetCurSel($cmbBarrack1)) + IniWrite($configFile, "troop", "troop2", _GUICtrlComboBox_GetCurSel($cmbBarrack2)) + IniWrite($configFile, "troop", "troop3", _GUICtrlComboBox_GetCurSel($cmbBarrack3)) + IniWrite($configFile, "troop", "troop4", _GUICtrlComboBox_GetCurSel($cmbBarrack4)) + + ;Dark Barracks + IniWrite($configFile, "other", "Darktroop1", _GUICtrlComboBox_GetCurSel($cmbDarkBarrack1)) + IniWrite($configFile, "other", "Darktroop2", _GUICtrlComboBox_GetCurSel($cmbDarkBarrack2)) + IniWrite($configFile, "other", "DarkRax1", GUICtrlRead($txtDarkBarrack1)) + IniWrite($configFile, "other", "DarkRax2", GUICtrlRead($txtDarkBarrack2)) + + IniWrite($configFile, "other", "Darktroop1Next", _GUICtrlComboBox_GetCurSel($cmbDarkBarrack1Next)) + IniWrite($configFile, "other", "Darktroop2Next", _GUICtrlComboBox_GetCurSel($cmbDarkBarrack2Next)) + IniWrite($configFile, "other", "DarkRax1Next", GUICtrlRead($txtDarkBarrack1Next)) + IniWrite($configFile, "other", "DarkRax2Next", GUICtrlRead($txtDarkBarrack2Next)) + + ;Spell Settings-------------------------------------------------------------------------- + If IsChecked($chkMakeSpells) Then + IniWrite($configFile, "spells", "chkMakeSpells", 1) + Else + IniWrite($configFile, "spells", "chkMakeSpells", 0) + EndIf + IniWrite($configFile, "spells", "spellname", _GUICtrlComboBox_GetCurSel($cmbSpellCreate)) + IniWrite($configFile, "spells", "nukelimit", GUICtrlRead($txtDENukeLimit)) + IniWrite($configFile, "spells", "spellnumber", GUICtrlRead($txtSpellNumber)) + If IsChecked($chkNukeAttacking) Then + IniWrite($configFile, "spells", "chkNukeAttacking", 1) + Else + IniWrite($configFile, "spells", "chkNukeAttacking", 0) + EndIf + If IsChecked($chkNukeOnly) Then + IniWrite($configFile, "spells", "chkNukeOnly", 1) + Else + IniWrite($configFile, "spells", "chkNukeOnly", 0) + EndIf + If IsChecked($chkNukeOnlyWithFullArmy) Then + IniWrite($configFile, "spells", "chkNukeOnlyWithFullArmy", 1) + Else + IniWrite($configFile, "spells", "chkNukeOnlyWithFullArmy", 0) + EndIf + +EndFunc ;==>Standard_SaveConfig diff --git a/COCBot/functions/Strategies/Standard/GUIControl.au3 b/COCBot/functions/Strategies/Standard/GUIControl.au3 index 66e93b3..71f5094 100644 --- a/COCBot/functions/Strategies/Standard/GUIControl.au3 +++ b/COCBot/functions/Strategies/Standard/GUIControl.au3 @@ -1,315 +1,315 @@ -Func Standard_btnSearchMode() - While 1 - GUICtrlSetState($btnStart, $GUI_HIDE) - GUICtrlSetState($btnStop, $GUI_SHOW) - - GUICtrlSetState($btnLocateBarracks, $GUI_DISABLE) - GUICtrlSetState($btnLocateDarkBarracks, $GUI_DISABLE) - GUICtrlSetState($btnSearchMode, $GUI_DISABLE) - GUICtrlSetState($cmbTroopComp, $GUI_DISABLE) - GUICtrlSetState($chkBackground, $GUI_DISABLE) - ;GUICtrlSetState($btnLocateCollectors, $GUI_DISABLE) - - Standard_Search() - - GUICtrlSetState($btnStart, $GUI_SHOW) - GUICtrlSetState($btnStop, $GUI_HIDE) - - GUICtrlSetState($btnLocateBarracks, $GUI_ENABLE) - GUICtrlSetState($btnLocateDarkBarracks, $GUI_ENABLE) - GUICtrlSetState($btnSearchMode, $GUI_ENABLE) - GUICtrlSetState($cmbTroopComp, $GUI_ENABLE) - GUICtrlSetState($chkBackground, $GUI_ENABLE) - ;GUICtrlSetState($btnLocateCollectors, $GUI_ENABLE) - ExitLoop - WEnd -EndFunc ;==>Standard_btnSearchMode - -Func Standard_chkDeadActivate() - If IsChecked($chkDeadActivate) Then - GUICtrlSetState($chkDeadKingAvail, $GUI_ENABLE) - GUICtrlSetState($chkDeadQueenAvail, $GUI_ENABLE) - GUICtrlSetState($chkDeadGE, $GUI_ENABLE) - GUICtrlSetState($txtDeadMinGold, $GUI_ENABLE) - GUICtrlSetState($cmbDead, $GUI_ENABLE) - GUICtrlSetState($txtDeadMinElixir, $GUI_ENABLE) - GUICtrlSetState($chkDeadMeetDE, $GUI_ENABLE) - GUICtrlSetState($txtDeadMinDarkElixir, $GUI_ENABLE) - GUICtrlSetState($chkDeadMeetTrophy, $GUI_ENABLE) - GUICtrlSetState($txtDeadMinTrophy, $GUI_ENABLE) - GUICtrlSetState($chkDeadMeetTH, $GUI_ENABLE) - GUICtrlSetState($cmbDeadTH, $GUI_ENABLE) - GUICtrlSetState($chkDeadMeetTHO, $GUI_ENABLE) - GUICtrlSetState($chkDeadSnipe, $GUI_ENABLE) - GUICtrlSetState($btnSearchMode, $GUI_ENABLE) - Else - GUICtrlSetState($chkDeadKingAvail, $GUI_DISABLE) - GUICtrlSetState($chkDeadQueenAvail, $GUI_DISABLE) - GUICtrlSetState($chkDeadGE, $GUI_DISABLE) - GUICtrlSetState($txtDeadMinGold, $GUI_DISABLE) - GUICtrlSetState($cmbDead, $GUI_DISABLE) - GUICtrlSetState($txtDeadMinElixir, $GUI_DISABLE) - GUICtrlSetState($chkDeadMeetDE, $GUI_DISABLE) - GUICtrlSetState($txtDeadMinDarkElixir, $GUI_DISABLE) - GUICtrlSetState($chkDeadMeetTrophy, $GUI_DISABLE) - GUICtrlSetState($txtDeadMinTrophy, $GUI_DISABLE) - GUICtrlSetState($chkDeadMeetTH, $GUI_DISABLE) - GUICtrlSetState($cmbDeadTH, $GUI_DISABLE) - GUICtrlSetState($chkDeadMeetTHO, $GUI_DISABLE) - GUICtrlSetState($chkDeadSnipe, $GUI_DISABLE) - If Not IsChecked($chkAnyActivate) Then - GUICtrlSetState($btnSearchMode, $GUI_DISABLE) - EndIf - EndIf -EndFunc ;==>Standard_chkDeadActivate - -Func Standard_chkAnyActivate() - If IsChecked($chkAnyActivate) Then - GUICtrlSetState($chkKingAvail, $GUI_ENABLE) - GUICtrlSetState($chkQueenAvail, $GUI_ENABLE) - GUICtrlSetState($chkMeetGE, $GUI_ENABLE) - GUICtrlSetState($txtMinGold, $GUI_ENABLE) - GUICtrlSetState($cmbAny, $GUI_ENABLE) - GUICtrlSetState($txtMinElixir, $GUI_ENABLE) - GUICtrlSetState($chkMeetDE, $GUI_ENABLE) - GUICtrlSetState($txtMinDarkElixir, $GUI_ENABLE) - GUICtrlSetState($chkMeetTrophy, $GUI_ENABLE) - GUICtrlSetState($txtMinTrophy, $GUI_ENABLE) - GUICtrlSetState($chkMeetTH, $GUI_ENABLE) - GUICtrlSetState($cmbTH, $GUI_ENABLE) - GUICtrlSetState($chkMeetTHO, $GUI_ENABLE) - GUICtrlSetState($chkSnipe, $GUI_ENABLE) - GUICtrlSetState($btnSearchMode, $GUI_ENABLE) - Else - GUICtrlSetState($chkKingAvail, $GUI_DISABLE) - GUICtrlSetState($chkQueenAvail, $GUI_DISABLE) - GUICtrlSetState($chkMeetGE, $GUI_DISABLE) - GUICtrlSetState($txtMinGold, $GUI_DISABLE) - GUICtrlSetState($cmbAny, $GUI_DISABLE) - GUICtrlSetState($txtMinElixir, $GUI_DISABLE) - GUICtrlSetState($chkMeetDE, $GUI_DISABLE) - GUICtrlSetState($txtMinDarkElixir, $GUI_DISABLE) - GUICtrlSetState($chkMeetTrophy, $GUI_DISABLE) - GUICtrlSetState($txtMinTrophy, $GUI_DISABLE) - GUICtrlSetState($chkMeetTH, $GUI_DISABLE) - GUICtrlSetState($cmbTH, $GUI_DISABLE) - GUICtrlSetState($chkSnipe, $GUI_DISABLE) - GUICtrlSetState($chkMeetTHO, $GUI_DISABLE) - If Not IsChecked($chkDeadActivate) Then - GUICtrlSetState($btnSearchMode, $GUI_DISABLE) - EndIf - EndIf -EndFunc ;==>Standard_chkAnyActivate - -Func Standard_chkMakeSpells() - If IsChecked($chkMakeSpells) Then - GUICtrlSetState($cmbSpellCreate, $GUI_ENABLE) - GUICtrlSetState($txtDENukeLimit, $GUI_ENABLE) - GUICtrlSetState($txtSpellNumber, $GUI_ENABLE) - GUICtrlSetState($chkNukeAttacking, $GUI_ENABLE) - GUICtrlSetState($chkNukeOnly, $GUI_ENABLE) - GUICtrlSetState($chkNukeOnlyWithFullArmy, $GUI_ENABLE) - Else - GUICtrlSetState($cmbSpellCreate, $GUI_DISABLE) - GUICtrlSetState($txtDENukeLimit, $GUI_DISABLE) - GUICtrlSetState($txtSpellNumber, $GUI_DISABLE) - GUICtrlSetState($chkNukeAttacking, $GUI_DISABLE) - GUICtrlSetState($chkNukeOnly, $GUI_DISABLE) - GUICtrlSetState($chkNukeOnlyWithFullArmy, $GUI_DISABLE) - EndIf -EndFunc ;==>Standard_chkMakeSpells - -Func Standard_chkNukeAttacking() - If IsChecked($chkNukeAttacking) Then - GUICtrlSetState($txtSpellNumber, $GUI_ENABLE) - Else - GUICtrlSetState($txtSpellNumber, $GUI_DISABLE) - EndIf -EndFunc ;==>Standard_chkNukeAttacking - -Func Standard_cmbSpellCreate() - If _GUICtrlComboBox_GetCurSel($cmbSpellCreate) <> 0 Then - GUICtrlSetState($txtDENukeLimit, $GUI_DISABLE) - GUICtrlSetState($txtSpellNumber, $GUI_DISABLE) - GUICtrlSetState($chkNukeAttacking, $GUI_DISABLE + $GUI_UNCHECKED) - GUICtrlSetState($chkNukeOnly, $GUI_DISABLE + $GUI_UNCHECKED) - GUICtrlSetState($chkNukeOnlyWithFullArmy, $GUI_DISABLE + $GUI_UNCHECKED) - Else - GUICtrlSetState($txtDENukeLimit, $GUI_ENABLE) - GUICtrlSetState($txtSpellNumber, $GUI_ENABLE) - GUICtrlSetState($chkNukeAttacking, $GUI_ENABLE) - GUICtrlSetState($chkNukeOnly, $GUI_ENABLE) - GUICtrlSetState($chkNukeOnlyWithFullArmy, $GUI_ENABLE) - EndIf -EndFunc ;==>Standard_cmbSpellCreate - -Func Standard_cmbTroopComp() - If _GUICtrlComboBox_GetCurSel($cmbTroopComp) <> $prevTroopComp Then - $prevTroopComp = _GUICtrlComboBox_GetCurSel($cmbTroopComp) - $ArmyComp = 0 - $CurArch = 1 - $CurBarb = 1 - $CurGoblin = 1 - $CurGiant = 1 - $CurWB = 1 - Standard_SetComboTroopComp() - _GUICtrlComboBox_SetCurSel($cmbAlgorithm, $prevTroopComp) - _GUICtrlComboBox_SetCurSel($cmbDeadAlgorithm, $prevTroopComp) - EndIf -EndFunc ;==>Standard_cmbTroopComp - -Func Standard_SetComboTroopComp() - Local $BarbariansComp = GUICtrlRead($txtBarbarians) - Local $ArchersComp = GUICtrlRead($txtArchers) - Local $GoblinsComp = GUICtrlRead($txtGoblins) - Local $GiantsComp = GUICtrlRead($txtNumGiants) - Local $WBComp = GUICtrlRead($txtNumWallbreakers) - Switch _GUICtrlComboBox_GetCurSel($cmbTroopComp) - Case 0 - GUICtrlSetState($cmbBarrack1, $GUI_DISABLE) - GUICtrlSetState($cmbBarrack2, $GUI_DISABLE) - GUICtrlSetState($cmbBarrack3, $GUI_DISABLE) - GUICtrlSetState($cmbBarrack4, $GUI_DISABLE) - GUICtrlSetState($txtBarbarians, $GUI_DISABLE) - GUICtrlSetState($txtArchers, $GUI_DISABLE) - GUICtrlSetState($txtGoblins, $GUI_DISABLE) - GUICtrlSetState($txtNumGiants, $GUI_DISABLE) - GUICtrlSetState($txtNumWallbreakers, $GUI_DISABLE) - GUICtrlSetData($txtBarbarians, "0") - GUICtrlSetData($txtArchers, "100") - GUICtrlSetData($txtGoblins, "0") - GUICtrlSetData($txtNumGiants, "0") - GUICtrlSetData($txtNumWallbreakers, "0") - Case 1 - GUICtrlSetState($cmbBarrack1, $GUI_DISABLE) - GUICtrlSetState($cmbBarrack2, $GUI_DISABLE) - GUICtrlSetState($cmbBarrack3, $GUI_DISABLE) - GUICtrlSetState($cmbBarrack4, $GUI_DISABLE) - GUICtrlSetState($txtBarbarians, $GUI_DISABLE) - GUICtrlSetState($txtArchers, $GUI_DISABLE) - GUICtrlSetState($txtGoblins, $GUI_DISABLE) - GUICtrlSetState($txtNumGiants, $GUI_DISABLE) - GUICtrlSetState($txtNumWallbreakers, $GUI_DISABLE) - GUICtrlSetData($txtBarbarians, "100") - GUICtrlSetData($txtArchers, "0") - GUICtrlSetData($txtGoblins, "0") - GUICtrlSetData($txtNumGiants, "0") - GUICtrlSetData($txtNumWallbreakers, "0") - Case 2 - GUICtrlSetState($cmbBarrack1, $GUI_DISABLE) - GUICtrlSetState($cmbBarrack2, $GUI_DISABLE) - GUICtrlSetState($cmbBarrack3, $GUI_DISABLE) - GUICtrlSetState($cmbBarrack4, $GUI_DISABLE) - GUICtrlSetState($txtBarbarians, $GUI_DISABLE) - GUICtrlSetState($txtArchers, $GUI_DISABLE) - GUICtrlSetState($txtGoblins, $GUI_DISABLE) - GUICtrlSetState($txtNumGiants, $GUI_DISABLE) - GUICtrlSetState($txtNumWallbreakers, $GUI_DISABLE) - GUICtrlSetData($txtBarbarians, "0") - GUICtrlSetData($txtArchers, "0") - GUICtrlSetData($txtGoblins, "100") - GUICtrlSetData($txtNumGiants, "0") - GUICtrlSetData($txtNumWallbreakers, "0") - Case 3 - GUICtrlSetState($cmbBarrack1, $GUI_DISABLE) - GUICtrlSetState($cmbBarrack2, $GUI_DISABLE) - GUICtrlSetState($cmbBarrack3, $GUI_DISABLE) - GUICtrlSetState($cmbBarrack4, $GUI_DISABLE) - GUICtrlSetState($txtBarbarians, $GUI_ENABLE) - GUICtrlSetState($txtArchers, $GUI_ENABLE) - GUICtrlSetState($txtGoblins, $GUI_DISABLE) - GUICtrlSetState($txtNumGiants, $GUI_DISABLE) - GUICtrlSetState($txtNumWallbreakers, $GUI_DISABLE) - GUICtrlSetData($txtBarbarians, $BarbariansComp) - GUICtrlSetData($txtArchers, $ArchersComp) - GUICtrlSetData($txtGoblins, "0") - GUICtrlSetData($txtNumGiants, "0") - GUICtrlSetData($txtNumWallbreakers, "0") - Case 4 - GUICtrlSetState($cmbBarrack1, $GUI_DISABLE) - GUICtrlSetState($cmbBarrack2, $GUI_DISABLE) - GUICtrlSetState($cmbBarrack3, $GUI_DISABLE) - GUICtrlSetState($cmbBarrack4, $GUI_DISABLE) - GUICtrlSetState($txtBarbarians, $GUI_ENABLE) - GUICtrlSetState($txtArchers, $GUI_ENABLE) - GUICtrlSetState($txtGoblins, $GUI_ENABLE) - GUICtrlSetState($txtNumGiants, $GUI_ENABLE) - GUICtrlSetState($txtNumWallbreakers, $GUI_DISABLE) - GUICtrlSetData($txtBarbarians, $BarbariansComp) - GUICtrlSetData($txtArchers, $ArchersComp) - GUICtrlSetData($txtGoblins, $GoblinsComp) - GUICtrlSetData($txtNumGiants, $GiantsComp) - GUICtrlSetData($txtNumWallbreakers, "0") - Case 5 - GUICtrlSetState($cmbBarrack1, $GUI_DISABLE) - GUICtrlSetState($cmbBarrack2, $GUI_DISABLE) - GUICtrlSetState($cmbBarrack3, $GUI_DISABLE) - GUICtrlSetState($cmbBarrack4, $GUI_DISABLE) - GUICtrlSetState($txtBarbarians, $GUI_ENABLE) - GUICtrlSetState($txtArchers, $GUI_ENABLE) - GUICtrlSetState($txtGoblins, $GUI_DISABLE) - GUICtrlSetState($txtNumGiants, $GUI_ENABLE) - GUICtrlSetState($txtNumWallbreakers, $GUI_DISABLE) - GUICtrlSetData($txtBarbarians, $BarbariansComp) - GUICtrlSetData($txtArchers, $ArchersComp) - GUICtrlSetData($txtGoblins, "0") - GUICtrlSetData($txtNumGiants, $GiantsComp) - GUICtrlSetData($txtNumWallbreakers, "0") - Case 6 - GUICtrlSetState($cmbBarrack1, $GUI_DISABLE) - GUICtrlSetState($cmbBarrack2, $GUI_DISABLE) - GUICtrlSetState($cmbBarrack3, $GUI_DISABLE) - GUICtrlSetState($cmbBarrack4, $GUI_DISABLE) - GUICtrlSetState($txtBarbarians, $GUI_ENABLE) - GUICtrlSetState($txtArchers, $GUI_ENABLE) - GUICtrlSetState($txtGoblins, $GUI_ENABLE) - GUICtrlSetState($txtNumGiants, $GUI_DISABLE) - GUICtrlSetState($txtNumWallbreakers, $GUI_DISABLE) - GUICtrlSetData($txtBarbarians, $BarbariansComp) - GUICtrlSetData($txtArchers, $ArchersComp) - GUICtrlSetData($txtGoblins, $GoblinsComp) - GUICtrlSetData($txtNumGiants, "0") - GUICtrlSetData($txtNumWallbreakers, "0") - Case 7 - GUICtrlSetState($cmbBarrack1, $GUI_DISABLE) - GUICtrlSetState($cmbBarrack2, $GUI_DISABLE) - GUICtrlSetState($cmbBarrack3, $GUI_DISABLE) - GUICtrlSetState($cmbBarrack4, $GUI_DISABLE) - GUICtrlSetState($txtBarbarians, $GUI_ENABLE) - GUICtrlSetState($txtArchers, $GUI_ENABLE) - GUICtrlSetState($txtGoblins, $GUI_ENABLE) - GUICtrlSetState($txtNumGiants, $GUI_ENABLE) - GUICtrlSetState($txtNumWallbreakers, $GUI_ENABLE) - GUICtrlSetData($txtBarbarians, $BarbariansComp) - GUICtrlSetData($txtArchers, $ArchersComp) - GUICtrlSetData($txtGoblins, $GoblinsComp) - GUICtrlSetData($txtNumGiants, $GiantsComp) - GUICtrlSetData($txtNumWallbreakers, $WBComp) - Case 8 - GUICtrlSetState($cmbBarrack1, $GUI_ENABLE) - GUICtrlSetState($cmbBarrack2, $GUI_ENABLE) - GUICtrlSetState($cmbBarrack3, $GUI_ENABLE) - GUICtrlSetState($cmbBarrack4, $GUI_ENABLE) - GUICtrlSetState($txtBarbarians, $GUI_DISABLE) - GUICtrlSetState($txtArchers, $GUI_DISABLE) - GUICtrlSetState($txtGoblins, $GUI_DISABLE) - GUICtrlSetState($txtNumGiants, $GUI_DISABLE) - GUICtrlSetState($txtNumWallbreakers, $GUI_DISABLE) - Case 9 - GUICtrlSetState($cmbBarrack1, $GUI_DISABLE) - GUICtrlSetState($cmbBarrack2, $GUI_DISABLE) - GUICtrlSetState($cmbBarrack3, $GUI_DISABLE) - GUICtrlSetState($cmbBarrack4, $GUI_DISABLE) - GUICtrlSetState($txtBarbarians, $GUI_ENABLE) - GUICtrlSetState($txtArchers, $GUI_ENABLE) - GUICtrlSetState($txtGoblins, $GUI_ENABLE) - GUICtrlSetState($txtNumGiants, $GUI_ENABLE) - GUICtrlSetState($txtNumWallbreakers, $GUI_ENABLE) - GUICtrlSetData($txtBarbarians, $BarbariansComp) - GUICtrlSetData($txtArchers, $ArchersComp) - GUICtrlSetData($txtGoblins, $GoblinsComp) - GUICtrlSetData($txtNumGiants, $GiantsComp) - GUICtrlSetData($txtNumWallbreakers, $WBComp) - EndSwitch -EndFunc ;==>Standard_SetComboTroopComp - +Func Standard_btnSearchMode() + While 1 + GUICtrlSetState($btnStart, $GUI_HIDE) + GUICtrlSetState($btnStop, $GUI_SHOW) + + GUICtrlSetState($btnLocateBarracks, $GUI_DISABLE) + GUICtrlSetState($btnLocateDarkBarracks, $GUI_DISABLE) + GUICtrlSetState($btnSearchMode, $GUI_DISABLE) + GUICtrlSetState($cmbTroopComp, $GUI_DISABLE) + GUICtrlSetState($chkBackground, $GUI_DISABLE) + ;GUICtrlSetState($btnLocateCollectors, $GUI_DISABLE) + + Standard_Search() + + GUICtrlSetState($btnStart, $GUI_SHOW) + GUICtrlSetState($btnStop, $GUI_HIDE) + + GUICtrlSetState($btnLocateBarracks, $GUI_ENABLE) + GUICtrlSetState($btnLocateDarkBarracks, $GUI_ENABLE) + GUICtrlSetState($btnSearchMode, $GUI_ENABLE) + GUICtrlSetState($cmbTroopComp, $GUI_ENABLE) + GUICtrlSetState($chkBackground, $GUI_ENABLE) + ;GUICtrlSetState($btnLocateCollectors, $GUI_ENABLE) + ExitLoop + WEnd +EndFunc ;==>Standard_btnSearchMode + +Func Standard_chkDeadActivate() + If IsChecked($chkDeadActivate) Then + GUICtrlSetState($chkDeadKingAvail, $GUI_ENABLE) + GUICtrlSetState($chkDeadQueenAvail, $GUI_ENABLE) + GUICtrlSetState($chkDeadGE, $GUI_ENABLE) + GUICtrlSetState($txtDeadMinGold, $GUI_ENABLE) + GUICtrlSetState($cmbDead, $GUI_ENABLE) + GUICtrlSetState($txtDeadMinElixir, $GUI_ENABLE) + GUICtrlSetState($chkDeadMeetDE, $GUI_ENABLE) + GUICtrlSetState($txtDeadMinDarkElixir, $GUI_ENABLE) + GUICtrlSetState($chkDeadMeetTrophy, $GUI_ENABLE) + GUICtrlSetState($txtDeadMinTrophy, $GUI_ENABLE) + GUICtrlSetState($chkDeadMeetTH, $GUI_ENABLE) + GUICtrlSetState($cmbDeadTH, $GUI_ENABLE) + GUICtrlSetState($chkDeadMeetTHO, $GUI_ENABLE) + GUICtrlSetState($chkDeadSnipe, $GUI_ENABLE) + GUICtrlSetState($btnSearchMode, $GUI_ENABLE) + Else + GUICtrlSetState($chkDeadKingAvail, $GUI_DISABLE) + GUICtrlSetState($chkDeadQueenAvail, $GUI_DISABLE) + GUICtrlSetState($chkDeadGE, $GUI_DISABLE) + GUICtrlSetState($txtDeadMinGold, $GUI_DISABLE) + GUICtrlSetState($cmbDead, $GUI_DISABLE) + GUICtrlSetState($txtDeadMinElixir, $GUI_DISABLE) + GUICtrlSetState($chkDeadMeetDE, $GUI_DISABLE) + GUICtrlSetState($txtDeadMinDarkElixir, $GUI_DISABLE) + GUICtrlSetState($chkDeadMeetTrophy, $GUI_DISABLE) + GUICtrlSetState($txtDeadMinTrophy, $GUI_DISABLE) + GUICtrlSetState($chkDeadMeetTH, $GUI_DISABLE) + GUICtrlSetState($cmbDeadTH, $GUI_DISABLE) + GUICtrlSetState($chkDeadMeetTHO, $GUI_DISABLE) + GUICtrlSetState($chkDeadSnipe, $GUI_DISABLE) + If Not IsChecked($chkAnyActivate) Then + GUICtrlSetState($btnSearchMode, $GUI_DISABLE) + EndIf + EndIf +EndFunc ;==>Standard_chkDeadActivate + +Func Standard_chkAnyActivate() + If IsChecked($chkAnyActivate) Then + GUICtrlSetState($chkKingAvail, $GUI_ENABLE) + GUICtrlSetState($chkQueenAvail, $GUI_ENABLE) + GUICtrlSetState($chkMeetGE, $GUI_ENABLE) + GUICtrlSetState($txtMinGold, $GUI_ENABLE) + GUICtrlSetState($cmbAny, $GUI_ENABLE) + GUICtrlSetState($txtMinElixir, $GUI_ENABLE) + GUICtrlSetState($chkMeetDE, $GUI_ENABLE) + GUICtrlSetState($txtMinDarkElixir, $GUI_ENABLE) + GUICtrlSetState($chkMeetTrophy, $GUI_ENABLE) + GUICtrlSetState($txtMinTrophy, $GUI_ENABLE) + GUICtrlSetState($chkMeetTH, $GUI_ENABLE) + GUICtrlSetState($cmbTH, $GUI_ENABLE) + GUICtrlSetState($chkMeetTHO, $GUI_ENABLE) + GUICtrlSetState($chkSnipe, $GUI_ENABLE) + GUICtrlSetState($btnSearchMode, $GUI_ENABLE) + Else + GUICtrlSetState($chkKingAvail, $GUI_DISABLE) + GUICtrlSetState($chkQueenAvail, $GUI_DISABLE) + GUICtrlSetState($chkMeetGE, $GUI_DISABLE) + GUICtrlSetState($txtMinGold, $GUI_DISABLE) + GUICtrlSetState($cmbAny, $GUI_DISABLE) + GUICtrlSetState($txtMinElixir, $GUI_DISABLE) + GUICtrlSetState($chkMeetDE, $GUI_DISABLE) + GUICtrlSetState($txtMinDarkElixir, $GUI_DISABLE) + GUICtrlSetState($chkMeetTrophy, $GUI_DISABLE) + GUICtrlSetState($txtMinTrophy, $GUI_DISABLE) + GUICtrlSetState($chkMeetTH, $GUI_DISABLE) + GUICtrlSetState($cmbTH, $GUI_DISABLE) + GUICtrlSetState($chkSnipe, $GUI_DISABLE) + GUICtrlSetState($chkMeetTHO, $GUI_DISABLE) + If Not IsChecked($chkDeadActivate) Then + GUICtrlSetState($btnSearchMode, $GUI_DISABLE) + EndIf + EndIf +EndFunc ;==>Standard_chkAnyActivate + +Func Standard_chkMakeSpells() + If IsChecked($chkMakeSpells) Then + GUICtrlSetState($cmbSpellCreate, $GUI_ENABLE) + GUICtrlSetState($txtDENukeLimit, $GUI_ENABLE) + GUICtrlSetState($txtSpellNumber, $GUI_ENABLE) + GUICtrlSetState($chkNukeAttacking, $GUI_ENABLE) + GUICtrlSetState($chkNukeOnly, $GUI_ENABLE) + GUICtrlSetState($chkNukeOnlyWithFullArmy, $GUI_ENABLE) + Else + GUICtrlSetState($cmbSpellCreate, $GUI_DISABLE) + GUICtrlSetState($txtDENukeLimit, $GUI_DISABLE) + GUICtrlSetState($txtSpellNumber, $GUI_DISABLE) + GUICtrlSetState($chkNukeAttacking, $GUI_DISABLE) + GUICtrlSetState($chkNukeOnly, $GUI_DISABLE) + GUICtrlSetState($chkNukeOnlyWithFullArmy, $GUI_DISABLE) + EndIf +EndFunc ;==>Standard_chkMakeSpells + +Func Standard_chkNukeAttacking() + If IsChecked($chkNukeAttacking) Then + GUICtrlSetState($txtSpellNumber, $GUI_ENABLE) + Else + GUICtrlSetState($txtSpellNumber, $GUI_DISABLE) + EndIf +EndFunc ;==>Standard_chkNukeAttacking + +Func Standard_cmbSpellCreate() + If _GUICtrlComboBox_GetCurSel($cmbSpellCreate) <> 0 Then + GUICtrlSetState($txtDENukeLimit, $GUI_DISABLE) + GUICtrlSetState($txtSpellNumber, $GUI_DISABLE) + GUICtrlSetState($chkNukeAttacking, $GUI_DISABLE + $GUI_UNCHECKED) + GUICtrlSetState($chkNukeOnly, $GUI_DISABLE + $GUI_UNCHECKED) + GUICtrlSetState($chkNukeOnlyWithFullArmy, $GUI_DISABLE + $GUI_UNCHECKED) + Else + GUICtrlSetState($txtDENukeLimit, $GUI_ENABLE) + GUICtrlSetState($txtSpellNumber, $GUI_ENABLE) + GUICtrlSetState($chkNukeAttacking, $GUI_ENABLE) + GUICtrlSetState($chkNukeOnly, $GUI_ENABLE) + GUICtrlSetState($chkNukeOnlyWithFullArmy, $GUI_ENABLE) + EndIf +EndFunc ;==>Standard_cmbSpellCreate + +Func Standard_cmbTroopComp() + If _GUICtrlComboBox_GetCurSel($cmbTroopComp) <> $prevTroopComp Then + $prevTroopComp = _GUICtrlComboBox_GetCurSel($cmbTroopComp) + $ArmyComp = 0 + $CurArch = 1 + $CurBarb = 1 + $CurGoblin = 1 + $CurGiant = 1 + $CurWB = 1 + Standard_SetComboTroopComp() + _GUICtrlComboBox_SetCurSel($cmbAlgorithm, $prevTroopComp) + _GUICtrlComboBox_SetCurSel($cmbDeadAlgorithm, $prevTroopComp) + EndIf +EndFunc ;==>Standard_cmbTroopComp + +Func Standard_SetComboTroopComp() + Local $BarbariansComp = GUICtrlRead($txtBarbarians) + Local $ArchersComp = GUICtrlRead($txtArchers) + Local $GoblinsComp = GUICtrlRead($txtGoblins) + Local $GiantsComp = GUICtrlRead($txtNumGiants) + Local $WBComp = GUICtrlRead($txtNumWallbreakers) + Switch _GUICtrlComboBox_GetCurSel($cmbTroopComp) + Case 0 + GUICtrlSetState($cmbBarrack1, $GUI_DISABLE) + GUICtrlSetState($cmbBarrack2, $GUI_DISABLE) + GUICtrlSetState($cmbBarrack3, $GUI_DISABLE) + GUICtrlSetState($cmbBarrack4, $GUI_DISABLE) + GUICtrlSetState($txtBarbarians, $GUI_DISABLE) + GUICtrlSetState($txtArchers, $GUI_DISABLE) + GUICtrlSetState($txtGoblins, $GUI_DISABLE) + GUICtrlSetState($txtNumGiants, $GUI_DISABLE) + GUICtrlSetState($txtNumWallbreakers, $GUI_DISABLE) + GUICtrlSetData($txtBarbarians, "0") + GUICtrlSetData($txtArchers, "100") + GUICtrlSetData($txtGoblins, "0") + GUICtrlSetData($txtNumGiants, "0") + GUICtrlSetData($txtNumWallbreakers, "0") + Case 1 + GUICtrlSetState($cmbBarrack1, $GUI_DISABLE) + GUICtrlSetState($cmbBarrack2, $GUI_DISABLE) + GUICtrlSetState($cmbBarrack3, $GUI_DISABLE) + GUICtrlSetState($cmbBarrack4, $GUI_DISABLE) + GUICtrlSetState($txtBarbarians, $GUI_DISABLE) + GUICtrlSetState($txtArchers, $GUI_DISABLE) + GUICtrlSetState($txtGoblins, $GUI_DISABLE) + GUICtrlSetState($txtNumGiants, $GUI_DISABLE) + GUICtrlSetState($txtNumWallbreakers, $GUI_DISABLE) + GUICtrlSetData($txtBarbarians, "100") + GUICtrlSetData($txtArchers, "0") + GUICtrlSetData($txtGoblins, "0") + GUICtrlSetData($txtNumGiants, "0") + GUICtrlSetData($txtNumWallbreakers, "0") + Case 2 + GUICtrlSetState($cmbBarrack1, $GUI_DISABLE) + GUICtrlSetState($cmbBarrack2, $GUI_DISABLE) + GUICtrlSetState($cmbBarrack3, $GUI_DISABLE) + GUICtrlSetState($cmbBarrack4, $GUI_DISABLE) + GUICtrlSetState($txtBarbarians, $GUI_DISABLE) + GUICtrlSetState($txtArchers, $GUI_DISABLE) + GUICtrlSetState($txtGoblins, $GUI_DISABLE) + GUICtrlSetState($txtNumGiants, $GUI_DISABLE) + GUICtrlSetState($txtNumWallbreakers, $GUI_DISABLE) + GUICtrlSetData($txtBarbarians, "0") + GUICtrlSetData($txtArchers, "0") + GUICtrlSetData($txtGoblins, "100") + GUICtrlSetData($txtNumGiants, "0") + GUICtrlSetData($txtNumWallbreakers, "0") + Case 3 + GUICtrlSetState($cmbBarrack1, $GUI_DISABLE) + GUICtrlSetState($cmbBarrack2, $GUI_DISABLE) + GUICtrlSetState($cmbBarrack3, $GUI_DISABLE) + GUICtrlSetState($cmbBarrack4, $GUI_DISABLE) + GUICtrlSetState($txtBarbarians, $GUI_ENABLE) + GUICtrlSetState($txtArchers, $GUI_ENABLE) + GUICtrlSetState($txtGoblins, $GUI_DISABLE) + GUICtrlSetState($txtNumGiants, $GUI_DISABLE) + GUICtrlSetState($txtNumWallbreakers, $GUI_DISABLE) + GUICtrlSetData($txtBarbarians, $BarbariansComp) + GUICtrlSetData($txtArchers, $ArchersComp) + GUICtrlSetData($txtGoblins, "0") + GUICtrlSetData($txtNumGiants, "0") + GUICtrlSetData($txtNumWallbreakers, "0") + Case 4 + GUICtrlSetState($cmbBarrack1, $GUI_DISABLE) + GUICtrlSetState($cmbBarrack2, $GUI_DISABLE) + GUICtrlSetState($cmbBarrack3, $GUI_DISABLE) + GUICtrlSetState($cmbBarrack4, $GUI_DISABLE) + GUICtrlSetState($txtBarbarians, $GUI_ENABLE) + GUICtrlSetState($txtArchers, $GUI_ENABLE) + GUICtrlSetState($txtGoblins, $GUI_ENABLE) + GUICtrlSetState($txtNumGiants, $GUI_ENABLE) + GUICtrlSetState($txtNumWallbreakers, $GUI_DISABLE) + GUICtrlSetData($txtBarbarians, $BarbariansComp) + GUICtrlSetData($txtArchers, $ArchersComp) + GUICtrlSetData($txtGoblins, $GoblinsComp) + GUICtrlSetData($txtNumGiants, $GiantsComp) + GUICtrlSetData($txtNumWallbreakers, "0") + Case 5 + GUICtrlSetState($cmbBarrack1, $GUI_DISABLE) + GUICtrlSetState($cmbBarrack2, $GUI_DISABLE) + GUICtrlSetState($cmbBarrack3, $GUI_DISABLE) + GUICtrlSetState($cmbBarrack4, $GUI_DISABLE) + GUICtrlSetState($txtBarbarians, $GUI_ENABLE) + GUICtrlSetState($txtArchers, $GUI_ENABLE) + GUICtrlSetState($txtGoblins, $GUI_DISABLE) + GUICtrlSetState($txtNumGiants, $GUI_ENABLE) + GUICtrlSetState($txtNumWallbreakers, $GUI_DISABLE) + GUICtrlSetData($txtBarbarians, $BarbariansComp) + GUICtrlSetData($txtArchers, $ArchersComp) + GUICtrlSetData($txtGoblins, "0") + GUICtrlSetData($txtNumGiants, $GiantsComp) + GUICtrlSetData($txtNumWallbreakers, "0") + Case 6 + GUICtrlSetState($cmbBarrack1, $GUI_DISABLE) + GUICtrlSetState($cmbBarrack2, $GUI_DISABLE) + GUICtrlSetState($cmbBarrack3, $GUI_DISABLE) + GUICtrlSetState($cmbBarrack4, $GUI_DISABLE) + GUICtrlSetState($txtBarbarians, $GUI_ENABLE) + GUICtrlSetState($txtArchers, $GUI_ENABLE) + GUICtrlSetState($txtGoblins, $GUI_ENABLE) + GUICtrlSetState($txtNumGiants, $GUI_DISABLE) + GUICtrlSetState($txtNumWallbreakers, $GUI_DISABLE) + GUICtrlSetData($txtBarbarians, $BarbariansComp) + GUICtrlSetData($txtArchers, $ArchersComp) + GUICtrlSetData($txtGoblins, $GoblinsComp) + GUICtrlSetData($txtNumGiants, "0") + GUICtrlSetData($txtNumWallbreakers, "0") + Case 7 + GUICtrlSetState($cmbBarrack1, $GUI_DISABLE) + GUICtrlSetState($cmbBarrack2, $GUI_DISABLE) + GUICtrlSetState($cmbBarrack3, $GUI_DISABLE) + GUICtrlSetState($cmbBarrack4, $GUI_DISABLE) + GUICtrlSetState($txtBarbarians, $GUI_ENABLE) + GUICtrlSetState($txtArchers, $GUI_ENABLE) + GUICtrlSetState($txtGoblins, $GUI_ENABLE) + GUICtrlSetState($txtNumGiants, $GUI_ENABLE) + GUICtrlSetState($txtNumWallbreakers, $GUI_ENABLE) + GUICtrlSetData($txtBarbarians, $BarbariansComp) + GUICtrlSetData($txtArchers, $ArchersComp) + GUICtrlSetData($txtGoblins, $GoblinsComp) + GUICtrlSetData($txtNumGiants, $GiantsComp) + GUICtrlSetData($txtNumWallbreakers, $WBComp) + Case 8 + GUICtrlSetState($cmbBarrack1, $GUI_ENABLE) + GUICtrlSetState($cmbBarrack2, $GUI_ENABLE) + GUICtrlSetState($cmbBarrack3, $GUI_ENABLE) + GUICtrlSetState($cmbBarrack4, $GUI_ENABLE) + GUICtrlSetState($txtBarbarians, $GUI_DISABLE) + GUICtrlSetState($txtArchers, $GUI_DISABLE) + GUICtrlSetState($txtGoblins, $GUI_DISABLE) + GUICtrlSetState($txtNumGiants, $GUI_DISABLE) + GUICtrlSetState($txtNumWallbreakers, $GUI_DISABLE) + Case 9 + GUICtrlSetState($cmbBarrack1, $GUI_DISABLE) + GUICtrlSetState($cmbBarrack2, $GUI_DISABLE) + GUICtrlSetState($cmbBarrack3, $GUI_DISABLE) + GUICtrlSetState($cmbBarrack4, $GUI_DISABLE) + GUICtrlSetState($txtBarbarians, $GUI_ENABLE) + GUICtrlSetState($txtArchers, $GUI_ENABLE) + GUICtrlSetState($txtGoblins, $GUI_ENABLE) + GUICtrlSetState($txtNumGiants, $GUI_ENABLE) + GUICtrlSetState($txtNumWallbreakers, $GUI_ENABLE) + GUICtrlSetData($txtBarbarians, $BarbariansComp) + GUICtrlSetData($txtArchers, $ArchersComp) + GUICtrlSetData($txtGoblins, $GoblinsComp) + GUICtrlSetData($txtNumGiants, $GiantsComp) + GUICtrlSetData($txtNumWallbreakers, $WBComp) + EndSwitch +EndFunc ;==>Standard_SetComboTroopComp + diff --git a/COCBot/functions/Strategies/Standard/GUIDesign.au3 b/COCBot/functions/Strategies/Standard/GUIDesign.au3 index 4b825f6..f0beb60 100644 --- a/COCBot/functions/Strategies/Standard/GUIDesign.au3 +++ b/COCBot/functions/Strategies/Standard/GUIDesign.au3 @@ -1,332 +1,338 @@ -Func Standard_LoadGUI() - ; Required prior to making new tabs - $frmAttackConfig = GUICreate("Attack config panel", 410, 410, -1, -1, $WS_BORDER + $WS_POPUP, $WS_EX_MDICHILD, $frmBot) - Opt('GUIResizeMode', 802) - GUISetState(@SW_HIDE, $frmAttackConfig) - _WinMoved(0, 0, 0, 0) - GUISwitch($frmAttackConfig) - - $tabStrat = GUICtrlCreateTab(10, 10, 415, 550) - ; --------------------------------------------------------------------------- - $pageSearch = GUICtrlCreateTabItem(GetLangText("pageSearch")) - $DeadConditions = GUICtrlCreateGroup(GetLangText("DeadConditions"), 18, 40, 397, 135) - Global $chkDeadActivate = GUICtrlCreateCheckbox(GetLangText("chkActivate"), 30, 60, 90, 17) - GUICtrlSetOnEvent($chkDeadActivate, "Standard_chkDeadActivate") - GUICtrlSetTip(-1, GetLangText("lblDeadConditions")) - ;$lblDeadConditions = GUICtrlCreateLabel(GetLangText("lblDeadConditions"), 120, 60, 380, 20) - Global $chkDeadKingAvail = GUICtrlCreateCheckbox(GetLangText("chkKingAvail"), 130, 60, 120, 17) - Global $chkDeadQueenAvail = GUICtrlCreateCheckbox(GetLangText("chkQueenAvail"), 260, 60, 120, 17) - Global $chkDeadGE = GUICtrlCreateCheckbox(GetLangText("chkMeetGE"), 30, 83, 100, 17) - $lblDeadMinGold = GUICtrlCreateLabel(GetLangText("lblMinGold"), 140, 85, 28, 17) - Global $txtDeadMinGold = GUICtrlCreateInput("50000", 170, 80, 50, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER)) - GUICtrlSetLimit(-1, 6) - Global $cmbDead = GUICtrlCreateCombo("", 240, 80, 45, 21, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) - GUICtrlSetData(-1, GetLangText("cmbAndOr"), GetLangText("cmbAnd")) - $lblDeadMinElixir = GUICtrlCreateLabel(GetLangText("lblMinElixir"), 300, 85, 28, 17) - Global $txtDeadMinElixir = GUICtrlCreateInput("50000", 330, 80, 50, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER)) - GUICtrlSetLimit(-1, 6) - Global $chkDeadMeetDE = GUICtrlCreateCheckbox(GetLangText("chkMeetDE"), 30, 113, 95, 17) - Global $txtDeadMinDarkElixir = GUICtrlCreateInput("0", 130, 110, 60, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER)) - GUICtrlSetLimit(-1, 6) - Global $chkDeadMeetTrophy = GUICtrlCreateCheckbox(GetLangText("chkMeetTrophy"), 225, 113, 95, 17) - Global $txtDeadMinTrophy = GUICtrlCreateInput("0", 325, 110, 60, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER)) - GUICtrlSetLimit(-1, 2) - Global $chkDeadMeetTH = GUICtrlCreateCheckbox(GetLangText("chkMeetTH"), 30, 143, 95, 17) - Global $cmbDeadTH = GUICtrlCreateCombo("", 130, 140, 60, 21, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) - GUICtrlSetData(-1, "4-6|7|8|9|10", "4-6") - Global $chkDeadMeetTHO = GUICtrlCreateCheckbox(GetLangText("chkMeetTHO"), 225, 143, 70, 17) - GUICtrlSetTip(-1, GetLangText("chkMeetTHOTip")) - Global $chkDeadSnipe = GUICtrlCreateCheckbox(GetLangText("chkSnipe"), 315, 143, 50, 17) - GUICtrlSetTip(-1, GetLangText("chkSnipeTip")) - GUICtrlSetState($chkDeadGE, $GUI_DISABLE) - GUICtrlSetState($txtDeadMinGold, $GUI_DISABLE) - GUICtrlSetState($cmbDead, $GUI_DISABLE) - GUICtrlSetState($txtDeadMinElixir, $GUI_DISABLE) - GUICtrlSetState($chkDeadMeetDE, $GUI_DISABLE) - GUICtrlSetState($txtDeadMinDarkElixir, $GUI_DISABLE) - GUICtrlSetState($chkDeadMeetTrophy, $GUI_DISABLE) - GUICtrlSetState($txtDeadMinTrophy, $GUI_DISABLE) - GUICtrlSetState($chkDeadMeetTH, $GUI_DISABLE) - GUICtrlSetState($cmbDeadTH, $GUI_DISABLE) - GUICtrlSetState($chkDeadMeetTHO, $GUI_DISABLE) - $AnyConditions = GUICtrlCreateGroup(GetLangText("AnyConditions"), 18, 180, 397, 130) - Global $chkAnyActivate = GUICtrlCreateCheckbox(GetLangText("chkActivate"), 30, 200, 90, 17) - GUICtrlSetOnEvent($chkAnyActivate, "Standard_chkAnyActivate") - GUICtrlSetTip(-1, GetLangText("lblAnyConditions")) - ;$lblAnyConditions = GUICtrlCreateLabel(GetLangText("lblAnyConditions"), 120, 200, 380, 20) - Global $chkKingAvail = GUICtrlCreateCheckbox(GetLangText("chkKingAvail"), 130, 200, 120, 17) - Global $chkQueenAvail = GUICtrlCreateCheckbox(GetLangText("chkQueenAvail"), 260, 200, 120, 17) - Global $chkMeetGE = GUICtrlCreateCheckbox(GetLangText("chkMeetGE"), 30, 223, 100, 17) - GUICtrlSetState(-1, $GUI_CHECKED) - $lblMinGold = GUICtrlCreateLabel(GetLangText("lblMinGold"), 140, 225, 28, 17) - Global $txtMinGold = GUICtrlCreateInput("80000", 170, 220, 50, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER)) - GUICtrlSetLimit(-1, 6) - Global $cmbAny = GUICtrlCreateCombo("", 240, 220, 45, 21, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) - GUICtrlSetData(-1, GetLangText("cmbAndOr"), GetLangText("cmbAnd")) - $lblMinElixir = GUICtrlCreateLabel(GetLangText("lblMinElixir"), 300, 225, 28, 17) - Global $txtMinElixir = GUICtrlCreateInput("80000", 330, 220, 50, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER)) - GUICtrlSetLimit(-1, 6) - Global $chkMeetDE = GUICtrlCreateCheckbox(GetLangText("chkMeetDE"), 30, 253, 95, 17) - Global $txtMinDarkElixir = GUICtrlCreateInput("0", 130, 250, 60, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER)) - GUICtrlSetLimit(-1, 6) - Global $chkMeetTrophy = GUICtrlCreateCheckbox(GetLangText("chkMeetTrophy"), 225, 253, 95, 17) - Global $txtMinTrophy = GUICtrlCreateInput("0", 325, 250, 60, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER)) - GUICtrlSetLimit(-1, 2) - Global $chkMeetTH = GUICtrlCreateCheckbox(GetLangText("chkMeetTH"), 30, 283, 95, 17) - Global $cmbTH = GUICtrlCreateCombo("", 130, 280, 60, 21, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) - GUICtrlSetData(-1, "4-6|7|8|9|10", "4-6") - Global $chkMeetTHO = GUICtrlCreateCheckbox(GetLangText("chkMeetTHO"), 225, 283, 70, 17) - GUICtrlSetTip(-1, GetLangText("chkMeetTHOTip")) - Global $chkSnipe = GUICtrlCreateCheckbox(GetLangText("chkSnipe"), 315, 283, 50, 17) - GUICtrlSetTip(-1, GetLangText("chkSnipeTip")) - GUICtrlSetState($chkMeetGE, $GUI_DISABLE) - GUICtrlSetState($txtMinGold, $GUI_DISABLE) - GUICtrlSetState($cmbAny, $GUI_DISABLE) - GUICtrlSetState($txtMinElixir, $GUI_DISABLE) - GUICtrlSetState($chkMeetDE, $GUI_DISABLE) - GUICtrlSetState($txtMinDarkElixir, $GUI_DISABLE) - GUICtrlSetState($chkMeetTrophy, $GUI_DISABLE) - GUICtrlSetState($txtMinTrophy, $GUI_DISABLE) - 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")) - - $DeadDeploySettings = GUICtrlCreateGroup(GetLangText("DeadDeploySettings"), 15, 40, 390, 123) - Global $cmbDeadDeploy = GUICtrlCreateCombo("", 30, 55, 360, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) - GUICtrlSetData(-1, GetLangText("cmbDeployMethods") & GetLangText("cmbDeployCollectors"), GetLangText("cmbDeployDefault")) - Global $cmbDeadAlgorithm = GUICtrlCreateCombo("", 30, 85, 360, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) - GUICtrlSetData(-1, GetLangText("cmbAlgorithms"), GetLangText("cmbAlgorithmsDefault")) - Global $chkDeadUseKing = GUICtrlCreateCheckbox(GetLangText("chkUseKing"), 30, 115, 150, 17) - Global $chkDeadUseQueen = GUICtrlCreateCheckbox(GetLangText("chkUseQueen"), 200, 115, 105, 17) - Global $chkDeadUseClanCastle = GUICtrlCreateCheckbox(GetLangText("chkUseClanCastle"), 30, 135, 160, 17) - Global $cmbDeadAttackTH = GUICtrlCreateCombo("", 200, 135, 190, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) - GUICtrlSetData(-1, GetLangText("cmbAttackTH")) - GUICtrlCreateGroup("", -99, -99, 1, 1) - - $AnyDeploySettings = GUICtrlCreateGroup(GetLangText("AnyDeploySettings"), 15, 164, 390, 123) - Global $cmbDeploy = GUICtrlCreateCombo("", 30, 182, 360, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) - GUICtrlSetData(-1, GetLangText("cmbDeployMethods") & GetLangText("cmbDeployCollectors"), GetLangText("cmbDeployDefault")) - Global $cmbAlgorithm = GUICtrlCreateCombo("", 30, 212, 360, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) - GUICtrlSetData(-1, GetLangText("cmbAlgorithms"), GetLangText("cmbAlgorithmsDefault")) - Global $chkUseKing = GUICtrlCreateCheckbox(GetLangText("chkUseKing"), 30, 240, 97, 17) - Global $chkUseQueen = GUICtrlCreateCheckbox(GetLangText("chkUseQueen"), 200, 240, 105, 17) - Global $chkUseClanCastle = GUICtrlCreateCheckbox(GetLangText("chkUseClanCastle"), 30, 260, 160, 17) - Global $cmbAttackTH = GUICtrlCreateCombo("", 200, 260, 190, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) - GUICtrlSetData(-1, GetLangText("cmbAttackTH")) - - $HeroAct = GUICtrlCreateGroup(GetLangText("HeroAct"), 15, 288, 390, 73) - $lblKingSkill = GUICtrlCreateLabel(GetLangText("lblKingSkill"), 30, 309, 110, 17) - GUICtrlSetTip(-1, GetLangText("lblKingSkillTip")) - Global $txtKingSkill = GUICtrlCreateInput("10", 140, 304, 31, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER)) - GUICtrlSetLimit(-1, 2) - $lblQueenSkill = GUICtrlCreateLabel(GetLangText("lblQueenSkill"), 30, 334, 110, 17) - GUICtrlSetTip(-1, GetLangText("lblQueenSkillTip")) - $lblheroSkill = GUICtrlCreateLabel(GetLangText("heroSkill"), 191, 304, 160, 20) - $lblheroSkill2 = GUICtrlCreateLabel(GetLangText("heroSkill2"), 191, 334, 180, 20) - Global $txtQueenSkill = GUICtrlCreateInput("10", 140, 329, 31, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER)) - GUICtrlSetLimit(-1, 2) - GUICtrlCreateGroup("", -99, -99, 1, 1) - - - ; --------------------------------------------------------------------------- - $pageTroops = GUICtrlCreateTabItem(GetLangText("pageTroops")) - - $Barracks = GUICtrlCreateGroup(GetLangText("Barracks"), 20, 40, 185, 194) - $lblBarbarians = GUICtrlCreateLabel(GetLangText("troopNamePlBarbarian") & ":", 30, 68, 60, 17) - $lblArchers = GUICtrlCreateLabel(GetLangText("troopNamePlArcher") & ":", 30, 93, 46, 17) - $lblGoblins = GUICtrlCreateLabel(GetLangText("troopNamePlGoblin") & ":", 30, 118, 45, 17) - $lblRaidcap = GUICtrlCreateLabel(GetLangText("lblRaidCap"), 30, 168, 95, 17) - Global $cmbRaidcap = GUICtrlCreateCombo("", 120, 165, 56, 21, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) - GUICtrlSetData(-1, "10|20|30|40|50|60|70|80|90|100", "100") - $lblPercentCapacity = GUICtrlCreateLabel("%", 180, 168, 12, 17) - Global $txtBarbarians = GUICtrlCreateInput("30", 120, 65, 56, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER)) - GUICtrlSetState(-1, $GUI_DISABLE) - Global $txtArchers = GUICtrlCreateInput("60", 120, 90, 56, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER)) - GUICtrlSetState(-1, $GUI_DISABLE) - Global $txtGoblins = GUICtrlCreateInput("10", 120, 115, 56, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER)) - GUICtrlSetState(-1, $GUI_DISABLE) - $lblPercentBarbarians = GUICtrlCreateLabel("%", 180, 68, 12, 17) - $lblPercentArchers = GUICtrlCreateLabel("%", 180, 93, 12, 17) - $lblPercentGoblins = GUICtrlCreateLabel("%", 180, 108, 12, 17) - Global $cmbTroopComp = GUICtrlCreateCombo("", 40, 200, 156, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) - GUICtrlSetData(-1, GetLangText("cmbTroopComp"), GetLangText("cmbTroopCompDefault")) - GUICtrlCreateGroup("", -99, -99, 1, 1) - - $OtherTroops = GUICtrlCreateGroup(GetLangText("OtherTroops"), 210, 40, 185, 70) - $lblGiants = GUICtrlCreateLabel(GetLangText("numberOf") & " " & GetLangText("troopNamePlGiant") & ":", 215, 59, 89, 17) - $lblWallBreakers = GUICtrlCreateLabel(GetLangText("numberOf") & " " & GetLangText("troopNamePlWallBreaker") & ":", 215, 84, 125, 17) - Global $txtNumGiants = GUICtrlCreateInput("4", 340, 56, 46, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER)) - GUICtrlSetState(-1, $GUI_DISABLE) - Global $txtNumWallbreakers = GUICtrlCreateInput("4", 340, 81, 46, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER)) - GUICtrlSetState(-1, $GUI_DISABLE) - - GUICtrlCreateGroup("", -99, -99, 1, 1) - - $BarrackGroup = GUICtrlCreateGroup(GetLangText("BarrackGroup"), 210, 112, 185, 122) - $lblBarrack1 = GUICtrlCreateLabel(GetLangText("chkBoostRax1"), 220, 137, 53, 17) - $lblBarrack2 = GUICtrlCreateLabel(GetLangText("chkBoostRax2"), 220, 162, 53, 17) - $lblBarrack3 = GUICtrlCreateLabel(GetLangText("chkBoostRax3"), 220, 187, 53, 17) - $lblBarrack4 = GUICtrlCreateLabel(GetLangText("chkBoostRax4"), 220, 212, 53, 17) - $cmbBarrackList = GetLangText("troopNamePlBarbarian") & "|" & GetLangText("troopNamePlArcher") & "|" & GetLangText("troopNamePlGiant") & "|" & GetLangText("troopNamePlGoblin") & "|" & GetLangText("troopNamePlWallBreaker") & "|" & GetLangText("troopNamePlBalloon") & GetLangText("cmbTrainingOnly") & "|" & GetLangText("troopNamePlWizard") & GetLangText("cmbTrainingOnly") & "|" & GetLangText("troopNamePlHealer") & GetLangText("cmbTrainingOnly") & "|" & GetLangText("troopNamePlDragon") & GetLangText("cmbTrainingOnly") & "|" & GetLangText("troopNamePlPEKKA") & GetLangText("cmbTrainingOnly") & "|" & GetLangText("cmbNothing") - Global $cmbBarrack1 = GUICtrlCreateCombo("", 275, 130, 110, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) - GUICtrlSetData(-1, $cmbBarrackList, GetLangText("troopNamePlBarbarian")) - Global $cmbBarrack2 = GUICtrlCreateCombo("", 275, 155, 110, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) - GUICtrlSetData(-1, $cmbBarrackList, GetLangText("troopNamePlBarbarian")) - Global $cmbBarrack3 = GUICtrlCreateCombo("", 275, 180, 110, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) - GUICtrlSetData(-1, $cmbBarrackList, GetLangText("troopNamePlBarbarian")) - Global $cmbBarrack4 = GUICtrlCreateCombo("", 275, 205, 110, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) - GUICtrlSetData(-1, $cmbBarrackList, GetLangText("troopNamePlBarbarian")) - GUICtrlCreateGroup("", -99, -99, 1, 1) - - $BarrackCTGroup = GUICtrlCreateGroup(GetLangText("BarrackCTGroup"), 20, 234, 375, 121) - $lblBarrackJOE1 = GUICtrlCreateLabel(GetLangText("chkBoostRax1"), 30, 253, 53, 17) - $lblBarrackJOE2 = GUICtrlCreateLabel(GetLangText("chkBoostRax2"), 30, 278, 53, 17) - $lblBarrackJOE3 = GUICtrlCreateLabel(GetLangText("chkBoostRax3"), 30, 303, 53, 17) - $lblBarrackJOE4 = GUICtrlCreateLabel(GetLangText("chkBoostRax4"), 30, 328, 53, 17) - $lblBarrackBK1 = GUICtrlCreateLabel(GetLangText("lblBarrackBK1"), 237, 253, 35, 17) - $lblBarrackBK2 = GUICtrlCreateLabel(GetLangText("lblBarrackBK1"), 237, 278, 35, 17) - $lblBarrackBK3 = GUICtrlCreateLabel(GetLangText("lblBarrackBK1"), 237, 303, 35, 17) - $lblBarrackBK4 = GUICtrlCreateLabel(GetLangText("lblBarrackBK1"), 237, 328, 35, 17) - - Global $txtBarrackJOE1 = GUICtrlCreateInput("2", 90, 250, 31, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER)) - GUICtrlSetLimit(-1, 2) - GUICtrlSetState(-1, $GUI_DISABLE) - Global $txtBarrackJOE2 = GUICtrlCreateInput("2", 90, 275, 31, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER)) - GUICtrlSetLimit(-1, 2) - GUICtrlSetState(-1, $GUI_DISABLE) - Global $txtBarrackJOE3 = GUICtrlCreateInput("2", 90, 300, 31, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER)) - GUICtrlSetLimit(-1, 2) - GUICtrlSetState(-1, $GUI_DISABLE) - Global $txtBarrackJOE4 = GUICtrlCreateInput("2", 90, 325, 31, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER)) - GUICtrlSetLimit(-1, 2) - GUICtrlSetState(-1, $GUI_DISABLE) - - $cmbBarrackShortList = GetLangText("troopNamePlBarbarian") & "|" & GetLangText("troopNamePlArcher") & "|" & GetLangText("troopNamePlGiant") & "|" & GetLangText("troopNamePlGoblin") & "|" & GetLangText("troopNamePlWallBreaker") & "|" & GetLangText("cmbNothing") - Global $cmbBarrackFT1 = GUICtrlCreateCombo("", 130, 250, 95, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) - GUICtrlSetData(-1, $cmbBarrackShortList, GetLangText("troopNamePlBarbarian")) - GUICtrlSetState(-1, $GUI_DISABLE) - Global $cmbBarrackFT2 = GUICtrlCreateCombo("", 130, 275, 95, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) - GUICtrlSetData(-1, $cmbBarrackShortList, GetLangText("troopNamePlBarbarian")) - GUICtrlSetState(-1, $GUI_DISABLE) - Global $cmbBarrackFT3 = GUICtrlCreateCombo("", 130, 300, 95, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) - GUICtrlSetData(-1, $cmbBarrackShortList, GetLangText("troopNamePlBarbarian")) - GUICtrlSetState(-1, $GUI_DISABLE) - Global $cmbBarrackFT4 = GUICtrlCreateCombo("", 130, 325, 95, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) - GUICtrlSetData(-1, $cmbBarrackShortList, GetLangText("troopNamePlBarbarian")) - GUICtrlSetState(-1, $GUI_DISABLE) - - Global $cmbBarrackBK1 = GUICtrlCreateCombo("", 285, 250, 95, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) - GUICtrlSetData(-1, $cmbBarrackShortList, GetLangText("troopNamePlBarbarian")) - GUICtrlSetState(-1, $GUI_DISABLE) - Global $cmbBarrackBK2 = GUICtrlCreateCombo("", 285, 275, 95, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) - GUICtrlSetData(-1, $cmbBarrackShortList, GetLangText("troopNamePlBarbarian")) - GUICtrlSetState(-1, $GUI_DISABLE) - Global $cmbBarrackBK3 = GUICtrlCreateCombo("", 285, 300, 95, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) - GUICtrlSetData(-1, $cmbBarrackShortList, GetLangText("troopNamePlBarbarian")) - GUICtrlSetState(-1, $GUI_DISABLE) - Global $cmbBarrackBK4 = GUICtrlCreateCombo("", 285, 325, 95, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) - GUICtrlSetData(-1, $cmbBarrackShortList, GetLangText("troopNamePlBarbarian")) - GUICtrlSetState(-1, $GUI_DISABLE) - -;~ $DarkBarracks = GUICtrlCreateGroup(GetLangText("DarkBarracks"), 20, 357, 375, 75) -;~ $lblDarkBarrack1 = GUICtrlCreateLabel(GetLangText("chkBoostRax1"), 30, 375, 53, 17) -;~ $lblDarkBarrack2 = GUICtrlCreateLabel(GetLangText("chkBoostRax2"), 30, 405, 53, 17) -;~ $cmbDarkBarrackList = GetLangText("troopDarkPlMinion") & "|" & GetLangText("troopDarkPlHog") & "|" & GetLangText("troopDarkPlValkyrie") & "|" & GetLangText("cmbNothing") -;~ Global $txtDarkBarrack1 = GUICtrlCreateInput("5", 90, 375, 31, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER)) -;~ GUICtrlSetState(-1, $GUI_DISABLE) -;~ GUICtrlSetLimit(-1, 2) -;~ Global $txtDarkBarrack2 = GUICtrlCreateInput("5", 90, 405, 31, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER)) -;~ GUICtrlSetState(-1, $GUI_DISABLE) -;~ GUICtrlSetLimit(-1, 2) -;~ Global $cmbDarkBarrack1 = GUICtrlCreateCombo("", 130, 375, 100, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) -;~ GUICtrlSetState(-1, $GUI_DISABLE) -;~ GUICtrlSetData(-1, $cmbDarkBarrackList, GetLangText("troopDarkPlMinion")) -;~ Global $cmbDarkBarrack2 = GUICtrlCreateCombo("", 130, 405, 100, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) -;~ GUICtrlSetState(-1, $GUI_DISABLE) -;~ GUICtrlSetData(-1, $cmbDarkBarrackList, GetLangText("troopDarkPlMinion")) -;~ Global $txtDarkBarrack1Next = GUICtrlCreateInput("5", 250, 375, 31, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER)) -;~ GUICtrlSetState(-1, $GUI_DISABLE) -;~ GUICtrlSetLimit(-1, 2) -;~ Global $txtDarkBarrack2Next = GUICtrlCreateInput("5", 250, 405, 31, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER)) -;~ GUICtrlSetState(-1, $GUI_DISABLE) -;~ GUICtrlSetLimit(-1, 2) -;~ Global $cmbDarkBarrack1Next = GUICtrlCreateCombo("", 290, 375, 100, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) -;~ GUICtrlSetState(-1, $GUI_DISABLE) -;~ GUICtrlSetData(-1, $cmbDarkBarrackList, GetLangText("troopDarkPlMinion")) -;~ Global $cmbDarkBarrack2Next = GUICtrlCreateCombo("", 290, 405, 100, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) -;~ GUICtrlSetState(-1, $GUI_DISABLE) -;~ GUICtrlSetData(-1, $cmbDarkBarrackList, GetLangText("troopDarkPlMinion")) - - GUICtrlCreateGroup("", -99, -99, 1, 1) - - ; --------------------------------------------------------------------------- - $pageSpells = GUICtrlCreateTabItem(GetLangText("pageSpells")) - - $cmbSpellList = GetLangText("spellNameLightning") & "|" & GetLangText("spellNameHealing") & "|" & GetLangText("spellNameRage") & "|" & GetLangText("spellNameJump") & "|" & GetLangText("spellNameFreeze") - $lblFactory = GUICtrlCreateGroup(GetLangText("lblfactory"), 20, 40, 375, 74) - Global $chkMakeSpells = GUICtrlCreateCheckbox(GetLangText("chkMakeSpells"), 30, 60, 97, 17) - GUICtrlSetOnEvent($chkMakeSpells, "Standard_chkMakeSpells") - GUICtrlSetState(-1, $GUI_UNCHECKED) - $lblSpellCreate = GUICtrlCreateLabel(GetLangText("lblSpellCreate"), 30, 87, 90, 17) - GUICtrlSetTip(-1, GetLangText("cmbSpellCreateTip")) - Global $cmbSpellCreate = GUICtrlCreateCombo("", 125, 83, 85, 21, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) - GUICtrlSetData(-1, $cmbSpellList, GetLangText("spellNameLightning")) - - $lblDEZap = GUICtrlCreateGroup(GetLangText("lblDEZap"), 20, 124, 375, 154) - $lblDENukeLimit = GUICtrlCreateLabel(GetLangText("lblDENukeLimit"), 30, 144, 170, 17) - Global $txtDENukeLimit = GUICtrlCreateInput("2000", 197, 144, 51, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER)) - Global $chkNukeOnly = GUICtrlCreateCheckbox(GetLangText("chkNukeOnly"), 30, 184, 180, 17) - GUICtrlSetTip(-1, GetLangText("chkNukeOnlyTip")) - Global $chkNukeOnlyWithFullArmy = GUICtrlCreateCheckbox(GetLangText("chkNukeOnlyWithFullArmy"), 30, 204, 250, 17) - GUICtrlSetState(-1, $GUI_UNCHECKED) - Global $chkNukeAttacking = GUICtrlCreateCheckbox(GetLangText("chkNukeAttacking"), 30, 231, 180, 17) - GUICtrlSetOnEvent($chkNukeAttacking, "Standard_chkNukeAttacking") - GUICtrlSetState(-1, $GUI_UNCHECKED) - GUICtrlSetTip(-1, GetLangText("chkNukeAttackingTip")) - $lblSpellNumber = GUICtrlCreateLabel(GetLangText("lblSpellNumber"), 30, 254, 170, 17) - Global $txtSpellNumber = GUICtrlCreateInput("3", 200, 250, 51, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER)) - - GUICtrlCreateGroup("", -99, -99, 1, 1) - GUICtrlCreateTabItem("") - Standard_LoadConfig() - - Global $PluginEvents[3][3] - $PluginEvents[0][0] = 2 - $PluginEvents[1][0] = $cmbTroopComp - $PluginEvents[1][1] = 1 - $PluginEvents[1][2] = "_cmbTroopComp" - $PluginEvents[2][0] = $cmbSpellCreate - $PluginEvents[2][1] = 1 - $PluginEvents[2][2] = "_cmbSpellCreate" - - Return $pageSearch -EndFunc ;==>Standard_LoadGUI +Func Standard_LoadGUI() + ; Required prior to making new tabs + $frmAttackConfig = GUICreate("Attack config panel", 410, 410, -1, -1, $WS_BORDER + $WS_POPUP, $WS_EX_MDICHILD, $frmBot) + Opt('GUIResizeMode', 802) + GUISetState(@SW_HIDE, $frmAttackConfig) + _WinMoved(0, 0, 0, 0) + GUISwitch($frmAttackConfig) + + $tabStrat = GUICtrlCreateTab(10, 10, 415, 550) + ; --------------------------------------------------------------------------- + $pageSearch = GUICtrlCreateTabItem(GetLangText("pageSearch")) + $DeadConditions = GUICtrlCreateGroup(GetLangText("DeadConditions"), 18, 40, 397, 135) + Global $chkDeadActivate = GUICtrlCreateCheckbox(GetLangText("chkActivate"), 30, 60, 90, 17) + GUICtrlSetOnEvent($chkDeadActivate, "Standard_chkDeadActivate") + GUICtrlSetTip(-1, GetLangText("lblDeadConditions")) + ;$lblDeadConditions = GUICtrlCreateLabel(GetLangText("lblDeadConditions"), 120, 60, 380, 20) + Global $chkDeadKingAvail = GUICtrlCreateCheckbox(GetLangText("chkKingAvail"), 130, 60, 120, 17) + Global $chkDeadQueenAvail = GUICtrlCreateCheckbox(GetLangText("chkQueenAvail"), 260, 60, 120, 17) + Global $chkDeadGE = GUICtrlCreateCheckbox(GetLangText("chkMeetGE"), 30, 83, 100, 17) + $lblDeadMinGold = GUICtrlCreateLabel(GetLangText("lblMinGold"), 140, 85, 28, 17) + Global $txtDeadMinGold = GUICtrlCreateInput("50000", 170, 80, 50, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER)) + GUICtrlSetLimit(-1, 6) + Global $cmbDead = GUICtrlCreateCombo("", 240, 80, 45, 21, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) + GUICtrlSetData(-1, GetLangText("cmbAndOr") & "|+", GetLangText("cmbAnd")) + $lblDeadMinElixir = GUICtrlCreateLabel(GetLangText("lblMinElixir"), 300, 85, 28, 17) + Global $txtDeadMinElixir = GUICtrlCreateInput("50000", 330, 80, 50, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER)) + GUICtrlSetLimit(-1, 6) + Global $chkDeadMeetDE = GUICtrlCreateCheckbox(GetLangText("chkMeetDE"), 30, 113, 95, 17) + Global $txtDeadMinDarkElixir = GUICtrlCreateInput("0", 130, 110, 60, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER)) + GUICtrlSetLimit(-1, 6) + Global $chkDeadMeetTrophy = GUICtrlCreateCheckbox(GetLangText("chkMeetTrophy"), 225, 113, 95, 17) + Global $txtDeadMinTrophy = GUICtrlCreateInput("0", 325, 110, 60, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER)) + GUICtrlSetLimit(-1, 2) + Global $chkDeadMeetTH = GUICtrlCreateCheckbox(GetLangText("chkMeetTH"), 30, 143, 95, 17) + Global $cmbDeadTH = GUICtrlCreateCombo("", 130, 140, 60, 21, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) + GUICtrlSetData(-1, "4-6|7|8|9|10", "4-6") + Global $chkDeadMeetTHO = GUICtrlCreateCheckbox(GetLangText("chkMeetTHO"), 225, 143, 70, 17) + GUICtrlSetTip(-1, GetLangText("chkMeetTHOTip")) + Global $chkDeadSnipe = GUICtrlCreateCheckbox(GetLangText("chkSnipe"), 315, 143, 50, 17) + GUICtrlSetTip(-1, GetLangText("chkSnipeTip")) + GUICtrlSetState($chkDeadGE, $GUI_DISABLE) + GUICtrlSetState($txtDeadMinGold, $GUI_DISABLE) + GUICtrlSetState($cmbDead, $GUI_DISABLE) + GUICtrlSetState($txtDeadMinElixir, $GUI_DISABLE) + GUICtrlSetState($chkDeadMeetDE, $GUI_DISABLE) + GUICtrlSetState($txtDeadMinDarkElixir, $GUI_DISABLE) + GUICtrlSetState($chkDeadMeetTrophy, $GUI_DISABLE) + GUICtrlSetState($txtDeadMinTrophy, $GUI_DISABLE) + GUICtrlSetState($chkDeadMeetTH, $GUI_DISABLE) + GUICtrlSetState($cmbDeadTH, $GUI_DISABLE) + GUICtrlSetState($chkDeadMeetTHO, $GUI_DISABLE) + $AnyConditions = GUICtrlCreateGroup(GetLangText("AnyConditions"), 18, 180, 397, 130) + Global $chkAnyActivate = GUICtrlCreateCheckbox(GetLangText("chkActivate"), 30, 200, 90, 17) + GUICtrlSetOnEvent($chkAnyActivate, "Standard_chkAnyActivate") + GUICtrlSetTip(-1, GetLangText("lblAnyConditions")) + ;$lblAnyConditions = GUICtrlCreateLabel(GetLangText("lblAnyConditions"), 120, 200, 380, 20) + Global $chkKingAvail = GUICtrlCreateCheckbox(GetLangText("chkKingAvail"), 130, 200, 120, 17) + Global $chkQueenAvail = GUICtrlCreateCheckbox(GetLangText("chkQueenAvail"), 260, 200, 120, 17) + Global $chkMeetGE = GUICtrlCreateCheckbox(GetLangText("chkMeetGE"), 30, 223, 100, 17) + GUICtrlSetState(-1, $GUI_CHECKED) + $lblMinGold = GUICtrlCreateLabel(GetLangText("lblMinGold"), 140, 225, 28, 17) + Global $txtMinGold = GUICtrlCreateInput("80000", 170, 220, 50, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER)) + GUICtrlSetLimit(-1, 6) + Global $cmbAny = GUICtrlCreateCombo("", 240, 220, 45, 21, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) + GUICtrlSetData(-1, GetLangText("cmbAndOr") & "|+", GetLangText("cmbAnd")) + $lblMinElixir = GUICtrlCreateLabel(GetLangText("lblMinElixir"), 300, 225, 28, 17) + Global $txtMinElixir = GUICtrlCreateInput("80000", 330, 220, 50, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER)) + GUICtrlSetLimit(-1, 6) + Global $chkMeetDE = GUICtrlCreateCheckbox(GetLangText("chkMeetDE"), 30, 253, 95, 17) + Global $txtMinDarkElixir = GUICtrlCreateInput("0", 130, 250, 60, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER)) + GUICtrlSetLimit(-1, 6) + Global $chkMeetTrophy = GUICtrlCreateCheckbox(GetLangText("chkMeetTrophy"), 225, 253, 95, 17) + Global $txtMinTrophy = GUICtrlCreateInput("0", 325, 250, 60, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER)) + GUICtrlSetLimit(-1, 2) + Global $chkMeetTH = GUICtrlCreateCheckbox(GetLangText("chkMeetTH"), 30, 283, 95, 17) + Global $cmbTH = GUICtrlCreateCombo("", 130, 280, 60, 21, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) + GUICtrlSetData(-1, "4-6|7|8|9|10", "4-6") + Global $chkMeetTHO = GUICtrlCreateCheckbox(GetLangText("chkMeetTHO"), 225, 283, 70, 17) + GUICtrlSetTip(-1, GetLangText("chkMeetTHOTip")) + Global $chkSnipe = GUICtrlCreateCheckbox(GetLangText("chkSnipe"), 315, 283, 50, 17) + GUICtrlSetTip(-1, GetLangText("chkSnipeTip")) + GUICtrlSetState($chkMeetGE, $GUI_DISABLE) + GUICtrlSetState($txtMinGold, $GUI_DISABLE) + GUICtrlSetState($cmbAny, $GUI_DISABLE) + GUICtrlSetState($txtMinElixir, $GUI_DISABLE) + GUICtrlSetState($chkMeetDE, $GUI_DISABLE) + GUICtrlSetState($txtMinDarkElixir, $GUI_DISABLE) + GUICtrlSetState($chkMeetTrophy, $GUI_DISABLE) + GUICtrlSetState($txtMinTrophy, $GUI_DISABLE) + 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")) + + $DeadDeploySettings = GUICtrlCreateGroup(GetLangText("DeadDeploySettings"), 15, 40, 390, 123) + Global $cmbDeadDeploy = GUICtrlCreateCombo("", 30, 55, 360, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) + GUICtrlSetData(-1, GetLangText("cmbDeployMethods") & GetLangText("cmbDeployCollectors"), GetLangText("cmbDeployDefault")) + Global $cmbDeadAlgorithm = GUICtrlCreateCombo("", 30, 85, 360, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) + GUICtrlSetData(-1, GetLangText("cmbAlgorithms"), GetLangText("cmbAlgorithmsDefault")) + Global $chkDeadUseKing = GUICtrlCreateCheckbox(GetLangText("chkUseKing"), 30, 115, 150, 17) + Global $chkDeadUseQueen = GUICtrlCreateCheckbox(GetLangText("chkUseQueen"), 200, 115, 105, 17) + Global $chkDeadUseClanCastle = GUICtrlCreateCheckbox(GetLangText("chkUseClanCastle"), 30, 135, 160, 17) + Global $cmbDeadAttackTH = GUICtrlCreateCombo("", 200, 135, 190, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) + GUICtrlSetData(-1, GetLangText("cmbAttackTH")) + GUICtrlCreateGroup("", -99, -99, 1, 1) + + $AnyDeploySettings = GUICtrlCreateGroup(GetLangText("AnyDeploySettings"), 15, 164, 390, 123) + Global $cmbDeploy = GUICtrlCreateCombo("", 30, 182, 360, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) + GUICtrlSetData(-1, GetLangText("cmbDeployMethods") & GetLangText("cmbDeployCollectors"), GetLangText("cmbDeployDefault")) + Global $cmbAlgorithm = GUICtrlCreateCombo("", 30, 212, 360, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) + GUICtrlSetData(-1, GetLangText("cmbAlgorithms"), GetLangText("cmbAlgorithmsDefault")) + Global $chkUseKing = GUICtrlCreateCheckbox(GetLangText("chkUseKing"), 30, 240, 97, 17) + Global $chkUseQueen = GUICtrlCreateCheckbox(GetLangText("chkUseQueen"), 200, 240, 105, 17) + Global $chkUseClanCastle = GUICtrlCreateCheckbox(GetLangText("chkUseClanCastle"), 30, 260, 160, 17) + Global $cmbAttackTH = GUICtrlCreateCombo("", 200, 260, 190, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) + GUICtrlSetData(-1, GetLangText("cmbAttackTH")) + + $HeroAct = GUICtrlCreateGroup(GetLangText("HeroAct"), 15, 288, 390, 73) + $lblKingSkill = GUICtrlCreateLabel(GetLangText("lblKingSkill"), 30, 309, 110, 17) + GUICtrlSetTip(-1, GetLangText("lblKingSkillTip")) + Global $txtKingSkill = GUICtrlCreateInput("10", 140, 304, 31, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER)) + GUICtrlSetLimit(-1, 2) + $lblQueenSkill = GUICtrlCreateLabel(GetLangText("lblQueenSkill"), 30, 334, 110, 17) + GUICtrlSetTip(-1, GetLangText("lblQueenSkillTip")) + $lblheroSkill = GUICtrlCreateLabel(GetLangText("heroSkill"), 191, 304, 160, 20) + $lblheroSkill2 = GUICtrlCreateLabel(GetLangText("heroSkill2"), 191, 334, 180, 20) + Global $txtQueenSkill = GUICtrlCreateInput("10", 140, 329, 31, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER)) + GUICtrlSetLimit(-1, 2) + GUICtrlCreateGroup("", -99, -99, 1, 1) + + + ; --------------------------------------------------------------------------- + $pageTroops = GUICtrlCreateTabItem(GetLangText("pageTroops")) + + $Barracks = GUICtrlCreateGroup(GetLangText("Barracks"), 20, 40, 185, 194) + $lblBarbarians = GUICtrlCreateLabel(GetLangText("troopNamePlBarbarian") & ":", 30, 68, 60, 17) + $lblArchers = GUICtrlCreateLabel(GetLangText("troopNamePlArcher") & ":", 30, 93, 46, 17) + $lblGoblins = GUICtrlCreateLabel(GetLangText("troopNamePlGoblin") & ":", 30, 118, 45, 17) + $lblRaidcap = GUICtrlCreateLabel(GetLangText("lblRaidCap"), 30, 168, 95, 17) + Global $cmbRaidcap = GUICtrlCreateCombo("", 120, 165, 56, 21, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) + GUICtrlSetData(-1, "10|20|30|40|50|60|70|80|90|100", "100") + $lblPercentCapacity = GUICtrlCreateLabel("%", 180, 168, 12, 17) + Global $txtBarbarians = GUICtrlCreateInput("30", 120, 65, 56, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER)) + GUICtrlSetState(-1, $GUI_DISABLE) + Global $txtArchers = GUICtrlCreateInput("60", 120, 90, 56, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER)) + GUICtrlSetState(-1, $GUI_DISABLE) + Global $txtGoblins = GUICtrlCreateInput("10", 120, 115, 56, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER)) + GUICtrlSetState(-1, $GUI_DISABLE) + $lblPercentBarbarians = GUICtrlCreateLabel("%", 180, 68, 12, 17) + $lblPercentArchers = GUICtrlCreateLabel("%", 180, 93, 12, 17) + $lblPercentGoblins = GUICtrlCreateLabel("%", 180, 108, 12, 17) + Global $cmbTroopComp = GUICtrlCreateCombo("", 40, 200, 156, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) + GUICtrlSetData(-1, GetLangText("cmbTroopComp"), GetLangText("cmbTroopCompDefault")) + GUICtrlCreateGroup("", -99, -99, 1, 1) + + $OtherTroops = GUICtrlCreateGroup(GetLangText("OtherTroops"), 210, 40, 185, 70) + $lblGiants = GUICtrlCreateLabel(GetLangText("numberOf") & " " & GetLangText("troopNamePlGiant") & ":", 215, 59, 89, 17) + $lblWallBreakers = GUICtrlCreateLabel(GetLangText("numberOf") & " " & GetLangText("troopNamePlWallBreaker") & ":", 215, 84, 125, 17) + Global $txtNumGiants = GUICtrlCreateInput("4", 340, 56, 46, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER)) + GUICtrlSetState(-1, $GUI_DISABLE) + Global $txtNumWallbreakers = GUICtrlCreateInput("4", 340, 81, 46, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER)) + GUICtrlSetState(-1, $GUI_DISABLE) + + GUICtrlCreateGroup("", -99, -99, 1, 1) + + $BarrackGroup = GUICtrlCreateGroup(GetLangText("BarrackGroup"), 210, 112, 185, 122) + $lblBarrack1 = GUICtrlCreateLabel(GetLangText("chkBoostRax1"), 220, 137, 53, 17) + $lblBarrack2 = GUICtrlCreateLabel(GetLangText("chkBoostRax2"), 220, 162, 53, 17) + $lblBarrack3 = GUICtrlCreateLabel(GetLangText("chkBoostRax3"), 220, 187, 53, 17) + $lblBarrack4 = GUICtrlCreateLabel(GetLangText("chkBoostRax4"), 220, 212, 53, 17) + $cmbBarrackList = GetLangText("troopNamePlBarbarian") & "|" & GetLangText("troopNamePlArcher") & "|" & GetLangText("troopNamePlGiant") & "|" & GetLangText("troopNamePlGoblin") & "|" & GetLangText("troopNamePlWallBreaker") & "|" & GetLangText("troopNamePlBalloon") & GetLangText("cmbTrainingOnly") & "|" & GetLangText("troopNamePlWizard") & GetLangText("cmbTrainingOnly") & "|" & GetLangText("troopNamePlHealer") & GetLangText("cmbTrainingOnly") & "|" & GetLangText("troopNamePlDragon") & GetLangText("cmbTrainingOnly") & "|" & GetLangText("troopNamePlPEKKA") & GetLangText("cmbTrainingOnly") & "|" & GetLangText("cmbNothing") + Global $cmbBarrack1 = GUICtrlCreateCombo("", 275, 130, 110, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) + GUICtrlSetData(-1, $cmbBarrackList, GetLangText("troopNamePlBarbarian")) + Global $cmbBarrack2 = GUICtrlCreateCombo("", 275, 155, 110, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) + GUICtrlSetData(-1, $cmbBarrackList, GetLangText("troopNamePlBarbarian")) + Global $cmbBarrack3 = GUICtrlCreateCombo("", 275, 180, 110, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) + GUICtrlSetData(-1, $cmbBarrackList, GetLangText("troopNamePlBarbarian")) + Global $cmbBarrack4 = GUICtrlCreateCombo("", 275, 205, 110, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) + GUICtrlSetData(-1, $cmbBarrackList, GetLangText("troopNamePlBarbarian")) + GUICtrlCreateGroup("", -99, -99, 1, 1) + + $BarrackCTGroup = GUICtrlCreateGroup(GetLangText("BarrackCTGroup"), 20, 234, 375, 121) + $lblBarrackJOE1 = GUICtrlCreateLabel(GetLangText("chkBoostRax1"), 30, 253, 53, 17) + $lblBarrackJOE2 = GUICtrlCreateLabel(GetLangText("chkBoostRax2"), 30, 278, 53, 17) + $lblBarrackJOE3 = GUICtrlCreateLabel(GetLangText("chkBoostRax3"), 30, 303, 53, 17) + $lblBarrackJOE4 = GUICtrlCreateLabel(GetLangText("chkBoostRax4"), 30, 328, 53, 17) + $lblBarrackBK1 = GUICtrlCreateLabel(GetLangText("lblBarrackBK1"), 237, 253, 35, 17) + $lblBarrackBK2 = GUICtrlCreateLabel(GetLangText("lblBarrackBK1"), 237, 278, 35, 17) + $lblBarrackBK3 = GUICtrlCreateLabel(GetLangText("lblBarrackBK1"), 237, 303, 35, 17) + $lblBarrackBK4 = GUICtrlCreateLabel(GetLangText("lblBarrackBK1"), 237, 328, 35, 17) + + Global $txtBarrackJOE1 = GUICtrlCreateInput("2", 90, 250, 31, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER)) + GUICtrlSetLimit(-1, 2) + GUICtrlSetState(-1, $GUI_DISABLE) + Global $txtBarrackJOE2 = GUICtrlCreateInput("2", 90, 275, 31, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER)) + GUICtrlSetLimit(-1, 2) + GUICtrlSetState(-1, $GUI_DISABLE) + Global $txtBarrackJOE3 = GUICtrlCreateInput("2", 90, 300, 31, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER)) + GUICtrlSetLimit(-1, 2) + GUICtrlSetState(-1, $GUI_DISABLE) + Global $txtBarrackJOE4 = GUICtrlCreateInput("2", 90, 325, 31, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER)) + GUICtrlSetLimit(-1, 2) + GUICtrlSetState(-1, $GUI_DISABLE) + + $cmbBarrackShortList = GetLangText("troopNamePlBarbarian") & "|" & GetLangText("troopNamePlArcher") & "|" & GetLangText("troopNamePlGiant") & "|" & GetLangText("troopNamePlGoblin") & "|" & GetLangText("troopNamePlWallBreaker") & "|" & GetLangText("cmbNothing") + Global $cmbBarrackFT1 = GUICtrlCreateCombo("", 130, 250, 95, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) + GUICtrlSetData(-1, $cmbBarrackShortList, GetLangText("troopNamePlBarbarian")) + GUICtrlSetState(-1, $GUI_DISABLE) + Global $cmbBarrackFT2 = GUICtrlCreateCombo("", 130, 275, 95, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) + GUICtrlSetData(-1, $cmbBarrackShortList, GetLangText("troopNamePlBarbarian")) + GUICtrlSetState(-1, $GUI_DISABLE) + Global $cmbBarrackFT3 = GUICtrlCreateCombo("", 130, 300, 95, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) + GUICtrlSetData(-1, $cmbBarrackShortList, GetLangText("troopNamePlBarbarian")) + GUICtrlSetState(-1, $GUI_DISABLE) + Global $cmbBarrackFT4 = GUICtrlCreateCombo("", 130, 325, 95, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) + GUICtrlSetData(-1, $cmbBarrackShortList, GetLangText("troopNamePlBarbarian")) + GUICtrlSetState(-1, $GUI_DISABLE) + + Global $cmbBarrackBK1 = GUICtrlCreateCombo("", 285, 250, 95, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) + GUICtrlSetData(-1, $cmbBarrackShortList, GetLangText("troopNamePlBarbarian")) + GUICtrlSetState(-1, $GUI_DISABLE) + Global $cmbBarrackBK2 = GUICtrlCreateCombo("", 285, 275, 95, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) + GUICtrlSetData(-1, $cmbBarrackShortList, GetLangText("troopNamePlBarbarian")) + GUICtrlSetState(-1, $GUI_DISABLE) + Global $cmbBarrackBK3 = GUICtrlCreateCombo("", 285, 300, 95, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) + GUICtrlSetData(-1, $cmbBarrackShortList, GetLangText("troopNamePlBarbarian")) + GUICtrlSetState(-1, $GUI_DISABLE) + Global $cmbBarrackBK4 = GUICtrlCreateCombo("", 285, 325, 95, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) + GUICtrlSetData(-1, $cmbBarrackShortList, GetLangText("troopNamePlBarbarian")) + GUICtrlSetState(-1, $GUI_DISABLE) + + $DarkBarracks = GUICtrlCreateGroup(GetLangText("DarkBarracks"), 20, 357, 375, 75) + $lblDarkBarrack1 = GUICtrlCreateLabel(GetLangText("chkBoostRax1"), 30, 375, 53, 17) + $lblDarkBarrack2 = GUICtrlCreateLabel(GetLangText("chkBoostRax2"), 30, 405, 53, 17) + $cmbDarkBarrackList = GetLangText("troopDarkPlMinion") & "|" & GetLangText("troopDarkPlHog") & "|" & GetLangText("troopDarkPlValkyrie") & "|" & GetLangText("cmbNothing") + Global $txtDarkBarrack1 = GUICtrlCreateInput("5", 90, 375, 31, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER)) + ;GUICtrlSetState(-1, $GUI_DISABLE) + GUICtrlSetLimit(-1, 2) + Global $txtDarkBarrack2 = GUICtrlCreateInput("5", 90, 405, 31, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER)) + ;GUICtrlSetState(-1, $GUI_DISABLE) + GUICtrlSetLimit(-1, 2) + Global $cmbDarkBarrack1 = GUICtrlCreateCombo("", 130, 375, 100, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) + ;GUICtrlSetState(-1, $GUI_DISABLE) + GUICtrlSetData(-1, $cmbDarkBarrackList, GetLangText("troopDarkPlMinion")) + Global $cmbDarkBarrack2 = GUICtrlCreateCombo("", 130, 405, 100, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) + ;GUICtrlSetState(-1, $GUI_DISABLE) + GUICtrlSetData(-1, $cmbDarkBarrackList, GetLangText("troopDarkPlMinion")) + Global $txtDarkBarrack1Next = GUICtrlCreateInput("5", 250, 375, 31, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER)) + ;GUICtrlSetState(-1, $GUI_DISABLE) + GUICtrlSetLimit(-1, 2) + Global $txtDarkBarrack2Next = GUICtrlCreateInput("5", 250, 405, 31, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER)) + ;GUICtrlSetState(-1, $GUI_DISABLE) + GUICtrlSetLimit(-1, 2) + Global $cmbDarkBarrack1Next = GUICtrlCreateCombo("", 290, 375, 100, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) + ;GUICtrlSetState(-1, $GUI_DISABLE) + GUICtrlSetData(-1, $cmbDarkBarrackList, GetLangText("troopDarkPlMinion")) + Global $cmbDarkBarrack2Next = GUICtrlCreateCombo("", 290, 405, 100, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) + ;GUICtrlSetState(-1, $GUI_DISABLE) + GUICtrlSetData(-1, $cmbDarkBarrackList, GetLangText("troopDarkPlMinion")) + + $DarkBarrackTroop[0] = _GUICtrlComboBox_GetCurSel($cmbDarkBarrack1) + $DarkBarrackTroop[1] = _GUICtrlComboBox_GetCurSel($cmbDarkBarrack2) + + $DarkBarrackTroopNext[0] = _GUICtrlComboBox_GetCurSel($cmbDarkBarrack1Next) + $DarkBarrackTroopNext[1] = _GUICtrlComboBox_GetCurSel($cmbDarkBarrack2Next) + + GUICtrlCreateGroup("", -99, -99, 1, 1) + + ; --------------------------------------------------------------------------- + $pageSpells = GUICtrlCreateTabItem(GetLangText("pageSpells")) + + $cmbSpellList = GetLangText("spellNameLightning") & "|" & GetLangText("spellNameHealing") & "|" & GetLangText("spellNameRage") & "|" & GetLangText("spellNameJump") & "|" & GetLangText("spellNameFreeze") + $lblFactory = GUICtrlCreateGroup(GetLangText("lblfactory"), 20, 40, 375, 74) + Global $chkMakeSpells = GUICtrlCreateCheckbox(GetLangText("chkMakeSpells"), 30, 60, 97, 17) + GUICtrlSetOnEvent($chkMakeSpells, "Standard_chkMakeSpells") + GUICtrlSetState(-1, $GUI_UNCHECKED) + $lblSpellCreate = GUICtrlCreateLabel(GetLangText("lblSpellCreate"), 30, 87, 90, 17) + GUICtrlSetTip(-1, GetLangText("cmbSpellCreateTip")) + Global $cmbSpellCreate = GUICtrlCreateCombo("", 125, 83, 85, 21, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) + GUICtrlSetData(-1, $cmbSpellList, GetLangText("spellNameLightning")) + + $lblDEZap = GUICtrlCreateGroup(GetLangText("lblDEZap"), 20, 124, 375, 154) + $lblDENukeLimit = GUICtrlCreateLabel(GetLangText("lblDENukeLimit"), 30, 144, 170, 17) + Global $txtDENukeLimit = GUICtrlCreateInput("2000", 197, 144, 51, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER)) + Global $chkNukeOnly = GUICtrlCreateCheckbox(GetLangText("chkNukeOnly"), 30, 184, 180, 17) + GUICtrlSetTip(-1, GetLangText("chkNukeOnlyTip")) + Global $chkNukeOnlyWithFullArmy = GUICtrlCreateCheckbox(GetLangText("chkNukeOnlyWithFullArmy"), 30, 204, 250, 17) + GUICtrlSetState(-1, $GUI_UNCHECKED) + Global $chkNukeAttacking = GUICtrlCreateCheckbox(GetLangText("chkNukeAttacking"), 30, 231, 180, 17) + GUICtrlSetOnEvent($chkNukeAttacking, "Standard_chkNukeAttacking") + GUICtrlSetState(-1, $GUI_UNCHECKED) + GUICtrlSetTip(-1, GetLangText("chkNukeAttackingTip")) + $lblSpellNumber = GUICtrlCreateLabel(GetLangText("lblSpellNumber"), 30, 254, 170, 17) + Global $txtSpellNumber = GUICtrlCreateInput("3", 200, 250, 51, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER)) + + GUICtrlCreateGroup("", -99, -99, 1, 1) + GUICtrlCreateTabItem("") + Standard_LoadConfig() + + Global $PluginEvents[3][3] + $PluginEvents[0][0] = 2 + $PluginEvents[1][0] = $cmbTroopComp + $PluginEvents[1][1] = 1 + $PluginEvents[1][2] = "_cmbTroopComp" + $PluginEvents[2][0] = $cmbSpellCreate + $PluginEvents[2][1] = 1 + $PluginEvents[2][2] = "_cmbSpellCreate" + + Return $pageSearch +EndFunc ;==>Standard_LoadGUI diff --git a/COCBot/functions/Strategies/Standard/Plugin.au3 b/COCBot/functions/Strategies/Standard/Plugin.au3 index 4eabd9f..a3e5411 100644 --- a/COCBot/functions/Strategies/Standard/Plugin.au3 +++ b/COCBot/functions/Strategies/Standard/Plugin.au3 @@ -1,18 +1,18 @@ -#include "Attack.au3" -#include "Config.au3" -#include "GUIControl.au3" -#include "GUIDesign.au3" -#include "PrepareAttack.au3" -#include "PrepNextBattle.au3" -#include "ReadyCheck.au3" -#include "Search.au3" -#include "AdjustCollPos.au3" - -$StratNames = "Standard" - -Global $prevTroopComp = -1 -Global $BarbariansComp, $ArchersComp, $GiantsComp, $GoblinsComp, $WBComp -Global $fullarmy, $fullSpellFactory -Global $stuckCount = 0 - - +#include "Attack.au3" +#include "Config.au3" +#include "GUIControl.au3" +#include "GUIDesign.au3" +#include "PrepareAttack.au3" +#include "PrepNextBattle.au3" +#include "ReadyCheck.au3" +#include "Search.au3" +#include "AdjustCollPos.au3" + +$StratNames = "Standard" + +Global $prevTroopComp = -1 +Global $BarbariansComp, $ArchersComp, $GiantsComp, $GoblinsComp, $WBComp +Global $fullarmy, $fullSpellFactory +Global $stuckCount = 0 + + diff --git a/COCBot/functions/Strategies/Standard/PrepNextBattle.au3 b/COCBot/functions/Strategies/Standard/PrepNextBattle.au3 index 55a2d72..b409bf2 100644 --- a/COCBot/functions/Strategies/Standard/PrepNextBattle.au3 +++ b/COCBot/functions/Strategies/Standard/PrepNextBattle.au3 @@ -1,7 +1,7 @@ -Func Standard_PrepNextBattle() - ;Resetting this flag only after search successful - ;As this flag will be used in miniReady_Check as well - ;$stuckCount = 0 - Standard_Train(True) -EndFunc ;==>Standard_PrepNextBattle - +Func Standard_PrepNextBattle() + ;Resetting this flag only after search successful + ;As this flag will be used in miniReady_Check as well + ;$stuckCount = 0 + Standard_Train(True) +EndFunc ;==>Standard_PrepNextBattle + diff --git a/COCBot/functions/Strategies/Standard/PrepareAttack.au3 b/COCBot/functions/Strategies/Standard/PrepareAttack.au3 index 2b6fcd8..6ea7455 100644 --- a/COCBot/functions/Strategies/Standard/PrepareAttack.au3 +++ b/COCBot/functions/Strategies/Standard/PrepareAttack.au3 @@ -1,152 +1,154 @@ -;Checks the troops when in battle, checks for type, slot, and quantity. -;Saved in $atkTroops[SLOT][TYPE/QUANTITY] variable - -Func Standard_PrepareAttack($remaining = False, $AttackMethod = 1, $noPrint = False) ;Assigns troops - If Not $noPrint Then - If $remaining Then - SetLog(GetLangText("msgCheckingRem"), $COLOR_ORANGE) - Else - SetLog(GetLangText("msgPreparingAtt"), $COLOR_BLUE) - EndIf - EndIf - _CaptureRegion() - - Local $iAlgorithm = ($AttackMethod = 0) ? _GUICtrlComboBox_GetCurSel($cmbDeadAlgorithm) : _GUICtrlComboBox_GetCurSel($cmbAlgorithm) - If $AttackMethod = 3 Then $iAlgorithm = 9 ; If sniping then have all troops ready - Local $BarrackControl - For $i = 0 To 8 - Local $troopKind = IdentifyTroopKind($i) - Switch $iAlgorithm - Case 0 - ; Archers only - If $troopKind <> $eArcher And $troopKind <> $eKing And $troopKind <> $eQueen And $troopKind <> $eCastle And $troopKind <> $eLSpell Then - If Not $remaining And Not $noPrint Then - If NameOfTroop($troopKind) <> "Unknown" Then SetLog(GetLangText("msgIgnoring") & NameOfTroop($troopKind)) - EndIf - $troopKind = -1 - EndIf - Case 1 - ; Barbarians only - If $troopKind <> $eBarbarian And $troopKind <> $eKing And $troopKind <> $eQueen And $troopKind <> $eCastle And $troopKind <> $eLSpell Then - If Not $remaining And Not $noPrint Then - If NameOfTroop($troopKind) <> "Unknown" Then SetLog(GetLangText("msgIgnoring") & NameOfTroop($troopKind)) - EndIf - $troopKind = -1 - EndIf - Case 2 - ; Goblins only - If $troopKind <> $eGoblin And $troopKind <> $eKing And $troopKind <> $eQueen And $troopKind <> $eCastle And $troopKind <> $eLSpell Then - If Not $remaining And Not $noPrint Then - If NameOfTroop($troopKind) <> "Unknown" Then SetLog(GetLangText("msgIgnoring") & NameOfTroop($troopKind)) - EndIf - $troopKind = -1 - EndIf - Case 3 - ; Barch - If $troopKind <> $eBarbarian And $troopKind <> $eArcher And $troopKind <> $eKing And $troopKind <> $eQueen And $troopKind <> $eCastle And $troopKind <> $eLSpell Then - If Not $remaining And Not $noPrint Then - If NameOfTroop($troopKind) <> "Unknown" Then SetLog(GetLangText("msgIgnoring") & NameOfTroop($troopKind)) - EndIf - $troopKind = -1 - EndIf - Case 4 - ; BAGG - If $troopKind <> $eBarbarian And $troopKind <> $eArcher And $troopKind <> $eGiant And $troopKind <> $eGoblin And $troopKind <> $eKing And $troopKind <> $eQueen And $troopKind <> $eCastle And $troopKind <> $eLSpell Then - If Not $remaining And Not $noPrint Then - If NameOfTroop($troopKind) <> "Unknown" Then SetLog(GetLangText("msgIgnoring") & NameOfTroop($troopKind)) - EndIf - $troopKind = -1 - EndIf - Case 5 - ; BAGiant - If $troopKind <> $eBarbarian And $troopKind <> $eArcher And $troopKind <> $eGiant And $troopKind <> $eKing And $troopKind <> $eQueen And $troopKind <> $eCastle And $troopKind <> $eLSpell Then - If Not $remaining And Not $noPrint Then - If NameOfTroop($troopKind) <> "Unknown" Then SetLog(GetLangText("msgIgnoring") & NameOfTroop($troopKind)) - EndIf - $troopKind = -1 - EndIf - Case 6 - ; BAGob - If $troopKind <> $eBarbarian And $troopKind <> $eArcher And $troopKind <> $eGoblin And $troopKind <> $eKing And $troopKind <> $eQueen And $troopKind <> $eCastle And $troopKind <> $eLSpell Then - If Not $remaining And Not $noPrint Then - If NameOfTroop($troopKind) <> "Unknown" Then SetLog(GetLangText("msgIgnoring") & NameOfTroop($troopKind)) - EndIf - $troopKind = -1 - EndIf - Case 7 - ; BAGGWB - If $troopKind <> $eBarbarian And $troopKind <> $eArcher And $troopKind <> $eGiant And $troopKind <> $eGoblin And $troopKind <> $eWallbreaker And $troopKind <> $eKing And $troopKind <> $eQueen And $troopKind <> $eCastle And $troopKind <> $eLSpell Then - If Not $remaining And Not $noPrint Then - If NameOfTroop($troopKind) <> "Unknown" Then SetLog(GetLangText("msgIgnoring") & NameOfTroop($troopKind)) - EndIf - $troopKind = -1 - EndIf - Case 8 - For $x = 0 To 3 - Switch $x - Case 0 - $BarrackControl = $cmbBarrack1 - Case 1 - $BarrackControl = $cmbBarrack2 - Case 2 - $BarrackControl = $cmbBarrack3 - Case 3 - $BarrackControl = $cmbBarrack4 - EndSwitch - $troopKind = IdentifyTroopKind($i) - If $troopKind = $eBarbarian And _GUICtrlComboBox_GetCurSel($BarrackControl) = 0 Then - $atkTroops[$i][0] = $troopKind - ExitLoop - ElseIf $troopKind = $eArcher And _GUICtrlComboBox_GetCurSel($BarrackControl) = 1 Then - $atkTroops[$i][0] = $troopKind - ExitLoop - ElseIf $troopKind = $eGiant And _GUICtrlComboBox_GetCurSel($BarrackControl) = 2 Then - $atkTroops[$i][0] = $troopKind - ExitLoop - ElseIf $troopKind = $eGoblin And _GUICtrlComboBox_GetCurSel($BarrackControl) = 3 Then - $atkTroops[$i][0] = $troopKind - ExitLoop - ElseIf $troopKind = $eWallbreaker And _GUICtrlComboBox_GetCurSel($BarrackControl) = 4 Then - $atkTroops[$i][0] = $troopKind - ExitLoop - ElseIf $troopKind = $eMinion And ($DarkBarrackTroop[0] = 0 Or $DarkBarrackTroop[1] = 0) Then - $atkTroops[$i][0] = $troopKind - ExitLoop - ElseIf $troopKind = $eHog And ($DarkBarrackTroop[0] = 1 Or $DarkBarrackTroop[1] = 1) Then - $atkTroops[$i][0] = $troopKind - ExitLoop - ElseIf $troopKind = $eValkyrie And ($DarkBarrackTroop[0] = 2 Or $DarkBarrackTroop[1] = 2) Then - $atkTroops[$i][0] = $troopKind - ExitLoop - ElseIf $troopKind <> $eKing And $troopKind <> $eQueen And $troopKind <> $eCastle And $troopKind <> $eLSpell Then - If Not $remaining And Not $noPrint Then - If NameOfTroop($troopKind) <> "Unknown" Then SetLog(GetLangText("msgIgnoring") & NameOfTroop($troopKind)) - EndIf - $troopKind = -1 - EndIf - Next - EndSwitch - - Local $useCastle = ($AttackMethod = 0) ? (IsChecked($chkDeadUseClanCastle) ? (True) : (False)) : (IsChecked($chkUseClanCastle) ? (True) : (False)) - Local $useKing = ($AttackMethod = 0) ? (IsChecked($chkDeadUseKing) ? (True) : (False)) : (IsChecked($chkUseKing) ? (True) : (False)) - Local $useQueen = ($AttackMethod = 0) ? (IsChecked($chkDeadUseQueen) ? (True) : (False)) : (IsChecked($chkUseQueen) ? (True) : (False)) - - If Not $useCastle And $troopKind = $eCastle Then $troopKind = -1 - If Not $useKing And $troopKind = $eKing Then $troopKind = -1 - If Not $useQueen And $troopKind = $eQueen Then $troopKind = -1 - If $remaining And $troopKind = $eLSpell Then $troopKind = -1 - - If ($troopKind == -1) Then - $atkTroops[$i][1] = 0 - ElseIf ($troopKind = $eKing) Or ($troopKind = $eQueen) Or ($troopKind = $eCastle) Then - $atkTroops[$i][1] = 1 - Else - $atkTroops[$i][1] = ReadTroopQuantity($i) - EndIf - $atkTroops[$i][0] = $troopKind - - If Not $noPrint Then - If $troopKind <> -1 Then SetLog("-" & NameOfTroop($atkTroops[$i][0]) & " " & $atkTroops[$i][1], $COLOR_GREEN) - EndIf - Next -EndFunc ;==>Standard_PrepareAttack +;Checks the troops when in battle, checks for type, slot, and quantity. +;Saved in $atkTroops[SLOT][TYPE/QUANTITY] variable + +Func Standard_PrepareAttack($remaining = False, $AttackMethod = 1, $noPrint = False) ;Assigns troops + If Not $noPrint Then + If $remaining Then + SetLog(GetLangText("msgCheckingRem"), $COLOR_ORANGE) + Else + SetLog(GetLangText("msgPreparingAtt"), $COLOR_BLUE) + EndIf + EndIf + _CaptureRegion() + + Local $iAlgorithm = ($AttackMethod = 0) ? _GUICtrlComboBox_GetCurSel($cmbDeadAlgorithm) : _GUICtrlComboBox_GetCurSel($cmbAlgorithm) + If $AttackMethod = 3 Then $iAlgorithm = 9 ; If sniping then have all troops ready + Local $BarrackControl + If $OverlayVisible And Not IsChecked($chkBackground) Then WinMove($frmOverlay, "", 10000, 10000, 860, 720) + For $i = 0 To 8 + Local $troopKind = IdentifyTroopKind($i) + Switch $iAlgorithm + Case 0 + ; Archers only + If $troopKind <> $eArcher And $troopKind <> $eKing And $troopKind <> $eQueen And $troopKind <> $eCastle And $troopKind <> $eLSpell Then + If Not $remaining And Not $noPrint Then + If NameOfTroop($troopKind) <> "Unknown" Then SetLog(GetLangText("msgIgnoring") & NameOfTroop($troopKind)) + EndIf + $troopKind = -1 + EndIf + Case 1 + ; Barbarians only + If $troopKind <> $eBarbarian And $troopKind <> $eKing And $troopKind <> $eQueen And $troopKind <> $eCastle And $troopKind <> $eLSpell Then + If Not $remaining And Not $noPrint Then + If NameOfTroop($troopKind) <> "Unknown" Then SetLog(GetLangText("msgIgnoring") & NameOfTroop($troopKind)) + EndIf + $troopKind = -1 + EndIf + Case 2 + ; Goblins only + If $troopKind <> $eGoblin And $troopKind <> $eKing And $troopKind <> $eQueen And $troopKind <> $eCastle And $troopKind <> $eLSpell Then + If Not $remaining And Not $noPrint Then + If NameOfTroop($troopKind) <> "Unknown" Then SetLog(GetLangText("msgIgnoring") & NameOfTroop($troopKind)) + EndIf + $troopKind = -1 + EndIf + Case 3 + ; Barch + If $troopKind <> $eBarbarian And $troopKind <> $eArcher And $troopKind <> $eKing And $troopKind <> $eQueen And $troopKind <> $eCastle And $troopKind <> $eLSpell Then + If Not $remaining And Not $noPrint Then + If NameOfTroop($troopKind) <> "Unknown" Then SetLog(GetLangText("msgIgnoring") & NameOfTroop($troopKind)) + EndIf + $troopKind = -1 + EndIf + Case 4 + ; BAGG + If $troopKind <> $eBarbarian And $troopKind <> $eArcher And $troopKind <> $eGiant And $troopKind <> $eGoblin And $troopKind <> $eKing And $troopKind <> $eQueen And $troopKind <> $eCastle And $troopKind <> $eLSpell Then + If Not $remaining And Not $noPrint Then + If NameOfTroop($troopKind) <> "Unknown" Then SetLog(GetLangText("msgIgnoring") & NameOfTroop($troopKind)) + EndIf + $troopKind = -1 + EndIf + Case 5 + ; BAGiant + If $troopKind <> $eBarbarian And $troopKind <> $eArcher And $troopKind <> $eGiant And $troopKind <> $eKing And $troopKind <> $eQueen And $troopKind <> $eCastle And $troopKind <> $eLSpell Then + If Not $remaining And Not $noPrint Then + If NameOfTroop($troopKind) <> "Unknown" Then SetLog(GetLangText("msgIgnoring") & NameOfTroop($troopKind)) + EndIf + $troopKind = -1 + EndIf + Case 6 + ; BAGob + If $troopKind <> $eBarbarian And $troopKind <> $eArcher And $troopKind <> $eGoblin And $troopKind <> $eKing And $troopKind <> $eQueen And $troopKind <> $eCastle And $troopKind <> $eLSpell Then + If Not $remaining And Not $noPrint Then + If NameOfTroop($troopKind) <> "Unknown" Then SetLog(GetLangText("msgIgnoring") & NameOfTroop($troopKind)) + EndIf + $troopKind = -1 + EndIf + Case 7 + ; BAGGWB + If $troopKind <> $eBarbarian And $troopKind <> $eArcher And $troopKind <> $eGiant And $troopKind <> $eGoblin And $troopKind <> $eWallbreaker And $troopKind <> $eKing And $troopKind <> $eQueen And $troopKind <> $eCastle And $troopKind <> $eLSpell Then + If Not $remaining And Not $noPrint Then + If NameOfTroop($troopKind) <> "Unknown" Then SetLog(GetLangText("msgIgnoring") & NameOfTroop($troopKind)) + EndIf + $troopKind = -1 + EndIf + Case 8 + For $x = 0 To 3 + Switch $x + Case 0 + $BarrackControl = $cmbBarrack1 + Case 1 + $BarrackControl = $cmbBarrack2 + Case 2 + $BarrackControl = $cmbBarrack3 + Case 3 + $BarrackControl = $cmbBarrack4 + EndSwitch + $troopKind = IdentifyTroopKind($i) + If $troopKind = $eBarbarian And _GUICtrlComboBox_GetCurSel($BarrackControl) = 0 Then + $atkTroops[$i][0] = $troopKind + ExitLoop + ElseIf $troopKind = $eArcher And _GUICtrlComboBox_GetCurSel($BarrackControl) = 1 Then + $atkTroops[$i][0] = $troopKind + ExitLoop + ElseIf $troopKind = $eGiant And _GUICtrlComboBox_GetCurSel($BarrackControl) = 2 Then + $atkTroops[$i][0] = $troopKind + ExitLoop + ElseIf $troopKind = $eGoblin And _GUICtrlComboBox_GetCurSel($BarrackControl) = 3 Then + $atkTroops[$i][0] = $troopKind + ExitLoop + ElseIf $troopKind = $eWallbreaker And _GUICtrlComboBox_GetCurSel($BarrackControl) = 4 Then + $atkTroops[$i][0] = $troopKind + ExitLoop + ElseIf $troopKind = $eMinion And ($DarkBarrackTroop[0] = 0 Or $DarkBarrackTroop[1] = 0) Then + $atkTroops[$i][0] = $troopKind + ExitLoop + ElseIf $troopKind = $eHog And ($DarkBarrackTroop[0] = 1 Or $DarkBarrackTroop[1] = 1) Then + $atkTroops[$i][0] = $troopKind + ExitLoop + ElseIf $troopKind = $eValkyrie And ($DarkBarrackTroop[0] = 2 Or $DarkBarrackTroop[1] = 2) Then + $atkTroops[$i][0] = $troopKind + ExitLoop + ElseIf $troopKind <> $eKing And $troopKind <> $eQueen And $troopKind <> $eCastle And $troopKind <> $eLSpell Then + If Not $remaining And Not $noPrint Then +;~ If NameOfTroop($troopKind) <> "Unknown" Then SetLog(GetLangText("msgIgnoring") & NameOfTroop($troopKind)) + EndIf + $troopKind = -1 + EndIf + Next + EndSwitch + + Local $useCastle = ($AttackMethod = 0) ? (IsChecked($chkDeadUseClanCastle) ? (True) : (False)) : (IsChecked($chkUseClanCastle) ? (True) : (False)) + Local $useKing = ($AttackMethod = 0) ? (IsChecked($chkDeadUseKing) ? (True) : (False)) : (IsChecked($chkUseKing) ? (True) : (False)) + Local $useQueen = ($AttackMethod = 0) ? (IsChecked($chkDeadUseQueen) ? (True) : (False)) : (IsChecked($chkUseQueen) ? (True) : (False)) + + If Not $useCastle And $troopKind = $eCastle Then $troopKind = -1 + If Not $useKing And $troopKind = $eKing Then $troopKind = -1 + If Not $useQueen And $troopKind = $eQueen Then $troopKind = -1 + If $remaining And $troopKind = $eLSpell Then $troopKind = -1 + + If ($troopKind == -1) Then + $atkTroops[$i][1] = 0 + ElseIf ($troopKind = $eKing) Or ($troopKind = $eQueen) Or ($troopKind = $eCastle) Then + $atkTroops[$i][1] = 1 + Else + $atkTroops[$i][1] = ReadTroopQuantity($i) + EndIf + $atkTroops[$i][0] = $troopKind + + If Not $noPrint Then + If $troopKind <> -1 Then SetLog("-" & NameOfTroop($atkTroops[$i][0]) & " " & $atkTroops[$i][1], $COLOR_GREEN) + EndIf + Next + If $OverlayVisible And Not IsChecked($chkBackground) Then WinMove($frmOverlay, "", $BSpos[0], $BSpos[1], 860, 720) +EndFunc ;==>Standard_PrepareAttack diff --git a/COCBot/functions/Strategies/Standard/ReadyCheck.au3 b/COCBot/functions/Strategies/Standard/ReadyCheck.au3 index c3ef496..06109ec 100644 --- a/COCBot/functions/Strategies/Standard/ReadyCheck.au3 +++ b/COCBot/functions/Strategies/Standard/ReadyCheck.au3 @@ -1,1063 +1,1408 @@ -;ReadyCheck is in charge of build full army and spell. -;When Army is full, ReadyCheck will Return True -;Hero status check will be done later in the loop, right before start search -Func Standard_ReadyCheck($TimeSinceNewTroop) - - If $TimeSinceNewTroop > Standard_GetTrainTime() + 60 Then - If $stuckCount < 3 Then - $FirstStart = True - SetLog(GetLangText("msgAppearsStuck")) - $stuckCount += 1 - ElseIf $stuckCount = 3 Then - SetLog(GetLangText("msgSevereStuck")) - $stuckCount += 1 - EndIf - EndIf - - $fullarmy = Standard_CheckArmyCamp() - If StatusCheck() Then Return False - - If Not $fullarmy And $stuckCount < 3 Then Standard_Train() - If StatusCheck() Then Return False - - If IsChecked($chkMakeSpells) Then - $fullSpellFactory = CheckFullSpellFactory() - If StatusCheck() Then Return False - - If Not $fullSpellFactory Then Standard_MakeSpells() - If StatusCheck() Then Return False - EndIf - - If $stuckCount >= 3 And (IsChecked($chkDeadActivate) Or IsChecked($chkAnyActivate)) Then $fullarmy = True - - If $fullarmy And (IsChecked($chkDeadActivate) Or 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 - -;Quick check before start searching -;Check Hero status -;If last search failed, also check spell status and army status -;If army is not full for some reason, return false, else return true -Func Standard_miniReadyCheck() - - ; Verify hero availability - ChkKingAvailability() - ChkQueenAvailability() - If $SearchFailed Then ;Last search failed, do additional checks - $fullarmy = Standard_CheckArmyCamp() - If Not $fullarmy And $stuckCount < 3 Then - Return False ;Troop missing in not stuck situation, exit loop and restart training - Else - $fullarmy = True ;Set the flag again, search condition can be properly populated - EndIf - If StatusCheck() Then Return False - - If IsChecked($chkMakeSpells) Then - $fullSpellFactory = CheckFullSpellFactory() - If StatusCheck() Then Return False - EndIf - Else ;SearchFailed=False - ;reset SearchCount only when last search wasn't failed - $SearchCount = 0 - EndIf - - If Not AdjustSearchCond() Then - ;No search condition is valid - SetLog(GetLangText("msgHeroNotReady"), $COLOR_PURPLE) - - If $KingUG And _ - Not (IsChecked($chkDeadActivate) And Not IsChecked($chkDeadKingAvail)) And _ - Not (IsChecked($chkAnyActivate) And Not IsChecked($chkKingAvail)) Then - ;King is upgrading, and all enabled search method need king - SetLog(GetLangText("msgWarningKingUG"), $COLOR_RED) - EndIf - If $QueenUG And _ - Not (IsChecked($chkDeadActivate) And Not IsChecked($chkDeadQueenAvail)) And _ - Not (IsChecked($chkAnyActivate) And Not IsChecked($chkQueenAvail)) Then - ;Queen is upgrading, and all enabled search method need king - SetLog(GetLangText("msgWarningQueenUG"), $COLOR_RED) - EndIf - ;Since Hero is required and not ready, we'd better wait outside, at lease we can donate. - ;Wait a bit before return, avoid bot being too busy ;) - _Sleep(20000) - Return False - EndIf - - Return True - -EndFunc ;==>Standard_miniReadyCheck - - -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 ;==>Standard_GetTrainTime - -Func Standard_CheckArmyCamp() - SetLog(GetLangText("msgCheckingCamp"), $COLOR_BLUE) - $fullarmy = False - - If _Sleep(100) Then Return - - ClickP($TopLeftClient) ;Click Away - - If $ArmyPos[0] = "" Then - If Not LocateCamp() Then Return - SaveConfig() - Else - If _Sleep(500) Then Return - Click($ArmyPos[0], $ArmyPos[1]) ;Click Army Camp - EndIf - - _CaptureRegion() - If _Sleep(500) Then Return - Local $BArmyPos = _WaitForPixel(309, 581, 433, 583, Hex(0x4084B8, 6), 5) ;Finds Info button - If IsArray($BArmyPos) = False Then - SetLog(GetLangText("msgCampNA"), $COLOR_RED) - Else - Click($BArmyPos[0], $BArmyPos[1]) ;Click Info button - _WaitForPixel(690, 150, 710, 170, Hex(0xD80407, 6), 5, 1) ;Finds Red Cross button in new popup window - If _Sleep(200) Then Return - For $readattempts = 1 to 3 - $CurCamp = StringStripWS(ReadText(426, 194, 280, $textWindows), 3) - $CurCamp = StringStripWS(StringMid($CurCamp, Stringinstr($CurCamp, ":") + 1), 3) - $itxtcampCap = StringMid($CurCamp, Stringinstr($CurCamp, "/") + 1) - If Number($itxtcampCap) > 0 And Number($itxtcampCap) < 300 Then - $CurCamp = StringLeft($CurCamp, StringInStr($CurCamp, "/") - 1) - If Number($CurCamp) >= 0 And Number($CurCamp) <= $itxtcampCap Then - SetLog(GetLangText("msgTotalCampCap") & $CurCamp & "/" & $itxtcampCap, $COLOR_GREEN) - ExitLoop - EndIf - EndIf - If _Sleep(500) Then Return - If $readattempts = 3 Then - SetLog(GetLangText("msgTotalCampCap") & GetLangText("lblUnknownCap"), $COLOR_GREEN) - $CurCamp = 0 - If $itxtcampCap = 0 then $itxtcampCap = 240 - EndIf - Next - - If ($CurCamp/$itxtcampCap) >= ((_GUICtrlComboBox_GetCurSel($cmbRaidcap)+1)/10) Then - $fullarmy = True - Else - _CaptureRegion() - If $FirstStart Then - $ArmyComp = 0 - $CurGiant = 0 - $CurWB = 0 - $CurArch = 0 - $CurBarb = 0 - $CurGoblin = 0 - EndIf - For $i = 0 To 6 - Local $TroopKind = _GetPixelColor(254 + 62 * $i, 375) - Local $TroopKind2 = _GetPixelColor(264 + 62 * $i, 380) - Local $TroopName = 0 - Local $TroopQ = StringStripWS(ReadText(239 + (62 * $i), 350, 37, $textWindows), 3) - If StringLeft($TroopQ, 1) = "x" Then $TroopQ = StringRight($TroopQ, StringLen($TroopQ) - 1) - $TroopQ = Number($TroopQ) - If _ColorCheck($TroopKind, Hex(0xEC4989, 6), 30) Then - If ($CurArch = 0 And $FirstStart) Then $CurArch -= $TroopQ - $TroopName = "Archers" - ElseIf _ColorCheck($TroopKind, Hex(0xFFC020, 6), 30) Then - If ($CurBarb = 0 And $FirstStart) Then $CurBarb -= $TroopQ - $TroopName = "Barbarians" - ElseIf _ColorCheck($TroopKind, Hex(0xFFC17F, 6), 30) Then - If ($CurGiant = 0 And $FirstStart) Then $CurGiant -= $TroopQ - $TroopName = "Giants" - ElseIf _ColorCheck($TroopKind, Hex(0x90E658, 6), 30) Then - If ($CurGoblin = 0 And $FirstStart) Then $CurGoblin -= $TroopQ - $TroopName = "Goblins" - ElseIf _ColorCheck($TroopKind2, Hex(0xD06C38, 6), 30) Then - If ($CurWB = 0 And $FirstStart) Then $CurWB -= $TroopQ - $TroopName = "Wallbreakers" - ElseIf _ColorCheck($TroopKind, Hex(0x151F37, 6), 20) Then - If ($FirstStart) Then $CurMinion -= $TroopQ - $TroopName = "Minions" - ElseIf _ColorCheck($TroopKind, Hex(0x4C2E26, 6), 30) Then - If ($FirstStart) Then $CurHog -= $TroopQ - $TroopName = "Hogs" - ElseIf _ColorCheck($TroopKind, Hex(0xA95E58, 6), 30) Then - If ($FirstStart) Then $CurValkyrie -= $TroopQ - $TroopName = "Valkyries" - EndIf - If $TroopQ <> 0 Then SetLog("- " & $TroopName & " " & $TroopQ, $COLOR_GREEN) - Next - EndIf - ClickP($TopLeftClient) ;Click Away - $FirstCampView = True - EndIf - Return $fullarmy -EndFunc ;==>Standard_CheckArmyCamp - -;Uses the location of manually set Barracks to train specified troops - -; Train the troops (Fill the barracks) - -Func Standard_GetTrainPos($TroopKind) - Switch $TroopKind - Case $eBarbarian ; 261, 366: 0x39D8E0 - Return $TrainBarbarian - Case $eArcher ; 369, 366: 0x39D8E0 - Return $TrainArcher - Case $eGiant ; 475, 366: 0x3DD8E0 - Return $TrainGiant - Case $eGoblin ; 581, 366: 0x39D8E0 - Return $TrainGoblin - Case $eWallbreaker ; 635, 335, 0x3AD8E0 - Return $TrainWallbreaker - Case $eMinion - Return $TrainMinion - Case $eHog - Return $TrainHog - Case $eValkyrie - Return $TrainValkyrie - Case Else - SetLog(GetLangText("msgDontKnow") & $TroopKind & GetLangText("msgYet")) - Return 0 - EndSwitch -EndFunc ;==>Standard_GetTrainPos - -Func Standard_TrainIt($TroopKind, $howMuch = 1, $iSleep = 100) - _CaptureRegion() - Local $pos = Standard_GetTrainPos($TroopKind) - If IsArray($pos) Then - If CheckPixel($pos) Then - ClickP($pos, $howMuch, 20) - If _Sleep($iSleep) Then Return False - Return True - EndIf - EndIf -EndFunc ;==>Standard_TrainIt - -Func Standard_Train($reset = False) - resetBarracksError() - If $barrackPos[0][0] = "" Then - If Not LocateBarrack() Then Return - SaveConfig() - If _Sleep(2000) Then Return - EndIf - - SetLog(GetLangText("msgTrainingTroops"), $COLOR_BLUE) - - If $reset Then ; reset all for cook again on startup - $ArmyComp = 0 - $CurGiant = 0 - $CurWB = 0 - $CurArch = 0 - $CurBarb = 0 - $CurGoblin = 0 - EndIf - - If (($ArmyComp = 0) And (_GUICtrlComboBox_GetCurSel($cmbTroopComp) <> 8)) Or $FixTrain Then - If $FixTrain Or $FirstStart And Not $reset Then $ArmyComp = $CurCamp - $FixTrain = False - $CurGiant += GUICtrlRead($txtNumGiants) - $CurWB += GUICtrlRead($txtNumWallbreakers) - $CurArch += Floor((($itxtcampCap * GUICtrlRead($cmbRaidcap) / 100) - (GUICtrlRead($txtNumGiants) * 5) - (GUICtrlRead($txtNumWallbreakers) * 2)) * (GUICtrlRead($txtArchers) / 100)) - $CurBarb += Floor((($itxtcampCap * GUICtrlRead($cmbRaidcap) / 100) - (GUICtrlRead($txtNumGiants) * 5) - (GUICtrlRead($txtNumWallbreakers) * 2)) * (GUICtrlRead($txtBarbarians) / 100)) - $CurGoblin += Floor((($itxtcampCap * GUICtrlRead($cmbRaidcap) / 100) - (GUICtrlRead($txtNumGiants) * 5) - (GUICtrlRead($txtNumWallbreakers) * 2)) * (GUICtrlRead($txtGoblins) / 100)) -;~ SetLog("CurArch" & $CurArch & "one: " & $itxtcampCap & ":" & GUICtrlRead($cmbRaidcap) & "two :" & (GUICtrlRead($txtNumGiants) * 5) & "three:" & (GUICtrlRead($txtNumWallbreakers) * 2) & "four:" & (GUICtrlRead($txtArchers) / 100)) -;~ SetLog("CurBarb" & $CurBarb) -;~ SetLog("CurGoblin" & $CurGoblin) - If $CurArch < 0 Then $CurArch = 0 - If $CurBarb < 0 Then $CurBarb = 0 - If $CurGoblin < 0 Then $CurGoblin = 0 - If $CurWB < 0 Then $CurWB = 0 - If $CurGiant < 0 Then $CurGiant = 0 - If ($CurArch + $CurBarb + $CurGoblin + (5 * $CurGiant) + (2 * $CurWB)) < $itxtcampCap Then - If $CurArch > 0 Then - $CurArch += 1 - EndIf - If ($CurArch + $CurBarb + $CurGoblin + (5 * $CurGiant) + (2 * $CurWB)) < $itxtcampCap Then - If $CurBarb > 0 Then - $CurBarb += 1 - EndIf - If ($CurArch + $CurBarb + $CurGoblin + (5 * $CurGiant) + (2 * $CurWB)) < $itxtcampCap Then - If $CurGoblin > 0 Then - $CurGoblin += 1 - EndIf - EndIf - EndIf - EndIf - SetLog(GetLangText("msgForcesNeededB") & $CurBarb & GetLangText("msgForcesNeededA") & $CurArch & GetLangText("msgForcesNeededGo") & $CurGoblin & GetLangText("msgForcesNeededGi") & $CurGiant & GetLangText("msgForcesNeededWB") & $CurWB, $COLOR_GREEN) - EndIf - - Local $GiantEBarrack, $WallEBarrack, $ArchEBarrack, $BarbEBarrack, $GoblinEBarrack - $GiantEBarrack = Floor($CurGiant / 4) - $WallEBarrack = Floor($CurWB / 4) - $ArchEBarrack = Floor($CurArch / 4) - $BarbEBarrack = Floor($CurBarb / 4) - $GoblinEBarrack = Floor($CurGoblin / 4) - - Local $troopFirstGiant, $troopSecondGiant, $troopFirstWall, $troopSecondWall, $troopFirstGoblin, $troopSecondGoblin, $troopFirstBarba, $troopSecondBarba, $troopFirstArch, $troopSecondArch - $troopFirstGiant = 0 - $troopSecondGiant = 0 - $troopFirstWall = 0 - $troopSecondWall = 0 - $troopFirstGoblin = 0 - $troopSecondGoblin = 0 - $troopFirstBarba = 0 - $troopSecondBarba = 0 - $troopFirstArch = 0 - $troopSecondArch = 0 - - Local $BarrackControl - Local $expUIRet[2] - - $hDLL = DllOpen(@ScriptDir & "\BrokenBot.org\BrokenBot32.dll") - For $i = 0 To 3 - - If _Sleep(500) Then ExitLoop - - ClickP($TopLeftClient) ;Click Away - - If _Sleep(500) Then ExitLoop - - Click($barrackPos[$i][0], $barrackPos[$i][1]) ;Click Barrack - If _Sleep(500) Then ExitLoop - - _CaptureRegion() - $sendHBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap) - $resUI = DllCall($hDLL, "str", "BrokenBotMatchButton", "ptr", $sendHBitmap, "int", 108, "int", 3, "int", 1, "int", 3, "int", (IsChecked($chkSpeedBoost) ? (1) : (0))) - _WinAPI_DeleteObject($sendHBitmap) - $expUIRet[0] = -1 - If IsArray($resUI) Then - If $resUI[0] = -1 Then - ; Didn't find button - ElseIf $resUI[0] = -2 Then - SetLog(GetLangText("msgLicense"), $COLOR_RED) - Else - $expUIRet = StringSplit($resUI[0], "|", 2) - EndIf - Else - SetLog(GetLangText("msgDLLError"), $COLOR_RED) - EndIf - If $expUIRet[0] = -1 Then - SetLog(GetLangText("msgBarrack") & $i + 1 & GetLangText("msgNotAvailable"), $COLOR_RED) - handleBarracksError($i) - If _Sleep(500) Then ExitLoop - Else - Click($expUIRet[1], $expUIRet[2]) ;Click Train Troops button - _WaitForPixel(720, 150, 740, 170, Hex(0xD80404, 6), 5, 1) ;Finds Red Cross button in new Training popup window - - If _GUICtrlComboBox_GetCurSel($cmbTroopComp) = 8 Then - Switch $i - Case 0 - $BarrackControl = $cmbBarrack1 - Case 1 - $BarrackControl = $cmbBarrack2 - Case 2 - $BarrackControl = $cmbBarrack3 - Case 3 - $BarrackControl = $cmbBarrack4 - EndSwitch - _CaptureRegion() - Switch _GUICtrlComboBox_GetCurSel($BarrackControl) - Case 0 - While _ColorCheck(_GetPixelColor(216, 325), Hex(0xF09D1C, 6), 30) - Click(216, 325, 75) ;Barbarian - If _Sleep(150) Then ExitLoop - _CaptureRegion() - WEnd - Case 1 - While _ColorCheck(_GetPixelColor(330, 323), Hex(0xE84070, 6), 30) - Click(325, 320, 75) ;Archer - If _Sleep(150) Then ExitLoop - _CaptureRegion() - WEnd - Case 2 - While _ColorCheck(_GetPixelColor(419, 319), Hex(0xF88409, 6), 30) - Click(419, 319, 20) ;Giant - If _Sleep(150) Then ExitLoop - _CaptureRegion() - WEnd - Case 3 - While _ColorCheck(_GetPixelColor(549, 328), Hex(0xFB4C24, 6), 30) - Click(535, 320, 75) ;Goblin - If _Sleep(150) Then ExitLoop - _CaptureRegion() - WEnd - Case 4 - While _ColorCheck(_GetPixelColor(685, 327), Hex(0x9E4716, 6), 30) - Click(685, 327, 20) ;Wall Breaker - If _Sleep(150) Then ExitLoop - _CaptureRegion() - WEnd - Case 5 - While _ColorCheck(_GetPixelColor(213, 418), Hex(0x861F15, 6), 30) - Click(213, 418, 20) ;Balloon - If _Sleep(150) Then ExitLoop - _CaptureRegion() - WEnd - Case 6 - While _ColorCheck(_GetPixelColor(340, 449), Hex(0xF09C85, 6), 30) - Click(325, 425, 20) ;Wizard - If _Sleep(150) Then ExitLoop - _CaptureRegion() - WEnd - Case 7 - While _ColorCheck(_GetPixelColor(440, 445), Hex(0xFDD8C0, 6), 30) - Click(440, 445, 10) ;Healer - If _Sleep(150) Then ExitLoop - _CaptureRegion() - WEnd - Case 8 - While _ColorCheck(_GetPixelColor(539, 444), Hex(0x302848, 6), 30) - Click(539, 444, 10) ;Dragon - If _Sleep(150) Then ExitLoop - _CaptureRegion() - WEnd - Case 9 - While _ColorCheck(_GetPixelColor(647, 440), Hex(0x456180, 6), 30) - Click(647, 440, 10) ;PEKKA - If _Sleep(150) Then ExitLoop - _CaptureRegion() - WEnd - Case Else - If _Sleep(50) Then ExitLoop - _CaptureRegion() - EndSwitch - Else - SetLog("====== " & GetLangText("msgBarrack") & $i + 1 & " : ======", $COLOR_BLUE) - _CaptureRegion() - ;while _ColorCheck(_GetPixelColor(496, 200), Hex(0x880000, 6), 20) Then - If $reset Or $FirstStart Then - Click(503, 180, 80, 5) - EndIf - ;wend - - If _Sleep(500) Then ExitLoop - _CaptureRegion() - If GUICtrlRead($txtNumGiants) <> "0" Then - $troopFirstGiant = StringStripWS(ReadText(181 + (2 * 107), 298, 35, $textWindows),3) - If StringRight($troopFirstGiant, 1) = "x" Then $troopFirstGiant = StringLeft($troopFirstGiant, StringLen($troopFirstGiant) - 1) - EndIf - - If GUICtrlRead($txtNumWallbreakers) <> "0" Then - $troopFirstWall = StringStripWS(ReadText(181 + (4 * 107), 298, 35, $textWindows),3) - If StringRight($troopFirstWall, 1) = "x" Then $troopFirstWall = StringLeft($troopFirstWall, StringLen($troopFirstWall) - 1) - EndIf - - If GUICtrlRead($txtGoblins) <> "0" Then - $troopFirstGoblin = StringStripWS(ReadText(181 + (3* 107), 298, 35, $textWindows),3) - If StringRight($troopFirstGoblin, 1) = "x" Then $troopFirstGoblin = StringLeft($troopFirstGoblin, StringLen($troopFirstGoblin) - 1) - EndIf - - If GUICtrlRead($txtBarbarians) <> "0" Then - $troopFirstBarba = StringStripWS(ReadText(181, 298, 35, $textWindows),3) - If StringRight($troopFirstBarba, 1) = "x" Then $troopFirstBarba = StringLeft($troopFirstBarba, StringLen($troopFirstBarba) - 1) - EndIf - - If GUICtrlRead($txtArchers) <> "0" Then - $troopFirstArch = StringStripWS(ReadText(181 + 107, 298, 35, $textWindows),3) - If StringRight($troopFirstArch, 1) = "x" Then $troopFirstArch = StringLeft($troopFirstArch, StringLen($troopFirstArch) - 1) - EndIf - - If GUICtrlRead($txtNumGiants) <> "0" And $CurGiant > 0 Then - ;If _ColorCheck(_GetPixelColor(475, 366), Hex(0x3DD8E0, 6), 20) And $CurGiant > 0 Then - If $CurGiant > 0 Then - If $GiantEBarrack = 0 Then - Standard_TrainIt($eGiant, 1) - ElseIf $GiantEBarrack >= $CurGiant Or $GiantEBarrack = 0 Then - Standard_TrainIt($eGiant, $CurGiant) - Else - Standard_TrainIt($eGiant, $GiantEBarrack) - EndIf - EndIf - EndIf - - If GUICtrlRead($txtNumWallbreakers) <> "0" And $CurWB > 0 Then - ;If _ColorCheck(_GetPixelColor(688, 366), Hex(0x3AD8E0, 6), 20) And $CurWB > 0 Then - If $CurWB > 0 Then - If $WallEBarrack = 0 Then - Standard_TrainIt($eWallbreaker, 1) - ElseIf $WallEBarrack >= $CurWB Or $WallEBarrack = 0 Then - Standard_TrainIt($eWallbreaker, $CurWB) - Else - Standard_TrainIt($eWallbreaker, $WallEBarrack) - EndIf - EndIf - EndIf - - If GUICtrlRead($txtGoblins) <> "0" And $CurGoblin > 0 Then - ;If _ColorCheck(_GetPixelColor(261, 366), Hex(0x39D8E0, 6), 20) And $CurGoblin > 0 Then - If $CurGoblin > 0 Then - If $GoblinEBarrack = 0 Then - Standard_TrainIt($eGoblin, 1) - ElseIf $GoblinEBarrack >= $CurGoblin Or $GoblinEBarrack = 0 Then - Standard_TrainIt($eGoblin, $CurGoblin) - Else - Standard_TrainIt($eGoblin, $GoblinEBarrack) - EndIf - EndIf - EndIf - - If GUICtrlRead($txtArchers) <> "0" And $CurArch > 0 Then - ;If _ColorCheck(_GetPixelColor(261, 366), Hex(0x39D8E0, 6), 20) And $CurArch > 0 Then - If $CurArch > 0 Then - If $ArchEBarrack = 0 Then - Standard_TrainIt($eArcher, 1) - ElseIf $ArchEBarrack >= $CurArch Then - Standard_TrainIt($eArcher, $CurArch) - Else - Standard_TrainIt($eArcher, $ArchEBarrack) - EndIf - EndIf - EndIf - - If GUICtrlRead($txtBarbarians) <> "0" And $CurBarb > 0 Then - ;If _ColorCheck(_GetPixelColor(369, 366), Hex(0x39D8E0, 6), 20) And $CurBarb > 0 Then - If $CurBarb > 0 Then - If $BarbEBarrack = 0 Then - Standard_TrainIt($eBarbarian, 1) - ElseIf $BarbEBarrack >= $CurBarb Or $BarbEBarrack = 0 Then - Standard_TrainIt($eBarbarian, $CurBarb) - Else - Standard_TrainIt($eBarbarian, $BarbEBarrack) - EndIf - EndIf - EndIf - - If _Sleep(900) Then ExitLoop - _CaptureRegion() - - If GUICtrlRead($txtNumGiants) <> "0" Then - $troopSecondGiant = StringStripWS(ReadText(181 + (2 * 107), 298, 35, $textWindows),3) - If StringRight($troopSecondGiant, 1) = "x" Then - $troopSecondGiant = StringLeft($troopSecondGiant, StringLen($troopSecondGiant) - 1) - Else - $troopSecondGiant = 0 - EndIf - EndIf - - If GUICtrlRead($txtNumWallbreakers) <> "0" Then - $troopSecondWall = StringStripWS(ReadText(181 + (4 * 107), 298, 35, $textWindows),3) - If StringRight($troopSecondWall, 1) = "x" Then - $troopSecondWall = StringLeft($troopSecondWall, StringLen($troopSecondWall) - 1) - Else - $troopSecondWall = 0 - EndIf - EndIf - - If GUICtrlRead($txtGoblins) <> "0" Then - $troopSecondGoblin = StringStripWS(ReadText(181 + (3* 107), 298, 35, $textWindows),3) - If StringRight($troopSecondGoblin, 1) = "x" Then - $troopSecondGoblin = StringLeft($troopSecondGoblin, StringLen($troopSecondGoblin) - 1) - Else - $troopSecondGoblin = 0 - EndIf - EndIf - - If GUICtrlRead($txtBarbarians) <> "0" Then - $troopSecondBarba = StringStripWS(ReadText(181, 298, 35, $textWindows),3) - If StringRight($troopSecondBarba, 1) = "x" Then - $troopSecondBarba = StringLeft($troopSecondBarba, StringLen($troopSecondBarba) - 1) - Else - $troopSecondBarba = 0 - EndIf - EndIf - - If GUICtrlRead($txtArchers) <> "0" Then - $troopSecondArch = StringStripWS(ReadText(181 + 107, 298, 35, $textWindows),3) - If StringRight($troopSecondArch, 1) = "x" Then - $troopSecondArch = StringLeft($troopSecondArch, StringLen($troopSecondArch) - 1) - Else - $troopSecondArch = 0 - EndIf - EndIf - - If $troopSecondGiant > $troopFirstGiant And GUICtrlRead($txtNumGiants) <> "0" Then - $ArmyComp += ($troopSecondGiant - $troopFirstGiant) * 5 - $CurGiant -= ($troopSecondGiant - $troopFirstGiant) - SetLog(GetLangText("msgBarrack") & ($i + 1) & GetLangText("msgTraining") & GetLangText("troopNameGiant") & " : " & ($troopSecondGiant - $troopFirstGiant), $COLOR_GREEN) - SetLog("Giant Remaining : " & $CurGiant, $COLOR_BLUE) - EndIf - - - If $troopSecondWall > $troopFirstWall And GUICtrlRead($txtNumWallbreakers) <> "0" Then - $ArmyComp += ($troopSecondWall - $troopFirstWall) * 2 - $CurWB -= ($troopSecondWall - $troopFirstWall) - SetLog(GetLangText("msgBarrack") & ($i + 1) & GetLangText("msgTraining") & GetLangText("troopNameWallBreaker") & " : " & ($troopSecondWall - $troopFirstWall), $COLOR_GREEN) - SetLog("WallBreaker Remaining : " & $CurWB, $COLOR_BLUE) - EndIf - - If $troopSecondGoblin > $troopFirstGoblin And GUICtrlRead($txtGoblins) <> "0" Then - $ArmyComp += ($troopSecondGoblin - $troopFirstGoblin) - $CurGoblin -= ($troopSecondGoblin - $troopFirstGoblin) - SetLog(GetLangText("msgBarrack") & ($i + 1) & GetLangText("msgTraining") & GetLangText("troopNameGoblin") & " : " & ($troopSecondGoblin - $troopFirstGoblin), $COLOR_GREEN) - SetLog("Goblin Remaining : " & $CurGoblin, $COLOR_BLUE) - EndIf - - If $troopSecondBarba > $troopFirstBarba And GUICtrlRead($txtBarbarians) <> "0" Then - $ArmyComp += ($troopSecondBarba - $troopFirstBarba) - $CurBarb -= ($troopSecondBarba - $troopFirstBarba) - SetLog(GetLangText("msgBarrack") & ($i + 1) & GetLangText("msgTraining") & GetLangText("troopNameBarbarian") & " : " & ($troopSecondBarba - $troopFirstBarba), $COLOR_GREEN) - SetLog("Barbarian Remaining : " & $CurBarb, $COLOR_BLUE) - EndIf - - If $troopSecondArch > $troopFirstArch And GUICtrlRead($txtArchers) <> "0" Then - $ArmyComp += ($troopSecondArch - $troopFirstArch) - $CurArch -= ($troopSecondArch - $troopFirstArch) - SetLog(GetLangText("msgBarrack") & ($i + 1) & GetLangText("msgTraining") & GetLangText("troopNameArcher") & " : " & ($troopSecondArch - $troopFirstArch), $COLOR_GREEN) - SetLog("Archer Remaining : " & $CurArch, $COLOR_BLUE) - EndIf - SetLog(GetLangText("msgTotalBuilding") & $ArmyComp, $COLOR_RED) - EndIf - EndIf - If _Sleep(100) Then ExitLoop - Click($TopLeftClient[0], $TopLeftClient[1], 2, 250); Click away twice with 250ms delay - Next - If $brerror[0] = True And $brerror[1] = True And $brerror[2] = True And $brerror[3] = True Then - resetBarracksError() - $needzoomout = True - SetLog(GetLangText("msgRestartComplete"), $COLOR_RED) - Else - SetLog(GetLangText("msgTrainingComp"), $COLOR_BLUE) - EndIf - $FirstStart = False - -;~ BEGIN DARK TROOPS -;~ If $ichkDarkTroop = 0 Then Return -;~ Local $TrainPos[2] -;~ If $DarkBarrackPos[0][0] = "" And GUICtrlRead($txtDarkBarrack1) <> "0" And GUICtrlRead($txtDarkBarrack2) <> "0" Then -;~ LocateDarkBarrack() -;~ SaveConfig() -;~ If _Sleep(2000) Then Return -;~ EndIf - -;~ Global $LeftRax1, $LeftRax2, $TrainDrax1, $TrainDrax2, $ClickRax1, $ClickRax2 - -;~ If $fullArmy Or $FirstDarkTrain Then -;~ $TrainDrax1 = True -;~ $TrainDrax2 = True -;~ EndIf - -;~ If $TrainDrax1 = False And $TrainDrax2 = False Then Return - -;~ SetLog(GetLangText("msgTrainingDark"), $COLOR_BLUE) -;~ For $i = 0 To 1 -;~ If _Sleep(500) Then ExitLoop - -;~ ClickP($TopLeftClient) ;Click Away - -;~ If _Sleep(500) Then ExitLoop -;~ Click($DarkBarrackPos[$i][0], $DarkBarrackPos[$i][1]) ;Click Dark Barrack -;~ If _Sleep(500) Then ExitLoop - -;~ Local $TrainPos = _PixelSearch(155, 603, 694, 605, Hex(0x603818, 6), 5) ;Finds Train Troops button -;~ _CaptureRegion() -;~ If _Sleep(500) Then ExitLoop -;~ $sendHBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap) -;~ $res = DllCall($hDLL, "str", "BrokenBotMatchButton", "ptr", $sendHBitmap, "int", 108, "int", 3, "int", 1, "int", 3, "int", (IsChecked($chkSpeedBoost) ? (1) : (0))) ; remove icon -;~ _WinAPI_DeleteObject($sendHBitmap) -;~ If IsArray($res) Then -;~ If $res[0] = -1 Then -;~ SetLog(GetLangText("msgDarkBarrack") & $i + 1 & GetLangText("msgNotAvailable"), $COLOR_RED) -;~ Return -;~ ElseIf $res[0] = -2 Then -;~ SetLog(GetLangText("msgLicense"), $COLOR_RED) -;~ Else -;~ $expUIRet = StringSplit($res[0], "|", 2) -;~ $TrainPos[0] = $expUIRet[1] -;~ $TrainPos[1] = $expUIRet[2] -;~ If $DebugMode = 1 Then SetLog("DB Train:" & $TrainPos[0] & " Y:" & $TrainPos[1]) -;~ EndIf -;~ EndIf -;~ Click($TrainPos[0], $TrainPos[1]) ;Click Train Troops button -;~ If _Sleep(800) Then ExitLoop -;~ If $fullArmy Or $FirstDarkTrain Then -;~ If Not _ColorCheck(_GetPixelColor(497, 195), Hex(0xE0E4D0, 6), 20) Then -;~ Click(496, 190, 80, 2) -;~ EndIf -;~ EndIf - -;~ ;Dark Barrack 1 -;~ If GUICtrlRead($txtDarkBarrack1) <> "0" And $i = 0 And $TrainDrax1 = True Then -;~ $itxtDarkBarrack1 = GUICtrlRead($txtDarkBarrack1) -;~ If $DarkBarrackTroop[$i] = 0 Then -;~ Local $troopMinion = Number(getOther(171 + 107 * 0, 278, "Barrack")) -;~ If $itxtDarkBarrack1 <= 20 And ($fullArmy Or $FirstDarkTrain) Then -;~ Standard_TrainIt($eMinion, $itxtDarkBarrack1) -;~ $TrainDrax1 = False -;~ SetLog("Dark Barrack 1 Train Minion Completed...", $COLOR_BLUE) -;~ $FirstDarkTrain = False -;~ ElseIf $itxtDarkBarrack1 > 20 And ($fullArmy Or $FirstDarkTrain) Then -;~ Standard_TrainIt($eMinion, 20) -;~ $LeftRax1 = ($itxtDarkBarrack1 - 20) -;~ $ClickRax1 = $LeftRax1 -;~ SetLog("Dark Barrack 1 Minion Remaining : " & $LeftRax1, $COLOR_BLUE) -;~ $FirstDarkTrain = False -;~ ElseIf $LeftRax1 > 1 And ($troopMinion < 20) And $LeftRax1 > ($troopMinion < 20) Then -;~ Standard_TrainIt($eMinion, (20 - $troopMinion)) -;~ $LeftRax1 = ($ClickRax1 - (20 - $troopMinion)) -;~ $ClickRax1 = $LeftRax1 -;~ SetLog("Dark Barrack 1 Minion Remaining : " & $LeftRax1, $COLOR_BLUE) -;~ $FirstDarkTrain = False -;~ ElseIf $LeftRax1 > 1 And ($troopMinion < 20) And $LeftRax1 <= ($troopMinion < 20) Then -;~ Standard_TrainIt($eMinion, $LeftRax1) -;~ $TrainDrax1 = False -;~ SetLog("Dark Barrack 1 Train Minion Completed...", $COLOR_BLUE) -;~ $FirstDarkTrain = False -;~ ElseIf $LeftRax1 <= 1 And ($troopMinion < 20) Then -;~ Standard_TrainIt($eMinion, $LeftRax1) -;~ $TrainDrax1 = False -;~ SetLog("Dark Barrack 1 Train Minion Completed...", $COLOR_BLUE) -;~ $FirstDarkTrain = False -;~ Else -;~ SetLog("Dark Barrack 1 Training in progress, Minion Remaining : " & $LeftRax1, $COLOR_BLUE) -;~ $FirstDarkTrain = False -;~ EndIf -;~ EndIf - -;~ If $DarkBarrackTroop[$i] = 1 Then -;~ Local $troopHog = Number(getOther(171 + 107 * 1, 278, "Barrack")) -;~ If $itxtDarkBarrack1 <= 10 And ($fullArmy Or $FirstDarkTrain) Then -;~ Standard_TrainIt($eHog, $itxtDarkBarrack1) -;~ $TrainDrax1 = False -;~ SetLog("Dark Barrack 1 Train Hog Completed...", $COLOR_BLUE) -;~ $FirstDarkTrain = False -;~ ElseIf $itxtDarkBarrack1 > 10 And ($fullArmy Or $FirstDarkTrain) Then -;~ Standard_TrainIt($eHog, 10) -;~ $LeftRax1 = ($itxtDarkBarrack1 - 10) -;~ $ClickRax1 = $LeftRax1 -;~ SetLog("Dark Barrack 1 Hog Remaining : " & $LeftRax1, $COLOR_BLUE) -;~ $FirstDarkTrain = False -;~ ElseIf $LeftRax1 > 1 And ($troopHog < 10) And $LeftRax1 > ($troopHog < 10) Then -;~ Standard_TrainIt($eHog, (10 - $troopHog)) -;~ $LeftRax1 = ($ClickRax1 - (10 - $troopHog)) -;~ $ClickRax1 = $LeftRax1 -;~ SetLog("Dark Barrack 1 Hog Remaining : " & $LeftRax1, $COLOR_BLUE) -;~ $FirstDarkTrain = False -;~ ElseIf $LeftRax1 > 1 And ($troopHog < 10) And $LeftRax1 <= ($troopHog < 10) Then -;~ Standard_TrainIt($eHog, $LeftRax1) -;~ $TrainDrax1 = False -;~ SetLog("Dark Barrack 1 Train Hog Completed...", $COLOR_BLUE) -;~ $FirstDarkTrain = False -;~ ElseIf $LeftRax1 <= 1 And ($troopHog < 10) Then -;~ Standard_TrainIt($eHog, $LeftRax1) -;~ $TrainDrax1 = False -;~ SetLog("Dark Barrack 1 Train Hog Completed...", $COLOR_BLUE) -;~ $FirstDarkTrain = False -;~ Else -;~ SetLog("Dark Barrack 1 Training in progress, Hog Remaining : " & $LeftRax1, $COLOR_BLUE) -;~ $FirstDarkTrain = False -;~ EndIf -;~ EndIf - -;~ If $DarkBarrackTroop[$i] = 2 Then -;~ Local $troopValkyrie = Number(getOther(171 + 107 * 2, 278, "Barrack")) -;~ If $itxtDarkBarrack1 <= 7 And ($fullArmy Or $FirstDarkTrain) Then -;~ Standard_TrainIt($eValkyrie, $itxtDarkBarrack1) -;~ $TrainDrax1 = False -;~ SetLog("Dark Barrack 1 Train Valkyrie Completed...", $COLOR_BLUE) -;~ $FirstDarkTrain = False -;~ ElseIf $itxtDarkBarrack1 > 7 And ($fullArmy Or $FirstDarkTrain) Then -;~ Standard_TrainIt($eValkyrie, 7) -;~ $LeftRax1 = ($itxtDarkBarrack1 - 7) -;~ $ClickRax1 = $LeftRax1 -;~ SetLog("Dark Barrack 1 Valkyrie Remaining : " & $LeftRax1, $COLOR_BLUE) -;~ $FirstDarkTrain = False -;~ ElseIf $LeftRax1 > 1 And ($troopValkyrie < 7) And $LeftRax1 > ($troopValkyrie < 7) Then -;~ Standard_TrainIt($eValkyrie, (7 - $troopValkyrie)) -;~ $LeftRax1 = ($ClickRax1 - (7 - $troopValkyrie)) -;~ $ClickRax1 = $LeftRax1 -;~ SetLog("Dark Barrack 1 Valkyrie Remaining : " & $LeftRax1, $COLOR_BLUE) -;~ $FirstDarkTrain = False -;~ ElseIf $LeftRax1 > 1 And ($troopValkyrie < 7) And $LeftRax1 <= ($troopValkyrie < 7) Then -;~ Standard_TrainIt($eValkyrie, $LeftRax1) -;~ $TrainDrax1 = False -;~ SetLog("Dark Barrack 1 Train Valkyrie Completed...", $COLOR_BLUE) -;~ $FirstDarkTrain = False -;~ ElseIf $LeftRax1 <= 1 And ($troopValkyrie < 7) Then -;~ Standard_TrainIt($eValkyrie, $LeftRax1) -;~ $TrainDrax1 = False -;~ SetLog("Dark Barrack 1 Train Valkyrie Completed...", $COLOR_BLUE) -;~ $FirstDarkTrain = False -;~ Else -;~ SetLog("Dark Barrack 1 Training in progress, Valkyrie Remaining : " & $LeftRax1, $COLOR_BLUE) -;~ $FirstDarkTrain = False -;~ EndIf -;~ EndIf -;~ EndIf - -;~ ;Dark Barrack 2 -;~ If GUICtrlRead($txtDarkBarrack2) <> "0" And $i = 1 And $TrainDrax2 = True Then -;~ $itxtDarkBarrack2 = GUICtrlRead($txtDarkBarrack2) -;~ If $DarkBarrackTroop[$i] = 0 Then -;~ Local $troopMinion2 = Number(getOther(171 + 107 * 0, 278, "Barrack")) -;~ If $itxtDarkBarrack2 <= 20 And ($fullArmy Or $FirstDarkTrain) Then -;~ Standard_TrainIt($eMinion, $itxtDarkBarrack2) -;~ $TrainDrax2 = False -;~ SetLog("Dark Barrack 2 Train Minion Completed...", $COLOR_BLUE) -;~ $FirstDarkTrain = False -;~ ElseIf $itxtDarkBarrack2 > 20 And ($fullArmy Or $FirstDarkTrain) Then -;~ Standard_TrainIt($eMinion, 20) -;~ $LeftRax2 = ($itxtDarkBarrack2 - 20) -;~ $ClickRax2 = $LeftRax2 -;~ SetLog("Dark Barrack 2 Minion Remaining : " & $LeftRax2, $COLOR_BLUE) -;~ $FirstDarkTrain = False -;~ ElseIf $LeftRax2 > 1 And ($troopMinion2 < 20) And $LeftRax2 > ($troopMinion2 < 20) Then -;~ Standard_TrainIt($eMinion, (20 - $troopMinion2)) -;~ $LeftRax2 = ($ClickRax2 - (20 - $troopMinion2)) -;~ $ClickRax2 = $LeftRax2 -;~ SetLog("Dark Barrack 2 Minion Remaining : " & $LeftRax2, $COLOR_BLUE) -;~ $FirstDarkTrain = False -;~ ElseIf $LeftRax2 > 1 And ($troopMinion2 < 20) And $LeftRax2 <= ($troopMinion2 < 20) Then -;~ Standard_TrainIt($eMinion, $LeftRax2) -;~ $TrainDrax2 = False -;~ SetLog("Dark Barrack 2 Train Minion Completed...", $COLOR_BLUE) -;~ $FirstDarkTrain = False -;~ ElseIf $LeftRax2 <= 1 And ($troopMinion2 < 20) Then -;~ Standard_TrainIt($eMinion, $LeftRax2) -;~ $TrainDrax2 = False -;~ SetLog("Dark Barrack 2 Train Minion Completed...", $COLOR_BLUE) -;~ $FirstDarkTrain = False -;~ Else -;~ SetLog("Dark Barrack 2 Training in progress, Minion Remaining : " & $LeftRax2, $COLOR_BLUE) -;~ $FirstDarkTrain = False -;~ EndIf -;~ EndIf - -;~ If $DarkBarrackTroop[$i] = 1 Then -;~ Local $troopHog2 = Number(getOther(171 + 107 * 1, 278, "Barrack")) -;~ If $itxtDarkBarrack2 <= 10 And ($fullArmy Or $FirstDarkTrain) Then -;~ Standard_TrainIt($eHog, $itxtDarkBarrack2) -;~ $TrainDrax2 = False -;~ SetLog("Dark Barrack 2 Train Hog Completed...", $COLOR_BLUE) -;~ $FirstDarkTrain = False -;~ ElseIf $itxtDarkBarrack2 > 10 And ($fullArmy Or $FirstDarkTrain) Then -;~ Standard_TrainIt($eHog, 10) -;~ $LeftRax2 = ($itxtDarkBarrack2 - 10) -;~ $ClickRax2 = $LeftRax2 -;~ SetLog("Dark Barrack 2 Hog Remaining : " & $LeftRax2, $COLOR_BLUE) -;~ $FirstDarkTrain = False -;~ ElseIf $LeftRax2 > 1 And ($troopHog2 < 10) And $LeftRax2 > ($troopHog2 < 10) Then -;~ Standard_TrainIt($eHog, (10 - $troopHog2)) -;~ $LeftRax2 = ($ClickRax2 - (10 - $troopHog2)) -;~ $ClickRax2 = $LeftRax2 -;~ SetLog("Dark Barrack 2 Hog Remaining : " & $LeftRax2, $COLOR_BLUE) -;~ $FirstDarkTrain = False -;~ ElseIf $LeftRax2 > 1 And ($troopHog2 < 10) And $LeftRax2 <= ($troopHog2 < 10) Then -;~ Standard_TrainIt($eHog, $LeftRax2) -;~ $TrainDrax2 = False -;~ SetLog("Dark Barrack 2 Train Hog Completed...", $COLOR_BLUE) -;~ $FirstDarkTrain = False -;~ ElseIf $LeftRax2 <= 1 And ($troopHog2 < 10) Then -;~ Standard_TrainIt($eHog, $LeftRax2) -;~ $TrainDrax2 = False -;~ SetLog("Dark Barrack 2 Train Hog Completed...", $COLOR_BLUE) -;~ $FirstDarkTrain = False -;~ Else -;~ SetLog("Dark Barrack 2 Training in progress, Hog Remaining : " & $LeftRax2, $COLOR_BLUE) -;~ $FirstDarkTrain = False -;~ EndIf -;~ EndIf - -;~ If $DarkBarrackTroop[$i] = 2 Then -;~ Local $troopValkyrie2 = Number(getOther(171 + 107 * 2, 278, "Barrack")) -;~ If $itxtDarkBarrack2 <= 7 And ($fullArmy Or $FirstDarkTrain) Then -;~ Standard_TrainIt($eValkyrie, $itxtDarkBarrack2) -;~ $TrainDrax2 = False -;~ SetLog("Dark Barrack 2 Train Valkyrie Completed...", $COLOR_BLUE) -;~ $FirstDarkTrain = False -;~ ElseIf $itxtDarkBarrack2 > 7 And ($fullArmy Or $FirstDarkTrain) Then -;~ Standard_TrainIt($eValkyrie, 7) -;~ $LeftRax2 = ($itxtDarkBarrack2 - 7) -;~ $ClickRax2 = $LeftRax2 -;~ SetLog("Dark Barrack 2 Valkyrie Remaining : " & $LeftRax2, $COLOR_BLUE) -;~ $FirstDarkTrain = False -;~ ElseIf $LeftRax2 > 1 And ($troopValkyrie2 < 7) And $LeftRax2 > ($troopValkyrie2 < 7) Then -;~ Standard_TrainIt($eValkyrie, (7 - $troopValkyrie2)) -;~ $LeftRax2 = ($ClickRax2 - (7 - $troopValkyrie2)) -;~ $ClickRax2 = $LeftRax2 -;~ SetLog("Dark Barrack 2 Valkyrie Remaining : " & $LeftRax2, $COLOR_BLUE) -;~ $FirstDarkTrain = False -;~ ElseIf $LeftRax2 > 1 And ($troopValkyrie2 < 7) And $LeftRax2 <= ($troopValkyrie2 < 7) Then -;~ Standard_TrainIt($eValkyrie, $LeftRax2) -;~ $TrainDrax2 = False -;~ SetLog("Dark Barrack 2 Train Valkyrie Completed...", $COLOR_BLUE) -;~ $FirstDarkTrain = False -;~ ElseIf $LeftRax2 <= 1 And ($troopValkyrie2 < 7) Then -;~ Standard_TrainIt($eValkyrie, $LeftRax2) -;~ $TrainDrax2 = False -;~ SetLog("Dark Barrack 2 Train Valkyrie Completed...", $COLOR_BLUE) -;~ $FirstDarkTrain = False -;~ Else -;~ SetLog("Dark Barrack 2 Training in progress, Valkyrie Remaining : " & $LeftRax2, $COLOR_BLUE) -;~ $FirstDarkTrain = False -;~ EndIf -;~ EndIf -;~ EndIf - -;~ If _Sleep(100) Then ExitLoop -;~ Click($TopLeftClient[0], $TopLeftClient[1], 2, 250); Click away twice with 250ms delay -;~ Next -;~ SetLog(GetLangText("msgDarkTroopComplete"), $COLOR_BLUE) -;~ $FirstDarkTrain = False -;~ END DARK TROOPS - DllClose($hDLL) -EndFunc ;==>Standard_Train - -Func Standard_MakeSpells() - If _Sleep(100) Then Return - - ClickP($TopLeftClient) ;Click Away - - If $SpellPos[0] = "" Then - If Not LocateSpellFactory() Then Return - SaveConfig() - Else - If _Sleep(500) Then Return - Click($SpellPos[0], $SpellPos[1]) ;Click Spell Factory - EndIf - - If _Sleep(500) Then Return ;Do a bit slower - _CaptureRegion() - Local $BSpellPos = _WaitForPixel(214, 581, 368, 583, Hex(0x4084B8, 6), 5, 3) ;Finds Info button, wait max 3 seconds - If IsArray($BSpellPos) = False Then - SetLog(GetLangText("msgSFUnavailable"), $COLOR_RED) - If $DebugMode = 2 Then _GDIPlus_ImageSaveToFile($hBitmap, $dirDebug & "SpellNA-" & @HOUR & @MIN & @SEC & ".png") - EndIf - - ;If _Sleep(1000) Then Return - Local $BSpellPos = _PixelSearch(500, 603, 570, 605, Hex(0x07346F, 6), 5) ;Finds create spells button - If IsArray($BSpellPos) Then - Click($BSpellPos[0], $BSpellPos[1]) - _WaitForPixel(720, 150, 740, 170, Hex(0xD80404, 6), 5, 1) ;Finds Red Cross button in new Training popup window - SetLog(GetLangText("msgMakingSpell") & GUICtrlRead($cmbSpellCreate) & " x " & $itxtspellcap, $COLOR_BLUE) - Click(220 + _GUICtrlComboBox_GetCurSel($cmbSpellCreate) * 106, 320, $itxtspellcap) - If _Sleep(500) Then Return - ClickP($TopLeftClient) - $spellsstarted = True - Else - SetLog(GetLangText("msgUnableCreate"), $COLOR_RED) - EndIf - - ;ClickP($TopLeftClient) ;Click Away - If _Sleep(500) Then Return - ClickP($TopLeftClient) ;Click Away -EndFunc ;==>Standard_MakeSpells +;ReadyCheck is in charge of build full army and spell. +;When Army is full, ReadyCheck will Return True +;Hero status check will be done later in the loop, right before start search +Func Standard_ReadyCheck($TimeSinceNewTroop) + + If $TimeSinceNewTroop > Standard_GetTrainTime() + 60 Then + If $stuckCount < 3 Then + $FirstStart = True + SetLog(GetLangText("msgAppearsStuck")) + $stuckCount += 1 + ElseIf $stuckCount >= 3 Then + SetLog(GetLangText("msgSevereStuck")) + $stuckCount += 1 + EndIf + EndIf + + $fullarmy = Standard_CheckArmyCamp() + If StatusCheck() Then Return False + + If Not $fullarmy And $stuckCount < 3 Then Standard_Train() + If StatusCheck() Then Return False + + If IsChecked($chkMakeSpells) Then + $fullSpellFactory = CheckFullSpellFactory() + If StatusCheck() Then Return False + + If Not $fullSpellFactory Then Standard_MakeSpells() + If StatusCheck() Then Return False + EndIf + + If $stuckCount >= 3 And (IsChecked($chkDeadActivate) Or IsChecked($chkAnyActivate)) Then + $fullarmy = True + EndIf + + If $fullarmy And (IsChecked($chkDeadActivate) Or IsChecked($chkAnyActivate)) Then + Return True + EndIf + + If IsChecked($chkMakeSpells) Then + If $fullSpellFactory And IsChecked($chkNukeOnly) And Not IsChecked($chkNukeOnlyWithFullArmy) Then + Return True + EndIf + EndIf + + Return False +EndFunc ;==>Standard_ReadyCheck + +;Quick check before start searching +;Check Hero status +;If last search failed, also check spell status and army status +;If army is not full for some reason, return false, else return true +Func Standard_miniReadyCheck() + + ; Verify hero availability + ChkKingAvailability() + ChkQueenAvailability() + If $SearchFailed Then ;Last search failed, do additional checks + $fullarmy = Standard_CheckArmyCamp() + If Not $fullarmy And $stuckCount < 3 Then + Return False ;Troop missing in not stuck situation, exit loop and restart training + Else + $fullarmy = True ;Set the flag again, search condition can be properly populated + EndIf + If StatusCheck() Then Return False + + If IsChecked($chkMakeSpells) Then + $fullSpellFactory = CheckFullSpellFactory() + If StatusCheck() Then Return False + EndIf + Else ;SearchFailed=False + ;reset SearchCount only when last search wasn't failed + $SearchCount = 0 + EndIf + + If Not AdjustSearchCond() Then + ;No search condition is valid + SetLog(GetLangText("msgHeroNotReady"), $COLOR_PURPLE) + + If $KingUG And _ + Not (IsChecked($chkDeadActivate) And Not IsChecked($chkDeadKingAvail)) And _ + Not (IsChecked($chkAnyActivate) And Not IsChecked($chkKingAvail)) Then + ;King is upgrading, and all enabled search method need king + SetLog(GetLangText("msgWarningKingUG"), $COLOR_RED) + EndIf + If $QueenUG And _ + Not (IsChecked($chkDeadActivate) And Not IsChecked($chkDeadQueenAvail)) And _ + Not (IsChecked($chkAnyActivate) And Not IsChecked($chkQueenAvail)) Then + ;Queen is upgrading, and all enabled search method need king + SetLog(GetLangText("msgWarningQueenUG"), $COLOR_RED) + EndIf + ;Since Hero is required and not ready, we'd better wait outside, at lease we can donate. + ;Wait a bit before return, avoid bot being too busy ;) + _Sleep(20000) + Return False + EndIf + + Return True + +EndFunc ;==>Standard_miniReadyCheck + + +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 ;==>Standard_GetTrainTime + +Func Standard_CheckArmyCamp() + SetLog(GetLangText("msgCheckingCamp"), $COLOR_BLUE) + $fullarmy = False + + If _Sleep(100) Then Return + + ClickP($TopLeftClient) ;Click Away + + If $ArmyPos[0] = "" Then + If Not LocateCamp() Then Return + SaveConfig() + Else + If _Sleep(500) Then Return + Click($ArmyPos[0], $ArmyPos[1]) ;Click Army Camp + EndIf + + _CaptureRegion() + If _Sleep(500) Then Return + Local $BArmyPos = _WaitForPixel(309, 581, 433, 583, Hex(0x4084B8, 6), 5) ;Finds Info button + If IsArray($BArmyPos) = False Then + SetLog(GetLangText("msgCampNA"), $COLOR_RED) + Else + Click($BArmyPos[0], $BArmyPos[1]) ;Click Info button + _WaitForPixel(690, 150, 710, 170, Hex(0xD80407, 6), 5, 1) ;Finds Red Cross button in new popup window + If _Sleep(200) Then Return + For $readattempts = 1 to 20 + $CurCamp = StringStripWS(ReadText(426, 194, 280, $textWindows), 8) + $CurCamp = StringStripWS(StringMid($CurCamp, Stringinstr($CurCamp, ":") + 1), 8) + $itxtcampCap = StringMid($CurCamp, Stringinstr($CurCamp, "/") + 1) + If Number($itxtcampCap) > 0 And Number($itxtcampCap) < 300 And StringIsDigit($itxtcampCap) Then + $CurCamp = StringLeft($CurCamp, StringInStr($CurCamp, "/") - 1) + If Number($CurCamp) >= 0 And Number($CurCamp) <= $itxtcampCap And StringIsDigit($CurCamp) Then + SetLog(GetLangText("msgTotalCampCap") & $CurCamp & "/" & $itxtcampCap, $COLOR_GREEN) + ExitLoop + EndIf + EndIf + If _Sleep(500) Then Return + If $readattempts = 20 Then + SetLog(GetLangText("msgTotalCampCap") & GetLangText("lblUnknownCap"), $COLOR_GREEN) + $CurCamp = 0 + If $itxtcampCap = 0 then $itxtcampCap = 240 + EndIf + Next + + If ($CurCamp/$itxtcampCap) >= ((_GUICtrlComboBox_GetCurSel($cmbRaidcap)+1)/10) Then + $fullarmy = True + Else + _CaptureRegion() + If $FirstStart Then + $ArmyComp = 0 + $CurGiant = 0 + $CurWB = 0 + $CurArch = 0 + $CurBarb = 0 + $CurGoblin = 0 + EndIf + For $i = 0 To 6 + Local $TroopKind = _GetPixelColor(254 + 62 * $i, 375) + Local $TroopKind2 = _GetPixelColor(264 + 62 * $i, 380) + Local $TroopName = "" + Local $TroopQ = StringStripWS(ReadText(239 + (62 * $i), 350, 37, $textWindows), 3) + If StringLeft($TroopQ, 1) = "x" Then $TroopQ = StringRight($TroopQ, StringLen($TroopQ) - 1) + $TroopQ = Number($TroopQ) + If _ColorCheck($TroopKind, Hex(0xEC4989, 6), 30) Then + If ($CurArch = 0 And $FirstStart) Then $CurArch -= $TroopQ + $TroopName = "Archers" + ElseIf _ColorCheck($TroopKind, Hex(0xFFC020, 6), 30) Then + If ($CurBarb = 0 And $FirstStart) Then $CurBarb -= $TroopQ + $TroopName = "Barbarians" + ElseIf _ColorCheck($TroopKind, Hex(0xFFC17F, 6), 30) Then + If ($CurGiant = 0 And $FirstStart) Then $CurGiant -= $TroopQ + $TroopName = "Giants" + ElseIf _ColorCheck($TroopKind, Hex(0x90E658, 6), 30) Then + If ($CurGoblin = 0 And $FirstStart) Then $CurGoblin -= $TroopQ + $TroopName = "Goblins" + ElseIf _ColorCheck($TroopKind2, Hex(0xD06C38, 6), 30) Then + If ($CurWB = 0 And $FirstStart) Then $CurWB -= $TroopQ + $TroopName = "Wallbreakers" + ElseIf _ColorCheck($TroopKind, Hex(0x151F37, 6), 20) Then + If ($FirstStart) Then $CurMinion -= $TroopQ + $TroopName = "Minions" + ElseIf _ColorCheck($TroopKind, Hex(0x4C2E26, 6), 30) Then + If ($FirstStart) Then $CurHog -= $TroopQ + $TroopName = "Hogs" + ElseIf _ColorCheck($TroopKind, Hex(0xA95E58, 6), 30) Then + If ($FirstStart) Then $CurValkyrie -= $TroopQ + $TroopName = "Valkyries" + EndIf + If $TroopName = "" Then $TroopName = "Unknown" + If $TroopQ <> 0 Then SetLog("- " & $TroopName & " " & $TroopQ, $COLOR_GREEN) + Next + EndIf + ClickP($TopLeftClient) ;Click Away + $FirstCampView = True + EndIf + Return $fullarmy +EndFunc ;==>Standard_CheckArmyCamp + +;Uses the location of manually set Barracks to train specified troops + +; Train the troops (Fill the barracks) + +Func Standard_GetTrainPos($TroopKind) + Switch $TroopKind + Case $eBarbarian ; 261, 366: 0x39D8E0 + Return $TrainBarbarian + Case $eArcher ; 369, 366: 0x39D8E0 + Return $TrainArcher + Case $eGiant ; 475, 366: 0x3DD8E0 + Return $TrainGiant + Case $eGoblin ; 581, 366: 0x39D8E0 + Return $TrainGoblin + Case $eWallbreaker ; 635, 335, 0x3AD8E0 + Return $TrainWallbreaker + Case $eMinion + Return $TrainMinion + Case $eHog + Return $TrainHog + Case $eValkyrie + Return $TrainValkyrie + Case Else + SetLog(GetLangText("msgDontKnow") & $TroopKind & GetLangText("msgYet")) + Return 0 + EndSwitch +EndFunc ;==>Standard_GetTrainPos + +Func Standard_TrainIt($TroopKind, $howMuch = 1, $iSleep = 100) + _CaptureRegion() + Local $pos = Standard_GetTrainPos($TroopKind) + If IsArray($pos) Then + If CheckPixel($pos) Then + ClickP($pos, $howMuch, 20) + If _Sleep($iSleep) Then Return False + Return True + EndIf + EndIf +EndFunc ;==>Standard_TrainIt + +Func Standard_GetTrainPosDll() + $res = CallHelper("170 290 700 500 BrokenBotMatchObject 200 6 0") + + If $res <> $DLLFailed And $res <> $DLLTimeout Then + If $res = $DLLLicense Then + SetLog(GetLangText("msgLicense"), $COLOR_RED) + ElseIf $res = $DLLNegative Then + ; failed to find training buttons + SetLog(GetLangText("Failed finding troop training..."), $COLOR_RED) + Return False + Else + $expRet = StringSplit($res, "|", 2) + $numTroops = $expRet[0] + $foundMinion = false + $foundHog = false + $foundValkyrie = false + For $j = 1 To UBound($expRet) - 1 Step 6 + $ResX = $expRet[$j] + 170 + $ResY = $expRet[$j + 1] + 290 + $ResID = $expRet[$j + 4] + If $ResX = 0 And $ResY = 0 Then ExitLoop + + ;Only deal with minions, hogs, valks for now + If $ResID = 11 Then ;minions + $foundMinion = true + $TrainMinionDll[0] = $ResX + $TrainMinionDll[1] = $ResY + ElseIf $ResID = 12 Then ;hogs + $foundHog = true + $TrainHogDll[0] = $ResX + $TrainHogDll[1] = $ResY + ElseIf $ResID = 13 Then ;valks + $foundValkyrie = true + $TrainValkyrieDll[0] = $ResX + $TrainValkyrieDll[1] = $ResY + EndIf + Next + + If Not $foundMinion Then + $TrainMinionDll[0] = -1 + $TrainMinionDll[1] = -1 + EndIf + + If Not $foundHog Then + $TrainHogDll[0] = -1 + $TrainHogDll[1] = -1 + EndIf + + If Not $foundValkyrie Then + $TrainValkyrieDll[0] = -1 + $TrainValkyrieDll[1] = -1 + EndIf + + If $DebugMode = 2 Then + SetLog("Minions: X:" & $TrainMinionDll[0] & " Y:" & $TrainMinionDll[1]) + SetLog("Hogs: X:" & $TrainHogDll[0] & " Y:" & $TrainHogDll[1]) + SetLog("Valkyries: X:" & $TrainValkyrieDll[0] & " Y:" & $TrainValkyrieDll[1]) + EndIf + + Return True + EndIf + Else + SetLog(GetLangText("msgDLLError"), $COLOR_RED) + $ResX = 0 + $ResY = 0 + Return False ; return 0 + EndIf +EndFunc ;==>Standard_GetTrainPosDll + +Func Standard_TrainItDll($TroopKind, $howMuch = 1, $iSleep = 100) + Switch $TroopKind + Case $eMinion + $pos = $TrainMinionDll + Case $eHog + $pos = $TrainHogDll + Case $eValkyrie + $pos = $TrainValkyrieDll + Case Else + SetLog(GetLangText("msgDontKnow") & $TroopKind & GetLangText("msgYet")) + Return + EndSwitch + If $pos[0] <> -1 Then + ClickP($pos, $howMuch, 20) + If _Sleep($iSleep) Then Return False + Return True + EndIf + +EndFunc ;==>Standard_TrainItDll + +Func Standard_Train($reset = False) + resetBarracksError() + If $barrackPos[0][0] = "" Then + If Not LocateBarrack() Then Return + SaveConfig() + If _Sleep(2000) Then Return + EndIf + + SetLog(GetLangText("msgTrainingTroops"), $COLOR_BLUE) + + If $reset Then ; reset all for cook again on startup + $ArmyComp = 0 + $CurGiant = 0 + $CurWB = 0 + $CurArch = 0 + $CurBarb = 0 + $CurGoblin = 0 + EndIf + + If (($ArmyComp = 0) And (_GUICtrlComboBox_GetCurSel($cmbTroopComp) <> 8)) Or $FixTrain Then + If $FixTrain Or $FirstStart And Not $reset Then $ArmyComp = $CurCamp + $FixTrain = False + $CurGiant += GUICtrlRead($txtNumGiants) + $CurWB += GUICtrlRead($txtNumWallbreakers) + $CurArch += Floor((($itxtcampCap * GUICtrlRead($cmbRaidcap) / 100) - (GUICtrlRead($txtNumGiants) * 5) - (GUICtrlRead($txtNumWallbreakers) * 2)) * (GUICtrlRead($txtArchers) / 100)) + $CurBarb += Floor((($itxtcampCap * GUICtrlRead($cmbRaidcap) / 100) - (GUICtrlRead($txtNumGiants) * 5) - (GUICtrlRead($txtNumWallbreakers) * 2)) * (GUICtrlRead($txtBarbarians) / 100)) + $CurGoblin += Floor((($itxtcampCap * GUICtrlRead($cmbRaidcap) / 100) - (GUICtrlRead($txtNumGiants) * 5) - (GUICtrlRead($txtNumWallbreakers) * 2)) * (GUICtrlRead($txtGoblins) / 100)) +;~ SetLog("CurArch" & $CurArch & "one: " & $itxtcampCap & ":" & GUICtrlRead($cmbRaidcap) & "two :" & (GUICtrlRead($txtNumGiants) * 5) & "three:" & (GUICtrlRead($txtNumWallbreakers) * 2) & "four:" & (GUICtrlRead($txtArchers) / 100)) +;~ SetLog("CurBarb" & $CurBarb) +;~ SetLog("CurGoblin" & $CurGoblin) + If $CurArch < 0 Then $CurArch = 0 + If $CurBarb < 0 Then $CurBarb = 0 + If $CurGoblin < 0 Then $CurGoblin = 0 + If $CurWB < 0 Then $CurWB = 0 + If $CurGiant < 0 Then $CurGiant = 0 + If ($CurArch + $CurBarb + $CurGoblin + (5 * $CurGiant) + (2 * $CurWB)) < $itxtcampCap Then + If $CurArch > 0 Then + $CurArch += 1 + EndIf + If ($CurArch + $CurBarb + $CurGoblin + (5 * $CurGiant) + (2 * $CurWB)) < $itxtcampCap Then + If $CurBarb > 0 Then + $CurBarb += 1 + EndIf + If ($CurArch + $CurBarb + $CurGoblin + (5 * $CurGiant) + (2 * $CurWB)) < $itxtcampCap Then + If $CurGoblin > 0 Then + $CurGoblin += 1 + EndIf + EndIf + EndIf + EndIf + SetLog(GetLangText("msgForcesNeededB") & $CurBarb & GetLangText("msgForcesNeededA") & $CurArch & GetLangText("msgForcesNeededGo") & $CurGoblin & GetLangText("msgForcesNeededGi") & $CurGiant & GetLangText("msgForcesNeededWB") & $CurWB, $COLOR_GREEN) + EndIf + + Local $GiantEBarrack, $WallEBarrack, $ArchEBarrack, $BarbEBarrack, $GoblinEBarrack + $GiantEBarrack = Floor($CurGiant / 4) + $WallEBarrack = Floor($CurWB / 4) + $ArchEBarrack = Floor($CurArch / 4) + $BarbEBarrack = Floor($CurBarb / 4) + $GoblinEBarrack = Floor($CurGoblin / 4) + + Local $troopFirstGiant, $troopSecondGiant, $troopFirstWall, $troopSecondWall, $troopFirstGoblin, $troopSecondGoblin, $troopFirstBarba, $troopSecondBarba, $troopFirstArch, $troopSecondArch + $troopFirstGiant = 0 + $troopSecondGiant = 0 + $troopFirstWall = 0 + $troopSecondWall = 0 + $troopFirstGoblin = 0 + $troopSecondGoblin = 0 + $troopFirstBarba = 0 + $troopSecondBarba = 0 + $troopFirstArch = 0 + $troopSecondArch = 0 + + Local $BarrackControl + Local $expUIRet[2] + + For $i = 0 To 3 + + If _Sleep(500) Then ExitLoop + + ClickP($TopLeftClient) ;Click Away + + If _Sleep(500) Then ExitLoop + + Click($barrackPos[$i][0], $barrackPos[$i][1]) ;Click Barrack + If _Sleep(500) Then ExitLoop + + $expUIRet[0] = -1 + $resUI = CallHelper("0 0 860 720 BrokenBotMatchButton 108 1 3") + If $resUI <> $DLLFailed And $resUI <> $DLLTimeout Then + If $resUI = $DLLNegative Then + ; Didn't find button + ElseIf $resUI = $DLLLicense Then + SetLog(GetLangText("msgLicense"), $COLOR_RED) + Else + $expUIRet = StringSplit($resUI, "|", 2) + EndIf + Else + SetLog(GetLangText("msgDLLError"), $COLOR_RED) + EndIf + If $expUIRet[0] = -1 Then + SetLog(GetLangText("msgBarrack") & $i + 1 & GetLangText("msgNotAvailable"), $COLOR_RED) + handleBarracksError($i) + If _Sleep(500) Then ExitLoop + Else + Click($expUIRet[1], $expUIRet[2]) ;Click Train Troops button + _WaitForPixel(720, 150, 740, 170, Hex(0xD80404, 6), 5, 1) ;Finds Red Cross button in new Training popup window + + If _GUICtrlComboBox_GetCurSel($cmbTroopComp) = 8 Then + Switch $i + Case 0 + $BarrackControl = $cmbBarrack1 + Case 1 + $BarrackControl = $cmbBarrack2 + Case 2 + $BarrackControl = $cmbBarrack3 + Case 3 + $BarrackControl = $cmbBarrack4 + EndSwitch + _CaptureRegion() + Local $safeguarding = 0 + Switch _GUICtrlComboBox_GetCurSel($BarrackControl) + Case 0 + While _ColorCheck(_GetPixelColor(216, 325), Hex(0xF09D1C, 6), 30) And ($safeguarding < 200) + $safeguarding += 1 + Click(216, 325, 75) ;Barbarian + If _Sleep(150) Then ExitLoop + _CaptureRegion() + WEnd + Case 1 + While _ColorCheck(_GetPixelColor(330, 323), Hex(0xE84070, 6), 30) And ($safeguarding < 200) + $safeguarding += 1 + Click(325, 320, 75) ;Archer + If _Sleep(150) Then ExitLoop + _CaptureRegion() + WEnd + Case 2 + While _ColorCheck(_GetPixelColor(419, 319), Hex(0xF88409, 6), 30) And ($safeguarding < 200) + $safeguarding += 1 + Click(419, 319, 20) ;Giant + If _Sleep(150) Then ExitLoop + _CaptureRegion() + WEnd + Case 3 + While _ColorCheck(_GetPixelColor(549, 328), Hex(0xFB4C24, 6), 30) And ($safeguarding < 200) + $safeguarding += 1 + Click(535, 320, 75) ;Goblin + If _Sleep(150) Then ExitLoop + _CaptureRegion() + WEnd + Case 4 + While _ColorCheck(_GetPixelColor(685, 327), Hex(0x9E4716, 6), 30) And ($safeguarding < 200) + $safeguarding += 1 + Click(641, 341, 20) ;Wall Breaker + If _Sleep(150) Then ExitLoop + _CaptureRegion() + WEnd + Case 5 + While _ColorCheck(_GetPixelColor(213, 418), Hex(0x861F15, 6), 30) And ($safeguarding < 200) + $safeguarding += 1 + Click(213, 418, 20) ;Balloon + If _Sleep(150) Then ExitLoop + _CaptureRegion() + WEnd + Case 6 + While _ColorCheck(_GetPixelColor(340, 449), Hex(0xF09C85, 6), 30) And ($safeguarding < 200) + $safeguarding += 1 + Click(325, 425, 20) ;Wizard + If _Sleep(150) Then ExitLoop + _CaptureRegion() + WEnd + Case 7 + While _ColorCheck(_GetPixelColor(440, 445), Hex(0xFDD8C0, 6), 30) And ($safeguarding < 200) + $safeguarding += 1 + Click(440, 445, 10) ;Healer + If _Sleep(150) Then ExitLoop + _CaptureRegion() + WEnd + Case 8 + While _ColorCheck(_GetPixelColor(539, 444), Hex(0x302848, 6), 30) And ($safeguarding < 200) + $safeguarding += 1 + Click(539, 444, 10) ;Dragon + If _Sleep(150) Then ExitLoop + _CaptureRegion() + WEnd + Case 9 + While _ColorCheck(_GetPixelColor(647, 440), Hex(0x456180, 6), 30) And ($safeguarding < 200) + $safeguarding += 1 + Click(647, 440, 10) ;PEKKA + If _Sleep(150) Then ExitLoop + _CaptureRegion() + WEnd + Case Else + If _Sleep(50) Then ExitLoop + _CaptureRegion() + EndSwitch + Else + SetLog("====== " & GetLangText("msgBarrack") & $i + 1 & " : ======", $COLOR_BLUE) + _CaptureRegion() + ;while _ColorCheck(_GetPixelColor(496, 200), Hex(0x880000, 6), 20) Then + If $reset Or $FirstStart Then + Click(503, 180, 80, 5) + EndIf + ;wend + + If _Sleep(500) Then ExitLoop + _CaptureRegion() + If GUICtrlRead($txtNumGiants) <> "0" Then + $troopFirstGiant = StringStripWS(ReadText(181 + (2 * 107), 298, 35, $textWindows),3) + If StringRight($troopFirstGiant, 1) = "x" Then $troopFirstGiant = StringLeft($troopFirstGiant, StringLen($troopFirstGiant) - 1) + EndIf + + If GUICtrlRead($txtNumWallbreakers) <> "0" Then + $troopFirstWall = StringStripWS(ReadText(181 + (4 * 107), 298, 35, $textWindows),3) + If StringRight($troopFirstWall, 1) = "x" Then $troopFirstWall = StringLeft($troopFirstWall, StringLen($troopFirstWall) - 1) + EndIf + + If GUICtrlRead($txtGoblins) <> "0" Then + $troopFirstGoblin = StringStripWS(ReadText(181 + (3* 107), 298, 35, $textWindows),3) + If StringRight($troopFirstGoblin, 1) = "x" Then $troopFirstGoblin = StringLeft($troopFirstGoblin, StringLen($troopFirstGoblin) - 1) + EndIf + + If GUICtrlRead($txtBarbarians) <> "0" Then + $troopFirstBarba = StringStripWS(ReadText(181, 298, 35, $textWindows),3) + If StringRight($troopFirstBarba, 1) = "x" Then $troopFirstBarba = StringLeft($troopFirstBarba, StringLen($troopFirstBarba) - 1) + EndIf + + If GUICtrlRead($txtArchers) <> "0" Then + $troopFirstArch = StringStripWS(ReadText(181 + 107, 298, 35, $textWindows),3) + If StringRight($troopFirstArch, 1) = "x" Then $troopFirstArch = StringLeft($troopFirstArch, StringLen($troopFirstArch) - 1) + EndIf + + If GUICtrlRead($txtNumGiants) <> "0" And $CurGiant > 0 Then + ;If _ColorCheck(_GetPixelColor(475, 366), Hex(0x3DD8E0, 6), 20) And $CurGiant > 0 Then + If $CurGiant > 0 Then + If $GiantEBarrack = 0 Then + Standard_TrainIt($eGiant, 1) + ElseIf $GiantEBarrack >= $CurGiant Or $GiantEBarrack = 0 Then + Standard_TrainIt($eGiant, $CurGiant) + Else + Standard_TrainIt($eGiant, $GiantEBarrack) + EndIf + EndIf + EndIf + + If GUICtrlRead($txtNumWallbreakers) <> "0" And $CurWB > 0 Then + ;If _ColorCheck(_GetPixelColor(688, 366), Hex(0x3AD8E0, 6), 20) And $CurWB > 0 Then + If $CurWB > 0 Then + If $WallEBarrack = 0 Then + Standard_TrainIt($eWallbreaker, 1) + ElseIf $WallEBarrack >= $CurWB Or $WallEBarrack = 0 Then + Standard_TrainIt($eWallbreaker, $CurWB) + Else + Standard_TrainIt($eWallbreaker, $WallEBarrack) + EndIf + EndIf + EndIf + + If GUICtrlRead($txtGoblins) <> "0" And $CurGoblin > 0 Then + ;If _ColorCheck(_GetPixelColor(261, 366), Hex(0x39D8E0, 6), 20) And $CurGoblin > 0 Then + If $CurGoblin > 0 Then + If $GoblinEBarrack = 0 Then + Standard_TrainIt($eGoblin, 1) + ElseIf $GoblinEBarrack >= $CurGoblin Or $GoblinEBarrack = 0 Then + Standard_TrainIt($eGoblin, $CurGoblin) + Else + Standard_TrainIt($eGoblin, $GoblinEBarrack) + EndIf + EndIf + EndIf + + If GUICtrlRead($txtArchers) <> "0" And $CurArch > 0 Then + ;If _ColorCheck(_GetPixelColor(261, 366), Hex(0x39D8E0, 6), 20) And $CurArch > 0 Then + If $CurArch > 0 Then + If $ArchEBarrack = 0 Then + Standard_TrainIt($eArcher, 1) + ElseIf $ArchEBarrack >= $CurArch Then + Standard_TrainIt($eArcher, $CurArch) + Else + Standard_TrainIt($eArcher, $ArchEBarrack) + EndIf + EndIf + EndIf + + If GUICtrlRead($txtBarbarians) <> "0" And $CurBarb > 0 Then + ;If _ColorCheck(_GetPixelColor(369, 366), Hex(0x39D8E0, 6), 20) And $CurBarb > 0 Then + If $CurBarb > 0 Then + If $BarbEBarrack = 0 Then + Standard_TrainIt($eBarbarian, 1) + ElseIf $BarbEBarrack >= $CurBarb Or $BarbEBarrack = 0 Then + Standard_TrainIt($eBarbarian, $CurBarb) + Else + Standard_TrainIt($eBarbarian, $BarbEBarrack) + EndIf + EndIf + EndIf + + If _Sleep(900) Then ExitLoop + _CaptureRegion() + + If GUICtrlRead($txtNumGiants) <> "0" Then + $troopSecondGiant = StringStripWS(ReadText(181 + (2 * 107), 298, 35, $textWindows),3) + If StringRight($troopSecondGiant, 1) = "x" Then + $troopSecondGiant = StringLeft($troopSecondGiant, StringLen($troopSecondGiant) - 1) + Else + $troopSecondGiant = 0 + EndIf + EndIf + + If GUICtrlRead($txtNumWallbreakers) <> "0" Then + $troopSecondWall = StringStripWS(ReadText(181 + (4 * 107), 298, 35, $textWindows),3) + If StringRight($troopSecondWall, 1) = "x" Then + $troopSecondWall = StringLeft($troopSecondWall, StringLen($troopSecondWall) - 1) + Else + $troopSecondWall = 0 + EndIf + EndIf + + If GUICtrlRead($txtGoblins) <> "0" Then + $troopSecondGoblin = StringStripWS(ReadText(181 + (3* 107), 298, 35, $textWindows),3) + If StringRight($troopSecondGoblin, 1) = "x" Then + $troopSecondGoblin = StringLeft($troopSecondGoblin, StringLen($troopSecondGoblin) - 1) + Else + $troopSecondGoblin = 0 + EndIf + EndIf + + If GUICtrlRead($txtBarbarians) <> "0" Then + $troopSecondBarba = StringStripWS(ReadText(181, 298, 35, $textWindows),3) + If StringRight($troopSecondBarba, 1) = "x" Then + $troopSecondBarba = StringLeft($troopSecondBarba, StringLen($troopSecondBarba) - 1) + Else + $troopSecondBarba = 0 + EndIf + EndIf + + If GUICtrlRead($txtArchers) <> "0" Then + $troopSecondArch = StringStripWS(ReadText(181 + 107, 298, 35, $textWindows),3) + If StringRight($troopSecondArch, 1) = "x" Then + $troopSecondArch = StringLeft($troopSecondArch, StringLen($troopSecondArch) - 1) + Else + $troopSecondArch = 0 + EndIf + EndIf + + If $troopSecondGiant > $troopFirstGiant And GUICtrlRead($txtNumGiants) <> "0" Then + $ArmyComp += ($troopSecondGiant - $troopFirstGiant) * 5 + $CurGiant -= ($troopSecondGiant - $troopFirstGiant) + SetLog(GetLangText("msgBarrack") & ($i + 1) & GetLangText("msgTraining") & GetLangText("troopNameGiant") & " : " & ($troopSecondGiant - $troopFirstGiant), $COLOR_GREEN) + SetLog("Giant Remaining : " & $CurGiant, $COLOR_BLUE) + EndIf + + + If $troopSecondWall > $troopFirstWall And GUICtrlRead($txtNumWallbreakers) <> "0" Then + $ArmyComp += ($troopSecondWall - $troopFirstWall) * 2 + $CurWB -= ($troopSecondWall - $troopFirstWall) + SetLog(GetLangText("msgBarrack") & ($i + 1) & GetLangText("msgTraining") & GetLangText("troopNameWallBreaker") & " : " & ($troopSecondWall - $troopFirstWall), $COLOR_GREEN) + SetLog("WallBreaker Remaining : " & $CurWB, $COLOR_BLUE) + EndIf + + If $troopSecondGoblin > $troopFirstGoblin And GUICtrlRead($txtGoblins) <> "0" Then + $ArmyComp += ($troopSecondGoblin - $troopFirstGoblin) + $CurGoblin -= ($troopSecondGoblin - $troopFirstGoblin) + SetLog(GetLangText("msgBarrack") & ($i + 1) & GetLangText("msgTraining") & GetLangText("troopNameGoblin") & " : " & ($troopSecondGoblin - $troopFirstGoblin), $COLOR_GREEN) + SetLog("Goblin Remaining : " & $CurGoblin, $COLOR_BLUE) + EndIf + + If $troopSecondBarba > $troopFirstBarba And GUICtrlRead($txtBarbarians) <> "0" Then + $ArmyComp += ($troopSecondBarba - $troopFirstBarba) + $CurBarb -= ($troopSecondBarba - $troopFirstBarba) + SetLog(GetLangText("msgBarrack") & ($i + 1) & GetLangText("msgTraining") & GetLangText("troopNameBarbarian") & " : " & ($troopSecondBarba - $troopFirstBarba), $COLOR_GREEN) + SetLog("Barbarian Remaining : " & $CurBarb, $COLOR_BLUE) + EndIf + + If $troopSecondArch > $troopFirstArch And GUICtrlRead($txtArchers) <> "0" Then + $ArmyComp += ($troopSecondArch - $troopFirstArch) + $CurArch -= ($troopSecondArch - $troopFirstArch) + SetLog(GetLangText("msgBarrack") & ($i + 1) & GetLangText("msgTraining") & GetLangText("troopNameArcher") & " : " & ($troopSecondArch - $troopFirstArch), $COLOR_GREEN) + SetLog("Archer Remaining : " & $CurArch, $COLOR_BLUE) + EndIf + SetLog(GetLangText("msgTotalBuilding") & $ArmyComp, $COLOR_RED) + EndIf + EndIf + If _Sleep(100) Then ExitLoop + Click($TopLeftClient[0], $TopLeftClient[1], 2, 250); Click away twice with 250ms delay + Next + If $brerror[0] = True And $brerror[1] = True And $brerror[2] = True And $brerror[3] = True Then + resetBarracksError() + $needzoomout = True + SetLog(GetLangText("msgRestartComplete"), $COLOR_RED) + Else + SetLog(GetLangText("msgTrainingComp"), $COLOR_BLUE) + EndIf + +;~ BEGIN DARK TROOPS + $ichkDarkTroop = Not (($DarkBarrackTroop[0] = 3 And $DarkBarrackTroop[1] = 3 And $DarkBarrackTroopNext[0] = 3 And $DarkBarrackTroopNext[0] = 3) Or (GUICtrlRead($txtDarkBarrack1) + GUICtrlRead($txtDarkBarrack2) + GUICtrlRead($txtDarkBarrack1Next) + GUICtrlRead($txtDarkBarrack2Next) = 0)) + If $ichkDarkTroop = False Then + $FirstStart = False + Return + EndIf + $DarkBarrackTroop[0] = _GUICtrlComboBox_GetCurSel($cmbDarkBarrack1) + $DarkBarrackTroop[1] = _GUICtrlComboBox_GetCurSel($cmbDarkBarrack2) + + $DarkBarrackTroopNext[0] = _GUICtrlComboBox_GetCurSel($cmbDarkBarrack1Next) + $DarkBarrackTroopNext[1] = _GUICtrlComboBox_GetCurSel($cmbDarkBarrack2Next) + + + + Local $TrainPos[2] + If $DarkBarrackPos[0][0] = "" And GUICtrlRead($txtDarkBarrack1) <> "0" And GUICtrlRead($txtDarkBarrack2) <> "0" Then + LocateDarkBarrack() + SaveConfig() + If _Sleep(2000) Then Return + EndIf + + Global $LeftRax1, $LeftRax2, $TrainDrax1, $TrainDrax2, $ClickRax1, $ClickRax2 + Global $LeftRax1Next, $LeftRax2Next, $TrainDrax1Next, $TrainDrax2Next, $ClickRax1Next, $ClickRax2Next + Global $FirstDarkTrain, $FirstDarkTrain2, $FirstDarkTrainNext, $FirstDarkTrain2Next + + If $fullArmy Or $FirstStart Then + $TrainDrax1 = True + $TrainDrax2 = True + $TrainDrax1Next = True + $TrainDrax2Next = True + $FirstDarkTrain = true + $FirstDarkTrain2 = true + $FirstDarkTrainNext = true + $FirstDarkTrain2Next = true + EndIf + + If $TrainDrax1 = False And $TrainDrax2 = False And $TrainDrax1Next = False And $TrainDrax2Next = False Then Return + + + + SetLog(GetLangText("msgTrainingDark"), $COLOR_BLUE) + For $i = 0 To 1 + If _Sleep(500) Then ExitLoop + + ClickP($TopLeftClient) ;Click Away + + If _Sleep(500) Then ExitLoop + Click($DarkBarrackPos[$i][0], $DarkBarrackPos[$i][1]) ;Click Dark Barrack + If _Sleep(500) Then ExitLoop + + $res = CallHelper("0 0 860 720 BrokenBotMatchObject 108 3 0") + If $res <> $DLLFailed And $res <> $DLLTimeout Then + If $res = $DLLNegative Then + SetLog(GetLangText("msgDarkBarrack") & $i + 1 & GetLangText("msgNotAvailable"), $COLOR_RED) + Return + ElseIf $res = $DLLLicense Then + SetLog(GetLangText("msgLicense"), $COLOR_RED) + Else + $expUIRet = StringSplit($res, "|", 2) + $TrainPos[0] = $expUIRet[1] + $TrainPos[1] = $expUIRet[2] + If $DebugMode = 2 Then SetLog("DB Train:" & $TrainPos[0] & " Y:" & $TrainPos[1]) + EndIf + EndIf + Click($TrainPos[0], $TrainPos[1]) ;Click Train Troops button + If _Sleep(800) Then ExitLoop + + _CaptureRegion() + If $fullArmy Or $FirstStart Then ;Reset troops on first loop, or if army is full to start cooking for next attack + If Not _ColorCheck(_GetPixelColor(502, 179), Hex(0xD1D0C2, 6), 20) Then + Click(502, 179, 80, 2) + EndIf + EndIf + + Standard_GetTrainPosDll() + + ;Dark Barrack 1 + If GUICtrlRead($txtDarkBarrack1) <> "0" And $i = 0 And $TrainDrax1 = True Then + $itxtDarkBarrack1 = GUICtrlRead($txtDarkBarrack1) + If $DarkBarrackTroop[$i] = 0 Then + Local $troopMinion = Number(getOther(171 + 107 * 0, 278, "Barrack")) + If $itxtDarkBarrack1 <= 20 And ($fullArmy Or $FirstDarkTrain) Then + Standard_TrainItDll($eMinion, $itxtDarkBarrack1) + $TrainDrax1 = False + SetLog("Dark Barrack 1 Train Minion Completed...", $COLOR_BLUE) + $FirstDarkTrain = False + ElseIf $itxtDarkBarrack1 > 20 And ($fullArmy Or $FirstDarkTrain) Then + Standard_TrainItDll($eMinion, 20) + $LeftRax1 = ($itxtDarkBarrack1 - 20) + $ClickRax1 = $LeftRax1 + SetLog("Dark Barrack 1 Minion Remaining : " & $LeftRax1, $COLOR_BLUE) + $FirstDarkTrain = False + ElseIf $LeftRax1 > 1 And ($troopMinion < 20) And $LeftRax1 > ($troopMinion < 20) Then + Standard_TrainItDll($eMinion, (20 - $troopMinion)) + $LeftRax1 = ($ClickRax1 - (20 - $troopMinion)) + $ClickRax1 = $LeftRax1 + SetLog("Dark Barrack 1 Minion Remaining : " & $LeftRax1, $COLOR_BLUE) + $FirstDarkTrain = False + ElseIf $LeftRax1 > 1 And ($troopMinion < 20) And $LeftRax1 <= ($troopMinion < 20) Then + Standard_TrainItDll($eMinion, $LeftRax1) + $TrainDrax1 = False + SetLog("Dark Barrack 1 Train Minion Completed...", $COLOR_BLUE) + $FirstDarkTrain = False + ElseIf $LeftRax1 <= 1 And ($troopMinion < 20) Then + Standard_TrainItDll($eMinion, $LeftRax1) + $TrainDrax1 = False + SetLog("Dark Barrack 1 Train Minion Completed...", $COLOR_BLUE) + $FirstDarkTrain = False + Else + SetLog("Dark Barrack 1 Training in progress, Minion Remaining : " & $LeftRax1, $COLOR_BLUE) + $FirstDarkTrain = False + EndIf + EndIf + + If $DarkBarrackTroop[$i] = 1 Then + Local $troopHog = Number(getOther(171 + 107 * 1, 278, "Barrack")) + If $itxtDarkBarrack1 <= 10 And ($fullArmy Or $FirstDarkTrain) Then + Standard_TrainItDll($eHog, $itxtDarkBarrack1) + $TrainDrax1 = False + SetLog("Dark Barrack 1 Train Hog Completed...", $COLOR_BLUE) + $FirstDarkTrain = False + ElseIf $itxtDarkBarrack1 > 10 And ($fullArmy Or $FirstDarkTrain) Then + Standard_TrainItDll($eHog, 10) + $LeftRax1 = ($itxtDarkBarrack1 - 10) + $ClickRax1 = $LeftRax1 + SetLog("Dark Barrack 1 Hog Remaining : " & $LeftRax1, $COLOR_BLUE) + $FirstDarkTrain = False + ElseIf $LeftRax1 > 1 And ($troopHog < 10) And $LeftRax1 > ($troopHog < 10) Then + Standard_TrainItDll($eHog, (10 - $troopHog)) + $LeftRax1 = ($ClickRax1 - (10 - $troopHog)) + $ClickRax1 = $LeftRax1 + SetLog("Dark Barrack 1 Hog Remaining : " & $LeftRax1, $COLOR_BLUE) + $FirstDarkTrain = False + ElseIf $LeftRax1 > 1 And ($troopHog < 10) And $LeftRax1 <= ($troopHog < 10) Then + Standard_TrainItDll($eHog, $LeftRax1) + $TrainDrax1 = False + SetLog("Dark Barrack 1 Train Hog Completed...", $COLOR_BLUE) + $FirstDarkTrain = False + ElseIf $LeftRax1 <= 1 And ($troopHog < 10) Then + Standard_TrainItDll($eHog, $LeftRax1) + $TrainDrax1 = False + SetLog("Dark Barrack 1 Train Hog Completed...", $COLOR_BLUE) + $FirstDarkTrain = False + Else + SetLog("Dark Barrack 1 Training in progress, Hog Remaining : " & $LeftRax1, $COLOR_BLUE) + $FirstDarkTrain = False + EndIf + EndIf + + If $DarkBarrackTroop[$i] = 2 Then + Local $troopValkyrie = Number(getOther(171 + 107 * 2, 278, "Barrack")) + If $itxtDarkBarrack1 <= 7 And ($fullArmy Or $FirstDarkTrain) Then + Standard_TrainItDll($eValkyrie, $itxtDarkBarrack1) + $TrainDrax1 = False + SetLog("Dark Barrack 1 Train Valkyrie Completed...", $COLOR_BLUE) + $FirstDarkTrain = False + ElseIf $itxtDarkBarrack1 > 7 And ($fullArmy Or $FirstDarkTrain) Then + Standard_TrainItDll($eValkyrie, 7) + $LeftRax1 = ($itxtDarkBarrack1 - 7) + $ClickRax1 = $LeftRax1 + SetLog("Dark Barrack 1 Valkyrie Remaining : " & $LeftRax1, $COLOR_BLUE) + $FirstDarkTrain = False + ElseIf $LeftRax1 > 1 And ($troopValkyrie < 7) And $LeftRax1 > ($troopValkyrie < 7) Then + Standard_TrainItDll($eValkyrie, (7 - $troopValkyrie)) + $LeftRax1 = ($ClickRax1 - (7 - $troopValkyrie)) + $ClickRax1 = $LeftRax1 + SetLog("Dark Barrack 1 Valkyrie Remaining : " & $LeftRax1, $COLOR_BLUE) + $FirstDarkTrain = False + ElseIf $LeftRax1 > 1 And ($troopValkyrie < 7) And $LeftRax1 <= ($troopValkyrie < 7) Then + Standard_TrainItDll($eValkyrie, $LeftRax1) + $TrainDrax1 = False + SetLog("Dark Barrack 1 Train Valkyrie Completed...", $COLOR_BLUE) + $FirstDarkTrain = False + ElseIf $LeftRax1 <= 1 And ($troopValkyrie < 7) Then + Standard_TrainItDll($eValkyrie, $LeftRax1) + $TrainDrax1 = False + SetLog("Dark Barrack 1 Train Valkyrie Completed...", $COLOR_BLUE) + $FirstDarkTrain = False + Else + SetLog("Dark Barrack 1 Training in progress, Valkyrie Remaining : " & $LeftRax1, $COLOR_BLUE) + $FirstDarkTrain = False + EndIf + EndIf + EndIf + + ;Second Troop type + If GUICtrlRead($txtDarkBarrack1Next) <> "0" And $i = 0 And $TrainDrax1Next = True Then + $itxtDarkBarrack1Next = GUICtrlRead($txtDarkBarrack1Next) + If $DarkBarrackTroopNext[$i] = 0 Then + Local $troopMinion = Number(getOther(171 + 107 * 0, 278, "Barrack")) + If $itxtDarkBarrack1Next <= 20 And ($fullArmy Or $FirstDarkTrainNext) Then + Standard_TrainItDll($eMinion, $itxtDarkBarrack1Next) + $TrainDrax1Next = False + SetLog("Dark Barrack 1 Train Minion Completed...", $COLOR_BLUE) + $FirstDarkTrainNext = False + ElseIf $itxtDarkBarrack1Next > 20 And ($fullArmy Or $FirstDarkTrainNext) Then + Standard_TrainItDll($eMinion, 20) + $LeftRax1Next = ($itxtDarkBarrack1Next - 20) + $ClickRax1Next = $LeftRax1Next + SetLog("Dark Barrack 1 Minion Remaining : " & $LeftRax1Next, $COLOR_BLUE) + $FirstDarkTrainNext = False + ElseIf $LeftRax1Next > 1 And ($troopMinion < 20) And $LeftRax1Next > ($troopMinion < 20) Then + Standard_TrainItDll($eMinion, (20 - $troopMinion)) + $LeftRax1Next = ($ClickRax1Next - (20 - $troopMinion)) + $ClickRax1Next = $LeftRax1Next + SetLog("Dark Barrack 1 Minion Remaining : " & $LeftRax1Next, $COLOR_BLUE) + $FirstDarkTrainNext = False + ElseIf $LeftRax1Next > 1 And ($troopMinion < 20) And $LeftRax1Next <= ($troopMinion < 20) Then + Standard_TrainItDll($eMinion, $LeftRax1Next) + $TrainDrax1Next = False + SetLog("Dark Barrack 1 Train Minion Completed...", $COLOR_BLUE) + $FirstDarkTrainNext = False + ElseIf $LeftRax1Next <= 1 And ($troopMinion < 20) Then + Standard_TrainItDll($eMinion, $LeftRax1Next) + $TrainDrax1Next = False + SetLog("Dark Barrack 1 Train Minion Completed...", $COLOR_BLUE) + $FirstDarkTrainNext = False + Else + SetLog("Dark Barrack 1 Training in progress, Minion Remaining : " & $LeftRax1Next, $COLOR_BLUE) + $FirstDarkTrainNext = False + EndIf + EndIf + + If $DarkBarrackTroopNext[$i] = 1 Then + Local $troopHog = Number(getOther(171 + 107 * 1, 278, "Barrack")) + If $itxtDarkBarrack1Next <= 10 And ($fullArmy Or $FirstDarkTrainNext) Then + Standard_TrainItDll($eHog, $itxtDarkBarrack1Next) + $TrainDrax1Next = False + SetLog("Dark Barrack 1 Train Hog Completed...", $COLOR_BLUE) + $FirstDarkTrainNext = False + ElseIf $itxtDarkBarrack1Next > 10 And ($fullArmy Or $FirstDarkTrainNext) Then + Standard_TrainItDll($eHog, 10) + $LeftRax1Next = ($itxtDarkBarrack1Next - 10) + $ClickRax1Next = $LeftRax1Next + SetLog("Dark Barrack 1 Hog Remaining : " & $LeftRax1Next, $COLOR_BLUE) + $FirstDarkTrainNext = False + ElseIf $LeftRax1Next > 1 And ($troopHog < 10) And $LeftRax1Next > ($troopHog < 10) Then + Standard_TrainItDll($eHog, (10 - $troopHog)) + $LeftRax1Next = ($ClickRax1Next - (10 - $troopHog)) + $ClickRax1Next = $LeftRax1Next + SetLog("Dark Barrack 1 Hog Remaining : " & $LeftRax1Next, $COLOR_BLUE) + $FirstDarkTrainNext = False + ElseIf $LeftRax1Next > 1 And ($troopHog < 10) And $LeftRax1Next <= ($troopHog < 10) Then + Standard_TrainItDll($eHog, $LeftRax1Next) + $TrainDrax1Next = False + SetLog("Dark Barrack 1 Train Hog Completed...", $COLOR_BLUE) + $FirstDarkTrainNext = False + ElseIf $LeftRax1Next <= 1 And ($troopHog < 10) Then + Standard_TrainItDll($eHog, $LeftRax1Next) + $TrainDrax1Next = False + SetLog("Dark Barrack 1 Train Hog Completed...", $COLOR_BLUE) + $FirstDarkTrainNext = False + Else + SetLog("Dark Barrack 1 Training in progress, Hog Remaining : " & $LeftRax1Next, $COLOR_BLUE) + $FirstDarkTrainNext = False + EndIf + EndIf + + If $DarkBarrackTroopNext[$i] = 2 Then + Local $troopValkyrie = Number(getOther(171 + 107 * 2, 278, "Barrack")) + If $itxtDarkBarrack1Next <= 7 And ($fullArmy Or $FirstDarkTrainNext) Then + Standard_TrainItDll($eValkyrie, $itxtDarkBarrack1Next) + $TrainDrax1Next = False + SetLog("Dark Barrack 1 Train Valkyrie Completed...", $COLOR_BLUE) + $FirstDarkTrainNext = False + ElseIf $itxtDarkBarrack1Next > 7 And ($fullArmy Or $FirstDarkTrainNext) Then + Standard_TrainItDll($eValkyrie, 7) + $LeftRax1Next = ($itxtDarkBarrack1Next - 7) + $ClickRax1Next = $LeftRax1Next + SetLog("Dark Barrack 1 Valkyrie Remaining : " & $LeftRax1Next, $COLOR_BLUE) + $FirstDarkTrainNext = False + ElseIf $LeftRax1Next > 1 And ($troopValkyrie < 7) And $LeftRax1Next > ($troopValkyrie < 7) Then + Standard_TrainItDll($eValkyrie, (7 - $troopValkyrie)) + $LeftRax1Next = ($ClickRax1Next - (7 - $troopValkyrie)) + $ClickRax1Next = $LeftRax1Next + SetLog("Dark Barrack 1 Valkyrie Remaining : " & $LeftRax1Next, $COLOR_BLUE) + $FirstDarkTrainNext = False + ElseIf $LeftRax1Next > 1 And ($troopValkyrie < 7) And $LeftRax1Next <= ($troopValkyrie < 7) Then + Standard_TrainItDll($eValkyrie, $LeftRax1Next) + $TrainDrax1Next = False + SetLog("Dark Barrack 1 Train Valkyrie Completed...", $COLOR_BLUE) + $FirstDarkTrainNext = False + ElseIf $LeftRax1Next <= 1 And ($troopValkyrie < 7) Then + Standard_TrainItDll($eValkyrie, $LeftRax1Next) + $TrainDrax1Next = False + SetLog("Dark Barrack 1 Train Valkyrie Completed...", $COLOR_BLUE) + $FirstDarkTrainNext = False + Else + SetLog("Dark Barrack 1 Training in progress, Valkyrie Remaining : " & $LeftRax1Next, $COLOR_BLUE) + $FirstDarkTrainNext = False + EndIf + EndIf + EndIf + + ;Dark Barrack 2 + If GUICtrlRead($txtDarkBarrack2) <> "0" And $i = 1 And $TrainDrax2 = True Then + $itxtDarkBarrack2 = GUICtrlRead($txtDarkBarrack2) + If $DarkBarrackTroop[$i] = 0 Then + Local $troopMinion2 = Number(getOther(171 + 107 * 0, 278, "Barrack")) + If $itxtDarkBarrack2 <= 20 And ($fullArmy Or $FirstDarkTrain2) Then + Standard_TrainItDll($eMinion, $itxtDarkBarrack2) + $TrainDrax2 = False + SetLog("Dark Barrack 2 Train Minion Completed...", $COLOR_BLUE) + $FirstDarkTrain2 = False + ElseIf $itxtDarkBarrack2 > 20 And ($fullArmy Or $FirstDarkTrain2) Then + Standard_TrainItDll($eMinion, 20) + $LeftRax2 = ($itxtDarkBarrack2 - 20) + $ClickRax2 = $LeftRax2 + SetLog("Dark Barrack 2 Minion Remaining : " & $LeftRax2, $COLOR_BLUE) + $FirstDarkTrain2 = False + ElseIf $LeftRax2 > 1 And ($troopMinion2 < 20) And $LeftRax2 > ($troopMinion2 < 20) Then + Standard_TrainItDll($eMinion, (20 - $troopMinion2)) + $LeftRax2 = ($ClickRax2 - (20 - $troopMinion2)) + $ClickRax2 = $LeftRax2 + SetLog("Dark Barrack 2 Minion Remaining : " & $LeftRax2, $COLOR_BLUE) + $FirstDarkTrain2 = False + ElseIf $LeftRax2 > 1 And ($troopMinion2 < 20) And $LeftRax2 <= ($troopMinion2 < 20) Then + Standard_TrainItDll($eMinion, $LeftRax2) + $TrainDrax2 = False + SetLog("Dark Barrack 2 Train Minion Completed...", $COLOR_BLUE) + $FirstDarkTrain2 = False + ElseIf $LeftRax2 <= 1 And ($troopMinion2 < 20) Then + Standard_TrainItDll($eMinion, $LeftRax2) + $TrainDrax2 = False + SetLog("Dark Barrack 2 Train Minion Completed...", $COLOR_BLUE) + $FirstDarkTrain2 = False + Else + SetLog("Dark Barrack 2 Training in progress, Minion Remaining : " & $LeftRax2, $COLOR_BLUE) + $FirstDarkTrain2 = False + EndIf + EndIf + + If $DarkBarrackTroop[$i] = 1 Then + Local $troopHog2 = Number(getOther(171 + 107 * 1, 278, "Barrack")) + If $itxtDarkBarrack2 <= 10 And ($fullArmy Or $FirstDarkTrain2) Then + Standard_TrainItDll($eHog, $itxtDarkBarrack2) + $TrainDrax2 = False + SetLog("Dark Barrack 2 Train Hog Completed...", $COLOR_BLUE) + $FirstDarkTrain2 = False + ElseIf $itxtDarkBarrack2 > 10 And ($fullArmy Or $FirstDarkTrain2) Then + Standard_TrainItDll($eHog, 10) + $LeftRax2 = ($itxtDarkBarrack2 - 10) + $ClickRax2 = $LeftRax2 + SetLog("Dark Barrack 2 Hog Remaining : " & $LeftRax2, $COLOR_BLUE) + $FirstDarkTrain2 = False + ElseIf $LeftRax2 > 1 And ($troopHog2 < 10) And $LeftRax2 > ($troopHog2 < 10) Then + Standard_TrainItDll($eHog, (10 - $troopHog2)) + $LeftRax2 = ($ClickRax2 - (10 - $troopHog2)) + $ClickRax2 = $LeftRax2 + SetLog("Dark Barrack 2 Hog Remaining : " & $LeftRax2, $COLOR_BLUE) + $FirstDarkTrain2 = False + ElseIf $LeftRax2 > 1 And ($troopHog2 < 10) And $LeftRax2 <= ($troopHog2 < 10) Then + Standard_TrainItDll($eHog, $LeftRax2) + $TrainDrax2 = False + SetLog("Dark Barrack 2 Train Hog Completed...", $COLOR_BLUE) + $FirstDarkTrain2 = False + ElseIf $LeftRax2 <= 1 And ($troopHog2 < 10) Then + Standard_TrainItDll($eHog, $LeftRax2) + $TrainDrax2 = False + SetLog("Dark Barrack 2 Train Hog Completed...", $COLOR_BLUE) + $FirstDarkTrain2 = False + Else + SetLog("Dark Barrack 2 Training in progress, Hog Remaining : " & $LeftRax2, $COLOR_BLUE) + $FirstDarkTrain2 = False + EndIf + EndIf + + If $DarkBarrackTroop[$i] = 2 Then + Local $troopValkyrie2 = Number(getOther(171 + 107 * 2, 278, "Barrack")) + If $itxtDarkBarrack2 <= 7 And ($fullArmy Or $FirstDarkTrain2) Then + Standard_TrainItDll($eValkyrie, $itxtDarkBarrack2) + $TrainDrax2 = False + SetLog("Dark Barrack 2 Train Valkyrie Completed...", $COLOR_BLUE) + $FirstDarkTrain2 = False + ElseIf $itxtDarkBarrack2 > 7 And ($fullArmy Or $FirstDarkTrain2) Then + Standard_TrainItDll($eValkyrie, 7) + $LeftRax2 = ($itxtDarkBarrack2 - 7) + $ClickRax2 = $LeftRax2 + SetLog("Dark Barrack 2 Valkyrie Remaining : " & $LeftRax2, $COLOR_BLUE) + $FirstDarkTrain2 = False + ElseIf $LeftRax2 > 1 And ($troopValkyrie2 < 7) And $LeftRax2 > ($troopValkyrie2 < 7) Then + Standard_TrainItDll($eValkyrie, (7 - $troopValkyrie2)) + $LeftRax2 = ($ClickRax2 - (7 - $troopValkyrie2)) + $ClickRax2 = $LeftRax2 + SetLog("Dark Barrack 2 Valkyrie Remaining : " & $LeftRax2, $COLOR_BLUE) + $FirstDarkTrain2 = False + ElseIf $LeftRax2 > 1 And ($troopValkyrie2 < 7) And $LeftRax2 <= ($troopValkyrie2 < 7) Then + Standard_TrainItDll($eValkyrie, $LeftRax2) + $TrainDrax2 = False + SetLog("Dark Barrack 2 Train Valkyrie Completed...", $COLOR_BLUE) + $FirstDarkTrain2 = False + ElseIf $LeftRax2 <= 1 And ($troopValkyrie2 < 7) Then + Standard_TrainItDll($eValkyrie, $LeftRax2) + $TrainDrax2 = False + SetLog("Dark Barrack 2 Train Valkyrie Completed...", $COLOR_BLUE) + $FirstDarkTrain2 = False + Else + SetLog("Dark Barrack 2 Training in progress, Valkyrie Remaining : " & $LeftRax2, $COLOR_BLUE) + $FirstDarkTrain2 = False + EndIf + EndIf + EndIf + + ;Second Troop type + If GUICtrlRead($txtDarkBarrack2Next) <> "0" And $i = 1 And $TrainDrax2Next = True Then + $itxtDarkBarrack2Next = GUICtrlRead($txtDarkBarrack2Next) + If $DarkBarrackTroopNext[$i] = 0 Then + Local $troopMinion = Number(getOther(171 + 107 * 0, 278, "Barrack")) + If $itxtDarkBarrack2Next <= 20 And ($fullArmy Or $FirstDarkTrain2Next) Then + Standard_TrainItDll($eMinion, $itxtDarkBarrack2Next) + $TrainDrax2Next = False + SetLog("Dark Barrack 2 Train Minion Completed...", $COLOR_BLUE) + $FirstDarkTrain2Next = False + ElseIf $itxtDarkBarrack2Next > 20 And ($fullArmy Or $FirstDarkTrain2Next) Then + Standard_TrainItDll($eMinion, 20) + $LeftRax2Next = ($itxtDarkBarrack2Next - 20) + $ClickRax2Next = $LeftRax2Next + SetLog("Dark Barrack 2 Minion Remaining : " & $LeftRax2Next, $COLOR_BLUE) + $FirstDarkTrain2Next = False + ElseIf $LeftRax2Next > 1 And ($troopMinion < 20) And $LeftRax2Next > ($troopMinion < 20) Then + Standard_TrainItDll($eMinion, (20 - $troopMinion)) + $LeftRax2Next = ($ClickRax2Next - (20 - $troopMinion)) + $ClickRax2Next = $LeftRax2Next + SetLog("Dark Barrack 2 Minion Remaining : " & $LeftRax2Next, $COLOR_BLUE) + $FirstDarkTrain2Next = False + ElseIf $LeftRax2Next > 1 And ($troopMinion < 20) And $LeftRax2Next <= ($troopMinion < 20) Then + Standard_TrainItDll($eMinion, $LeftRax2Next) + $TrainDrax2Next = False + SetLog("Dark Barrack 2 Train Minion Completed...", $COLOR_BLUE) + $FirstDarkTrain2Next = False + ElseIf $LeftRax2Next <= 1 And ($troopMinion < 20) Then + Standard_TrainItDll($eMinion, $LeftRax2Next) + $TrainDrax2Next = False + SetLog("Dark Barrack 2 Train Minion Completed...", $COLOR_BLUE) + $FirstDarkTrain2Next = False + Else + SetLog("Dark Barrack 2 Training in progress, Minion Remaining : " & $LeftRax2Next, $COLOR_BLUE) + $FirstDarkTrain2Next = False + EndIf + EndIf + + If $DarkBarrackTroopNext[$i] = 1 Then + Local $troopHog = Number(getOther(171 + 107 * 1, 278, "Barrack")) + If $itxtDarkBarrack2Next <= 10 And ($fullArmy Or $FirstDarkTrain2Next) Then + Standard_TrainItDll($eHog, $itxtDarkBarrack2Next) + $TrainDrax2Next = False + SetLog("Dark Barrack 2 Train Hog Completed...", $COLOR_BLUE) + $FirstDarkTrain2Next = False + ElseIf $itxtDarkBarrack2Next > 10 And ($fullArmy Or $FirstDarkTrain2Next) Then + Standard_TrainItDll($eHog, 10) + $LeftRax2Next = ($itxtDarkBarrack2Next - 10) + $ClickRax2Next = $LeftRax2Next + SetLog("Dark Barrack 2 Hog Remaining : " & $LeftRax2Next, $COLOR_BLUE) + $FirstDarkTrain2Next = False + ElseIf $LeftRax2Next > 1 And ($troopHog < 10) And $LeftRax2Next > ($troopHog < 10) Then + Standard_TrainItDll($eHog, (10 - $troopHog)) + $LeftRax2Next = ($ClickRax2Next - (10 - $troopHog)) + $ClickRax2Next = $LeftRax2Next + SetLog("Dark Barrack 2 Hog Remaining : " & $LeftRax2Next, $COLOR_BLUE) + $FirstDarkTrain2Next = False + ElseIf $LeftRax2Next > 1 And ($troopHog < 10) And $LeftRax2Next <= ($troopHog < 10) Then + Standard_TrainItDll($eHog, $LeftRax2Next) + $TrainDrax2Next = False + SetLog("Dark Barrack 2 Train Hog Completed...", $COLOR_BLUE) + $FirstDarkTrain2Next = False + ElseIf $LeftRax2Next <= 1 And ($troopHog < 10) Then + Standard_TrainItDll($eHog, $LeftRax2Next) + $TrainDrax2Next = False + SetLog("Dark Barrack 2 Train Hog Completed...", $COLOR_BLUE) + $FirstDarkTrain2Next = False + Else + SetLog("Dark Barrack 2 Training in progress, Hog Remaining : " & $LeftRax2Next, $COLOR_BLUE) + $FirstDarkTrain2Next = False + EndIf + EndIf + + If $DarkBarrackTroopNext[$i] = 2 Then + Local $troopValkyrie = Number(getOther(171 + 107 * 2, 278, "Barrack")) + If $itxtDarkBarrack2Next <= 7 And ($fullArmy Or $FirstDarkTrain2Next) Then + Standard_TrainItDll($eValkyrie, $itxtDarkBarrack2Next) + $TrainDrax2Next = False + SetLog("Dark Barrack 2 Train Valkyrie Completed...", $COLOR_BLUE) + $FirstDarkTrain2Next = False + ElseIf $itxtDarkBarrack2Next > 7 And ($fullArmy Or $FirstDarkTrain2Next) Then + Standard_TrainItDll($eValkyrie, 7) + $LeftRax2Next = ($itxtDarkBarrack2Next - 7) + $ClickRax2Next = $LeftRax2Next + SetLog("Dark Barrack 2 Valkyrie Remaining : " & $LeftRax2Next, $COLOR_BLUE) + $FirstDarkTrain2Next = False + ElseIf $LeftRax2Next > 1 And ($troopValkyrie < 7) And $LeftRax2Next > ($troopValkyrie < 7) Then + Standard_TrainItDll($eValkyrie, (7 - $troopValkyrie)) + $LeftRax2Next = ($ClickRax2Next - (7 - $troopValkyrie)) + $ClickRax2Next = $LeftRax2Next + SetLog("Dark Barrack 2 Valkyrie Remaining : " & $LeftRax2Next, $COLOR_BLUE) + $FirstDarkTrain2Next = False + ElseIf $LeftRax2Next > 1 And ($troopValkyrie < 7) And $LeftRax2Next <= ($troopValkyrie < 7) Then + Standard_TrainItDll($eValkyrie, $LeftRax2Next) + $TrainDrax2Next = False + SetLog("Dark Barrack 2 Train Valkyrie Completed...", $COLOR_BLUE) + $FirstDarkTrain2Next = False + ElseIf $LeftRax2Next <= 1 And ($troopValkyrie < 7) Then + Standard_TrainItDll($eValkyrie, $LeftRax2Next) + $TrainDrax2Next = False + SetLog("Dark Barrack 2 Train Valkyrie Completed...", $COLOR_BLUE) + $FirstDarkTrain2Next = False + Else + SetLog("Dark Barrack 2 Training in progress, Valkyrie Remaining : " & $LeftRax2Next, $COLOR_BLUE) + $FirstDarkTrain2Next = False + EndIf + EndIf + EndIf + + + If _Sleep(100) Then ExitLoop + Click($TopLeftClient[0], $TopLeftClient[1], 2, 250); Click away twice with 250ms delay + Next + SetLog(GetLangText("msgDarkTroopComplete"), $COLOR_BLUE) + $FirstDarkTrain = False + $FirstDarkTrain2 = False + $FirstDarkTrainNext = False + $FirstDarkTrain2Next = False + $FirstStart = False +;~ END DARK TROOPS +EndFunc ;==>Standard_Train + +Func Standard_MakeSpells() + If _Sleep(100) Then Return + + ClickP($TopLeftClient) ;Click Away + + If $SpellPos[0] = "" Then + If Not LocateSpellFactory() Then Return + SaveConfig() + Else + If _Sleep(500) Then Return + Click($SpellPos[0], $SpellPos[1]) ;Click Spell Factory + EndIf + + If _Sleep(500) Then Return ;Do a bit slower + _CaptureRegion() + Local $BSpellPos = _WaitForPixel(214, 581, 368, 583, Hex(0x4084B8, 6), 5, 3) ;Finds Info button, wait max 3 seconds + If IsArray($BSpellPos) = False Then + SetLog(GetLangText("msgSFUnavailable"), $COLOR_RED) + If $DebugMode = 2 Then _GDIPlus_ImageSaveToFile($hBitmap, $dirDebug & "SpellNA-" & @HOUR & @MIN & @SEC & ".png") + EndIf + + ;If _Sleep(1000) Then Return + Local $BSpellPos = _PixelSearch(500, 603, 570, 605, Hex(0x07346F, 6), 5) ;Finds create spells button + If IsArray($BSpellPos) Then + Click($BSpellPos[0], $BSpellPos[1]) + _WaitForPixel(720, 150, 740, 170, Hex(0xD80404, 6), 5, 1) ;Finds Red Cross button in new Training popup window + SetLog(GetLangText("msgMakingSpell") & GUICtrlRead($cmbSpellCreate) & " x " & $itxtspellcap, $COLOR_BLUE) + Click(220 + _GUICtrlComboBox_GetCurSel($cmbSpellCreate) * 106, 320, $itxtspellcap) + If _Sleep(500) Then Return + ClickP($TopLeftClient) + $spellsstarted = True + Else + SetLog(GetLangText("msgUnableCreate"), $COLOR_RED) + EndIf + + ;ClickP($TopLeftClient) ;Click Away + If _Sleep(500) Then Return + ClickP($TopLeftClient) ;Click Away +EndFunc ;==>Standard_MakeSpells diff --git a/COCBot/functions/Strategies/Standard/Search.au3 b/COCBot/functions/Strategies/Standard/Search.au3 index 5a0ec12..d664f0f 100644 --- a/COCBot/functions/Strategies/Standard/Search.au3 +++ b/COCBot/functions/Strategies/Standard/Search.au3 @@ -1,424 +1,461 @@ -;Searches for a village that until meets conditions - -Func Standard_Search() - Local $skippedVillages - Local $conditionlogstr - Local $AttackMethod - Local $DG, $DE, $DD, $DT, $G, $E, $D, $T - Local $calculateCondition - - _WinAPI_EmptyWorkingSet(WinGetProcess($Title)) ; Reduce BlueStacks Memory Usage - - $hTimerClickNext = TimerInit() ;Next button already pressed before call here - - ;safe to reset flag here. If failed and return -1, this flag will be set again. - $SearchFailed = False - - While 1 - $calculateCondition = False - GUICtrlSetData($lblresultsearchcost, GUICtrlRead($lblresultsearchcost) + $SearchCost) - If $TakeAllTownSnapShot = 1 Then SetLog(GetLangText("msgWillSaveAll"), $COLOR_GREEN) - - _BlockInputEx(3, "", "", $HWnD) - While 1 - ; Make sure end battle button is visible - If Not _WaitForColor(36, 523, Hex(0xEE5056, 6), 50, 10) Then - ChkDisconnection() - Return -1 - EndIf - - ; Make sure clouds have cleared - If Not _WaitForColor(1, 670, Hex(0x02070D, 6), 50, 5) Then Return -1 - - ;If _Sleep($speedBump) Then Return -1 - GUICtrlSetState($btnAtkNow, $GUI_ENABLE) - - ; Wait just a bit extra - If _Sleep(100) Then Return - - If IsChecked($chkTakeTownSS) Then - Local $Date = @MDAY & "." & @MON & "." & @YEAR - Local $Time = @HOUR & "." & @MIN & "." & @SEC - _CaptureRegion() - _GDIPlus_ImageSaveToFile($hBitmap, @ScriptDir & "\AllTowns\" & $Date & " at " & $Time & ".png") - EndIf - -;~ If $DebugMode = 1 And $Hide = False Then ActivateOverlay() -;~ SeekEdges() - - If $calculateCondition = True And ($SearchCount <> 0 And Mod($SearchCount, GUICtrlRead($txtRedNumOfSerach)) = 0) Then - _BumpMouse() - AdjustSearchCond() - EndIf - $calculateCondition = True - - ;Initial working variables - $GoodBase = False - $DEx = 0 - $DEy = 0 - Local $conditionlogstr - $NukeAttack = False - - $BaseData = GetResources() - If Not IsArray($BaseData) Then - SetLog(GetLangText("msgNoNextRestart"), $COLOR_RED) - ChkDisconnection() - Return -1 - EndIf - - $SubmissionSearches += 1 - If StringLen($SubmissionSGold) > 0 Then - $SubmissionSGold &= "|" - $SubmissionSElix &= "|" - $SubmissionSDE &= "|" - $SubmissionSTH &= "|" - $SubmissionSDead &= "|" - EndIf - $SubmissionSGold &= String($BaseData[2]) - $SubmissionSElix &= String($BaseData[3]) - $SubmissionSDE &= String($BaseData[4]) - $SubmissionSTH &= String($BaseData[1]) - $LastAttackTH = String($BaseData[1]) - If $BaseData[0] Then - $SubmissionSDead &= "0" - $LastAttackDead = "0" - Else - $SubmissionSDead &= "1" - $LastAttackDead = "1" - EndIf - - StatSubmission() - - $DG = (Number($BaseData[2]) >= Number($MinDeadGold)) - $DE = (Number($BaseData[3]) >= Number($MinDeadElixir)) - $DD = (Number($BaseData[4]) >= Number($MinDeadDark)) - $DT = (Number($BaseData[5]) >= Number($MinDeadTrophy)) - $G = (Number($BaseData[2]) >= Number($MinGold)) - $E = (Number($BaseData[3]) >= Number($MinElixir)) - $D = (Number($BaseData[4]) >= Number($MinDark)) - $T = (Number($BaseData[5]) >= Number($MinTrophy)) - - $THL = -1 - $THLO = -1 - - For $i = 0 To 4 - If $BaseData[1] = $THText[$i] Then $THL = $i - Next - - Switch $THLoc - Case "In" - $THLO = 0 - Case "Out" - $THLO = 1 - EndSwitch - - If $THLoc = "Out" Then - If (Number(GUICtrlRead($lblresulttrophynow)) < Number(GUICtrlRead($txtSnipeBelow))) Or (IsChecked($chkDeadActivate) And IsChecked($chkDeadSnipe) And $BaseData[0]) Or (IsChecked($chkAnyActivate) And IsChecked($chkSnipe) And Not $BaseData[0]) Then - SetLog(GetLangText("msgSnipeFound"), $COLOR_PURPLE) - $AttackMethod = 3 - ExitLoop - EndIf - EndIf - - ; Variables to check whether to attack dead bases - Local $conditionDeadPass = True - - If IsChecked($chkDeadActivate) And $fullArmy And _ - (Not IsChecked($chkDeadKingAvail) Or $KingAvailable) And _ - (Not IsChecked($chkDeadQueenAvail) Or $QueenAvailable) Then - If IsChecked($chkDeadGE) Then - $deadEnabled = True - If _GUICtrlComboBox_GetCurSel($cmbDead) = 0 Then ; And - If $DG = False Or $DE = False Then $conditionDeadPass = False - Else ; Or - If $DG = False And $DE = False Then $conditionDeadPass = False - EndIf - EndIf - - If IsChecked($chkDeadMeetDE) Then - If $DD = False Then $conditionDeadPass = False - EndIf - - If IsChecked($chkDeadMeetTrophy) Then - If $DT = False Then $conditionDeadPass = False - EndIf - - If IsChecked($chkDeadMeetTH) Then - If $THL = -1 Or $THL > _GUICtrlComboBox_GetCurSel($cmbDeadTH) Then $conditionDeadPass = False - EndIf - - If IsChecked($chkDeadMeetTHO) Then - If $THLO <> 1 Then $conditionDeadPass = False - EndIf - - If $BaseData[0] And $conditionDeadPass Then - SetLog(GetLangText("msgDeadFound"), $COLOR_GREEN) - $GoodBase = True - $AttackMethod = 0 - EndIf - EndIf - - If Not $GoodBase Then - ; Variables to check whether to attack non-dead bases - Local $conditionAnyPass = True - If IsChecked($chkAnyActivate) And $fullArmy And _ - (Not IsChecked($chkKingAvail) Or $KingAvailable) And _ - (Not IsChecked($chkQueenAvail) Or $QueenAvailable) Then - If IsChecked($chkMeetGE) Then - $anyEnabled = True - If _GUICtrlComboBox_GetCurSel($cmbAny) = 0 Then ; And - If $G = False Or $E = False Then $conditionAnyPass = False - Else ; Or - If $G = False And $E = False Then $conditionAnyPass = False - EndIf - EndIf - - If IsChecked($chkMeetDE) Then - If $D = False Then $conditionAnyPass = False - EndIf - - If IsChecked($chkMeetTrophy) Then - If $T = False Then $conditionAnyPass = False - EndIf - - If IsChecked($chkMeetTH) Then - If $THL = -1 Or $THL > _GUICtrlComboBox_GetCurSel($cmbTH) Then $conditionAnyPass = False - EndIf - - If IsChecked($chkMeetTHO) Then - If $THLO <> 1 Then $conditionAnyPass = False - EndIf - - If $conditionAnyPass Then - SetLog(GetLangText("msgOtherFound"), $COLOR_GREEN) - $GoodBase = True - $AttackMethod = 1 - EndIf - EndIf - EndIf - - If Not $GoodBase Then - ; Variables to check whether to zap Dark elixir - If IsChecked($chkNukeOnly) And $fullSpellFactory And $iNukeLimit > 0 Then - If Number($BaseData[4]) >= Number($iNukeLimit) Then - If checkDarkElix() Then - $NukeAttack = True - SetLog(GetLangText("msgZapFound"), $COLOR_GREEN) - $GoodBase = True - $AttackMethod = 2 - EndIf - EndIf - EndIf - EndIf - -;~ If $OverlayVisible Then DeleteOverlay() - - If $GoodBase Then - GUICtrlSetState($btnAtkNow, $GUI_DISABLE) - ExitLoop - Else - _CaptureRegion() - If _ColorCheck(_GetPixelColor(726, 497), Hex(0xF0AE28, 6), 20) Then - ; Attack instantly if Attack Now button pressed - If $AttackNow Then - GUICtrlSetState($btnAtkNow, $GUI_DISABLE) - $AttackNow = False - SetLog(GetLangText("msgAttackNowClicked"), $COLOR_GREEN) - ExitLoop - EndIf - - Local $fDiffNow = TimerDiff($hTimerClickNext) - $fdiffReadGold ;How long in attack prep mode - $RandomDelay = _Random_Gaussian($icmbSearchsp * 1500, ($icmbSearchsp * 1500) / 6) - If $fDiffNow < $speedBump + $RandomDelay Then ; Wait accoridng to search speed + speedBump - If _Sleep($speedBump + $RandomDelay - $fDiffNow) Then ExitLoop (2) - EndIf - - If $AttackNow Then - GUICtrlSetState($btnAtkNow, $GUI_DISABLE) - $AttackNow = False - SetLog(GetLangText("msgAttackNowClicked"), $COLOR_GREEN) - ExitLoop - EndIf - - GUICtrlSetState($btnAtkNow, $GUI_DISABLE) - Click(750, 500) ;Click Next - $hTimerClickNext = TimerInit() - ;Take time to do search - GUICtrlSetData($lblresultvillagesskipped, GUICtrlRead($lblresultvillagesskipped) + 1) - GUICtrlSetData($lblresultsearchcost, GUICtrlRead($lblresultsearchcost) + $SearchCost) - If _Sleep(1000) Then Return -1 - ElseIf _ColorCheck(_GetPixelColor(36, 523), Hex(0xEE5056, 6), 20) Then ;If End battle is available - GUICtrlSetState($btnAtkNow, $GUI_DISABLE) - SetLog(GetLangText("msgNoNextReturn"), $COLOR_RED) - ChkDisconnection(True) - ReturnHome(False, False, True) - Return -1 - Else - GUICtrlSetState($btnAtkNow, $GUI_DISABLE) - SetLog(GetLangText("msgNoNextRestart"), $COLOR_RED) - ChkDisconnection() - Return -1 - EndIf - EndIf - WEnd - GUICtrlSetData($lblresultvillagesattacked, GUICtrlRead($lblresultvillagesattacked) + 1) - GUICtrlSetData($lblresultsearchcost, GUICtrlRead($lblresultsearchcost) + $SearchCost) - If IsChecked($chkAlertSearch) Then - TrayTip("Match Found!", "Gold: " & $BaseData[2] & "; Elixir: " & $BaseData[3] & "; Dark: " & $BaseData[4] & "; Trophy: " & $BaseData[5] & "; Townhall: " & $BaseData[1] & ", " & $THLoc, 0) - If FileExists(@WindowsDir & "\media\Windows Exclamation.wav") Then - SoundPlay(@WindowsDir & "\media\Windows Exclamation.wav", 1) - Else - SoundPlay(@WindowsDir & "\media\Festival\Windows Exclamation.wav", 1) - EndIf - EndIf - $MatchFoundText = "[" & GetLangText("msgGoldinitial") & "]: " & _NumberFormat($BaseData[2]) & "; [" & GetLangText("msgElixirinitial") & "]: " & _NumberFormat($BaseData[3]) & _ - "; [" & GetLangText("msgDarkElixinitial") & "]: " & _NumberFormat($BaseData[4]) & "; [" & GetLangText("msgTrophyInitial") & "]: " & $BaseData[5] & _ - "; [TH Lvl]: " & $BaseData[1] & ", Loc: " & $THLoc & "; [" & GetLangText("msgDeadBase ") & "]:" & $BaseData[0] - If $PushBulletEnabled = 1 And $PushBulletmatchfound = 1 Then - _Push(GetLangText("pushMatch"), $MatchFoundText) - SetLog(GetLangText("msgPushMatch"), $COLOR_GREEN) - EndIf - SetLog(GetLangText("msgSearchComplete"), $COLOR_BLUE) - ;Match found, reset stuckCount flag & searchfailed falg before run readycheck again. - $SearchFailed = False - $stuckCount = 0 - _BlockInputEx(0, "", "", $HWnD) - Return $AttackMethod - WEnd -EndFunc ;==>Standard_Search - -;Adjust and Print out search condition if there is any -;Return True if there is valid condition -;Return False if no valid search condition -Func AdjustSearchCond() - Local $conditionlogsarray[3] ;max three types of base to search - Local $condCounts = 0 - Local $conditionlogstr - Local $CondMultipler - - $CondMultipler = Int($SearchCount / GUICtrlRead($txtRedNumOfSerach)) - - $MaxDeadTH = _GUICtrlComboBox_GetCurSel($cmbDeadTH) - $MaxTH = _GUICtrlComboBox_GetCurSel($cmbTH) - - $MinDeadGold = GUICtrlRead($txtDeadMinGold) * (1 - $CondMultipler * GUICtrlRead($txtRedGoldPercent) / 100) - $MinDeadGold = ($MinDeadGold > 0) ? $MinDeadGold : 0 - $MinDeadElixir = GUICtrlRead($txtDeadMinElixir) * (1 - $CondMultipler * GUICtrlRead($txtRedElixirPercent) / 100) - $MinDeadElixir = ($MinDeadElixir > 0) ? $MinDeadElixir : 0 - $MinDeadDark = GUICtrlRead($txtDeadMinDarkElixir) * (1 - $CondMultipler * GUICtrlRead($txtRedDEPercent) / 100) - $MinDeadDark = ($MinDeadDark > 0) ? $MinDeadDark : 0 - $MinDeadTrophy = Int(GUICtrlRead($txtDeadMinTrophy) * (1 - $CondMultipler * GUICtrlRead($txtRedTrophyPercent) / 100)) - $MinDeadTrophy = ($MinDeadTrophy > 0) ? $MinDeadTrophy : 0 - $MinGold = GUICtrlRead($txtMinGold) * (1 - $CondMultipler * GUICtrlRead($txtRedGoldPercent) / 100) - $MinGold = ($MinGold > 0) ? $MinGold : 0 - $MinElixir = GUICtrlRead($txtMinElixir) * (1 - $CondMultipler * GUICtrlRead($txtRedElixirPercent) / 100) - $MinElixir = ($MinElixir > 0) ? $MinElixir : 0 - $MinDark = GUICtrlRead($txtMinDarkElixir) * (1 - $CondMultipler * GUICtrlRead($txtRedDEPercent) / 100) - $MinDark = ($MinDark > 0) ? $MinDark : 0 - $MinTrophy = Int(GUICtrlRead($txtMinTrophy) * (1 - $CondMultipler * GUICtrlRead($txtRedTrophyPercent) / 100)) - $MinTrophy = ($MinTrophy > 0) ? $MinTrophy : 0 - $iNukeLimit = GUICtrlRead($txtDENukeLimit) * (1 - $CondMultipler * GUICtrlRead($txtRedNukePercent) / 100) - $iNukeLimit = ($iNukeLimit > 0) ? $iNukeLimit : 0 - - ;New condition test for king & queen availablity - If IsChecked($chkDeadActivate) And $fullArmy And _ - (Not IsChecked($chkDeadKingAvail) Or $KingAvailable) And _ - (Not IsChecked($chkDeadQueenAvail) Or $QueenAvailable) Then - $conditionlogstr = "Dead Base (" - If IsChecked($chkDeadGE) Then - If _GUICtrlComboBox_GetCurSel($cmbDead) = 0 Then - $conditionlogstr = $conditionlogstr & " Gold: " & $MinDeadGold & " And " & "Elixir: " & $MinDeadElixir - Else - $conditionlogstr = $conditionlogstr & " Gold: " & $MinDeadGold & " Or " & "Elixir: " & $MinDeadElixir - EndIf - EndIf - If IsChecked($chkDeadMeetDE) Then - If $conditionlogstr <> "Dead Base (" Then - $conditionlogstr = $conditionlogstr & ";" - EndIf - $conditionlogstr = $conditionlogstr & " Dark: " & $MinDeadDark - EndIf - If IsChecked($chkDeadMeetTrophy) Then - If $conditionlogstr <> "Dead Base (" Then - $conditionlogstr = $conditionlogstr & ";" - EndIf - $conditionlogstr = $conditionlogstr & " Trophy: " & $MinDeadTrophy - EndIf - If IsChecked($chkDeadMeetTH) Then - If $conditionlogstr <> "Dead Base (" Then - $conditionlogstr = $conditionlogstr & ";" - EndIf - $conditionlogstr = $conditionlogstr & " Max Townhall: " & $THText[$MaxDeadTH] - EndIf - If IsChecked($chkDeadMeetTHO) Then - If $conditionlogstr <> "Dead Base (" Then - $conditionlogstr = $conditionlogstr & ";" - EndIf - $conditionlogstr = $conditionlogstr & " Townhall Outside" - EndIf - $conditionlogstr = $conditionlogstr & " )" - $conditionlogsarray[$condCounts] = $conditionlogstr - $condCounts += 1 - ;SetLog($conditionlogstr, $COLOR_GREEN) - EndIf - ;New condition test for king & queen availablity - If IsChecked($chkAnyActivate) And $fullArmy And _ - (Not IsChecked($chkKingAvail) Or $KingAvailable) And _ - (Not IsChecked($chkQueenAvail) Or $QueenAvailable) Then - $conditionlogstr = "Live Base (" - If IsChecked($chkMeetGE) Then - If _GUICtrlComboBox_GetCurSel($cmbDead) = 0 Then - $conditionlogstr = $conditionlogstr & " Gold: " & $MinGold & " And " & "Elixir: " & $MinElixir - Else - $conditionlogstr = $conditionlogstr & " Gold: " & $MinGold & " Or " & "Elixir: " & $MinElixir - EndIf - EndIf - If IsChecked($chkMeetDE) Then - If $conditionlogstr <> "Live Base (" Then - $conditionlogstr = $conditionlogstr & ";" - EndIf - $conditionlogstr = $conditionlogstr & " Dark: " & $MinDark - EndIf - If IsChecked($chkMeetTrophy) Then - If $conditionlogstr <> "Live Base (" Then - $conditionlogstr = $conditionlogstr & ";" - EndIf - $conditionlogstr = $conditionlogstr & " Trophy: " & $MinTrophy - EndIf - If IsChecked($chkMeetTH) Then - If $conditionlogstr <> "Live Base (" Then - $conditionlogstr = $conditionlogstr & ";" - EndIf - $conditionlogstr = $conditionlogstr & " Max Townhall: " & $THText[$MaxTH] - EndIf - If IsChecked($chkMeetTHO) Then - If $conditionlogstr <> "Live Base (" Then - $conditionlogstr = $conditionlogstr & ";" - EndIf - $conditionlogstr = $conditionlogstr & " Townhall Outside" - EndIf - $conditionlogstr = $conditionlogstr & " )" - $conditionlogsarray[$condCounts] = $conditionlogstr - $condCounts += 1 - ;SetLog($conditionlogstr, $COLOR_GREEN) - EndIf - If IsChecked($chkNukeOnly) And $fullSpellFactory And $iNukeLimit > 0 Then - $conditionlogstr = "Zap Base ( Dark: " & $iNukeLimit & " )" - $conditionlogsarray[$condCounts] = $conditionlogstr - $condCounts += 1 - ;SetLog($conditionlogstr, $COLOR_GREEN) - EndIf - - ;All condtions here, if there is any - If $condCounts > 0 Then - ;we have valid search condition - SetLog(GetLangText("msgSearchCond"), $COLOR_RED) - For $i = 0 To $condCounts - 1 - SetLog($conditionlogsarray[$i], $COLOR_GREEN) - Next - Return True - Else - Return False - EndIf - -EndFunc ;==>AdjustSearchCond +;Searches for a village that until meets conditions + +Func Standard_Search() + Local $skippedVillages + Local $conditionlogstr + Local $AttackMethod + Local $DG, $DE, $DD, $DT, $DGE, $G, $E, $D, $T, $GE + Local $calculateCondition + Local $stuckSearchCount = 0 + Local $OldBaseData[6] = ["","","","","",""] + + _WinAPI_EmptyWorkingSet(WinGetProcess($Title)) ; Reduce BlueStacks Memory Usage + + $hTimerClickNext = TimerInit() ;Next button already pressed before call here + + ;safe to reset flag here. If failed and return -1, this flag will be set again. + $SearchFailed = False + + While 1 + $calculateCondition = False + GUICtrlSetData($lblresultsearchcost, GUICtrlRead($lblresultsearchcost) + $SearchCost) + If $TakeAllTownSnapShot = 1 Then SetLog(GetLangText("msgWillSaveAll"), $COLOR_GREEN) + + _BlockInputEx(3, "", "", $HWnD) + While 1 + ; Make sure end battle button is visible + If Not _WaitForColorArea(23, 523, 25, 10, Hex(0xEE5056, 6), 50, 10) Then + ChkDisconnection() + Return -1 + EndIf + + ; Make sure clouds have cleared + If Not _WaitForColor(1, 670, Hex(0x02070D, 6), 50, 5) Then Return -1 + + ;If _Sleep($speedBump) Then Return -1 + GUICtrlSetState($btnAtkNow, $GUI_ENABLE) + + ; Wait just a bit extra + If _Sleep(100) Then Return + + If IsChecked($chkTakeTownSS) Then + Local $Date = @MDAY & "." & @MON & "." & @YEAR + Local $Time = @HOUR & "." & @MIN & "." & @SEC + _CaptureRegion() + _GDIPlus_ImageSaveToFile($hBitmap, @ScriptDir & "\AllTowns\" & $Date & " at " & $Time & ".png") + EndIf + +;~ If $DebugMode = 1 And $Hide = False Then ActivateOverlay() +;~ SeekEdges() + + If $calculateCondition = True And ($SearchCount <> 0 And Mod($SearchCount, GUICtrlRead($txtRedNumOfSerach)) = 0) Then + _BumpMouse() + AdjustSearchCond() + EndIf + $calculateCondition = True + + ;Initial working variables + $GoodBase = False + $DEx = 0 + $DEy = 0 + Local $conditionlogstr + $NukeAttack = False + + $BaseData = GetResources() + If Not IsArray($BaseData) Then + SetLog(GetLangText("msgNoNextRestart"), $COLOR_RED) + ChkDisconnection() + Return -1 + EndIf + + ;Check Stuck + $flagSame = True + $i = 0 + While ($flagSame = True) and ($i < 6) + $flagSame = ($OldBaseData[$i] = $BaseData[$i]) + $i += 1 + WEnd + $stuckSearchCount = $flagSame ? $stuckSearchCount + 1 : 0 + + If $stuckSearchCount >= 3 Then ;same base several times, must be stuck + If $PushBulletEnabled = 1 Then + _Push("Stuck in search", "Your bot got stuck in search, restarting bot") + EndIf + ReturnHome(False, False, True) ;Abort search + Return -1 + EndIf + + $SubmissionSearches += 1 + If StringLen($SubmissionSGold) > 0 Then + $SubmissionSGold &= "|" + $SubmissionSElix &= "|" + $SubmissionSDE &= "|" + $SubmissionSTH &= "|" + $SubmissionSDead &= "|" + EndIf + $SubmissionSGold &= String($BaseData[2]) + $SubmissionSElix &= String($BaseData[3]) + $SubmissionSDE &= String($BaseData[4]) + $SubmissionSTH &= String($BaseData[1]) + $LastAttackTH = String($BaseData[1]) + If $BaseData[0] Then + $SubmissionSDead &= "0" + $LastAttackDead = "0" + Else + $SubmissionSDead &= "1" + $LastAttackDead = "1" + EndIf + + StatSubmission() + + $DG = (Number($BaseData[2]) >= Number($MinDeadGold)) + $DE = (Number($BaseData[3]) >= Number($MinDeadElixir)) + $DD = (Number($BaseData[4]) >= Number($MinDeadDark)) + $DT = (Number($BaseData[5]) >= Number($MinDeadTrophy)) + $DGE = ((Number($BaseData[2]) + Number($BaseData[3])) >= (Number($MinDeadGold) + Number($MinDeadElixir))) + $G = (Number($BaseData[2]) >= Number($MinGold)) + $E = (Number($BaseData[3]) >= Number($MinElixir)) + $D = (Number($BaseData[4]) >= Number($MinDark)) + $T = (Number($BaseData[5]) >= Number($MinTrophy)) + $GE = ((Number($BaseData[2]) + Number($BaseData[3])) >= (Number($MinGold) + Number($MinElixir))) + $THL = -1 + $THLO = -1 + + For $i = 0 To 4 + If $BaseData[1] = $THText[$i] Then $THL = $i + Next + + Switch $THLoc + Case "In" + $THLO = 0 + Case "Out" + $THLO = 1 + EndSwitch + + If $THLoc = "Out" Then + If (Number(GUICtrlRead($lblresulttrophynow)) < Number(GUICtrlRead($txtSnipeBelow))) Or (IsChecked($chkDeadActivate) And IsChecked($chkDeadSnipe) And $BaseData[0]) Or (IsChecked($chkAnyActivate) And IsChecked($chkSnipe) And Not $BaseData[0]) Then + SetLog(GetLangText("msgSnipeFound"), $COLOR_PURPLE) + $AttackMethod = 3 + ExitLoop + EndIf + EndIf + + ; Variables to check whether to attack dead bases + Local $conditionDeadPass = True + + If IsChecked($chkDeadActivate) And $fullArmy And _ + (Not IsChecked($chkDeadKingAvail) Or $KingAvailable) And _ + (Not IsChecked($chkDeadQueenAvail) Or $QueenAvailable) Then + If IsChecked($chkDeadGE) Then + $deadEnabled = True + If _GUICtrlComboBox_GetCurSel($cmbDead) = 0 Then ; And + If $DG = False Or $DE = False Then $conditionDeadPass = False + ElseIf _GUICtrlComboBox_GetCurSel($cmbDead) = 1 Then ; Or + If $DG = False And $DE = False Then $conditionDeadPass = False + Else ; + + If $DGE = False Then $conditionDeadPass = False + EndIf + EndIf + + If IsChecked($chkDeadMeetDE) Then + If $DD = False Then $conditionDeadPass = False + EndIf + + If IsChecked($chkDeadMeetTrophy) Then + If $DT = False Then $conditionDeadPass = False + EndIf + + If IsChecked($chkDeadMeetTH) Then + If $THL = -1 Or $THL > _GUICtrlComboBox_GetCurSel($cmbDeadTH) Then $conditionDeadPass = False + EndIf + + If IsChecked($chkDeadMeetTHO) Then + If $THLO <> 1 Then $conditionDeadPass = False + EndIf + + If $BaseData[0] And $conditionDeadPass Then + SetLog(GetLangText("msgDeadFound"), $COLOR_GREEN) + $GoodBase = True + $AttackMethod = 0 + EndIf + EndIf + + If Not $GoodBase Then + ; Variables to check whether to attack non-dead bases + Local $conditionAnyPass = True + If IsChecked($chkAnyActivate) And $fullArmy And _ + (Not IsChecked($chkKingAvail) Or $KingAvailable) And _ + (Not IsChecked($chkQueenAvail) Or $QueenAvailable) Then + If IsChecked($chkMeetGE) Then + $anyEnabled = True + If _GUICtrlComboBox_GetCurSel($cmbAny) = 0 Then ; And + If $G = False Or $E = False Then $conditionAnyPass = False + ElseIf _GUICtrlComboBox_GetCurSel($cmbAny) = 1 Then ; Or + If $G = False And $E = False Then $conditionAnyPass = False + Else ; + + If $GE = False Then $conditionAnyPass = False + EndIf + EndIf + + If IsChecked($chkMeetDE) Then + If $D = False Then $conditionAnyPass = False + EndIf + + If IsChecked($chkMeetTrophy) Then + If $T = False Then $conditionAnyPass = False + EndIf + + If IsChecked($chkMeetTH) Then + If $THL = -1 Or $THL > _GUICtrlComboBox_GetCurSel($cmbTH) Then $conditionAnyPass = False + EndIf + + If IsChecked($chkMeetTHO) Then + If $THLO <> 1 Then $conditionAnyPass = False + EndIf + + If $conditionAnyPass Then + SetLog(GetLangText("msgOtherFound"), $COLOR_GREEN) + $GoodBase = True + $AttackMethod = 1 + EndIf + EndIf + EndIf + + If Not $GoodBase Then + ; Variables to check whether to zap Dark elixir + If IsChecked($chkNukeOnly) And $fullSpellFactory And $iNukeLimit > 0 And $BaseData[0] Then + If Number($BaseData[4]) >= Number($iNukeLimit) Then + $NukeAttack = True + SetLog(GetLangText("msgZapFound"), $COLOR_GREEN) + $GoodBase = True + $AttackMethod = 2 + EndIf + EndIf + EndIf + +;~ If $OverlayVisible Then DeleteOverlay() + + If $GoodBase Then + GUICtrlSetState($btnAtkNow, $GUI_DISABLE) + ExitLoop + Else + _CaptureRegion() + If _ColorCheck(_GetPixelColor(726, 497), Hex(0xF0AE28, 6), 20) Then + ; Attack instantly if Attack Now button pressed + If $AttackNow Then + GUICtrlSetState($btnAtkNow, $GUI_DISABLE) + $AttackNow = False + If $BaseData[0] Then + $AttackMethod = 0 + Else + $AttackMethod = 1 + EndIf + SetLog(GetLangText("msgAttackNowClicked"), $COLOR_GREEN) + ExitLoop + EndIf + + Local $fDiffNow = TimerDiff($hTimerClickNext) - $fdiffReadGold ;How long in attack prep mode + $RandomDelay = _Random_Gaussian($icmbSearchsp * 1500, ($icmbSearchsp * 1500) / 6) + If $fDiffNow < $speedBump + $RandomDelay Then ; Wait accoridng to search speed + speedBump + If _Sleep($speedBump + $RandomDelay - $fDiffNow) Then ExitLoop (2) + EndIf + + If $AttackNow Then + GUICtrlSetState($btnAtkNow, $GUI_DISABLE) + $AttackNow = False + If $BaseData[0] Then + $AttackMethod = 0 + Else + $AttackMethod = 1 + EndIf + SetLog(GetLangText("msgAttackNowClicked"), $COLOR_GREEN) + SetLog(GetLangText("msgAttackNowClicked"), $COLOR_GREEN) + ExitLoop + EndIf + + GUICtrlSetState($btnAtkNow, $GUI_DISABLE) + Click(750, 500) ;Click Next + $hTimerClickNext = TimerInit() + ;Take time to do search + GUICtrlSetData($lblresultvillagesskipped, GUICtrlRead($lblresultvillagesskipped) + 1) + GUICtrlSetData($lblresultsearchcost, GUICtrlRead($lblresultsearchcost) + $SearchCost) + If _Sleep(1000) Then Return -1 + ElseIf _ColorCheck(_GetPixelColor(23, 523), Hex(0xEE5056, 6), 20) Then ;If End battle is available + GUICtrlSetState($btnAtkNow, $GUI_DISABLE) + SetLog(GetLangText("msgNoNextReturn"), $COLOR_RED) + ChkDisconnection(True) + ReturnHome(False, False, True) + Return -1 + Else + GUICtrlSetState($btnAtkNow, $GUI_DISABLE) + SetLog(GetLangText("msgNoNextRestart"), $COLOR_RED) + ChkDisconnection() + Return -1 + EndIf + EndIf + WEnd + GUICtrlSetData($lblresultvillagesattacked, GUICtrlRead($lblresultvillagesattacked) + 1) + GUICtrlSetData($lblresultsearchcost, GUICtrlRead($lblresultsearchcost) + $SearchCost) + If IsChecked($chkAlertSearch) Then + TrayTip("Match Found!", "Gold: " & $BaseData[2] & "; Elixir: " & $BaseData[3] & "; Dark: " & $BaseData[4] & "; Trophy: " & $BaseData[5] & "; Townhall: " & $BaseData[1] & ", " & $THLoc, 0) + If FileExists(@WindowsDir & "\media\Windows Exclamation.wav") Then + SoundPlay(@WindowsDir & "\media\Windows Exclamation.wav", 1) + Else + SoundPlay(@WindowsDir & "\media\Festival\Windows Exclamation.wav", 1) + EndIf + EndIf + $MatchFoundText = "[" & GetLangText("msgGoldinitial") & "]: " & _NumberFormat($BaseData[2]) & "; [" & GetLangText("msgElixirinitial") & "]: " & _NumberFormat($BaseData[3]) & _ + "; [" & GetLangText("msgDarkElixinitial") & "]: " & _NumberFormat($BaseData[4]) & "; [" & GetLangText("msgTrophyInitial") & "]: " & $BaseData[5] & _ + "; [TH Lvl]: " & $BaseData[1] & ", Loc: " & $THLoc & "; [" & GetLangText("msgDeadBase ") & "]:" & $BaseData[0] + If $PushBulletEnabled = 1 And $PushBulletmatchfound = 1 Then + _Push(GetLangText("pushMatch"), $MatchFoundText) + SetLog(GetLangText("msgPushMatch"), $COLOR_GREEN) + EndIf + SetLog(GetLangText("msgSearchComplete"), $COLOR_BLUE) + ;Match found, reset stuckCount flag & searchfailed falg before run readycheck again. + $SearchFailed = False + $stuckCount = 0 + _BlockInputEx(0, "", "", $HWnD) + Return $AttackMethod + WEnd +EndFunc ;==>Standard_Search + +;Adjust and Print out search condition if there is any +;Return True if there is valid condition +;Return False if no valid search condition +Func AdjustSearchCond() + Local $conditionlogsarray[3] ;max three types of base to search + Local $condCounts = 0 + Local $conditionlogstr + Local $CondMultipler + + $CondMultipler = Int($SearchCount / GUICtrlRead($txtRedNumOfSerach)) + + $MaxDeadTH = _GUICtrlComboBox_GetCurSel($cmbDeadTH) + $MaxTH = _GUICtrlComboBox_GetCurSel($cmbTH) + + $MinDeadGold = GUICtrlRead($txtDeadMinGold) * (1 - $CondMultipler * GUICtrlRead($txtRedGoldPercent) / 100) + $MinDeadGold = ($MinDeadGold > 0) ? $MinDeadGold : 0 + $MinDeadElixir = GUICtrlRead($txtDeadMinElixir) * (1 - $CondMultipler * GUICtrlRead($txtRedElixirPercent) / 100) + $MinDeadElixir = ($MinDeadElixir > 0) ? $MinDeadElixir : 0 + $MinDeadDark = GUICtrlRead($txtDeadMinDarkElixir) * (1 - $CondMultipler * GUICtrlRead($txtRedDEPercent) / 100) + $MinDeadDark = ($MinDeadDark > 0) ? $MinDeadDark : 0 + $MinDeadTrophy = Int(GUICtrlRead($txtDeadMinTrophy) * (1 - $CondMultipler * GUICtrlRead($txtRedTrophyPercent) / 100)) + $MinDeadTrophy = ($MinDeadTrophy > 0) ? $MinDeadTrophy : 0 + $MinGold = GUICtrlRead($txtMinGold) * (1 - $CondMultipler * GUICtrlRead($txtRedGoldPercent) / 100) + $MinGold = ($MinGold > 0) ? $MinGold : 0 + $MinElixir = GUICtrlRead($txtMinElixir) * (1 - $CondMultipler * GUICtrlRead($txtRedElixirPercent) / 100) + $MinElixir = ($MinElixir > 0) ? $MinElixir : 0 + $MinDark = GUICtrlRead($txtMinDarkElixir) * (1 - $CondMultipler * GUICtrlRead($txtRedDEPercent) / 100) + $MinDark = ($MinDark > 0) ? $MinDark : 0 + $MinTrophy = Int(GUICtrlRead($txtMinTrophy) * (1 - $CondMultipler * GUICtrlRead($txtRedTrophyPercent) / 100)) + $MinTrophy = ($MinTrophy > 0) ? $MinTrophy : 0 + $iNukeLimit = GUICtrlRead($txtDENukeLimit) * (1 - $CondMultipler * GUICtrlRead($txtRedNukePercent) / 100) + $iNukeLimit = ($iNukeLimit > 0) ? $iNukeLimit : 0 + + ;New condition test for king & queen availablity + If IsChecked($chkDeadActivate) And $fullArmy And _ + (Not IsChecked($chkDeadKingAvail) Or $KingAvailable) And _ + (Not IsChecked($chkDeadQueenAvail) Or $QueenAvailable) Then + $conditionlogstr = "Dead Base (" + If IsChecked($chkDeadGE) Then + If _GUICtrlComboBox_GetCurSel($cmbDead) = 0 Then + $conditionlogstr = $conditionlogstr & " Gold: " & $MinDeadGold & " And " & "Elixir: " & $MinDeadElixir + ElseIf _GUICtrlComboBox_GetCurSel($cmbDead) = 1 Then + $conditionlogstr = $conditionlogstr & " Gold: " & $MinDeadGold & " Or " & "Elixir: " & $MinDeadElixir + Else + $conditionlogstr = $conditionlogstr & " Gold+Elixir: " & $MinDeadGold + $MinDeadElixir + EndIf + EndIf + If IsChecked($chkDeadMeetDE) Then + If $conditionlogstr <> "Dead Base (" Then + $conditionlogstr = $conditionlogstr & ";" + EndIf + $conditionlogstr = $conditionlogstr & " Dark: " & $MinDeadDark + EndIf + If IsChecked($chkDeadMeetTrophy) Then + If $conditionlogstr <> "Dead Base (" Then + $conditionlogstr = $conditionlogstr & ";" + EndIf + $conditionlogstr = $conditionlogstr & " Trophy: " & $MinDeadTrophy + EndIf + If IsChecked($chkDeadMeetTH) Then + If $conditionlogstr <> "Dead Base (" Then + $conditionlogstr = $conditionlogstr & ";" + EndIf + $conditionlogstr = $conditionlogstr & " Max Townhall: " & $THText[$MaxDeadTH] + EndIf + If IsChecked($chkDeadMeetTHO) Then + If $conditionlogstr <> "Dead Base (" Then + $conditionlogstr = $conditionlogstr & ";" + EndIf + $conditionlogstr = $conditionlogstr & " Townhall Outside" + EndIf + $conditionlogstr = $conditionlogstr & " )" + $conditionlogsarray[$condCounts] = $conditionlogstr + $condCounts += 1 + ;SetLog($conditionlogstr, $COLOR_GREEN) + EndIf + ;New condition test for king & queen availablity + If IsChecked($chkAnyActivate) And $fullArmy And _ + (Not IsChecked($chkKingAvail) Or $KingAvailable) And _ + (Not IsChecked($chkQueenAvail) Or $QueenAvailable) Then + $conditionlogstr = "Live Base (" + If IsChecked($chkMeetGE) Then + If _GUICtrlComboBox_GetCurSel($cmbDead) = 0 Then + $conditionlogstr = $conditionlogstr & " Gold: " & $MinGold & " And " & "Elixir: " & $MinElixir + ElseIf _GUICtrlComboBox_GetCurSel($cmbDead) = 1 Then + $conditionlogstr = $conditionlogstr & " Gold: " & $MinGold & " Or " & "Elixir: " & $MinElixir + Else + $conditionlogstr = $conditionlogstr & " Gold+Elixir: " & $MinGold + $MinElixir + EndIf + EndIf + If IsChecked($chkMeetDE) Then + If $conditionlogstr <> "Live Base (" Then + $conditionlogstr = $conditionlogstr & ";" + EndIf + $conditionlogstr = $conditionlogstr & " Dark: " & $MinDark + EndIf + If IsChecked($chkMeetTrophy) Then + If $conditionlogstr <> "Live Base (" Then + $conditionlogstr = $conditionlogstr & ";" + EndIf + $conditionlogstr = $conditionlogstr & " Trophy: " & $MinTrophy + EndIf + If IsChecked($chkMeetTH) Then + If $conditionlogstr <> "Live Base (" Then + $conditionlogstr = $conditionlogstr & ";" + EndIf + $conditionlogstr = $conditionlogstr & " Max Townhall: " & $THText[$MaxTH] + EndIf + If IsChecked($chkMeetTHO) Then + If $conditionlogstr <> "Live Base (" Then + $conditionlogstr = $conditionlogstr & ";" + EndIf + $conditionlogstr = $conditionlogstr & " Townhall Outside" + EndIf + $conditionlogstr = $conditionlogstr & " )" + $conditionlogsarray[$condCounts] = $conditionlogstr + $condCounts += 1 + ;SetLog($conditionlogstr, $COLOR_GREEN) + EndIf + If IsChecked($chkNukeOnly) And $fullSpellFactory And $iNukeLimit > 0 Then + $conditionlogstr = "Zap Base ( Dark: " & $iNukeLimit & " )" + $conditionlogsarray[$condCounts] = $conditionlogstr + $condCounts += 1 + ;SetLog($conditionlogstr, $COLOR_GREEN) + EndIf + + ;All condtions here, if there is any + If $condCounts > 0 Then + ;we have valid search condition + SetLog(GetLangText("msgSearchCond"), $COLOR_RED) + For $i = 0 To $condCounts - 1 + SetLog($conditionlogsarray[$i], $COLOR_GREEN) + Next + Return True + Else + Return False + EndIf + +EndFunc ;==>AdjustSearchCond diff --git a/COCBot/functions/Strategies/Strategies.au3 b/COCBot/functions/Strategies/Strategies.au3 index 94599be..aa5dc4d 100644 --- a/COCBot/functions/Strategies/Strategies.au3 +++ b/COCBot/functions/Strategies/Strategies.au3 @@ -1,3 +1,3 @@ -; Just need a single line for each attack strategy plugin -; Leave Standard at top! -#include "Standard\Plugin.au3" +; Just need a single line for each attack strategy plugin +; Leave Standard at top! +#include "Standard\Plugin.au3" diff --git a/COCBot/functions/Village/BoostAllBuilding.au3 b/COCBot/functions/Village/BoostAllBuilding.au3 index 697551c..30a3d34 100644 --- a/COCBot/functions/Village/BoostAllBuilding.au3 +++ b/COCBot/functions/Village/BoostAllBuilding.au3 @@ -1,164 +1,164 @@ -;==>BoostBarracks -Func BoostAllBuilding() - $BoostAll = 0 - If (GUICtrlRead($cmbBoostBarracks) > 0) And ($boostsEnabled = 1) Then - - If $barrackPos[0][0] = "" Then - If Not LocateBarrack() Then Return - SaveConfig() - If _Sleep(2000) Then Return - EndIf - - If _Sleep(500) Then Return - ClickP($TopLeftClient) ;Click Away - If _Sleep(500) Then Return - - If GUICtrlRead($chkBoostRax1) = 1 Then; Barrack 1 - SetLog(GetLangText("msgBoostingBarrack") & "1...", $COLOR_BLUE) - Click($barrackPos[0][0], $barrackPos[0][1]) ;Click Barrack 1 - If _Sleep(500) Then Return - BoostBuilding() - EndIf - - If GUICtrlRead($chkBoostRax2) = 1 Then; Barrack 2 - SetLog(GetLangText("msgBoostingBarrack") & "2...", $COLOR_BLUE) - Click($barrackPos[1][0], $barrackPos[1][1]) ;Click Barrack 2 - If _Sleep(500) Then Return - BoostBuilding() - EndIf - - If GUICtrlRead($chkBoostRax3) = 1 Then; Barrack 3 - SetLog(GetLangText("msgBoostingBarrack") & "3...", $COLOR_BLUE) - Click($barrackPos[2][0], $barrackPos[2][1]) ;Click Barrack 3 - If _Sleep(500) Then Return - BoostBuilding() - EndIf - - If GUICtrlRead($chkBoostRax4) = 1 Then; Barrack 4 - SetLog(GetLangText("msgBoostingBarrack") & "4...", $COLOR_BLUE) - Click($barrackPos[3][0], $barrackPos[3][1]) ;Click Barrack 4 - If _Sleep(500) Then Return - BoostBuilding() - EndIf - - If GUICtrlRead($chkBoostDB1) = 1 Then; Dark Barrack 1 - SetLog(GetLangText("msgBoostingDark") & "1...", $COLOR_BLUE) - Click($DarkBarrackPos[0][0], $DarkBarrackPos[0][1]) ;Click Dark Barrack 1 - If _Sleep(500) Then Return - BoostBuilding() - EndIf - - If GUICtrlRead($chkBoostDB2) = 1 Then; Dark Barrack 2 - SetLog(GetLangText("msgBoostingDark") & "2...", $COLOR_BLUE) - Click($DarkBarrackPos[1][0], $DarkBarrackPos[1][1]) ;Click Dark Barrack 2 - If _Sleep(500) Then Return - BoostBuilding() - EndIf - - If GUICtrlRead($chkBoostKing) = 1 Then; King Altar - If $KingPos[0] = "" Then - If Not LocateKingAltar() Then Return - SaveConfig() - If _Sleep(2000) Then Return - ClickP($TopLeftClient) ;Click Away - EndIf - SetLog(GetLangText("msgBoostingKing"), $COLOR_BLUE) - Click($KingPos[0], $KingPos[1]) ;Click King Altar - If _Sleep(500) Then Return - BoostBuilding() - EndIf - - If GUICtrlRead($chkBoostQueen) = 1 Then; Queen Altar - If $QueenPos[0] = "" Then - If Not LocateQueenAltar() Then Return - SaveConfig() - If _Sleep(2000) Then Return - ClickP($TopLeftClient) ;Click Away - EndIf - SetLog(GetLangText("msgBoostingQueen"), $COLOR_BLUE) - Click($QueenPos[0], $QueenPos[1]) ;Click Queen Altar - If _Sleep(500) Then Return - BoostBuilding() - EndIf - - If GUICtrlRead($chkBoostSpell) = 1 Then; Spell Factory - If $SpellPos[0] = "" Then - If Not LocateSpellFactory() Then Return - SaveConfig() - If _Sleep(2000) Then Return - ClickP($TopLeftClient) ;Click Away - EndIf - SetLog(GetLangText("msgBoostingSpell"), $COLOR_BLUE) - Click($SpellPos[0], $SpellPos[1]) ;Click Spell Factory - If _Sleep(500) Then Return - BoostSpells() - EndIf - - If $BoostAll >= 1 Then - _GUICtrlComboBox_SetCurSel($cmbBoostBarracks, (GUICtrlRead($cmbBoostBarracks) - 1)) - SetLog(GetLangText("msgBoostRem") & GUICtrlRead($cmbBoostBarracks), $COLOR_GREEN) - EndIf - EndIf -EndFunc ;==>BoostAllBuilding - -Func BoostBuilding() - _CaptureRegion() - Local $Boost = _PixelSearch(355, 608, 362, 610, Hex(0xA1A084, 6), 10) ;Check Boost - If IsArray($Boost) Then - Click(355, 608) ;Click Boost - If _Sleep(1000) Then Return - _CaptureRegion() - If _ColorCheck(_GetPixelColor(420, 375), Hex(0xd2ec78, 6), 20) Then ;Confirm Message - Click(420, 375) - If _Sleep(2000) Then Return - _CaptureRegion() - If _ColorCheck(_GetPixelColor(586, 267), Hex(0xd80405, 6), 20) Then ;Not enough Gem - _GUICtrlComboBox_SetCurSel($cmbBoostBarracks, 0) - SetLog(GetLangText("msgNotEnoughGem"), $COLOR_RED) - Else - SetLog(GetLangText("msgBoostComplete"), $COLOR_GREEN) - $BoostAll += 1 - EndIf - Else - SetLog(GetLangText("msgAlreadyBooster"), $COLOR_ORANGE) - EndIf - If _Sleep(500) Then Return - ClickP($TopLeftClient) ;Click Away - Else - SetLog(GetLangText("msgAlreadyBooster"), $COLOR_ORANGE) - If _Sleep(1000) Then Return - EndIf -EndFunc ;==>BoostBuilding - -Func BoostSpells() - _CaptureRegion() - Local $Boost = _PixelSearch(355, 608, 362, 610, Hex(0xA1A084, 6), 10) ;Check Boost - If IsArray($Boost) Then - If GUICtrlRead($txtSpellCap) = 5 Then - Click(430, 608) ;Click Boost for Spell Factory lvl5 - Else - Click(355, 608) ;Click Boost for Not Spell Factory lvl5 - EndIf - If _Sleep(1000) Then Return - _CaptureRegion() - If _ColorCheck(_GetPixelColor(420, 375), Hex(0xd2ec78, 6), 20) Then ;Confirm Message - Click(420, 375) - If _Sleep(2000) Then Return - _CaptureRegion() - If _ColorCheck(_GetPixelColor(586, 267), Hex(0xd80405, 6), 20) Then ;Not enough Gem - _GUICtrlComboBox_SetCurSel($cmbBoostBarracks, 0) - SetLog(GetLangText("msgNotEnoughGem"), $COLOR_RED) - Else - SetLog(GetLangText("msgBoostComplete"), $COLOR_GREEN) - $BoostAll += 1 - EndIf - Else - SetLog(GetLangText("msgSpellsAlready"), $COLOR_ORANGE) - EndIf - If _Sleep(500) Then Return - ClickP($TopLeftClient) ;Click Away - Else - SetLog(GetLangText("msgSpellsAlready"), $COLOR_ORANGE) - If _Sleep(1000) Then Return - EndIf -EndFunc ;==>BoostSpells +;==>BoostBarracks +Func BoostAllBuilding() + $BoostAll = 0 + If (GUICtrlRead($cmbBoostBarracks) > 0) And ($boostsEnabled = 1) Then + + If $barrackPos[0][0] = "" Then + If Not LocateBarrack() Then Return + SaveConfig() + If _Sleep(2000) Then Return + EndIf + + If _Sleep(500) Then Return + ClickP($TopLeftClient) ;Click Away + If _Sleep(500) Then Return + + If GUICtrlRead($chkBoostRax1) = 1 Then; Barrack 1 + SetLog(GetLangText("msgBoostingBarrack") & "1...", $COLOR_BLUE) + Click($barrackPos[0][0], $barrackPos[0][1]) ;Click Barrack 1 + If _Sleep(500) Then Return + BoostBuilding() + EndIf + + If GUICtrlRead($chkBoostRax2) = 1 Then; Barrack 2 + SetLog(GetLangText("msgBoostingBarrack") & "2...", $COLOR_BLUE) + Click($barrackPos[1][0], $barrackPos[1][1]) ;Click Barrack 2 + If _Sleep(500) Then Return + BoostBuilding() + EndIf + + If GUICtrlRead($chkBoostRax3) = 1 Then; Barrack 3 + SetLog(GetLangText("msgBoostingBarrack") & "3...", $COLOR_BLUE) + Click($barrackPos[2][0], $barrackPos[2][1]) ;Click Barrack 3 + If _Sleep(500) Then Return + BoostBuilding() + EndIf + + If GUICtrlRead($chkBoostRax4) = 1 Then; Barrack 4 + SetLog(GetLangText("msgBoostingBarrack") & "4...", $COLOR_BLUE) + Click($barrackPos[3][0], $barrackPos[3][1]) ;Click Barrack 4 + If _Sleep(500) Then Return + BoostBuilding() + EndIf + + If GUICtrlRead($chkBoostDB1) = 1 Then; Dark Barrack 1 + SetLog(GetLangText("msgBoostingDark") & "1...", $COLOR_BLUE) + Click($DarkBarrackPos[0][0], $DarkBarrackPos[0][1]) ;Click Dark Barrack 1 + If _Sleep(500) Then Return + BoostBuilding() + EndIf + + If GUICtrlRead($chkBoostDB2) = 1 Then; Dark Barrack 2 + SetLog(GetLangText("msgBoostingDark") & "2...", $COLOR_BLUE) + Click($DarkBarrackPos[1][0], $DarkBarrackPos[1][1]) ;Click Dark Barrack 2 + If _Sleep(500) Then Return + BoostBuilding() + EndIf + + If GUICtrlRead($chkBoostKing) = 1 Then; King Altar + If $KingPos[0] = "" Then + If Not LocateKingAltar() Then Return + SaveConfig() + If _Sleep(2000) Then Return + ClickP($TopLeftClient) ;Click Away + EndIf + SetLog(GetLangText("msgBoostingKing"), $COLOR_BLUE) + Click($KingPos[0], $KingPos[1]) ;Click King Altar + If _Sleep(500) Then Return + BoostBuilding() + EndIf + + If GUICtrlRead($chkBoostQueen) = 1 Then; Queen Altar + If $QueenPos[0] = "" Then + If Not LocateQueenAltar() Then Return + SaveConfig() + If _Sleep(2000) Then Return + ClickP($TopLeftClient) ;Click Away + EndIf + SetLog(GetLangText("msgBoostingQueen"), $COLOR_BLUE) + Click($QueenPos[0], $QueenPos[1]) ;Click Queen Altar + If _Sleep(500) Then Return + BoostBuilding() + EndIf + + If GUICtrlRead($chkBoostSpell) = 1 Then; Spell Factory + If $SpellPos[0] = "" Then + If Not LocateSpellFactory() Then Return + SaveConfig() + If _Sleep(2000) Then Return + ClickP($TopLeftClient) ;Click Away + EndIf + SetLog(GetLangText("msgBoostingSpell"), $COLOR_BLUE) + Click($SpellPos[0], $SpellPos[1]) ;Click Spell Factory + If _Sleep(500) Then Return + BoostSpells() + EndIf + + If $BoostAll >= 1 Then + _GUICtrlComboBox_SetCurSel($cmbBoostBarracks, (GUICtrlRead($cmbBoostBarracks) - 1)) + SetLog(GetLangText("msgBoostRem") & GUICtrlRead($cmbBoostBarracks), $COLOR_GREEN) + EndIf + EndIf +EndFunc ;==>BoostAllBuilding + +Func BoostBuilding() + _CaptureRegion() + Local $Boost = _PixelSearch(355, 608, 362, 610, Hex(0xA1A084, 6), 10) ;Check Boost + If IsArray($Boost) Then + Click(355, 608) ;Click Boost + If _Sleep(1000) Then Return + _CaptureRegion() + If _ColorCheck(_GetPixelColor(420, 375), Hex(0xd2ec78, 6), 20) Then ;Confirm Message + Click(420, 375) + If _Sleep(2000) Then Return + _CaptureRegion() + If _ColorCheck(_GetPixelColor(586, 267), Hex(0xd80405, 6), 20) Then ;Not enough Gem + _GUICtrlComboBox_SetCurSel($cmbBoostBarracks, 0) + SetLog(GetLangText("msgNotEnoughGem"), $COLOR_RED) + Else + SetLog(GetLangText("msgBoostComplete"), $COLOR_GREEN) + $BoostAll += 1 + EndIf + Else + SetLog(GetLangText("msgAlreadyBooster"), $COLOR_ORANGE) + EndIf + If _Sleep(500) Then Return + ClickP($TopLeftClient) ;Click Away + Else + SetLog(GetLangText("msgAlreadyBooster"), $COLOR_ORANGE) + If _Sleep(1000) Then Return + EndIf +EndFunc ;==>BoostBuilding + +Func BoostSpells() + _CaptureRegion() + Local $Boost = _PixelSearch(355, 608, 362, 610, Hex(0xA1A084, 6), 10) ;Check Boost + If IsArray($Boost) Then + If GUICtrlRead($txtSpellCap) = 5 Then + Click(430, 608) ;Click Boost for Spell Factory lvl5 + Else + Click(355, 608) ;Click Boost for Not Spell Factory lvl5 + EndIf + If _Sleep(1000) Then Return + _CaptureRegion() + If _ColorCheck(_GetPixelColor(420, 375), Hex(0xd2ec78, 6), 20) Then ;Confirm Message + Click(420, 375) + If _Sleep(2000) Then Return + _CaptureRegion() + If _ColorCheck(_GetPixelColor(586, 267), Hex(0xd80405, 6), 20) Then ;Not enough Gem + _GUICtrlComboBox_SetCurSel($cmbBoostBarracks, 0) + SetLog(GetLangText("msgNotEnoughGem"), $COLOR_RED) + Else + SetLog(GetLangText("msgBoostComplete"), $COLOR_GREEN) + $BoostAll += 1 + EndIf + Else + SetLog(GetLangText("msgSpellsAlready"), $COLOR_ORANGE) + EndIf + If _Sleep(500) Then Return + ClickP($TopLeftClient) ;Click Away + Else + SetLog(GetLangText("msgSpellsAlready"), $COLOR_ORANGE) + If _Sleep(1000) Then Return + EndIf +EndFunc ;==>BoostSpells diff --git a/COCBot/functions/Village/BoostBarracks.au3 b/COCBot/functions/Village/BoostBarracks.au3 index c6ee80b..9790607 100644 --- a/COCBot/functions/Village/BoostBarracks.au3 +++ b/COCBot/functions/Village/BoostBarracks.au3 @@ -1,49 +1,49 @@ -;==>BoostBarracks -Func BoostBarracks() - If (GUICtrlRead($cmbBoostBarracks) > 0) And ($boostsEnabled = 1) Then - If $barrackPos[0][0] = "" Then - If Not LocateBarrack() Then Return - SaveConfig() - If _Sleep(2000) Then Return - EndIf - While 1 - SetLog(GetLangText("msgBoostingBarracks"), $COLOR_BLUE) - - - Click(1, 1) - If _Sleep(1000) Then ExitLoop - Click($barrackPos[0][0], $barrackPos[0][1]) - If _Sleep(1000) Then ExitLoop - _CaptureRegion() - $Boost = _PixelSearch(410, 603, 493, 621, Hex(0xfffd70, 6), 10) - If IsArray($Boost) Then - Click($Boost[0], $Boost[1]) - If _Sleep(1000) Then Return - _CaptureRegion() - If _ColorCheck(_GetPixelColor(420, 375), Hex(0xd2ec78, 6), 20) Then - Click(420, 375) - If _Sleep(2000) Then Return - _CaptureRegion() - If _ColorCheck(_GetPixelColor(586, 267), Hex(0xd80405, 6), 20) Then - _GUICtrlComboBox_SetCurSel($cmbBoostBarracks, 0) - SetLog(GetLangText("msgNotEnoughGem"), $COLOR_RED) - Else - _GUICtrlComboBox_SetCurSel($cmbBoostBarracks, (GUICtrlRead($cmbBoostBarracks) - 1)) - SetLog(GetLangText("msgBoostCompRem") & (GUICtrlRead($cmbBoostBarracks)), $COLOR_GREEN) - EndIf - Else - SetLog(GetLangText("msgBarracksAlready"), $COLOR_ORANGE) - EndIf - If _Sleep(500) Then ExitLoop - Click(1, 1) - Else - SetLog(GetLangText("msgBarracksAlready"), $COLOR_ORANGE) - If _Sleep(1000) Then Return - EndIf - - ExitLoop - WEnd - EndIf - - -EndFunc ;==>BoostBarracks +;==>BoostBarracks +Func BoostBarracks() + If (GUICtrlRead($cmbBoostBarracks) > 0) And ($boostsEnabled = 1) Then + If $barrackPos[0][0] = "" Then + If Not LocateBarrack() Then Return + SaveConfig() + If _Sleep(2000) Then Return + EndIf + While 1 + SetLog(GetLangText("msgBoostingBarracks"), $COLOR_BLUE) + + + Click(1, 1) + If _Sleep(1000) Then ExitLoop + Click($barrackPos[0][0], $barrackPos[0][1]) + If _Sleep(1000) Then ExitLoop + _CaptureRegion() + $Boost = _PixelSearch(410, 603, 493, 621, Hex(0xfffd70, 6), 10) + If IsArray($Boost) Then + Click($Boost[0], $Boost[1]) + If _Sleep(1000) Then Return + _CaptureRegion() + If _ColorCheck(_GetPixelColor(420, 375), Hex(0xd2ec78, 6), 20) Then + Click(420, 375) + If _Sleep(2000) Then Return + _CaptureRegion() + If _ColorCheck(_GetPixelColor(586, 267), Hex(0xd80405, 6), 20) Then + _GUICtrlComboBox_SetCurSel($cmbBoostBarracks, 0) + SetLog(GetLangText("msgNotEnoughGem"), $COLOR_RED) + Else + _GUICtrlComboBox_SetCurSel($cmbBoostBarracks, (GUICtrlRead($cmbBoostBarracks) - 1)) + SetLog(GetLangText("msgBoostCompRem") & (GUICtrlRead($cmbBoostBarracks)), $COLOR_GREEN) + EndIf + Else + SetLog(GetLangText("msgBarracksAlready"), $COLOR_ORANGE) + EndIf + If _Sleep(500) Then ExitLoop + Click(1, 1) + Else + SetLog(GetLangText("msgBarracksAlready"), $COLOR_ORANGE) + If _Sleep(1000) Then Return + EndIf + + ExitLoop + WEnd + EndIf + + +EndFunc ;==>BoostBarracks diff --git a/COCBot/functions/Village/BotStopped.au3 b/COCBot/functions/Village/BotStopped.au3 index cdbc4c8..8d59cc7 100644 --- a/COCBot/functions/Village/BotStopped.au3 +++ b/COCBot/functions/Village/BotStopped.au3 @@ -1,75 +1,89 @@ -; Returns True if bot no longer running. -; There are Commands to Shutdown, Sleep, Halt Attack and Halt Training mode - -Func BotStopped($CheckLimits = True) - Local $Stopped = False - If $CheckLimits Then - If IsChecked($chkBotStop) Then - $MeetCondStop = False - Local $TrophyCount = Number(ReadText(59, 75, 60, $textMainScreen)) - Local $TrophyMax = Number($TrophyCount) > Number($itxtMaxTrophy) - If $TrophyMax Then - $Trophy = "Max. Trophy Reached!" - Else - $Trophy = "" - EndIf - - Switch $icmbBotCond - Case 0 - If isGoldFull() And isElixirFull() And $TrophyMax Then $MeetCondStop = True - Case 1 - If (isGoldFull() And isElixirFull()) Or $TrophyMax Then $MeetCondStop = True - Case 2 - If (isGoldFull() Or isElixirFull()) And $TrophyMax Then $MeetCondStop = True - Case 3 - If isGoldFull() Or isElixirFull() Or $TrophyMax Then $MeetCondStop = True - Case 4 - If isGoldFull() And isElixirFull() Then $MeetCondStop = True - Case 5 - If isGoldFull() Or isElixirFull() Then $MeetCondStop = True - Case 6 - If isGoldFull() And $TrophyMax Then $MeetCondStop = True - Case 7 - If isElixirFull() And $TrophyMax Then $MeetCondStop = True - Case 8 - If isGoldFull() Or $TrophyMax Then $MeetCondStop = True - Case 9 - If isElixirFull() Or $TrophyMax Then $MeetCondStop = True - Case 10 - If isGoldFull() Then $MeetCondStop = True - Case 11 - If isElixirFull() Then $MeetCondStop = True - Case 12 - If $TrophyMax Then $MeetCondStop = True - EndSwitch - - If $MeetCondStop Then - If $icmbBotCond <> 4 And $icmbBotCond <> 5 And $icmbBotCond <> 10 And $icmbBotCond <> 11 Then - If $Trophy <> "" Then SetLog($Trophy, $COLOR_GREEN) - If _Sleep(500) Then Return - EndIf - Switch $icmbBotCommand - Case 0 - SetLog(GetLangText("msgHaltDonate"), $COLOR_BLUE) - $CurrentMode = $modeDonateTrain ; Halt Attack - If _Sleep(500) Then Return - Case 1 - SetLog(GetLangText("msgForceShutdown"), $COLOR_BLUE) - If _Sleep(500) Then Return - Shutdown(5) ; Force Shutdown - btnStop() - Case 2 - SetLog(GetLangText("msgSleep"), $COLOR_BLUE) - If _Sleep(500) Then Return - Shutdown(32) ; Sleep / Stand by - btnStop() - EndSwitch - EndIf - EndIf - EndIf - If BitAND(GUICtrlGetState($btnStop), $GUI_HIDE) Then - Return True - Else - Return False - EndIf -EndFunc ;==>BotStopped +; Returns True if bot no longer running. +; There are Commands to Shutdown, Sleep, Halt Attack and Halt Training mode + +Func BotStopped($CheckLimits = True) + Local $Stopped = False + If $CheckLimits Then + If IsChecked($chkBotStop) Then + $MeetCondStop = False + Local $TrophyCount = Number(ReadText(59, 75, 60, $textMainScreen)) + Local $TrophyMax = Number($TrophyCount) > Number($itxtMaxTrophy) + If $TrophyMax Then + $Trophy = "Max. Trophy Reached!" + Else + $Trophy = "" + EndIf + + Switch $icmbBotCond + Case 0 + If isGoldFull() And isElixirFull() And isDarkElixirFull() And $TrophyMax Then $MeetCondStop = True + Case 1 + If (isGoldFull() And isElixirFull() And isDarkElixirFull()) Or $TrophyMax Then $MeetCondStop = True + Case 2 + If isGoldFull() And isElixirFull() And isDarkElixirFull() Then $MeetCondStop = True + Case 3 + If isGoldFull() Or isElixirFull() Or isDarkElixirFull() Then $MeetCondStop = True + Case 4 + If isDarkElixirFull() Then $MeetCondStop = True + Case 5 + If isGoldFull() And isElixirFull() And $TrophyMax Then $MeetCondStop = True + Case 6 + If (isGoldFull() And isElixirFull()) Or $TrophyMax Then $MeetCondStop = True + Case 7 + If (isGoldFull() Or isElixirFull()) And $TrophyMax Then $MeetCondStop = True + Case 8 + If isGoldFull() Or isElixirFull() Or $TrophyMax Then $MeetCondStop = True + Case 9 + If isGoldFull() And isElixirFull() Then $MeetCondStop = True + Case 10 + If isGoldFull() Or isElixirFull() Then $MeetCondStop = True + Case 11 + If isGoldFull() And $TrophyMax Then $MeetCondStop = True + Case 12 + If isElixirFull() And $TrophyMax Then $MeetCondStop = True + Case 13 + If isGoldFull() Or $TrophyMax Then $MeetCondStop = True + Case 14 + If isElixirFull() Or $TrophyMax Then $MeetCondStop = True + Case 15 + If isGoldFull() Then $MeetCondStop = True + Case 16 + If isElixirFull() Then $MeetCondStop = True + Case 17 + If $TrophyMax Then $MeetCondStop = True + EndSwitch + + If $MeetCondStop Then + If $icmbBotCond <> 4 And $icmbBotCond <> 5 And $icmbBotCond <> 10 And $icmbBotCond <> 11 Then + If $Trophy <> "" Then SetLog($Trophy, $COLOR_GREEN) + If _Sleep(500) Then Return + EndIf + Switch $icmbBotCommand + Case 0 + SetLog(GetLangText("msgHaltExp"), $COLOR_BLUE) + $CurrentMode = $modeExperience ; Switch to exp mode + If _Sleep(500) Then Return + Case 1 + SetLog(GetLangText("msgHaltDonate"), $COLOR_BLUE) + $CurrentMode = $modeDonateTrain ; Halt Attack + If _Sleep(500) Then Return + Case 2 + SetLog(GetLangText("msgForceShutdown"), $COLOR_BLUE) + If _Sleep(500) Then Return + Shutdown(5) ; Force Shutdown + btnStop() + Case 3 + SetLog(GetLangText("msgSleep"), $COLOR_BLUE) + If _Sleep(500) Then Return + Shutdown(32) ; Sleep / Stand by + btnStop() + EndSwitch + EndIf + EndIf + EndIf + If BitAND(GUICtrlGetState($btnStop), $GUI_HIDE) Then + Return True + Else + Return False + EndIf +EndFunc ;==>BotStopped diff --git a/COCBot/functions/Village/CheckCostPerSearch.au3 b/COCBot/functions/Village/CheckCostPerSearch.au3 index 40b3f72..4ef3e54 100644 --- a/COCBot/functions/Village/CheckCostPerSearch.au3 +++ b/COCBot/functions/Village/CheckCostPerSearch.au3 @@ -1,59 +1,58 @@ -;Will detect how much gold per search -Func CheckCostPerSearch() - - If $SearchCost = 0 Then - SetLog(GetLangText("msgCheckGold"), $COLOR_GREEN) - - If $TownHallPos[0] = "" Then - If Not LocateTownHall() Then Return - SaveConfig() - EndIf - - ClickP($TopLeftClient, 2, 250); Click away twice with 250ms delay - StatusCheck() - - Click($TownHallPos[0], $TownHallPos[1]) - $Location = _WaitForPixel(240, 581, 484, 583, Hex(0x4084B8, 6), 6, 2) - - If Not IsArray($Location) Then - SetLog(GetLangText("msgFailedTH"), $COLOR_RED) - Return - Else - Click($Location[0], $Location[1]) - If Not _WaitForColor(698, 160, Hex(0xD80408, 6), 16, 2) Then - SetLog(GetLangText("msgFailedTH"), $COLOR_RED) - ClickP($TopLeftClient, 2, 250) - Return - Else - $MenuBar = StringStripWS(ReadText(175, 138, 500, $textWindowTitles),3) - $MenuBar = StringLeft($MenuBar, StringLen($MenuBar)-1) - $THLevel = Number(StringRegExpReplace(StringRight($MenuBar, 5),"[^0-9]","")) - If $THLevel = "1" Then - $SearchCost = 10 - ElseIf $THLevel = "2" Then - $SearchCost = 50 - ElseIf $THLevel = "3" Then - $SearchCost = 75 - ElseIf $THLevel = "4" Then - $SearchCost = 110 - ElseIf $THLevel = "5" Then - $SearchCost = 170 - ElseIf $THLevel = "6" Then - $SearchCost = 250 - ElseIf $THLevel = "7" Then - $SearchCost = 380 - ElseIf $THLevel = "8" Then - $SearchCost = 580 - ElseIf $THLevel = "9" Then - $SearchCost = 750 - ElseIf $THLevel = "10" Then - $SearchCost = 1000 - EndIf - - SetLog(GetLangText("msgTHLevel") & $THLevel & GetLangText("msgGoldCPS") & $SearchCost, $COLOR_GREEN) - EndIf - EndIf - ClickP($TopLeftClient, 2, 250); Click away twice with 250ms delay - EndIf - -EndFunc ;==>CheckCostPerSearch +;Will detect how much gold per search +Func CheckCostPerSearch() + + If $SearchCost = 0 Then + SetLog(GetLangText("msgCheckGold"), $COLOR_GREEN) + + If $TownHallPos[0] = "" Then + If Not LocateTownHall() Then Return + SaveConfig() + EndIf + + ClickP($TopLeftClient, 2, 250); Click away twice with 250ms delay + StatusCheck() + + Click($TownHallPos[0], $TownHallPos[1]) + $Location = _WaitForPixel(240, 581, 484, 583, Hex(0x4084B8, 6), 6, 2) + + If Not IsArray($Location) Then + SetLog(GetLangText("msgFailedTH"), $COLOR_RED) + Return + Else + Click($Location[0], $Location[1]) + If Not _WaitForColor(698, 160, Hex(0xD80408, 6), 16, 2) Then + SetLog(GetLangText("msgFailedTH"), $COLOR_RED) + ClickP($TopLeftClient, 2, 250) + Return + Else + $MenuBar = StringStripWS(ReadText(175, 138, 500, $textWindowTitles),3) + $THLevel = Number(StringRegExpReplace(StringRight($MenuBar, 25),"[^0-9]","")) + If $THLevel = "1" Then + $SearchCost = 10 + ElseIf $THLevel = "2" Then + $SearchCost = 50 + ElseIf $THLevel = "3" Then + $SearchCost = 75 + ElseIf $THLevel = "4" Then + $SearchCost = 110 + ElseIf $THLevel = "5" Then + $SearchCost = 170 + ElseIf $THLevel = "6" Then + $SearchCost = 250 + ElseIf $THLevel = "7" Then + $SearchCost = 380 + ElseIf $THLevel = "8" Then + $SearchCost = 580 + ElseIf $THLevel = "9" Then + $SearchCost = 750 + ElseIf $THLevel = "10" Then + $SearchCost = 1000 + EndIf + + SetLog(GetLangText("msgTHLevel") & $THLevel & GetLangText("msgGoldCPS") & $SearchCost, $COLOR_GREEN) + EndIf + EndIf + ClickP($TopLeftClient, 2, 250); Click away twice with 250ms delay + EndIf + +EndFunc ;==>CheckCostPerSearch diff --git a/COCBot/functions/Village/CheckFullSpellFactory.au3 b/COCBot/functions/Village/CheckFullSpellFactory.au3 index 76388b4..b9d5218 100644 --- a/COCBot/functions/Village/CheckFullSpellFactory.au3 +++ b/COCBot/functions/Village/CheckFullSpellFactory.au3 @@ -1,37 +1,37 @@ -Func CheckFullSpellFactory() - SetLog(GetLangText("msgCheckingSF"), $COLOR_BLUE) - $fullSpellFactory = False - - If _Sleep(100) Then Return - - ClickP($TopLeftClient) ;Click Away - - If $SpellPos[0] = "" Then - If Not LocateSpellFactory() Then Return - SaveConfig() - Else - If _Sleep(100) Then Return - Click($SpellPos[0], $SpellPos[1]) ;Click Spell Factory - EndIf - - Local $BSpellPos = _WaitForPixel(214, 581, 368, 583, Hex(0x4084B8, 6), 5, 1) ;Finds Info button - If IsArray($BSpellPos) = False Then - SetLog(GetLangText("msgSFUnavailable"), $COLOR_RED) - If $DebugMode = 2 Then _GDIPlus_ImageSaveToFile($hBitmap, $dirDebug & "SpellNA-" & @HOUR & @MIN & @SEC & ".png") - Else - Click($BSpellPos[0], $BSpellPos[1]) ;Click Info button - ;If _Sleep(2000) Then Return - _WaitForPixel(690, 150, 710, 170, Hex(0xD80407, 6), 5, 1) ;Finds Red Cross button in new popup window - - _CaptureRegion() - Local $Spellbar = _PixelSearch(707, 210, 709, 213, Hex(0x37A800, 6), 5) - ClickP($TopLeftClient) ;Click Away - If IsArray($Spellbar) Then - $fullSpellFactory = True - SetLog(GetLangText("msgSpellFull"), $COLOR_RED) - EndIf - ClickP($TopLeftClient) ;Click Away - Return $fullSpellFactory - EndIf - -EndFunc ;==>CheckFullSpellFactory +Func CheckFullSpellFactory() + SetLog(GetLangText("msgCheckingSF"), $COLOR_BLUE) + $fullSpellFactory = False + + If _Sleep(100) Then Return + + ClickP($TopLeftClient) ;Click Away + + If $SpellPos[0] = "" Then + If Not LocateSpellFactory() Then Return + SaveConfig() + Else + If _Sleep(100) Then Return + Click($SpellPos[0], $SpellPos[1]) ;Click Spell Factory + EndIf + + Local $BSpellPos = _WaitForPixel(214, 581, 368, 583, Hex(0x4084B8, 6), 5, 1) ;Finds Info button + If IsArray($BSpellPos) = False Then + SetLog(GetLangText("msgSFUnavailable"), $COLOR_RED) + If $DebugMode = 2 Then _GDIPlus_ImageSaveToFile($hBitmap, $dirDebug & "SpellNA-" & @HOUR & @MIN & @SEC & ".png") + Else + Click($BSpellPos[0], $BSpellPos[1]) ;Click Info button + ;If _Sleep(2000) Then Return + _WaitForPixel(690, 150, 710, 170, Hex(0xD80407, 6), 5, 1) ;Finds Red Cross button in new popup window + + _CaptureRegion() + Local $Spellbar = _PixelSearch(707, 210, 709, 213, Hex(0x37A800, 6), 5) + ClickP($TopLeftClient) ;Click Away + If IsArray($Spellbar) Then + $fullSpellFactory = True + SetLog(GetLangText("msgSpellFull"), $COLOR_RED) + EndIf + ClickP($TopLeftClient) ;Click Away + Return $fullSpellFactory + EndIf + +EndFunc ;==>CheckFullSpellFactory diff --git a/COCBot/functions/Village/Collect.au3 b/COCBot/functions/Village/Collect.au3 index 3018c1a..8063e36 100644 --- a/COCBot/functions/Village/Collect.au3 +++ b/COCBot/functions/Village/Collect.au3 @@ -1,22 +1,22 @@ -;Clickes the collector locations - -Func Collect() - Local $collectx, $collecty, $i = 0 - - If $ichkCollect = 1 Then - SetLog(GetLangText("msgCollecting"), $COLOR_BLUE) - _Sleep(250) - Click(1, 1) ;Click Away - While 1 - If _Sleep(300) Or $Running = False Then ExitLoop - _CaptureRegion(0, 0, 780) - If _ImageSearch(@ScriptDir & "\images\Collectors\resimg.png", 1, $collectx, $collecty, 20) Then - Click($collectx, $collecty) ;Click collector - ElseIf $i >= 20 Then - ExitLoop - EndIf - $i += 1 - Click(1, 1) ;Click Away - WEnd - EndIf -EndFunc ;==>Collect +;Clickes the collector locations + +Func Collect() + Local $collectx, $collecty, $i = 0 + + If $ichkCollect = 1 Then + SetLog(GetLangText("msgCollecting"), $COLOR_BLUE) + _Sleep(250) + Click(1, 1) ;Click Away + While 1 + If _Sleep(300) Or $Running = False Then ExitLoop + _CaptureRegion(0, 0, 780) + If _ImageSearch(@ScriptDir & "\images\Collectors\resimg.png", 1, $collectx, $collecty, 20) Then + Click($collectx, $collecty) ;Click collector + ElseIf $i >= 20 Then + ExitLoop + EndIf + $i += 1 + Click(1, 1) ;Click Away + WEnd + EndIf +EndFunc ;==>Collect diff --git a/COCBot/functions/Village/DonateCC.au3 b/COCBot/functions/Village/DonateCC.au3 index 8829159..3e7f39f 100644 --- a/COCBot/functions/Village/DonateCC.au3 +++ b/COCBot/functions/Village/DonateCC.au3 @@ -1,317 +1,325 @@ -;Donates troops - -Func DonateCC() - Global $Troop, $TroopAmount, $ColDist = 1, $RowDist = 0 ; default to archer - Global $AmountBarbarians = Number(GUICtrlRead($NoOfBarbarians)) - Global $AmountArchers = Number(GUICtrlRead($NoOfArchers)) - Global $AmountGiants = Number(GUICtrlRead($NoOfGiants)) - - Global $Donate = IsChecked($chkDonateAllBarbarians) Or IsChecked($chkDonateBarbarians) Or IsChecked($chkDonateAllArchers) Or IsChecked($chkDonateArchers) Or IsChecked($chkDonateAllGiants) Or IsChecked($chkDonateGiants) - If $Donate = False Then Return - Local $y = 119 - SetLog(GetLangText("msgDonatingTroops"), $COLOR_BLUE) - - _CaptureRegion() - - Click(1, 1) ;Click Away - If _ColorCheck(_GetPixelColor(331, 330), Hex(0xF0A03B, 6), 20) = False Then Click(19, 349) ;Clicks chat thing - If _Sleep(500) Then Return - Click(189, 24) ; clicking clan tab - - While $Donate - Local $offColors[3][3] = [[0x000000, 0, -2], [0x262926, 0, 1], [0xF8FCF0, 0, 11]] - While 1 - If _Sleep(1000) Then ExitLoop - Global $DonatePixel = _MultiPixelSearch(202, $y, 203, 670, 1, 1, Hex(0x262926, 6), $offColors, 30) - If IsArray($DonatePixel) Then - $Donate = False - If Not (IsChecked($chkDonateAllBarbarians) Or IsChecked($chkDonateAllArchers) Or IsChecked($chkDonateAllGiants)) Then - If Not _SatSearch(34, $DonatePixel[1] - 29, 20, 10, 20, 100) Then - ; Multiline text - If Not _SatSearch(34, $DonatePixel[1] - 42, 20, 10, 20, 100) Then - $String = ReadText(34, $DonatePixel[1] - 40, 274, $textChat) - $String &= " " & ReadText(34, $DonatePixel[1] - 27, 274, $textChat) - $String &= " " & ReadText(34, $DonatePixel[1] - 14, 274, $textChat) - Else - $String = ReadText(34, $DonatePixel[1] - 27, 274, $textChat) - $String &= " " & ReadText(34, $DonatePixel[1] - 14, 274, $textChat) - EndIf - Else - $String = ReadText(34, $DonatePixel[1] - 14, 274, $textChat) - EndIf - - SetLog(GetLangText("msgChatText") & $String, $COLOR_GREEN) - - $Blacklisted = False - If IsChecked($chkBlacklist) Then - $blacklist = StringSplit(GUICtrlRead($txtBlacklist), @CRLF) - If IsArray($blacklist) Then - For $loop = 1 To $blacklist[0] - If StringStripWS($blacklist[$loop], 3) <> "" And StringInStr($String, StringStripWS($blacklist[$loop], 3)) Then $Blacklisted = True - Next - EndIf - EndIf - - If $Blacklisted Then - SetLog(GetLangText("msgBlacklisted"), $COLOR_GREEN) - Else - If IsChecked($chkDonateBarbarians) Then - Local $Barbs = StringSplit(StringStripWS($itxtDonateBarbarians, 3), @CRLF) - If IsArray($Barbs) Then - For $i = 1 To $Barbs[0] - If CheckDonate($Barbs[$i], $String) Then - $Troop = GUICtrlRead($cmbDonateBarbarians) - GetTroopCoord() - DonateTroops($Troop, $ColDist, $RowDist, $AmountBarbarians) - ExitLoop - EndIf - Next - If $Donate Then - If _Sleep(500) Then ExitLoop - $y = $DonatePixel[1] + 10 - EndIf - Else - SetLog(GetLangText("msgUnableToRead") & "1" & GetLangText("msgDonateRules")) - Return - EndIf - EndIf - If IsChecked($chkDonateArchers) Then - Local $Archers = StringSplit(StringStripWS($itxtDonateArchers, 3), @CRLF) - If IsArray($Archers) Then - For $i = 1 To $Archers[0] - If CheckDonate($Archers[$i], $String) Then - $Troop = GUICtrlRead($cmbDonateArchers) - GetTroopCoord() - DonateTroops($Troop, $ColDist, $RowDist, $AmountArchers) - ExitLoop - EndIf - Next - If $Donate Then - If _Sleep(500) Then ExitLoop - $y = $DonatePixel[1] + 10 - EndIf - Else - SetLog(GetLangText("msgUnableToRead") & "2" & GetLangText("msgDonateRules")) - Return - EndIf - EndIf - If IsChecked($chkDonateGiants) Then - Local $Giants = StringSplit(StringStripWS($itxtDonateGiants, 3), @CRLF) - If IsArray($Giants) Then - For $i = 1 To $Giants[0] - If CheckDonate($Giants[$i], $String) Then - $Troop = GUICtrlRead($cmbDonateGiants) - GetTroopCoord() - DonateTroops($Troop, $ColDist, $RowDist, $AmountGiants) - ExitLoop - EndIf - Next - If $Donate Then - If _Sleep(500) Then ExitLoop - $y = $DonatePixel[1] + 10 - EndIf - Else - SetLog(GetLangText("msgUnableToRead") & "3" & GetLangText("msgDonateRules")) - Return - EndIf - EndIf - EndIf - Else - If IsChecked($chkDonateAllBarbarians) Then - $Troop = GUICtrlRead($cmbDonateBarbarians) - $TroopAmount = Number(GUICtrlRead($NoOfBarbarians)) - ElseIf IsChecked($chkDonateAllArchers) Then - $Troop = GUICtrlRead($cmbDonateArchers) - $TroopAmount = Number(GUICtrlRead($NoOfArchers)) - ElseIf IsChecked($chkDonateAllGiants) Then - $Troop = GUICtrlRead($cmbDonateGiants) - $TroopAmount = Number(GUICtrlRead($NoOfGiants)) - EndIf - GetTroopCoord() - If $RowDist = -1 Or $ColDist = -1 Then - SetLog(GetLangText("msgUnableToDetermine") & $Troop) - ExitLoop - Else - DonateTroops($Troop, $ColDist, $RowDist, $TroopAmount) - If $Donate Then - If _Sleep(500) Then ExitLoop - $y = $DonatePixel[1] + 10 - EndIf - EndIf - EndIf - Else - ExitLoop - EndIf - If _Sleep(500) Then Return - Click(1, 1, 1, 2000) - $y = $DonatePixel[1] + 10 - WEnd - $DonatePixel = _MultiPixelSearch(202, $y, 203, 670, 1, 1, Hex(0x262926, 6), $offColors, 20) - Local $Scroll = _PixelSearch(285, 650, 287, 700, Hex(0x97E405, 6), 20) - $Donate = True - If IsArray($Scroll) Then - Click($Scroll[0], $Scroll[1]) - $y = 119 - If _Sleep(700) Then ExitLoop - ElseIf Not IsArray($DonatePixel) Then - $Donate = False - EndIf - WEnd - - If _Sleep(1000) Then Return - SetLog(GetLangText("msgFinishedDonating"), $COLOR_BLUE) - - _CaptureRegion() - If _ColorCheck(_GetPixelColor(331, 330), Hex(0xF0A03B, 6), 20) Then - Click(331, 330) ;Clicks chat thing - If _Sleep(500) Then Return - EndIf - - ;------------------------gtfo------------------------; - If GUICtrlRead($gtfo) = 1 Then - Local $Scroll, $kick_y, $kicked = 0 - While 1 - Click($CCPos[0], $CCPos[1]) ; click clan castle - If _Sleep(500) Then Return - Click(530, 600) ; open clan page - If _Sleep(5000) Then Return ; wait for it to load - $Scroll = 0 - While 1 - _CaptureRegion(190, 80, 220, 650) - If _Sleep(1000) Then ExitLoop - Local $new = _PixelSearch(200, 80, 210, 650, Hex(0xE73838, 6), 20) - If IsArray($new) Then - SetLog("x:" & $new[0] & " y:" & $new[1], $COLOR_RED) ; debuggin purpose - Click($new[0], $new[1]) - If _Sleep(500) Then ExitLoop - If $new[1] + 80 > 640 Then - $kick_y = 640 - Else - $kick_y = $new[1] + 80 - EndIf - Click($new[0] + 300, $kick_y) ; kick button, hopefully - If _Sleep(500) Then ExitLoop - Click(520, 240) - If _Sleep(500) Then ExitLoop - $kicked += 1 - SetLog($kicked & GetLangText("msgKicked"), $COLOR_RED) - If _Sleep(2000) Then ExitLoop - ExitLoop - Else - ControlSend($Title, "", "", "{CTRLDOWN}{UP}{CTRLUP}") ; scroll down the member list - SetLog(GetLangText("msgScrollingDown"), $COLOR_RED) - $Scroll += 1 - If _Sleep(3000) Then ExitLoop - EndIf - If $Scroll = 8 Then ExitLoop (2) - WEnd - WEnd - SetLog(GetLangText("msgFinishedKicking"), $COLOR_RED) - EndIf - Click(1, 1, 1, 2000) -EndFunc ;==>DonateCC - -Func CheckDonate($String, $clanString) ;Checks if it exact - $Contains = StringMid($String, 1, 1) & StringMid($String, StringLen($String), 1) - If $Contains = "[]" Then - If $clanString = StringMid($String, 2, StringLen($String) - 2) Then - Return True - Else - Return False - EndIf - Else - If StringInStr($clanString, $String, 2) Then - Return True - Else - Return False - EndIf - EndIf -EndFunc ;==>CheckDonate - -Func DonateTroops($Troop, $i, $Row, $number) - Local $x, $y - If IsArray(_PixelSearch(119, $DonatePixel[1], 204, $DonatePixel[1] + 4, Hex(0x262926, 6), 10)) Then - Click($DonatePixel[0], $DonatePixel[1] + 15) - Else - SetLog(GetLangText("msgNoDonateButton")) - EndIf - If _Sleep(1000) Then Return - _CaptureRegion(0, 0, 860, $DonatePixel[1] + 200) - If $i >= 0 Then $x = 237 + $i * 80 - If $Row = 0 Then - $y = $DonatePixel[1] - 5 - ElseIf $Row = 1 Then - $y = $DonatePixel[1] + 91 - Else - $y = $DonatePixel[1] + 185 - EndIf - If _ColorCheck(_GetPixelColor($x, $y), Hex(0x507C00, 6), 10) Or _ColorCheck(_GetPixelColor($x, $y - 5), Hex(0x507C00, 6), 10) Then - SetLog(GetLangText("msgDonating") & $number & " " & $Troop, $COLOR_BLUE) - If _Sleep(500) Then Return - ; TODO, check available trrop before donate the amount of number - Click($x, $y, $number, 50) - $Donate = True - update_armycamp($Troop, $number) - Else - SetLog(GetLangText("msgNo") & $Troop & GetLangText("msgAvailable"), $COLOR_ORANGE) - Return - EndIf - If _Sleep(500) Then Return -EndFunc ;==>DonateTroops - -Func update_armycamp($Troop, $number) - Switch $Troop - Case GetLangText("troopNamePlArcher"), GetLangText("troopNameArcher") - $CurArch += $number - Case GetLangText("troopNamePlBarbarian"), GetLangText("troopNameBarbarian") - $CurBarb += $number - Case GetLangText("troopNamePlGoblin"), GetLangText("troopNameGoblin") - $CurGoblin += $number - Case GetLangText("troopNamePlGiant"), GetLangText("troopNameGiant") - $CurGiant += $number - Case GetLangText("troopNamePlWallBreaker"), GetLangText("troopNameWallBreaker") - $CurWB += $number - ; Case "Balloon" - ; Case "Hog" - ; Case "Dragon" - ; Case "Pekka" - ; Case "Minion" - ; Case "Valkyrie" - ; Case "Witch" - ; Case "Healer" - ; Case "Golem" - ; Case "Lava" - EndSwitch -EndFunc ;==>update_armycamp - -Func GetTroopCoord() - Switch $Troop - Case GetLangText("troopNamePlBarbarian"), GetLangText("troopNameBarbarian"), GetLangText("troopNamePlHealer"), GetLangText("troopNameHealer"), GetLangText("troopDarkPlWitch"), GetLangText("troopDarkWitch") - $ColDist = 0 - Case GetLangText("troopNamePlArcher"), GetLangText("troopNameArcher"), GetLangText("troopNamePlDragon"), GetLangText("troopNameDragon"), GetLangText("troopDarkPlLavaHound"), GetLangText("troopDarkLavaHound") - $ColDist = 1 - Case GetLangText("troopNamePlGiant"), GetLangText("troopNameGiant"), GetLangText("troopNamePlPEKKA"), GetLangText("troopNamePEKKA") - $ColDist = 2 - Case GetLangText("troopNamePlGoblin"), GetLangText("troopNameGoblin"), GetLangText("troopDarkPlMinion"), GetLangText("troopDarkMinion") - $ColDist = 3 - Case GetLangText("troopNamePlWallBreaker"), GetLangText("troopNameWallBreaker"), GetLangText("troopDarkPlHog"), GetLangText("troopDarkHog") - $ColDist = 4 - Case GetLangText("troopNamePlBalloon"), GetLangText("troopNameBalloon"), GetLangText("troopDarkPlValkyrie"), GetLangText("troopDarkValkyrie") - $ColDist = 5 - Case GetLangText("troopNamePlWizard"), GetLangText("troopNameWizard"), GetLangText("troopDarkPlGolem"), GetLangText("troopDarkGolem") - $ColDist = 6 - Case Else - $ColDist = -1 - EndSwitch - - Switch $Troop - Case GetLangText("troopNamePlBarbarian"), GetLangText("troopNameBarbarian"), GetLangText("troopNamePlArcher"), GetLangText("troopNameArcher"), GetLangText("troopNamePlGiant"), GetLangText("troopNameGiant"), GetLangText("troopNamePlGoblin"), GetLangText("troopNameGoblin"), GetLangText("troopNamePlWallBreaker"), GetLangText("troopNameWallBreaker"), GetLangText("troopNamePlBalloon"), GetLangText("troopNameBalloon"), GetLangText("troopNamePlWizard"), GetLangText("troopNameWizard") - $RowDist = 0 - Case GetLangText("troopNamePlHealer"), GetLangText("troopNameHealer"), GetLangText("troopNamePlDragon"), GetLangText("troopNameDragon"), GetLangText("troopNamePlPEKKA"), GetLangText("troopNamePEKKA"), GetLangText("troopDarkPlMinion"), GetLangText("troopDarkMinion"), GetLangText("troopDarkPlHog"), GetLangText("troopDarkHog"), GetLangText("troopDarkPlValkyrie"), GetLangText("troopDarkValkyrie"), GetLangText("troopDarkPlGolem"), GetLangText("troopDarkGolem") - $RowDist = 1 - Case GetLangText("troopDarkPlWitch"), GetLangText("troopDarkWitch"), GetLangText("troopDarkPlLavaHound"), GetLangText("troopDarkLavaHound") - $RowDist = 2 - Case Else - $RowDist = -1 - EndSwitch -EndFunc ;==>GetTroopCoord +;Donates troops + +Func DonateCC($Check = False) + Global $Troop, $TroopAmount, $ColDist = 1, $RowDist = 0 ; default to archer + Global $AmountBarbarians = Number(GUICtrlRead($NoOfBarbarians)) + Global $AmountArchers = Number(GUICtrlRead($NoOfArchers)) + Global $AmountGiants = Number(GUICtrlRead($NoOfGiants)) + + Global $Donate = IsChecked($chkDonateAllBarbarians) Or IsChecked($chkDonateBarbarians) Or IsChecked($chkDonateAllArchers) Or IsChecked($chkDonateArchers) Or IsChecked($chkDonateAllGiants) Or IsChecked($chkDonateGiants) + If $Donate = False Then Return + Local $y = 119 + If $Check = True Then + _CaptureRegion() + If Not _ColorCheck(_GetPixelColor(26, 319), Hex(0xE80000, 6), 30) Then + Return ;exit if no new chats + EndIf + EndIf + + SetLog(GetLangText("msgDonatingTroops"), $COLOR_BLUE) + _CaptureRegion() + + Click(1, 1) ;Click Away + If _ColorCheck(_GetPixelColor(331, 330), Hex(0xF0A03B, 6), 20) = False Then Click(19, 349) ;Clicks chat thing + If _Sleep(500) Then Return + Click(189, 24) ; clicking clan tab + + While $Donate + Local $offColors[3][3] = [[0x000000, 0, -2], [0x262926, 0, 1], [0xF8FCF0, 0, 11]] + While 1 + If _Sleep(1000) Then ExitLoop + Global $DonatePixel = _MultiPixelSearch(202, $y, 203, 670, 1, 1, Hex(0x262926, 6), $offColors, 30) + If IsArray($DonatePixel) Then + $Donate = False + If Not (IsChecked($chkDonateAllBarbarians) Or IsChecked($chkDonateAllArchers) Or IsChecked($chkDonateAllGiants)) Then + If Not _SatSearch(34, $DonatePixel[1] - 29, 20, 10, 20, 100) Then + ; Multiline text + If Not _SatSearch(34, $DonatePixel[1] - 42, 20, 10, 20, 100) Then + $String = ReadText(34, $DonatePixel[1] - 40, 274, $textChat) + $String &= " " & ReadText(34, $DonatePixel[1] - 27, 274, $textChat) + $String &= " " & ReadText(34, $DonatePixel[1] - 14, 274, $textChat) + Else + $String = ReadText(34, $DonatePixel[1] - 27, 274, $textChat) + $String &= " " & ReadText(34, $DonatePixel[1] - 14, 274, $textChat) + EndIf + Else + $String = ReadText(34, $DonatePixel[1] - 14, 274, $textChat) + EndIf + + SetLog(GetLangText("msgChatText") & $String, $COLOR_GREEN) + + $Blacklisted = False + If IsChecked($chkBlacklist) Then + $blacklist = StringSplit(GUICtrlRead($txtBlacklist), @CRLF) + If IsArray($blacklist) Then + For $loop = 1 To $blacklist[0] + If StringStripWS($blacklist[$loop], 3) <> "" And StringInStr($String, StringStripWS($blacklist[$loop], 3)) Then $Blacklisted = True + Next + EndIf + EndIf + + If $Blacklisted Then + SetLog(GetLangText("msgBlacklisted"), $COLOR_GREEN) + Else + If IsChecked($chkDonateBarbarians) Then + Local $Barbs = StringSplit(StringStripWS($itxtDonateBarbarians, 3), @CRLF) + If IsArray($Barbs) Then + For $i = 1 To $Barbs[0] + If CheckDonate($Barbs[$i], $String) Then + $Troop = GUICtrlRead($cmbDonateBarbarians) + GetTroopCoord() + DonateTroops($Troop, $ColDist, $RowDist, $AmountBarbarians) + ExitLoop + EndIf + Next + If $Donate Then + If _Sleep(500) Then ExitLoop + $y = $DonatePixel[1] + 10 + EndIf + Else + SetLog(GetLangText("msgUnableToRead") & "1" & GetLangText("msgDonateRules")) + Return + EndIf + EndIf + If IsChecked($chkDonateArchers) Then + Local $Archers = StringSplit(StringStripWS($itxtDonateArchers, 3), @CRLF) + If IsArray($Archers) Then + For $i = 1 To $Archers[0] + If CheckDonate($Archers[$i], $String) Then + $Troop = GUICtrlRead($cmbDonateArchers) + GetTroopCoord() + DonateTroops($Troop, $ColDist, $RowDist, $AmountArchers) + ExitLoop + EndIf + Next + If $Donate Then + If _Sleep(500) Then ExitLoop + $y = $DonatePixel[1] + 10 + EndIf + Else + SetLog(GetLangText("msgUnableToRead") & "2" & GetLangText("msgDonateRules")) + Return + EndIf + EndIf + If IsChecked($chkDonateGiants) Then + Local $Giants = StringSplit(StringStripWS($itxtDonateGiants, 3), @CRLF) + If IsArray($Giants) Then + For $i = 1 To $Giants[0] + If CheckDonate($Giants[$i], $String) Then + $Troop = GUICtrlRead($cmbDonateGiants) + GetTroopCoord() + DonateTroops($Troop, $ColDist, $RowDist, $AmountGiants) + ExitLoop + EndIf + Next + If $Donate Then + If _Sleep(500) Then ExitLoop + $y = $DonatePixel[1] + 10 + EndIf + Else + SetLog(GetLangText("msgUnableToRead") & "3" & GetLangText("msgDonateRules")) + Return + EndIf + EndIf + EndIf + Else + If IsChecked($chkDonateAllBarbarians) Then + $Troop = GUICtrlRead($cmbDonateBarbarians) + $TroopAmount = Number(GUICtrlRead($NoOfBarbarians)) + ElseIf IsChecked($chkDonateAllArchers) Then + $Troop = GUICtrlRead($cmbDonateArchers) + $TroopAmount = Number(GUICtrlRead($NoOfArchers)) + ElseIf IsChecked($chkDonateAllGiants) Then + $Troop = GUICtrlRead($cmbDonateGiants) + $TroopAmount = Number(GUICtrlRead($NoOfGiants)) + EndIf + GetTroopCoord() + If $RowDist = -1 Or $ColDist = -1 Then + SetLog(GetLangText("msgUnableToDetermine") & $Troop) + ExitLoop + Else + DonateTroops($Troop, $ColDist, $RowDist, $TroopAmount) + If $Donate Then + If _Sleep(500) Then ExitLoop + $y = $DonatePixel[1] + 10 + EndIf + EndIf + EndIf + Else + ExitLoop + EndIf + If _Sleep(500) Then Return + Click(1, 1, 1, 2000) + $y = $DonatePixel[1] + 10 + WEnd + $DonatePixel = _MultiPixelSearch(202, $y, 203, 670, 1, 1, Hex(0x262926, 6), $offColors, 20) + Local $Scroll = _PixelSearch(285, 650, 287, 700, Hex(0x97E405, 6), 20) + $Donate = True + If IsArray($Scroll) Then + Click($Scroll[0], $Scroll[1]) + $y = 119 + If _Sleep(700) Then ExitLoop + ElseIf Not IsArray($DonatePixel) Then + $Donate = False + EndIf + WEnd + + If _Sleep(1000) Then Return + SetLog(GetLangText("msgFinishedDonating"), $COLOR_BLUE) + + _CaptureRegion() + If _ColorCheck(_GetPixelColor(331, 330), Hex(0xF0A03B, 6), 20) Then + Click(331, 330) ;Clicks chat thing + If _Sleep(500) Then Return + EndIf + + ;------------------------gtfo------------------------; + If GUICtrlRead($gtfo) = 1 Then + Local $Scroll, $kick_y, $kicked = 0 + While 1 + Click(1, 1, 1, 2000) + If _Sleep(500) Then Return + Click($CCPos[0], $CCPos[1]) ; click clan castle + If _Sleep(500) Then Return + Click(459, 600) ; open clan page + If _Sleep(5000) Then Return ; wait for it to load + $Scroll = 0 + While 1 + _CaptureRegion(190, 80, 220, 650) + If _Sleep(1000) Then ExitLoop + Local $new = _PixelSearch(200, 80, 210, 650, Hex(0xE73838, 6), 20) + If IsArray($new) Then + SetLog("x:" & $new[0] & " y:" & $new[1], $COLOR_RED) ; debuggin purpose + Click($new[0], $new[1]) + If _Sleep(500) Then ExitLoop + If $new[1] + 80 > 640 Then + $kick_y = 640 + Else + $kick_y = $new[1] + 80 + EndIf + Click($new[0] + 300, $kick_y) ; kick button, hopefully + If _Sleep(500) Then ExitLoop + Click(520, 240) + If _Sleep(500) Then ExitLoop + $kicked += 1 + SetLog($kicked & GetLangText("msgKicked"), $COLOR_RED) + If _Sleep(2000) Then ExitLoop + ExitLoop + Else + ControlSend($Title, "", "", "{CTRLDOWN}{UP}{CTRLUP}") ; scroll down the member list + SetLog(GetLangText("msgScrollingDown"), $COLOR_RED) + $Scroll += 1 + If _Sleep(3000) Then ExitLoop + EndIf + If $Scroll = 8 Then ExitLoop (2) + WEnd + WEnd + SetLog(GetLangText("msgFinishedKicking"), $COLOR_RED) + EndIf + Click(1, 1, 1, 2000) +EndFunc ;==>DonateCC + +Func CheckDonate($String, $clanString) ;Checks if it exact + $Contains = StringMid($String, 1, 1) & StringMid($String, StringLen($String), 1) + If $Contains = "[]" Then + If $clanString = StringMid($String, 2, StringLen($String) - 2) Then + Return True + Else + Return False + EndIf + Else + If StringInStr($clanString, $String, 2) Then + Return True + Else + Return False + EndIf + EndIf +EndFunc ;==>CheckDonate + +Func DonateTroops($Troop, $i, $Row, $number) + Local $x, $y + If IsArray(_PixelSearch(119, $DonatePixel[1], 204, $DonatePixel[1] + 4, Hex(0x262926, 6), 10)) Then + Click($DonatePixel[0], $DonatePixel[1] + 15) + Else + SetLog(GetLangText("msgNoDonateButton")) + EndIf + If _Sleep(1000) Then Return + _CaptureRegion(0, 0, 860, $DonatePixel[1] + 200) + If $i >= 0 Then $x = 237 + $i * 80 + If $Row = 0 Then + $y = $DonatePixel[1] - 5 + ElseIf $Row = 1 Then + $y = $DonatePixel[1] + 91 + Else + $y = $DonatePixel[1] + 185 + EndIf + If _ColorCheck(_GetPixelColor($x, $y), Hex(0x507C00, 6), 10) Or _ColorCheck(_GetPixelColor($x, $y - 5), Hex(0x507C00, 6), 10) Then + SetLog(GetLangText("msgDonating") & $number & " " & $Troop, $COLOR_BLUE) + If _Sleep(500) Then Return + ; TODO, check available trrop before donate the amount of number + Click($x, $y, $number, 50) + $Donate = True + update_armycamp($Troop, $number) + Else + SetLog(GetLangText("msgNo") & $Troop & GetLangText("msgAvailable"), $COLOR_ORANGE) + Return + EndIf + If _Sleep(500) Then Return +EndFunc ;==>DonateTroops + +Func update_armycamp($Troop, $number) + Switch $Troop + Case GetLangText("troopNamePlArcher"), GetLangText("troopNameArcher") + $CurArch += $number + Case GetLangText("troopNamePlBarbarian"), GetLangText("troopNameBarbarian") + $CurBarb += $number + Case GetLangText("troopNamePlGoblin"), GetLangText("troopNameGoblin") + $CurGoblin += $number + Case GetLangText("troopNamePlGiant"), GetLangText("troopNameGiant") + $CurGiant += $number + Case GetLangText("troopNamePlWallBreaker"), GetLangText("troopNameWallBreaker") + $CurWB += $number + ; Case "Balloon" + ; Case "Hog" + ; Case "Dragon" + ; Case "Pekka" + ; Case "Minion" + ; Case "Valkyrie" + ; Case "Witch" + ; Case "Healer" + ; Case "Golem" + ; Case "Lava" + EndSwitch +EndFunc ;==>update_armycamp + +Func GetTroopCoord() + Switch $Troop + Case GetLangText("troopNamePlBarbarian"), GetLangText("troopNameBarbarian"), GetLangText("troopNamePlHealer"), GetLangText("troopNameHealer"), GetLangText("troopDarkPlWitch"), GetLangText("troopDarkWitch") + $ColDist = 0 + Case GetLangText("troopNamePlArcher"), GetLangText("troopNameArcher"), GetLangText("troopNamePlDragon"), GetLangText("troopNameDragon"), GetLangText("troopDarkPlLavaHound"), GetLangText("troopDarkLavaHound") + $ColDist = 1 + Case GetLangText("troopNamePlGiant"), GetLangText("troopNameGiant"), GetLangText("troopNamePlPEKKA"), GetLangText("troopNamePEKKA") + $ColDist = 2 + Case GetLangText("troopNamePlGoblin"), GetLangText("troopNameGoblin"), GetLangText("troopDarkPlMinion"), GetLangText("troopDarkMinion") + $ColDist = 3 + Case GetLangText("troopNamePlWallBreaker"), GetLangText("troopNameWallBreaker"), GetLangText("troopDarkPlHog"), GetLangText("troopDarkHog") + $ColDist = 4 + Case GetLangText("troopNamePlBalloon"), GetLangText("troopNameBalloon"), GetLangText("troopDarkPlValkyrie"), GetLangText("troopDarkValkyrie") + $ColDist = 5 + Case GetLangText("troopNamePlWizard"), GetLangText("troopNameWizard"), GetLangText("troopDarkPlGolem"), GetLangText("troopDarkGolem") + $ColDist = 6 + Case Else + $ColDist = -1 + EndSwitch + + Switch $Troop + Case GetLangText("troopNamePlBarbarian"), GetLangText("troopNameBarbarian"), GetLangText("troopNamePlArcher"), GetLangText("troopNameArcher"), GetLangText("troopNamePlGiant"), GetLangText("troopNameGiant"), GetLangText("troopNamePlGoblin"), GetLangText("troopNameGoblin"), GetLangText("troopNamePlWallBreaker"), GetLangText("troopNameWallBreaker"), GetLangText("troopNamePlBalloon"), GetLangText("troopNameBalloon"), GetLangText("troopNamePlWizard"), GetLangText("troopNameWizard") + $RowDist = 0 + Case GetLangText("troopNamePlHealer"), GetLangText("troopNameHealer"), GetLangText("troopNamePlDragon"), GetLangText("troopNameDragon"), GetLangText("troopNamePlPEKKA"), GetLangText("troopNamePEKKA"), GetLangText("troopDarkPlMinion"), GetLangText("troopDarkMinion"), GetLangText("troopDarkPlHog"), GetLangText("troopDarkHog"), GetLangText("troopDarkPlValkyrie"), GetLangText("troopDarkValkyrie"), GetLangText("troopDarkPlGolem"), GetLangText("troopDarkGolem") + $RowDist = 1 + Case GetLangText("troopDarkPlWitch"), GetLangText("troopDarkWitch"), GetLangText("troopDarkPlLavaHound"), GetLangText("troopDarkLavaHound") + $RowDist = 2 + Case Else + $RowDist = -1 + EndSwitch +EndFunc ;==>GetTroopCoord diff --git a/COCBot/functions/Village/DonateCheckArmyCamp.au3 b/COCBot/functions/Village/DonateCheckArmyCamp.au3 index 8173418..b58e58e 100644 --- a/COCBot/functions/Village/DonateCheckArmyCamp.au3 +++ b/COCBot/functions/Village/DonateCheckArmyCamp.au3 @@ -1,96 +1,97 @@ -Func Donate_CheckArmyCamp() - SetLog(GetLangText("msgCheckingCamp"), $COLOR_BLUE) - $fullArmy = False - - If _Sleep(100) Then Return - - ClickP($TopLeftClient) ;Click Away - - If $ArmyPos[0] = "" Then - If Not LocateCamp() Then Return - SaveConfig() - Else - If _Sleep(1000) Then Return - Click($ArmyPos[0], $ArmyPos[1]) ;Click Army Camp - EndIf - - _CaptureRegion() - If _Sleep(1000) Then Return - Local $BArmyPos = _WaitForPixel(309, 581, 433, 583, Hex(0x4084B8, 6), 5) ;Finds Info button - If IsArray($BArmyPos) = False Then - SetLog(GetLangText("msgCampNA"), $COLOR_RED) - Else - Click($BArmyPos[0], $BArmyPos[1]) ;Click Info button - _WaitForPixel(690, 150, 710, 170, Hex(0xD80407, 6), 5, 1) ;Finds Red Cross button in new popup window - If _Sleep(200) Then Return - For $readattempts = 1 to 3 - $CurCamp = StringStripWS(ReadText(426, 194, 280, $textWindows), 3) - $CurCamp = StringStripWS(StringMid($CurCamp, Stringinstr($CurCamp, ":") + 1), 3) - Local $itxtcampCap = StringMid($CurCamp, Stringinstr($CurCamp, "/") + 1) - If Number($itxtcampCap) > 0 And Number($itxtcampCap) < 300 Then - $CurCamp = StringLeft($CurCamp, StringInStr($CurCamp, "/") - 1) - If Number($CurCamp) >= 0 And Number($CurCamp) <= $itxtcampCap Then - SetLog(GetLangText("msgTotalCampCap") & $CurCamp & "/" & $itxtcampCap, $COLOR_GREEN) - ExitLoop - EndIf - EndIf - If _Sleep(500) Then Return - If $readattempts = 3 Then - SetLog(GetLangText("msgTotalCampCap") & GetLangText("lblUnknownCap"), $COLOR_GREEN) - $CurCamp = 0 - If $itxtcampCap = 0 then $itxtcampCap = 240 - EndIf - Next - - If ($CurCamp/$itxtcampCap) >= ((_GUICtrlComboBox_GetCurSel($cmbRaidcap)+1)/10) Then - $fullarmy = True - Else - _CaptureRegion() - If $FirstStart Then - $ArmyComp = 0 - $CurGiant = 0 - $CurWB = 0 - $CurArch = 0 - $CurBarb = 0 - $CurGoblin = 0 - EndIf - For $i = 0 To 6 - Local $TroopKind = _GetPixelColor(254 + 62 * $i, 375) - Local $TroopKind2 = _GetPixelColor(264 + 62 * $i, 380) - Local $TroopName = 0 - Local $TroopQ = StringStripWS(ReadText(239 + (62 * $i), 350, 37, $textWindows), 3) - If StringLeft($TroopQ, 1) = "x" Then $TroopQ = StringRight($TroopQ, StringLen($TroopQ) - 1) - $TroopQ = Number($TroopQ) - If _ColorCheck($TroopKind, Hex(0xEC4989, 6), 30) Then - If ($CurArch = 0 And $FirstStart) Then $CurArch -= $TroopQ - $TroopName = "Archers" - ElseIf _ColorCheck($TroopKind, Hex(0xFFC020, 6), 30) Then - If ($CurBarb = 0 And $FirstStart) Then $CurBarb -= $TroopQ - $TroopName = "Barbarians" - ElseIf _ColorCheck($TroopKind, Hex(0xFFC17F, 6), 30) Then - If ($CurGiant = 0 And $FirstStart) Then $CurGiant -= $TroopQ - $TroopName = "Giants" - ElseIf _ColorCheck($TroopKind, Hex(0x90E658, 6), 30) Then - If ($CurGoblin = 0 And $FirstStart) Then $CurGoblin -= $TroopQ - $TroopName = "Goblins" - ElseIf _ColorCheck($TroopKind2, Hex(0xD06C38, 6), 30) Then - If ($CurWB = 0 And $FirstStart) Then $CurWB -= $TroopQ - $TroopName = "Wallbreakers" - ElseIf _ColorCheck($TroopKind, Hex(0x151F37, 6), 20) Then - If ($FirstStart) Then $CurMinion -= $TroopQ - $TroopName = "Minions" - ElseIf _ColorCheck($TroopKind, Hex(0x4C2E26, 6), 30) Then - If ($FirstStart) Then $CurHog -= $TroopQ - $TroopName = "Hogs" - ElseIf _ColorCheck($TroopKind, Hex(0xA95E58, 6), 30) Then - If ($FirstStart) Then $CurValkyrie -= $TroopQ - $TroopName = "Valkyries" - EndIf - If $TroopQ <> 0 Then SetLog("- " & $TroopName & " " & $TroopQ, $COLOR_GREEN) - Next - EndIf - ClickP($TopLeftClient) ;Click Away - $FirstCampView = True - EndIf - Return $fullArmy -EndFunc ;==>Donate_CheckArmyCamp +Func Donate_CheckArmyCamp() + SetLog(GetLangText("msgCheckingCamp"), $COLOR_BLUE) + $fullArmy = False + + If _Sleep(100) Then Return + + ClickP($TopLeftClient) ;Click Away + + If $ArmyPos[0] = "" Then + If Not LocateCamp() Then Return + SaveConfig() + Else + If _Sleep(1000) Then Return + Click($ArmyPos[0], $ArmyPos[1]) ;Click Army Camp + EndIf + + _CaptureRegion() + If _Sleep(1000) Then Return + Local $BArmyPos = _WaitForPixel(309, 581, 433, 583, Hex(0x4084B8, 6), 5) ;Finds Info button + If IsArray($BArmyPos) = False Then + SetLog(GetLangText("msgCampNA"), $COLOR_RED) + Else + Click($BArmyPos[0], $BArmyPos[1]) ;Click Info button + _WaitForPixel(690, 150, 710, 170, Hex(0xD80407, 6), 5, 1) ;Finds Red Cross button in new popup window + If _Sleep(200) Then Return + For $readattempts = 1 to 20 + $CurCamp = StringStripWS(ReadText(426, 194, 280, $textWindows), 8) + $CurCamp = StringStripWS(StringMid($CurCamp, Stringinstr($CurCamp, ":") + 1), 8) + Local $itxtcampCap = StringMid($CurCamp, Stringinstr($CurCamp, "/") + 1) + If Number($itxtcampCap) > 0 And Number($itxtcampCap) < 300 And StringIsDigit($itxtcampCap) Then + $CurCamp = StringLeft($CurCamp, StringInStr($CurCamp, "/") - 1) + If Number($CurCamp) >= 0 And Number($CurCamp) <= $itxtcampCap And StringIsDigit($itxtcampCap) Then + SetLog(GetLangText("msgTotalCampCap") & $CurCamp & "/" & $itxtcampCap, $COLOR_GREEN) + ExitLoop + EndIf + EndIf + If _Sleep(500) Then Return + If $readattempts = 20 Then + SetLog(GetLangText("msgTotalCampCap") & GetLangText("lblUnknownCap"), $COLOR_GREEN) + $CurCamp = 0 + If $itxtcampCap = 0 then $itxtcampCap = 240 + EndIf + Next + + If ($CurCamp/$itxtcampCap) >= ((_GUICtrlComboBox_GetCurSel($cmbRaidcap)+1)/10) Then + $fullarmy = True + Else + _CaptureRegion() + If $FirstStart Then + $ArmyComp = 0 + $CurGiant = 0 + $CurWB = 0 + $CurArch = 0 + $CurBarb = 0 + $CurGoblin = 0 + EndIf + For $i = 0 To 6 + Local $TroopKind = _GetPixelColor(254 + 62 * $i, 375) + Local $TroopKind2 = _GetPixelColor(264 + 62 * $i, 380) + Local $TroopName = "" + Local $TroopQ = StringStripWS(ReadText(239 + (62 * $i), 350, 37, $textWindows), 3) + If StringLeft($TroopQ, 1) = "x" Then $TroopQ = StringRight($TroopQ, StringLen($TroopQ) - 1) + $TroopQ = Number($TroopQ) + If _ColorCheck($TroopKind, Hex(0xEC4989, 6), 30) Then + If ($CurArch = 0 And $FirstStart) Then $CurArch -= $TroopQ + $TroopName = "Archers" + ElseIf _ColorCheck($TroopKind, Hex(0xFFC020, 6), 30) Then + If ($CurBarb = 0 And $FirstStart) Then $CurBarb -= $TroopQ + $TroopName = "Barbarians" + ElseIf _ColorCheck($TroopKind, Hex(0xFFC17F, 6), 30) Then + If ($CurGiant = 0 And $FirstStart) Then $CurGiant -= $TroopQ + $TroopName = "Giants" + ElseIf _ColorCheck($TroopKind, Hex(0x90E658, 6), 30) Then + If ($CurGoblin = 0 And $FirstStart) Then $CurGoblin -= $TroopQ + $TroopName = "Goblins" + ElseIf _ColorCheck($TroopKind2, Hex(0xD06C38, 6), 30) Then + If ($CurWB = 0 And $FirstStart) Then $CurWB -= $TroopQ + $TroopName = "Wallbreakers" + ElseIf _ColorCheck($TroopKind, Hex(0x151F37, 6), 20) Then + If ($FirstStart) Then $CurMinion -= $TroopQ + $TroopName = "Minions" + ElseIf _ColorCheck($TroopKind, Hex(0x4C2E26, 6), 30) Then + If ($FirstStart) Then $CurHog -= $TroopQ + $TroopName = "Hogs" + ElseIf _ColorCheck($TroopKind, Hex(0xA95E58, 6), 30) Then + If ($FirstStart) Then $CurValkyrie -= $TroopQ + $TroopName = "Valkyries" + EndIf + If $TroopName = "" Then $TroopName = "Unknown" + If $TroopQ <> 0 Then SetLog("- " & $TroopName & " " & $TroopQ, $COLOR_GREEN) + Next + EndIf + ClickP($TopLeftClient) ;Click Away + $FirstCampView = True + EndIf + Return $fullArmy +EndFunc ;==>Donate_CheckArmyCamp diff --git a/COCBot/functions/Village/DonateTrain.au3 b/COCBot/functions/Village/DonateTrain.au3 index 957accb..3811701 100644 --- a/COCBot/functions/Village/DonateTrain.au3 +++ b/COCBot/functions/Village/DonateTrain.au3 @@ -1,677 +1,673 @@ -;Uses the location of manually set Barracks to train specified troops - -; Train the troops (Fill the barracks) - -Func Donate_GetTrainPos($troopKind) - Switch $troopKind - Case $eBarbarian ; 261, 366: 0x39D8E0 - Return $TrainBarbarian - Case $eArcher ; 369, 366: 0x39D8E0 - Return $TrainArcher - Case $eGiant ; 475, 366: 0x3DD8E0 - Return $TrainGiant - Case $eGoblin ; 581, 366: 0x39D8E0 - Return $TrainGoblin - Case $eWallbreaker ; 688, 366, 0x3AD8E0 - Return $TrainWallbreaker - Case $eMinion - Return $TrainMinion - Case $eHog - Return $TrainHog - Case $eValkyrie - Return $TrainValkyrie - Case Else - SetLog(GetLangText("msgDontKnow") & $troopKind & GetLangText("msgYet")) - Return 0 - EndSwitch -EndFunc ;==>Donate_GetTrainPos - -Func Donate_TrainIt($troopKind, $howMuch = 1, $iSleep = 100) - _CaptureRegion() - Local $pos = Donate_GetTrainPos($troopKind) - If IsArray($pos) Then - If CheckPixel($pos) Then - ClickP($pos, $howMuch, 20) - If _Sleep($iSleep) Then Return False - Return True - EndIf - EndIf -EndFunc ;==>Donate_TrainIt - -Func Donate_Train($reset = False) - resetBarracksError() - If $barrackPos[0][0] = "" Then - If Not LocateBarrack() Then Return - SaveConfig() - If _Sleep(2000) Then Return - EndIf - - SetLog(GetLangText("msgTrainingTroops"), $COLOR_BLUE) - - If $reset Then ; reset all for cook again on startup - $ArmyComp = 0 - $CurGiant = 0 - $CurWB = 0 - $CurArch = 0 - $CurBarb = 0 - $CurGoblin = 0 - EndIf - - If (($ArmyComp = 0) And (_GUICtrlComboBox_GetCurSel($cmbTroopComp) <> 8)) Or $FixTrain Then - If $FixTrain Or $FirstStart And Not $reset Then $ArmyComp = $CurCamp - $FixTrain = False - $CurGiant += GUICtrlRead($txtNumGiants) - $CurWB += GUICtrlRead($txtNumWallbreakers) - $CurArch += Floor((($itxtcampCap * GUICtrlRead($cmbRaidcap) / 100) - (GUICtrlRead($txtNumGiants) * 5) - (GUICtrlRead($txtNumWallbreakers) * 2)) * (GUICtrlRead($txtArchers) / 100)) - $CurBarb += Floor((($itxtcampCap * GUICtrlRead($cmbRaidcap) / 100) - (GUICtrlRead($txtNumGiants) * 5) - (GUICtrlRead($txtNumWallbreakers) * 2)) * (GUICtrlRead($txtBarbarians) / 100)) - $CurGoblin += Floor((($itxtcampCap * GUICtrlRead($cmbRaidcap) / 100) - (GUICtrlRead($txtNumGiants) * 5) - (GUICtrlRead($txtNumWallbreakers) * 2)) * (GUICtrlRead($txtGoblins) / 100)) - SetLog("D-CurArch" & $CurArch) - SetLog("D-CurBarb" & $CurBarb) - SetLog("D-CurGoblin" & $CurGoblin) - If $CurArch < 0 Then $CurArch = 0 - If $CurBarb < 0 Then $CurBarb = 0 - If $CurGoblin < 0 Then $CurGoblin = 0 - If $CurWB < 0 Then $CurWB = 0 - If $CurGiant < 0 Then $CurGiant = 0 - If ($CurArch + $CurBarb + $CurGoblin + (5 * $CurGiant) + (2 * $CurWB)) < $itxtcampCap Then - If $CurArch > 0 Then - $CurArch += 1 - EndIf - If ($CurArch + $CurBarb + $CurGoblin + (5 * $CurGiant) + (2 * $CurWB)) < $itxtcampCap Then - If $CurBarb > 0 Then - $CurBarb += 1 - EndIf - If ($CurArch + $CurBarb + $CurGoblin + (5 * $CurGiant) + (2 * $CurWB)) < $itxtcampCap Then - If $CurGoblin > 0 Then - $CurGoblin += 1 - EndIf - EndIf - EndIf - EndIf - SetLog(GetLangText("msgForcesNeededB") & $CurBarb & GetLangText("msgForcesNeededA") & $CurArch & GetLangText("msgForcesNeededGo") & $CurGoblin & GetLangText("msgForcesNeededGi") & $CurGiant & GetLangText("msgForcesNeededWB") & $CurWB, $COLOR_GREEN) - EndIf - - Local $GiantEBarrack, $WallEBarrack, $ArchEBarrack, $BarbEBarrack, $GoblinEBarrack - $GiantEBarrack = Floor($CurGiant / 4) - $WallEBarrack = Floor($CurWB / 4) - $ArchEBarrack = Floor($CurArch / 4) - $BarbEBarrack = Floor($CurBarb / 4) - $GoblinEBarrack = Floor($CurGoblin / 4) - - Local $troopFirstGiant, $troopSecondGiant, $troopFirstWall, $troopSecondWall, $troopFirstGoblin, $troopSecondGoblin, $troopFirstBarba, $troopSecondBarba, $troopFirstArch, $troopSecondArch - $troopFirstGiant = 0 - $troopSecondGiant = 0 - $troopFirstWall = 0 - $troopSecondWall = 0 - $troopFirstGoblin = 0 - $troopSecondGoblin = 0 - $troopFirstBarba = 0 - $troopSecondBarba = 0 - $troopFirstArch = 0 - $troopSecondArch = 0 - - Local $BarrackControl - Local $expUIRet[2] - - $hDLL = DllOpen(@ScriptDir & "\BrokenBot.org\BrokenBot32.dll") - For $i = 0 To 3 - If _Sleep(500) Then ExitLoop - - ClickP($TopLeftClient) ;Click Away - - If _Sleep(500) Then ExitLoop - - Click($barrackPos[$i][0], $barrackPos[$i][1]) ;Click Barrack - If _Sleep(500) Then ExitLoop - - _CaptureRegion() - $sendHBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap) - $resUI = DllCall($hDLL, "str", "BrokenBotMatchButton", "ptr", $sendHBitmap, "int", 108, "int", 3, "int", 1, "int", 3, "int", (IsChecked($chkSpeedBoost) ? (1) : (0))) - _WinAPI_DeleteObject($sendHBitmap) - $expUIRet[0] = -1 - If IsArray($resUI) Then - If $resUI[0] = -1 Then - ; Didn't find button - ElseIf $resUI[0] = -2 Then - SetLog(GetLangText("msgLicense"), $COLOR_RED) - Else - $expUIRet = StringSplit($resUI[0], "|", 2) - EndIf - Else - SetLog(GetLangText("msgDLLError"), $COLOR_RED) - EndIf - If $expUIRet[0] = -1 Then - SetLog(GetLangText("msgBarrack") & $i + 1 & GetLangText("msgNotAvailable"), $COLOR_RED) - handleBarracksError($i) - If _Sleep(500) Then ExitLoop - Else - Click($expUIRet[1], $expUIRet[2]) ;Click Train Troops button - _WaitForPixel(720, 150, 740, 170, Hex(0xD80404, 6), 5, 1) ;Finds Red Cross button in new Training popup window - - If _GUICtrlComboBox_GetCurSel($cmbTroopComp) = 8 Then - Switch $i - Case 0 - $BarrackControl = $cmbBarrack1 - Case 1 - $BarrackControl = $cmbBarrack2 - Case 2 - $BarrackControl = $cmbBarrack3 - Case 3 - $BarrackControl = $cmbBarrack4 - EndSwitch - _CaptureRegion() - Switch _GUICtrlComboBox_GetCurSel($BarrackControl) - Case 0 - While _ColorCheck(_GetPixelColor(216, 325), Hex(0xF09D1C, 6), 30) - Click(216, 325, 75) ;Barbarian - If _Sleep(150) Then ExitLoop - _CaptureRegion() - WEnd - Case 1 - While _ColorCheck(_GetPixelColor(330, 323), Hex(0xE84070, 6), 30) - Click(325, 320, 75) ;Archer - If _Sleep(150) Then ExitLoop - _CaptureRegion() - WEnd - Case 2 - While _ColorCheck(_GetPixelColor(419, 319), Hex(0xF88409, 6), 30) - Click(419, 319, 20) ;Giant - If _Sleep(150) Then ExitLoop - _CaptureRegion() - WEnd - Case 3 - While _ColorCheck(_GetPixelColor(549, 328), Hex(0xFB4C24, 6), 30) - Click(535, 320, 75) ;Goblin - If _Sleep(150) Then ExitLoop - _CaptureRegion() - WEnd - Case 4 - While _ColorCheck(_GetPixelColor(685, 327), Hex(0x9E4716, 6), 30) - Click(685, 327, 20) ;Wall Breaker - If _Sleep(150) Then ExitLoop - _CaptureRegion() - WEnd - Case 5 - While _ColorCheck(_GetPixelColor(213, 418), Hex(0x861F15, 6), 30) - Click(213, 418, 20) ;Balloon - If _Sleep(150) Then ExitLoop - _CaptureRegion() - WEnd - Case 6 - While _ColorCheck(_GetPixelColor(340, 449), Hex(0xF09C85, 6), 30) - Click(325, 425, 20) ;Wizard - If _Sleep(150) Then ExitLoop - _CaptureRegion() - WEnd - Case 7 - While _ColorCheck(_GetPixelColor(440, 445), Hex(0xFDD8C0, 6), 30) - Click(440, 445, 10) ;Healer - If _Sleep(150) Then ExitLoop - _CaptureRegion() - WEnd - Case 8 - While _ColorCheck(_GetPixelColor(539, 444), Hex(0x302848, 6), 30) - Click(539, 444, 10) ;Dragon - If _Sleep(150) Then ExitLoop - _CaptureRegion() - WEnd - Case 9 - While _ColorCheck(_GetPixelColor(647, 440), Hex(0x456180, 6), 30) - Click(647, 440, 10) ;PEKKA - If _Sleep(150) Then ExitLoop - _CaptureRegion() - WEnd - Case Else - If _Sleep(50) Then ExitLoop - _CaptureRegion() - EndSwitch - Else - SetLog("====== " & GetLangText("msgBarrack") & $i + 1 & " : ======", $COLOR_BLUE) - _CaptureRegion() - ;while _ColorCheck(_GetPixelColor(496, 200), Hex(0x880000, 6), 20) Then - If $reset Or $FirstStart Then - Click(503, 180, 80, 5) - EndIf - ;wend - - If _Sleep(500) Then ExitLoop - _CaptureRegion() - If GUICtrlRead($txtNumGiants) <> "0" Then - $troopFirstGiant = StringStripWS(ReadText(181 + (2 * 107), 298, 35, $textWindows),3) - If StringRight($troopFirstGiant, 1) = "x" Then $troopFirstGiant = StringLeft($troopFirstGiant, StringLen($troopFirstGiant) - 1) - EndIf - - If GUICtrlRead($txtNumWallbreakers) <> "0" Then - $troopFirstWall = StringStripWS(ReadText(181 + (4 * 107), 298, 35, $textWindows),3) - If StringRight($troopFirstWall, 1) = "x" Then $troopFirstWall = StringLeft($troopFirstWall, StringLen($troopFirstWall) - 1) - EndIf - - If GUICtrlRead($txtGoblins) <> "0" Then - $troopFirstGoblin = StringStripWS(ReadText(181 + (3* 107), 298, 35, $textWindows),3) - If StringRight($troopFirstGoblin, 1) = "x" Then $troopFirstGoblin = StringLeft($troopFirstGoblin, StringLen($troopFirstGoblin) - 1) - EndIf - - If GUICtrlRead($txtBarbarians) <> "0" Then - $troopFirstBarba = StringStripWS(ReadText(181, 298, 35, $textWindows),3) - If StringRight($troopFirstBarba, 1) = "x" Then $troopFirstBarba = StringLeft($troopFirstBarba, StringLen($troopFirstBarba) - 1) - EndIf - - If GUICtrlRead($txtArchers) <> "0" Then - $troopFirstArch = StringStripWS(ReadText(181 + 107, 298, 35, $textWindows),3) - If StringRight($troopFirstArch, 1) = "x" Then $troopFirstArch = StringLeft($troopFirstArch, StringLen($troopFirstArch) - 1) - EndIf - - If GUICtrlRead($txtNumGiants) <> "0" And $CurGiant > 0 Then - ;If _ColorCheck(_GetPixelColor(475, 366), Hex(0x3DD8E0, 6), 20) And $CurGiant > 0 Then - If $CurGiant > 0 Then - If $GiantEBarrack = 0 Then - Donate_TrainIt($eGiant, 1) - ElseIf $GiantEBarrack >= $CurGiant Or $GiantEBarrack = 0 Then - Donate_TrainIt($eGiant, $CurGiant) - Else - Donate_TrainIt($eGiant, $GiantEBarrack) - EndIf - EndIf - EndIf - - - If GUICtrlRead($txtNumWallbreakers) <> "0" And $CurWB > 0 Then - ;If _ColorCheck(_GetPixelColor(688, 366), Hex(0x3AD8E0, 6), 20) And $CurWB > 0 Then - If $CurWB > 0 Then - If $WallEBarrack = 0 Then - Donate_TrainIt($eWallbreaker, 1) - ElseIf $WallEBarrack >= $CurWB Or $WallEBarrack = 0 Then - Donate_TrainIt($eWallbreaker, $CurWB) - Else - Donate_TrainIt($eWallbreaker, $WallEBarrack) - EndIf - EndIf - EndIf - - - If GUICtrlRead($txtBarbarians) <> "0" And $CurBarb > 0 Then - ;If _ColorCheck(_GetPixelColor(369, 366), Hex(0x39D8E0, 6), 20) And $CurBarb > 0 Then - If $CurBarb > 0 Then - If $BarbEBarrack = 0 Then - Donate_TrainIt($eBarbarian, 1) - ElseIf $BarbEBarrack >= $CurBarb Or $BarbEBarrack = 0 Then - Donate_TrainIt($eBarbarian, $CurBarb) - Else - Donate_TrainIt($eBarbarian, $BarbEBarrack) - EndIf - EndIf - EndIf - - - If GUICtrlRead($txtGoblins) <> "0" And $CurGoblin > 0 Then - ;If _ColorCheck(_GetPixelColor(261, 366), Hex(0x39D8E0, 6), 20) And $CurGoblin > 0 Then - If $CurGoblin > 0 Then - If $GoblinEBarrack = 0 Then - Donate_TrainIt($eGoblin, 1) - ElseIf $GoblinEBarrack >= $CurGoblin Or $GoblinEBarrack = 0 Then - Donate_TrainIt($eGoblin, $CurGoblin) - Else - Donate_TrainIt($eGoblin, $GoblinEBarrack) - EndIf - EndIf - EndIf - - If _Sleep(900) Then ExitLoop - _CaptureRegion() - - If GUICtrlRead($txtNumGiants) <> "0" Then - $troopSecondGiant = StringStripWS(ReadText(181 + (2 * 107), 298, 35, $textWindows)) - If StringRight($troopSecondGiant, 1) = "x" Then $troopSecondGiant = StringLeft($troopSecondGiant, StringLen($troopSecondGiant) - 1) - EndIf - - If GUICtrlRead($txtNumWallbreakers) <> "0" Then - $troopSecondWall = StringStripWS(ReadText(181 + (4 * 107), 298, 35, $textWindows)) - If StringRight($troopSecondWall, 1) = "x" Then $troopSecondWall = StringLeft($troopSecondWall, StringLen($troopSecondWall) - 1) - EndIf - - If GUICtrlRead($txtGoblins) <> "0" Then - $troopSecondGoblin = StringStripWS(ReadText(181 + (3* 107), 298, 35, $textWindows)) - If StringRight($troopSecondGoblin, 1) = "x" Then $troopSecondGoblin = StringLeft($troopSecondGoblin, StringLen($troopSecondGoblin) - 1) - EndIf - - If GUICtrlRead($txtBarbarians) <> "0" Then - $troopSecondBarba = StringStripWS(ReadText(181, 298, 35, $textWindows)) - If StringRight($troopSecondBarba, 1) = "x" Then $troopSecondBarba = StringLeft($troopSecondBarba, StringLen($troopSecondBarba) - 1) - EndIf - - If GUICtrlRead($txtArchers) <> "0" Then - $troopSecondArch = StringStripWS(ReadText(181 + 107, 298, 35, $textWindows)) - If StringRight($troopSecondArch, 1) = "x" Then $troopSecondArch = StringLeft($troopSecondArch, StringLen($troopSecondArch) - 1) - EndIf - - - If $troopSecondGiant > $troopFirstGiant And GUICtrlRead($txtNumGiants) <> "0" Then - $ArmyComp += ($troopSecondGiant - $troopFirstGiant) * 5 - $CurGiant -= ($troopSecondGiant - $troopFirstGiant) - SetLog(GetLangText("msgBarrack") & ($i + 1) & GetLangText("msgTraining") & GetLangText("troopNameGiant") & " : " & ($troopSecondGiant - $troopFirstGiant), $COLOR_GREEN) - SetLog(GetLangText("troopNameGiant") & GetLangText("msgRemaining") & $CurGiant, $COLOR_BLUE) - EndIf - - - If $troopSecondWall > $troopFirstWall And GUICtrlRead($txtNumWallbreakers) <> "0" Then - $ArmyComp += ($troopSecondWall - $troopFirstWall) * 2 - $CurWB -= ($troopSecondWall - $troopFirstWall) - SetLog(GetLangText("msgBarrack") & ($i + 1) & GetLangText("msgTraining") & GetLangText("troopNameWallBreaker") & " : " & ($troopSecondGiant - $troopFirstGiant), $COLOR_GREEN) - SetLog(GetLangText("troopNameWallBreaker") & GetLangText("msgRemaining") & $CurGiant, $COLOR_BLUE) - EndIf - - If $troopSecondGoblin > $troopFirstGoblin And GUICtrlRead($txtGoblins) <> "0" Then - $ArmyComp += ($troopSecondGoblin - $troopFirstGoblin) - $CurGoblin -= ($troopSecondGoblin - $troopFirstGoblin) - SetLog(GetLangText("msgBarrack") & ($i + 1) & GetLangText("msgTraining") & GetLangText("troopNameGoblin") & " : " & ($troopSecondGiant - $troopFirstGiant), $COLOR_GREEN) - SetLog(GetLangText("troopNameGoblin") & GetLangText("msgRemaining") & $CurGiant, $COLOR_BLUE) - EndIf - - If $troopSecondBarba > $troopFirstBarba And GUICtrlRead($txtBarbarians) <> "0" Then - $ArmyComp += ($troopSecondBarba - $troopFirstBarba) - $CurBarb -= ($troopSecondBarba - $troopFirstBarba) - SetLog(GetLangText("msgBarrack") & ($i + 1) & GetLangText("msgTraining") & GetLangText("troopNameBarbarian") & " : " & ($troopSecondGiant - $troopFirstGiant), $COLOR_GREEN) - SetLog(GetLangText("troopNameBarbarian") & GetLangText("msgRemaining") & $CurGiant, $COLOR_BLUE) - EndIf - - If $troopSecondArch > $troopFirstArch And GUICtrlRead($txtArchers) <> "0" Then - $ArmyComp += ($troopSecondArch - $troopFirstArch) - $CurArch -= ($troopSecondArch - $troopFirstArch) - SetLog(GetLangText("msgBarrack") & ($i + 1) & GetLangText("msgTraining") & GetLangText("troopNameArcher") & " : " & ($troopSecondGiant - $troopFirstGiant), $COLOR_GREEN) - SetLog(GetLangText("troopNameArcher") & GetLangText("msgRemaining") & $CurGiant, $COLOR_BLUE) - EndIf - SetLog(GetLangText("msgTotalBuilding") & $ArmyComp, $COLOR_RED) - EndIf - EndIf - If _Sleep(100) Then ExitLoop - Click($TopLeftClient[0], $TopLeftClient[1], 2, 250); Click away twice with 250ms delay - Next - If $brerror[0] And $brerror[1] And $brerror[2] And $brerror[3] Then - resetBarracksError() - $needzoomout = True - SetLog(GetLangText("msgRestartComplete"), $COLOR_RED) - Else - SetLog(GetLangText("msgTrainingComp"), $COLOR_BLUE) - EndIf - $FirstStart = False - -;~ BEGIN DARK TROOPS -;~ If $ichkDarkTroop = 0 Then Return - Local $TrainPos[2] - If $DarkBarrackPos[0][0] = "" Then - LocateDarkBarrack() - SaveConfig() - If _Sleep(2000) Then Return - EndIf - - Global $LeftRax1, $LeftRax2, $TrainDrax1, $TrainDrax2, $ClickRax1, $ClickRax2 - - If $fullArmy Or $FirstDarkTrain Then - $TrainDrax1 = True - $TrainDrax2 = True - EndIf - - If $TrainDrax1 = False And $TrainDrax2 = False Then Return - - SetLog(GetLangText("msgTrainingDark"), $COLOR_BLUE) - For $i = 0 To 1 - If _Sleep(500) Then ExitLoop - - ClickP($TopLeftClient) ;Click Away - - If _Sleep(500) Then ExitLoop - Click($DarkBarrackPos[$i][0], $DarkBarrackPos[$i][1]) ;Click Dark Barrack - If _Sleep(500) Then ExitLoop - -;~ Local $TrainPos = _PixelSearch(155, 603, 694, 605, Hex(0x603818, 6), 5) ;Finds Train Troops button - _CaptureRegion() - If _Sleep(500) Then ExitLoop - $sendHBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap) - $res = DllCall(@ScriptDir & "\BrokenBot.org\BrokenBot32.dll", "str", "BrokenBotMatchButton", "ptr", $sendHBitmap, "int", 108, "int", 3, "int", 1, "int", 3, "int", (IsChecked($chkSpeedBoost) ? (1) : (0))) ; remove icon - _WinAPI_DeleteObject($sendHBitmap) - If IsArray($res) Then - If $res[0] = -1 Then - SetLog(GetLangText("msgDarkBarrack") & $i + 1 & GetLangText("msgNotAvailable"), $COLOR_RED) - Return - ElseIf $res[0] = -2 Then - SetLog(GetLangText("msgLicense"), $COLOR_RED) - Else - $expUIRet = StringSplit($res[0], "|", 2) - $TrainPos[0] = $expUIRet[1] - $TrainPos[1] = $expUIRet[2] - If $DebugMode = 1 Then SetLog("DB Train:" & $TrainPos[0] & " Y:" & $TrainPos[1]) - EndIf - EndIf - Click($TrainPos[0], $TrainPos[1]) ;Click Train Troops button - If _Sleep(800) Then ExitLoop - If $fullArmy Or $FirstDarkTrain Then - If Not _ColorCheck(_GetPixelColor(497, 195), Hex(0xE0E4D0, 6), 20) Then - Click(496, 190, 80, 2) - EndIf - EndIf - - ;Dark Barrack 1 - If GUICtrlRead($txtDarkBarrack1) <> "0" And $i = 0 And $TrainDrax1 = True Then - $itxtDarkBarrack1 = GUICtrlRead($txtDarkBarrack1) - If $DarkBarrackTroop[$i] = 0 Then - Local $troopMinion = Number(getOther(171 + 107 * 0, 278, "Barrack")) - If $itxtDarkBarrack1 <= 20 And ($fullArmy Or $FirstDarkTrain) Then - Donate_TrainIt($eMinion, $itxtDarkBarrack1) - $TrainDrax1 = False - SetLog("Dark Barrack 1 Train Minion Completed...", $COLOR_BLUE) - $FirstDarkTrain = False - ElseIf $itxtDarkBarrack1 > 20 And ($fullArmy Or $FirstDarkTrain) Then - Donate_TrainIt($eMinion, 20) - $LeftRax1 = ($itxtDarkBarrack1 - 20) - $ClickRax1 = $LeftRax1 - SetLog("Dark Barrack 1 Minion Remaining : " & $LeftRax1, $COLOR_BLUE) - $FirstDarkTrain = False - ElseIf $LeftRax1 > 1 And ($troopMinion < 20) And $LeftRax1 > ($troopMinion < 20) Then - Donate_TrainIt($eMinion, (20 - $troopMinion)) - $LeftRax1 = ($ClickRax1 - (20 - $troopMinion)) - $ClickRax1 = $LeftRax1 - SetLog("Dark Barrack 1 Minion Remaining : " & $LeftRax1, $COLOR_BLUE) - $FirstDarkTrain = False - ElseIf $LeftRax1 > 1 And ($troopMinion < 20) And $LeftRax1 <= ($troopMinion < 20) Then - Donate_TrainIt($eMinion, $LeftRax1) - $TrainDrax1 = False - SetLog("Dark Barrack 1 Train Minion Completed...", $COLOR_BLUE) - $FirstDarkTrain = False - ElseIf $LeftRax1 <= 1 And ($troopMinion < 20) Then - Donate_TrainIt($eMinion, $LeftRax1) - $TrainDrax1 = False - SetLog("Dark Barrack 1 Train Minion Completed...", $COLOR_BLUE) - $FirstDarkTrain = False - Else - SetLog("Dark Barrack 1 Training in progress, Minion Remaining : " & $LeftRax1, $COLOR_BLUE) - $FirstDarkTrain = False - EndIf - EndIf - - If $DarkBarrackTroop[$i] = 1 Then - Local $troopHog = Number(getOther(171 + 107 * 1, 278, "Barrack")) - If $itxtDarkBarrack1 <= 10 And ($fullArmy Or $FirstDarkTrain) Then - Donate_TrainIt($eHog, $itxtDarkBarrack1) - $TrainDrax1 = False - SetLog("Dark Barrack 1 Train Hog Completed...", $COLOR_BLUE) - $FirstDarkTrain = False - ElseIf $itxtDarkBarrack1 > 10 And ($fullArmy Or $FirstDarkTrain) Then - Donate_TrainIt($eHog, 10) - $LeftRax1 = ($itxtDarkBarrack1 - 10) - $ClickRax1 = $LeftRax1 - SetLog("Dark Barrack 1 Hog Remaining : " & $LeftRax1, $COLOR_BLUE) - $FirstDarkTrain = False - ElseIf $LeftRax1 > 1 And ($troopHog < 10) And $LeftRax1 > ($troopHog < 10) Then - Donate_TrainIt($eHog, (10 - $troopHog)) - $LeftRax1 = ($ClickRax1 - (10 - $troopHog)) - $ClickRax1 = $LeftRax1 - SetLog("Dark Barrack 1 Hog Remaining : " & $LeftRax1, $COLOR_BLUE) - $FirstDarkTrain = False - ElseIf $LeftRax1 > 1 And ($troopHog < 10) And $LeftRax1 <= ($troopHog < 10) Then - Donate_TrainIt($eHog, $LeftRax1) - $TrainDrax1 = False - SetLog("Dark Barrack 1 Train Hog Completed...", $COLOR_BLUE) - $FirstDarkTrain = False - ElseIf $LeftRax1 <= 1 And ($troopHog < 10) Then - Donate_TrainIt($eHog, $LeftRax1) - $TrainDrax1 = False - SetLog("Dark Barrack 1 Train Hog Completed...", $COLOR_BLUE) - $FirstDarkTrain = False - Else - SetLog("Dark Barrack 1 Training in progress, Hog Remaining : " & $LeftRax1, $COLOR_BLUE) - $FirstDarkTrain = False - EndIf - EndIf - - If $DarkBarrackTroop[$i] = 2 Then - Local $troopValkyrie = Number(getOther(171 + 107 * 2, 278, "Barrack")) - If $itxtDarkBarrack1 <= 7 And ($fullArmy Or $FirstDarkTrain) Then - Donate_TrainIt($eValkyrie, $itxtDarkBarrack1) - $TrainDrax1 = False - SetLog("Dark Barrack 1 Train Valkyrie Completed...", $COLOR_BLUE) - $FirstDarkTrain = False - ElseIf $itxtDarkBarrack1 > 7 And ($fullArmy Or $FirstDarkTrain) Then - Donate_TrainIt($eValkyrie, 7) - $LeftRax1 = ($itxtDarkBarrack1 - 7) - $ClickRax1 = $LeftRax1 - SetLog("Dark Barrack 1 Valkyrie Remaining : " & $LeftRax1, $COLOR_BLUE) - $FirstDarkTrain = False - ElseIf $LeftRax1 > 1 And ($troopValkyrie < 7) And $LeftRax1 > ($troopValkyrie < 7) Then - Donate_TrainIt($eValkyrie, (7 - $troopValkyrie)) - $LeftRax1 = ($ClickRax1 - (7 - $troopValkyrie)) - $ClickRax1 = $LeftRax1 - SetLog("Dark Barrack 1 Valkyrie Remaining : " & $LeftRax1, $COLOR_BLUE) - $FirstDarkTrain = False - ElseIf $LeftRax1 > 1 And ($troopValkyrie < 7) And $LeftRax1 <= ($troopValkyrie < 7) Then - Donate_TrainIt($eValkyrie, $LeftRax1) - $TrainDrax1 = False - SetLog("Dark Barrack 1 Train Valkyrie Completed...", $COLOR_BLUE) - $FirstDarkTrain = False - ElseIf $LeftRax1 <= 1 And ($troopValkyrie < 7) Then - Donate_TrainIt($eValkyrie, $LeftRax1) - $TrainDrax1 = False - SetLog("Dark Barrack 1 Train Valkyrie Completed...", $COLOR_BLUE) - $FirstDarkTrain = False - Else - SetLog("Dark Barrack 1 Training in progress, Valkyrie Remaining : " & $LeftRax1, $COLOR_BLUE) - $FirstDarkTrain = False - EndIf - EndIf - EndIf - - ;Dark Barrack 2 - If GUICtrlRead($txtDarkBarrack2) <> "0" And $i = 1 And $TrainDrax2 = True Then - $itxtDarkBarrack2 = GUICtrlRead($txtDarkBarrack2) - If $DarkBarrackTroop[$i] = 0 Then - Local $troopMinion2 = Number(getOther(171 + 107 * 0, 278, "Barrack")) - If $itxtDarkBarrack2 <= 20 And ($fullArmy Or $FirstDarkTrain) Then - Donate_TrainIt($eMinion, $itxtDarkBarrack2) - $TrainDrax2 = False - SetLog("Dark Barrack 2 Train Minion Completed...", $COLOR_BLUE) - $FirstDarkTrain = False - ElseIf $itxtDarkBarrack2 > 20 And ($fullArmy Or $FirstDarkTrain) Then - Donate_TrainIt($eMinion, 20) - $LeftRax2 = ($itxtDarkBarrack2 - 20) - $ClickRax2 = $LeftRax2 - SetLog("Dark Barrack 2 Minion Remaining : " & $LeftRax2, $COLOR_BLUE) - $FirstDarkTrain = False - ElseIf $LeftRax2 > 1 And ($troopMinion2 < 20) And $LeftRax2 > ($troopMinion2 < 20) Then - Donate_TrainIt($eMinion, (20 - $troopMinion2)) - $LeftRax2 = ($ClickRax2 - (20 - $troopMinion2)) - $ClickRax2 = $LeftRax2 - SetLog("Dark Barrack 2 Minion Remaining : " & $LeftRax2, $COLOR_BLUE) - $FirstDarkTrain = False - ElseIf $LeftRax2 > 1 And ($troopMinion2 < 20) And $LeftRax2 <= ($troopMinion2 < 20) Then - Donate_TrainIt($eMinion, $LeftRax2) - $TrainDrax2 = False - SetLog("Dark Barrack 2 Train Minion Completed...", $COLOR_BLUE) - $FirstDarkTrain = False - ElseIf $LeftRax2 <= 1 And ($troopMinion2 < 20) Then - Donate_TrainIt($eMinion, $LeftRax2) - $TrainDrax2 = False - SetLog("Dark Barrack 2 Train Minion Completed...", $COLOR_BLUE) - $FirstDarkTrain = False - Else - SetLog("Dark Barrack 2 Training in progress, Minion Remaining : " & $LeftRax2, $COLOR_BLUE) - $FirstDarkTrain = False - EndIf - EndIf - - If $DarkBarrackTroop[$i] = 1 Then - Local $troopHog2 = Number(getOther(171 + 107 * 1, 278, "Barrack")) - If $itxtDarkBarrack2 <= 10 And ($fullArmy Or $FirstDarkTrain) Then - Donate_TrainIt($eHog, $itxtDarkBarrack2) - $TrainDrax2 = False - SetLog("Dark Barrack 2 Train Hog Completed...", $COLOR_BLUE) - $FirstDarkTrain = False - ElseIf $itxtDarkBarrack2 > 10 And ($fullArmy Or $FirstDarkTrain) Then - Donate_TrainIt($eHog, 10) - $LeftRax2 = ($itxtDarkBarrack2 - 10) - $ClickRax2 = $LeftRax2 - SetLog("Dark Barrack 2 Hog Remaining : " & $LeftRax2, $COLOR_BLUE) - $FirstDarkTrain = False - ElseIf $LeftRax2 > 1 And ($troopHog2 < 10) And $LeftRax2 > ($troopHog2 < 10) Then - Donate_TrainIt($eHog, (10 - $troopHog2)) - $LeftRax2 = ($ClickRax2 - (10 - $troopHog2)) - $ClickRax2 = $LeftRax2 - SetLog("Dark Barrack 2 Hog Remaining : " & $LeftRax2, $COLOR_BLUE) - $FirstDarkTrain = False - ElseIf $LeftRax2 > 1 And ($troopHog2 < 10) And $LeftRax2 <= ($troopHog2 < 10) Then - Donate_TrainIt($eHog, $LeftRax2) - $TrainDrax2 = False - SetLog("Dark Barrack 2 Train Hog Completed...", $COLOR_BLUE) - $FirstDarkTrain = False - ElseIf $LeftRax2 <= 1 And ($troopHog2 < 10) Then - Donate_TrainIt($eHog, $LeftRax2) - $TrainDrax2 = False - SetLog("Dark Barrack 2 Train Hog Completed...", $COLOR_BLUE) - $FirstDarkTrain = False - Else - SetLog("Dark Barrack 2 Training in progress, Hog Remaining : " & $LeftRax2, $COLOR_BLUE) - $FirstDarkTrain = False - EndIf - EndIf - - If $DarkBarrackTroop[$i] = 2 Then - Local $troopValkyrie2 = Number(getOther(171 + 107 * 2, 278, "Barrack")) - If $itxtDarkBarrack2 <= 7 And ($fullArmy Or $FirstDarkTrain) Then - Donate_TrainIt($eValkyrie, $itxtDarkBarrack2) - $TrainDrax2 = False - SetLog("Dark Barrack 2 Train Valkyrie Completed...", $COLOR_BLUE) - $FirstDarkTrain = False - ElseIf $itxtDarkBarrack2 > 7 And ($fullArmy Or $FirstDarkTrain) Then - Donate_TrainIt($eValkyrie, 7) - $LeftRax2 = ($itxtDarkBarrack2 - 7) - $ClickRax2 = $LeftRax2 - SetLog("Dark Barrack 2 Valkyrie Remaining : " & $LeftRax2, $COLOR_BLUE) - $FirstDarkTrain = False - ElseIf $LeftRax2 > 1 And ($troopValkyrie2 < 7) And $LeftRax2 > ($troopValkyrie2 < 7) Then - Donate_TrainIt($eValkyrie, (7 - $troopValkyrie2)) - $LeftRax2 = ($ClickRax2 - (7 - $troopValkyrie2)) - $ClickRax2 = $LeftRax2 - SetLog("Dark Barrack 2 Valkyrie Remaining : " & $LeftRax2, $COLOR_BLUE) - $FirstDarkTrain = False - ElseIf $LeftRax2 > 1 And ($troopValkyrie2 < 7) And $LeftRax2 <= ($troopValkyrie2 < 7) Then - Donate_TrainIt($eValkyrie, $LeftRax2) - $TrainDrax2 = False - SetLog("Dark Barrack 2 Train Valkyrie Completed...", $COLOR_BLUE) - $FirstDarkTrain = False - ElseIf $LeftRax2 <= 1 And ($troopValkyrie2 < 7) Then - Donate_TrainIt($eValkyrie, $LeftRax2) - $TrainDrax2 = False - SetLog("Dark Barrack 2 Train Valkyrie Completed...", $COLOR_BLUE) - $FirstDarkTrain = False - Else - SetLog("Dark Barrack 2 Training in progress, Valkyrie Remaining : " & $LeftRax2, $COLOR_BLUE) - $FirstDarkTrain = False - EndIf - EndIf - EndIf - - If _Sleep(100) Then ExitLoop - Click($TopLeftClient[0], $TopLeftClient[1], 2, 250); Click away twice with 250ms delay - Next - SetLog(GetLangText("msgDarkTroopComplete"), $COLOR_BLUE) - $FirstDarkTrain = False -;~ END DARK TROOPS -EndFunc ;==>Donate_Train +;Uses the location of manually set Barracks to train specified troops + +; Train the troops (Fill the barracks) + +Func Donate_GetTrainPos($troopKind) + Switch $troopKind + Case $eBarbarian ; 261, 366: 0x39D8E0 + Return $TrainBarbarian + Case $eArcher ; 369, 366: 0x39D8E0 + Return $TrainArcher + Case $eGiant ; 475, 366: 0x3DD8E0 + Return $TrainGiant + Case $eGoblin ; 581, 366: 0x39D8E0 + Return $TrainGoblin + Case $eWallbreaker ; 688, 366, 0x3AD8E0 + Return $TrainWallbreaker + Case $eMinion + Return $TrainMinion + Case $eHog + Return $TrainHog + Case $eValkyrie + Return $TrainValkyrie + Case Else + SetLog(GetLangText("msgDontKnow") & $troopKind & GetLangText("msgYet")) + Return 0 + EndSwitch +EndFunc ;==>Donate_GetTrainPos + +Func Donate_TrainIt($troopKind, $howMuch = 1, $iSleep = 100) + _CaptureRegion() + Local $pos = Donate_GetTrainPos($troopKind) + If IsArray($pos) Then + If CheckPixel($pos) Then + ClickP($pos, $howMuch, 20) + If _Sleep($iSleep) Then Return False + Return True + EndIf + EndIf +EndFunc ;==>Donate_TrainIt + +Func Donate_Train($reset = False) + resetBarracksError() + If $barrackPos[0][0] = "" Then + If Not LocateBarrack() Then Return + SaveConfig() + If _Sleep(2000) Then Return + EndIf + + SetLog(GetLangText("msgTrainingTroops"), $COLOR_BLUE) + + If $reset Then ; reset all for cook again on startup + $ArmyComp = 0 + $CurGiant = 0 + $CurWB = 0 + $CurArch = 0 + $CurBarb = 0 + $CurGoblin = 0 + EndIf + + If (($ArmyComp = 0) And (_GUICtrlComboBox_GetCurSel($cmbTroopComp) <> 8)) Or $FixTrain Then + If $FixTrain Or $FirstStart And Not $reset Then $ArmyComp = $CurCamp + $FixTrain = False + $CurGiant += GUICtrlRead($txtNumGiants) + $CurWB += GUICtrlRead($txtNumWallbreakers) + $CurArch += Floor((($itxtcampCap * GUICtrlRead($cmbRaidcap) / 100) - (GUICtrlRead($txtNumGiants) * 5) - (GUICtrlRead($txtNumWallbreakers) * 2)) * (GUICtrlRead($txtArchers) / 100)) + $CurBarb += Floor((($itxtcampCap * GUICtrlRead($cmbRaidcap) / 100) - (GUICtrlRead($txtNumGiants) * 5) - (GUICtrlRead($txtNumWallbreakers) * 2)) * (GUICtrlRead($txtBarbarians) / 100)) + $CurGoblin += Floor((($itxtcampCap * GUICtrlRead($cmbRaidcap) / 100) - (GUICtrlRead($txtNumGiants) * 5) - (GUICtrlRead($txtNumWallbreakers) * 2)) * (GUICtrlRead($txtGoblins) / 100)) + SetLog("D-CurArch" & $CurArch) + SetLog("D-CurBarb" & $CurBarb) + SetLog("D-CurGoblin" & $CurGoblin) + If $CurArch < 0 Then $CurArch = 0 + If $CurBarb < 0 Then $CurBarb = 0 + If $CurGoblin < 0 Then $CurGoblin = 0 + If $CurWB < 0 Then $CurWB = 0 + If $CurGiant < 0 Then $CurGiant = 0 + If ($CurArch + $CurBarb + $CurGoblin + (5 * $CurGiant) + (2 * $CurWB)) < $itxtcampCap Then + If $CurArch > 0 Then + $CurArch += 1 + EndIf + If ($CurArch + $CurBarb + $CurGoblin + (5 * $CurGiant) + (2 * $CurWB)) < $itxtcampCap Then + If $CurBarb > 0 Then + $CurBarb += 1 + EndIf + If ($CurArch + $CurBarb + $CurGoblin + (5 * $CurGiant) + (2 * $CurWB)) < $itxtcampCap Then + If $CurGoblin > 0 Then + $CurGoblin += 1 + EndIf + EndIf + EndIf + EndIf + SetLog(GetLangText("msgForcesNeededB") & $CurBarb & GetLangText("msgForcesNeededA") & $CurArch & GetLangText("msgForcesNeededGo") & $CurGoblin & GetLangText("msgForcesNeededGi") & $CurGiant & GetLangText("msgForcesNeededWB") & $CurWB, $COLOR_GREEN) + EndIf + + Local $GiantEBarrack, $WallEBarrack, $ArchEBarrack, $BarbEBarrack, $GoblinEBarrack + $GiantEBarrack = Floor($CurGiant / 4) + $WallEBarrack = Floor($CurWB / 4) + $ArchEBarrack = Floor($CurArch / 4) + $BarbEBarrack = Floor($CurBarb / 4) + $GoblinEBarrack = Floor($CurGoblin / 4) + + Local $troopFirstGiant, $troopSecondGiant, $troopFirstWall, $troopSecondWall, $troopFirstGoblin, $troopSecondGoblin, $troopFirstBarba, $troopSecondBarba, $troopFirstArch, $troopSecondArch + $troopFirstGiant = 0 + $troopSecondGiant = 0 + $troopFirstWall = 0 + $troopSecondWall = 0 + $troopFirstGoblin = 0 + $troopSecondGoblin = 0 + $troopFirstBarba = 0 + $troopSecondBarba = 0 + $troopFirstArch = 0 + $troopSecondArch = 0 + + Local $BarrackControl + Local $expUIRet[2] + + For $i = 0 To 3 + If _Sleep(500) Then ExitLoop + + ClickP($TopLeftClient) ;Click Away + + If _Sleep(500) Then ExitLoop + + Click($barrackPos[$i][0], $barrackPos[$i][1]) ;Click Barrack + If _Sleep(500) Then ExitLoop + + $expUIRet[0] = -1 + $resUI = CallHelper("0 0 860 720 BrokenBotMatchButton 108 1 3") + If $resUI <> $DLLFailed And $resUI <> $DLLTimeout Then + If $resUI = $DLLNegative Then + ; Didn't find button + ElseIf $resUI = $DLLLicense Then + SetLog(GetLangText("msgLicense"), $COLOR_RED) + Else + $expUIRet = StringSplit($resUI, "|", 2) + EndIf + Else + SetLog(GetLangText("msgDLLError"), $COLOR_RED) + EndIf + If $expUIRet[0] = -1 Then + SetLog(GetLangText("msgBarrack") & $i + 1 & GetLangText("msgNotAvailable"), $COLOR_RED) + handleBarracksError($i) + If _Sleep(500) Then ExitLoop + Else + Click($expUIRet[1], $expUIRet[2]) ;Click Train Troops button + _WaitForPixel(720, 150, 740, 170, Hex(0xD80404, 6), 5, 1) ;Finds Red Cross button in new Training popup window + + If _GUICtrlComboBox_GetCurSel($cmbTroopComp) = 8 Then + Switch $i + Case 0 + $BarrackControl = $cmbBarrack1 + Case 1 + $BarrackControl = $cmbBarrack2 + Case 2 + $BarrackControl = $cmbBarrack3 + Case 3 + $BarrackControl = $cmbBarrack4 + EndSwitch + _CaptureRegion() + Switch _GUICtrlComboBox_GetCurSel($BarrackControl) + Case 0 + While _ColorCheck(_GetPixelColor(216, 325), Hex(0xF09D1C, 6), 30) + Click(216, 325, 75) ;Barbarian + If _Sleep(150) Then ExitLoop + _CaptureRegion() + WEnd + Case 1 + While _ColorCheck(_GetPixelColor(330, 323), Hex(0xE84070, 6), 30) + Click(325, 320, 75) ;Archer + If _Sleep(150) Then ExitLoop + _CaptureRegion() + WEnd + Case 2 + While _ColorCheck(_GetPixelColor(419, 319), Hex(0xF88409, 6), 30) + Click(419, 319, 20) ;Giant + If _Sleep(150) Then ExitLoop + _CaptureRegion() + WEnd + Case 3 + While _ColorCheck(_GetPixelColor(549, 328), Hex(0xFB4C24, 6), 30) + Click(535, 320, 75) ;Goblin + If _Sleep(150) Then ExitLoop + _CaptureRegion() + WEnd + Case 4 + While _ColorCheck(_GetPixelColor(685, 327), Hex(0x9E4716, 6), 30) + Click(685, 327, 20) ;Wall Breaker + If _Sleep(150) Then ExitLoop + _CaptureRegion() + WEnd + Case 5 + While _ColorCheck(_GetPixelColor(213, 418), Hex(0x861F15, 6), 30) + Click(213, 418, 20) ;Balloon + If _Sleep(150) Then ExitLoop + _CaptureRegion() + WEnd + Case 6 + While _ColorCheck(_GetPixelColor(340, 449), Hex(0xF09C85, 6), 30) + Click(325, 425, 20) ;Wizard + If _Sleep(150) Then ExitLoop + _CaptureRegion() + WEnd + Case 7 + While _ColorCheck(_GetPixelColor(440, 445), Hex(0xFDD8C0, 6), 30) + Click(440, 445, 10) ;Healer + If _Sleep(150) Then ExitLoop + _CaptureRegion() + WEnd + Case 8 + While _ColorCheck(_GetPixelColor(539, 444), Hex(0x302848, 6), 30) + Click(539, 444, 10) ;Dragon + If _Sleep(150) Then ExitLoop + _CaptureRegion() + WEnd + Case 9 + While _ColorCheck(_GetPixelColor(647, 440), Hex(0x456180, 6), 30) + Click(647, 440, 10) ;PEKKA + If _Sleep(150) Then ExitLoop + _CaptureRegion() + WEnd + Case Else + If _Sleep(50) Then ExitLoop + _CaptureRegion() + EndSwitch + Else + SetLog("====== " & GetLangText("msgBarrack") & $i + 1 & " : ======", $COLOR_BLUE) + _CaptureRegion() + ;while _ColorCheck(_GetPixelColor(496, 200), Hex(0x880000, 6), 20) Then + If $reset Or $FirstStart Then + Click(503, 180, 80, 5) + EndIf + ;wend + + If _Sleep(500) Then ExitLoop + _CaptureRegion() + If GUICtrlRead($txtNumGiants) <> "0" Then + $troopFirstGiant = StringStripWS(ReadText(181 + (2 * 107), 298, 35, $textWindows),3) + If StringRight($troopFirstGiant, 1) = "x" Then $troopFirstGiant = StringLeft($troopFirstGiant, StringLen($troopFirstGiant) - 1) + EndIf + + If GUICtrlRead($txtNumWallbreakers) <> "0" Then + $troopFirstWall = StringStripWS(ReadText(181 + (4 * 107), 298, 35, $textWindows),3) + If StringRight($troopFirstWall, 1) = "x" Then $troopFirstWall = StringLeft($troopFirstWall, StringLen($troopFirstWall) - 1) + EndIf + + If GUICtrlRead($txtGoblins) <> "0" Then + $troopFirstGoblin = StringStripWS(ReadText(181 + (3* 107), 298, 35, $textWindows),3) + If StringRight($troopFirstGoblin, 1) = "x" Then $troopFirstGoblin = StringLeft($troopFirstGoblin, StringLen($troopFirstGoblin) - 1) + EndIf + + If GUICtrlRead($txtBarbarians) <> "0" Then + $troopFirstBarba = StringStripWS(ReadText(181, 298, 35, $textWindows),3) + If StringRight($troopFirstBarba, 1) = "x" Then $troopFirstBarba = StringLeft($troopFirstBarba, StringLen($troopFirstBarba) - 1) + EndIf + + If GUICtrlRead($txtArchers) <> "0" Then + $troopFirstArch = StringStripWS(ReadText(181 + 107, 298, 35, $textWindows),3) + If StringRight($troopFirstArch, 1) = "x" Then $troopFirstArch = StringLeft($troopFirstArch, StringLen($troopFirstArch) - 1) + EndIf + + If GUICtrlRead($txtNumGiants) <> "0" And $CurGiant > 0 Then + ;If _ColorCheck(_GetPixelColor(475, 366), Hex(0x3DD8E0, 6), 20) And $CurGiant > 0 Then + If $CurGiant > 0 Then + If $GiantEBarrack = 0 Then + Donate_TrainIt($eGiant, 1) + ElseIf $GiantEBarrack >= $CurGiant Or $GiantEBarrack = 0 Then + Donate_TrainIt($eGiant, $CurGiant) + Else + Donate_TrainIt($eGiant, $GiantEBarrack) + EndIf + EndIf + EndIf + + + If GUICtrlRead($txtNumWallbreakers) <> "0" And $CurWB > 0 Then + ;If _ColorCheck(_GetPixelColor(688, 366), Hex(0x3AD8E0, 6), 20) And $CurWB > 0 Then + If $CurWB > 0 Then + If $WallEBarrack = 0 Then + Donate_TrainIt($eWallbreaker, 1) + ElseIf $WallEBarrack >= $CurWB Or $WallEBarrack = 0 Then + Donate_TrainIt($eWallbreaker, $CurWB) + Else + Donate_TrainIt($eWallbreaker, $WallEBarrack) + EndIf + EndIf + EndIf + + + If GUICtrlRead($txtBarbarians) <> "0" And $CurBarb > 0 Then + ;If _ColorCheck(_GetPixelColor(369, 366), Hex(0x39D8E0, 6), 20) And $CurBarb > 0 Then + If $CurBarb > 0 Then + If $BarbEBarrack = 0 Then + Donate_TrainIt($eBarbarian, 1) + ElseIf $BarbEBarrack >= $CurBarb Or $BarbEBarrack = 0 Then + Donate_TrainIt($eBarbarian, $CurBarb) + Else + Donate_TrainIt($eBarbarian, $BarbEBarrack) + EndIf + EndIf + EndIf + + + If GUICtrlRead($txtGoblins) <> "0" And $CurGoblin > 0 Then + ;If _ColorCheck(_GetPixelColor(261, 366), Hex(0x39D8E0, 6), 20) And $CurGoblin > 0 Then + If $CurGoblin > 0 Then + If $GoblinEBarrack = 0 Then + Donate_TrainIt($eGoblin, 1) + ElseIf $GoblinEBarrack >= $CurGoblin Or $GoblinEBarrack = 0 Then + Donate_TrainIt($eGoblin, $CurGoblin) + Else + Donate_TrainIt($eGoblin, $GoblinEBarrack) + EndIf + EndIf + EndIf + + If _Sleep(900) Then ExitLoop + _CaptureRegion() + + If GUICtrlRead($txtNumGiants) <> "0" Then + $troopSecondGiant = StringStripWS(ReadText(181 + (2 * 107), 298, 35, $textWindows), 3) + If StringRight($troopSecondGiant, 1) = "x" Then $troopSecondGiant = StringLeft($troopSecondGiant, StringLen($troopSecondGiant) - 1) + EndIf + + If GUICtrlRead($txtNumWallbreakers) <> "0" Then + $troopSecondWall = StringStripWS(ReadText(181 + (4 * 107), 298, 35, $textWindows), 3) + If StringRight($troopSecondWall, 1) = "x" Then $troopSecondWall = StringLeft($troopSecondWall, StringLen($troopSecondWall) - 1) + EndIf + + If GUICtrlRead($txtGoblins) <> "0" Then + $troopSecondGoblin = StringStripWS(ReadText(181 + (3* 107), 298, 35, $textWindows), 3) + If StringRight($troopSecondGoblin, 1) = "x" Then $troopSecondGoblin = StringLeft($troopSecondGoblin, StringLen($troopSecondGoblin) - 1) + EndIf + + If GUICtrlRead($txtBarbarians) <> "0" Then + $troopSecondBarba = StringStripWS(ReadText(181, 298, 35, $textWindows), 3) + If StringRight($troopSecondBarba, 1) = "x" Then $troopSecondBarba = StringLeft($troopSecondBarba, StringLen($troopSecondBarba) - 1) + EndIf + + If GUICtrlRead($txtArchers) <> "0" Then + $troopSecondArch = StringStripWS(ReadText(181 + 107, 298, 35, $textWindows), 3) + If StringRight($troopSecondArch, 1) = "x" Then $troopSecondArch = StringLeft($troopSecondArch, StringLen($troopSecondArch) - 1) + EndIf + + + If $troopSecondGiant > $troopFirstGiant And GUICtrlRead($txtNumGiants) <> "0" Then + $ArmyComp += ($troopSecondGiant - $troopFirstGiant) * 5 + $CurGiant -= ($troopSecondGiant - $troopFirstGiant) + SetLog(GetLangText("msgBarrack") & ($i + 1) & GetLangText("msgTraining") & GetLangText("troopNameGiant") & " : " & ($troopSecondGiant - $troopFirstGiant), $COLOR_GREEN) + SetLog(GetLangText("troopNameGiant") & GetLangText("msgRemaining") & $CurGiant, $COLOR_BLUE) + EndIf + + + If $troopSecondWall > $troopFirstWall And GUICtrlRead($txtNumWallbreakers) <> "0" Then + $ArmyComp += ($troopSecondWall - $troopFirstWall) * 2 + $CurWB -= ($troopSecondWall - $troopFirstWall) + SetLog(GetLangText("msgBarrack") & ($i + 1) & GetLangText("msgTraining") & GetLangText("troopNameWallBreaker") & " : " & ($troopSecondGiant - $troopFirstGiant), $COLOR_GREEN) + SetLog(GetLangText("troopNameWallBreaker") & GetLangText("msgRemaining") & $CurGiant, $COLOR_BLUE) + EndIf + + If $troopSecondGoblin > $troopFirstGoblin And GUICtrlRead($txtGoblins) <> "0" Then + $ArmyComp += ($troopSecondGoblin - $troopFirstGoblin) + $CurGoblin -= ($troopSecondGoblin - $troopFirstGoblin) + SetLog(GetLangText("msgBarrack") & ($i + 1) & GetLangText("msgTraining") & GetLangText("troopNameGoblin") & " : " & ($troopSecondGiant - $troopFirstGiant), $COLOR_GREEN) + SetLog(GetLangText("troopNameGoblin") & GetLangText("msgRemaining") & $CurGiant, $COLOR_BLUE) + EndIf + + If $troopSecondBarba > $troopFirstBarba And GUICtrlRead($txtBarbarians) <> "0" Then + $ArmyComp += ($troopSecondBarba - $troopFirstBarba) + $CurBarb -= ($troopSecondBarba - $troopFirstBarba) + SetLog(GetLangText("msgBarrack") & ($i + 1) & GetLangText("msgTraining") & GetLangText("troopNameBarbarian") & " : " & ($troopSecondGiant - $troopFirstGiant), $COLOR_GREEN) + SetLog(GetLangText("troopNameBarbarian") & GetLangText("msgRemaining") & $CurGiant, $COLOR_BLUE) + EndIf + + If $troopSecondArch > $troopFirstArch And GUICtrlRead($txtArchers) <> "0" Then + $ArmyComp += ($troopSecondArch - $troopFirstArch) + $CurArch -= ($troopSecondArch - $troopFirstArch) + SetLog(GetLangText("msgBarrack") & ($i + 1) & GetLangText("msgTraining") & GetLangText("troopNameArcher") & " : " & ($troopSecondGiant - $troopFirstGiant), $COLOR_GREEN) + SetLog(GetLangText("troopNameArcher") & GetLangText("msgRemaining") & $CurGiant, $COLOR_BLUE) + EndIf + SetLog(GetLangText("msgTotalBuilding") & $ArmyComp, $COLOR_RED) + EndIf + EndIf + If _Sleep(100) Then ExitLoop + Click($TopLeftClient[0], $TopLeftClient[1], 2, 250); Click away twice with 250ms delay + Next + If $brerror[0] And $brerror[1] And $brerror[2] And $brerror[3] Then + resetBarracksError() + $needzoomout = True + SetLog(GetLangText("msgRestartComplete"), $COLOR_RED) + Else + SetLog(GetLangText("msgTrainingComp"), $COLOR_BLUE) + EndIf + $FirstStart = False + +;~ BEGIN DARK TROOPS +;~ If $ichkDarkTroop = 0 Then Return +;~ Local $TrainPos[2] +;~ If $DarkBarrackPos[0][0] = "" Then +;~ LocateDarkBarrack() +;~ SaveConfig() +;~ If _Sleep(2000) Then Return +;~ EndIf + +;~ Global $LeftRax1, $LeftRax2, $TrainDrax1, $TrainDrax2, $ClickRax1, $ClickRax2 + +;~ If $fullArmy Or $FirstDarkTrain Then +;~ $TrainDrax1 = True +;~ $TrainDrax2 = True +;~ EndIf + +;~ If $TrainDrax1 = False And $TrainDrax2 = False Then Return + +;~ SetLog(GetLangText("msgTrainingDark"), $COLOR_BLUE) +;~ For $i = 0 To 1 +;~ If _Sleep(500) Then ExitLoop + +;~ ClickP($TopLeftClient) ;Click Away + +;~ If _Sleep(500) Then ExitLoop +;~ Click($DarkBarrackPos[$i][0], $DarkBarrackPos[$i][1]) ;Click Dark Barrack +;~ If _Sleep(500) Then ExitLoop + +;~ Local $TrainPos = _PixelSearch(155, 603, 694, 605, Hex(0x603818, 6), 5) ;Finds Train Troops button +;~ _CaptureRegion() +;~ If _Sleep(500) Then ExitLoop +;~ $sendHBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap) +;~ $res = DllCall(@ScriptDir & "\BrokenBot.org\BrokenBot32.dll", "str", "BrokenBotMatchButton", "ptr", $sendHBitmap, "int", 108, "int", 3, "int", 1, "int", 3, "int", (IsChecked($chkSpeedBoost) ? (1) : (0))) ; remove icon +;~ _WinAPI_DeleteObject($sendHBitmap) +;~ If IsArray($res) Then +;~ If $res[0] = -1 Then +;~ SetLog(GetLangText("msgDarkBarrack") & $i + 1 & GetLangText("msgNotAvailable"), $COLOR_RED) +;~ Return +;~ ElseIf $res[0] = -2 Then +;~ SetLog(GetLangText("msgLicense"), $COLOR_RED) +;~ Else +;~ $expUIRet = StringSplit($res[0], "|", 2) +;~ $TrainPos[0] = $expUIRet[1] +;~ $TrainPos[1] = $expUIRet[2] +;~ If $DebugMode = 1 Then SetLog("DB Train:" & $TrainPos[0] & " Y:" & $TrainPos[1]) +;~ EndIf +;~ EndIf +;~ Click($TrainPos[0], $TrainPos[1]) ;Click Train Troops button +;~ If _Sleep(800) Then ExitLoop +;~ If $fullArmy Or $FirstDarkTrain Then +;~ If Not _ColorCheck(_GetPixelColor(497, 195), Hex(0xE0E4D0, 6), 20) Then +;~ Click(496, 190, 80, 2) +;~ EndIf +;~ EndIf + +;~ ;Dark Barrack 1 +;~ If GUICtrlRead($txtDarkBarrack1) <> "0" And $i = 0 And $TrainDrax1 = True Then +;~ $itxtDarkBarrack1 = GUICtrlRead($txtDarkBarrack1) +;~ If $DarkBarrackTroop[$i] = 0 Then +;~ Local $troopMinion = Number(getOther(171 + 107 * 0, 278, "Barrack")) +;~ If $itxtDarkBarrack1 <= 20 And ($fullArmy Or $FirstDarkTrain) Then +;~ Donate_TrainIt($eMinion, $itxtDarkBarrack1) +;~ $TrainDrax1 = False +;~ SetLog("Dark Barrack 1 Train Minion Completed...", $COLOR_BLUE) +;~ $FirstDarkTrain = False +;~ ElseIf $itxtDarkBarrack1 > 20 And ($fullArmy Or $FirstDarkTrain) Then +;~ Donate_TrainIt($eMinion, 20) +;~ $LeftRax1 = ($itxtDarkBarrack1 - 20) +;~ $ClickRax1 = $LeftRax1 +;~ SetLog("Dark Barrack 1 Minion Remaining : " & $LeftRax1, $COLOR_BLUE) +;~ $FirstDarkTrain = False +;~ ElseIf $LeftRax1 > 1 And ($troopMinion < 20) And $LeftRax1 > ($troopMinion < 20) Then +;~ Donate_TrainIt($eMinion, (20 - $troopMinion)) +;~ $LeftRax1 = ($ClickRax1 - (20 - $troopMinion)) +;~ $ClickRax1 = $LeftRax1 +;~ SetLog("Dark Barrack 1 Minion Remaining : " & $LeftRax1, $COLOR_BLUE) +;~ $FirstDarkTrain = False +;~ ElseIf $LeftRax1 > 1 And ($troopMinion < 20) And $LeftRax1 <= ($troopMinion < 20) Then +;~ Donate_TrainIt($eMinion, $LeftRax1) +;~ $TrainDrax1 = False +;~ SetLog("Dark Barrack 1 Train Minion Completed...", $COLOR_BLUE) +;~ $FirstDarkTrain = False +;~ ElseIf $LeftRax1 <= 1 And ($troopMinion < 20) Then +;~ Donate_TrainIt($eMinion, $LeftRax1) +;~ $TrainDrax1 = False +;~ SetLog("Dark Barrack 1 Train Minion Completed...", $COLOR_BLUE) +;~ $FirstDarkTrain = False +;~ Else +;~ SetLog("Dark Barrack 1 Training in progress, Minion Remaining : " & $LeftRax1, $COLOR_BLUE) +;~ $FirstDarkTrain = False +;~ EndIf +;~ EndIf + +;~ If $DarkBarrackTroop[$i] = 1 Then +;~ Local $troopHog = Number(getOther(171 + 107 * 1, 278, "Barrack")) +;~ If $itxtDarkBarrack1 <= 10 And ($fullArmy Or $FirstDarkTrain) Then +;~ Donate_TrainIt($eHog, $itxtDarkBarrack1) +;~ $TrainDrax1 = False +;~ SetLog("Dark Barrack 1 Train Hog Completed...", $COLOR_BLUE) +;~ $FirstDarkTrain = False +;~ ElseIf $itxtDarkBarrack1 > 10 And ($fullArmy Or $FirstDarkTrain) Then +;~ Donate_TrainIt($eHog, 10) +;~ $LeftRax1 = ($itxtDarkBarrack1 - 10) +;~ $ClickRax1 = $LeftRax1 +;~ SetLog("Dark Barrack 1 Hog Remaining : " & $LeftRax1, $COLOR_BLUE) +;~ $FirstDarkTrain = False +;~ ElseIf $LeftRax1 > 1 And ($troopHog < 10) And $LeftRax1 > ($troopHog < 10) Then +;~ Donate_TrainIt($eHog, (10 - $troopHog)) +;~ $LeftRax1 = ($ClickRax1 - (10 - $troopHog)) +;~ $ClickRax1 = $LeftRax1 +;~ SetLog("Dark Barrack 1 Hog Remaining : " & $LeftRax1, $COLOR_BLUE) +;~ $FirstDarkTrain = False +;~ ElseIf $LeftRax1 > 1 And ($troopHog < 10) And $LeftRax1 <= ($troopHog < 10) Then +;~ Donate_TrainIt($eHog, $LeftRax1) +;~ $TrainDrax1 = False +;~ SetLog("Dark Barrack 1 Train Hog Completed...", $COLOR_BLUE) +;~ $FirstDarkTrain = False +;~ ElseIf $LeftRax1 <= 1 And ($troopHog < 10) Then +;~ Donate_TrainIt($eHog, $LeftRax1) +;~ $TrainDrax1 = False +;~ SetLog("Dark Barrack 1 Train Hog Completed...", $COLOR_BLUE) +;~ $FirstDarkTrain = False +;~ Else +;~ SetLog("Dark Barrack 1 Training in progress, Hog Remaining : " & $LeftRax1, $COLOR_BLUE) +;~ $FirstDarkTrain = False +;~ EndIf +;~ EndIf + +;~ If $DarkBarrackTroop[$i] = 2 Then +;~ Local $troopValkyrie = Number(getOther(171 + 107 * 2, 278, "Barrack")) +;~ If $itxtDarkBarrack1 <= 7 And ($fullArmy Or $FirstDarkTrain) Then +;~ Donate_TrainIt($eValkyrie, $itxtDarkBarrack1) +;~ $TrainDrax1 = False +;~ SetLog("Dark Barrack 1 Train Valkyrie Completed...", $COLOR_BLUE) +;~ $FirstDarkTrain = False +;~ ElseIf $itxtDarkBarrack1 > 7 And ($fullArmy Or $FirstDarkTrain) Then +;~ Donate_TrainIt($eValkyrie, 7) +;~ $LeftRax1 = ($itxtDarkBarrack1 - 7) +;~ $ClickRax1 = $LeftRax1 +;~ SetLog("Dark Barrack 1 Valkyrie Remaining : " & $LeftRax1, $COLOR_BLUE) +;~ $FirstDarkTrain = False +;~ ElseIf $LeftRax1 > 1 And ($troopValkyrie < 7) And $LeftRax1 > ($troopValkyrie < 7) Then +;~ Donate_TrainIt($eValkyrie, (7 - $troopValkyrie)) +;~ $LeftRax1 = ($ClickRax1 - (7 - $troopValkyrie)) +;~ $ClickRax1 = $LeftRax1 +;~ SetLog("Dark Barrack 1 Valkyrie Remaining : " & $LeftRax1, $COLOR_BLUE) +;~ $FirstDarkTrain = False +;~ ElseIf $LeftRax1 > 1 And ($troopValkyrie < 7) And $LeftRax1 <= ($troopValkyrie < 7) Then +;~ Donate_TrainIt($eValkyrie, $LeftRax1) +;~ $TrainDrax1 = False +;~ SetLog("Dark Barrack 1 Train Valkyrie Completed...", $COLOR_BLUE) +;~ $FirstDarkTrain = False +;~ ElseIf $LeftRax1 <= 1 And ($troopValkyrie < 7) Then +;~ Donate_TrainIt($eValkyrie, $LeftRax1) +;~ $TrainDrax1 = False +;~ SetLog("Dark Barrack 1 Train Valkyrie Completed...", $COLOR_BLUE) +;~ $FirstDarkTrain = False +;~ Else +;~ SetLog("Dark Barrack 1 Training in progress, Valkyrie Remaining : " & $LeftRax1, $COLOR_BLUE) +;~ $FirstDarkTrain = False +;~ EndIf +;~ EndIf +;~ EndIf + +;~ ;Dark Barrack 2 +;~ If GUICtrlRead($txtDarkBarrack2) <> "0" And $i = 1 And $TrainDrax2 = True Then +;~ $itxtDarkBarrack2 = GUICtrlRead($txtDarkBarrack2) +;~ If $DarkBarrackTroop[$i] = 0 Then +;~ Local $troopMinion2 = Number(getOther(171 + 107 * 0, 278, "Barrack")) +;~ If $itxtDarkBarrack2 <= 20 And ($fullArmy Or $FirstDarkTrain) Then +;~ Donate_TrainIt($eMinion, $itxtDarkBarrack2) +;~ $TrainDrax2 = False +;~ SetLog("Dark Barrack 2 Train Minion Completed...", $COLOR_BLUE) +;~ $FirstDarkTrain = False +;~ ElseIf $itxtDarkBarrack2 > 20 And ($fullArmy Or $FirstDarkTrain) Then +;~ Donate_TrainIt($eMinion, 20) +;~ $LeftRax2 = ($itxtDarkBarrack2 - 20) +;~ $ClickRax2 = $LeftRax2 +;~ SetLog("Dark Barrack 2 Minion Remaining : " & $LeftRax2, $COLOR_BLUE) +;~ $FirstDarkTrain = False +;~ ElseIf $LeftRax2 > 1 And ($troopMinion2 < 20) And $LeftRax2 > ($troopMinion2 < 20) Then +;~ Donate_TrainIt($eMinion, (20 - $troopMinion2)) +;~ $LeftRax2 = ($ClickRax2 - (20 - $troopMinion2)) +;~ $ClickRax2 = $LeftRax2 +;~ SetLog("Dark Barrack 2 Minion Remaining : " & $LeftRax2, $COLOR_BLUE) +;~ $FirstDarkTrain = False +;~ ElseIf $LeftRax2 > 1 And ($troopMinion2 < 20) And $LeftRax2 <= ($troopMinion2 < 20) Then +;~ Donate_TrainIt($eMinion, $LeftRax2) +;~ $TrainDrax2 = False +;~ SetLog("Dark Barrack 2 Train Minion Completed...", $COLOR_BLUE) +;~ $FirstDarkTrain = False +;~ ElseIf $LeftRax2 <= 1 And ($troopMinion2 < 20) Then +;~ Donate_TrainIt($eMinion, $LeftRax2) +;~ $TrainDrax2 = False +;~ SetLog("Dark Barrack 2 Train Minion Completed...", $COLOR_BLUE) +;~ $FirstDarkTrain = False +;~ Else +;~ SetLog("Dark Barrack 2 Training in progress, Minion Remaining : " & $LeftRax2, $COLOR_BLUE) +;~ $FirstDarkTrain = False +;~ EndIf +;~ EndIf + +;~ If $DarkBarrackTroop[$i] = 1 Then +;~ Local $troopHog2 = Number(getOther(171 + 107 * 1, 278, "Barrack")) +;~ If $itxtDarkBarrack2 <= 10 And ($fullArmy Or $FirstDarkTrain) Then +;~ Donate_TrainIt($eHog, $itxtDarkBarrack2) +;~ $TrainDrax2 = False +;~ SetLog("Dark Barrack 2 Train Hog Completed...", $COLOR_BLUE) +;~ $FirstDarkTrain = False +;~ ElseIf $itxtDarkBarrack2 > 10 And ($fullArmy Or $FirstDarkTrain) Then +;~ Donate_TrainIt($eHog, 10) +;~ $LeftRax2 = ($itxtDarkBarrack2 - 10) +;~ $ClickRax2 = $LeftRax2 +;~ SetLog("Dark Barrack 2 Hog Remaining : " & $LeftRax2, $COLOR_BLUE) +;~ $FirstDarkTrain = False +;~ ElseIf $LeftRax2 > 1 And ($troopHog2 < 10) And $LeftRax2 > ($troopHog2 < 10) Then +;~ Donate_TrainIt($eHog, (10 - $troopHog2)) +;~ $LeftRax2 = ($ClickRax2 - (10 - $troopHog2)) +;~ $ClickRax2 = $LeftRax2 +;~ SetLog("Dark Barrack 2 Hog Remaining : " & $LeftRax2, $COLOR_BLUE) +;~ $FirstDarkTrain = False +;~ ElseIf $LeftRax2 > 1 And ($troopHog2 < 10) And $LeftRax2 <= ($troopHog2 < 10) Then +;~ Donate_TrainIt($eHog, $LeftRax2) +;~ $TrainDrax2 = False +;~ SetLog("Dark Barrack 2 Train Hog Completed...", $COLOR_BLUE) +;~ $FirstDarkTrain = False +;~ ElseIf $LeftRax2 <= 1 And ($troopHog2 < 10) Then +;~ Donate_TrainIt($eHog, $LeftRax2) +;~ $TrainDrax2 = False +;~ SetLog("Dark Barrack 2 Train Hog Completed...", $COLOR_BLUE) +;~ $FirstDarkTrain = False +;~ Else +;~ SetLog("Dark Barrack 2 Training in progress, Hog Remaining : " & $LeftRax2, $COLOR_BLUE) +;~ $FirstDarkTrain = False +;~ EndIf +;~ EndIf + +;~ If $DarkBarrackTroop[$i] = 2 Then +;~ Local $troopValkyrie2 = Number(getOther(171 + 107 * 2, 278, "Barrack")) +;~ If $itxtDarkBarrack2 <= 7 And ($fullArmy Or $FirstDarkTrain) Then +;~ Donate_TrainIt($eValkyrie, $itxtDarkBarrack2) +;~ $TrainDrax2 = False +;~ SetLog("Dark Barrack 2 Train Valkyrie Completed...", $COLOR_BLUE) +;~ $FirstDarkTrain = False +;~ ElseIf $itxtDarkBarrack2 > 7 And ($fullArmy Or $FirstDarkTrain) Then +;~ Donate_TrainIt($eValkyrie, 7) +;~ $LeftRax2 = ($itxtDarkBarrack2 - 7) +;~ $ClickRax2 = $LeftRax2 +;~ SetLog("Dark Barrack 2 Valkyrie Remaining : " & $LeftRax2, $COLOR_BLUE) +;~ $FirstDarkTrain = False +;~ ElseIf $LeftRax2 > 1 And ($troopValkyrie2 < 7) And $LeftRax2 > ($troopValkyrie2 < 7) Then +;~ Donate_TrainIt($eValkyrie, (7 - $troopValkyrie2)) +;~ $LeftRax2 = ($ClickRax2 - (7 - $troopValkyrie2)) +;~ $ClickRax2 = $LeftRax2 +;~ SetLog("Dark Barrack 2 Valkyrie Remaining : " & $LeftRax2, $COLOR_BLUE) +;~ $FirstDarkTrain = False +;~ ElseIf $LeftRax2 > 1 And ($troopValkyrie2 < 7) And $LeftRax2 <= ($troopValkyrie2 < 7) Then +;~ Donate_TrainIt($eValkyrie, $LeftRax2) +;~ $TrainDrax2 = False +;~ SetLog("Dark Barrack 2 Train Valkyrie Completed...", $COLOR_BLUE) +;~ $FirstDarkTrain = False +;~ ElseIf $LeftRax2 <= 1 And ($troopValkyrie2 < 7) Then +;~ Donate_TrainIt($eValkyrie, $LeftRax2) +;~ $TrainDrax2 = False +;~ SetLog("Dark Barrack 2 Train Valkyrie Completed...", $COLOR_BLUE) +;~ $FirstDarkTrain = False +;~ Else +;~ SetLog("Dark Barrack 2 Training in progress, Valkyrie Remaining : " & $LeftRax2, $COLOR_BLUE) +;~ $FirstDarkTrain = False +;~ EndIf +;~ EndIf +;~ EndIf + +;~ If _Sleep(100) Then ExitLoop +;~ Click($TopLeftClient[0], $TopLeftClient[1], 2, 250); Click away twice with 250ms delay +;~ Next +;~ SetLog(GetLangText("msgDarkTroopComplete"), $COLOR_BLUE) +;~ $FirstDarkTrain = False +;~ END DARK TROOPS +EndFunc ;==>Donate_Train diff --git a/COCBot/functions/Village/DropTrophy.au3 b/COCBot/functions/Village/DropTrophy.au3 index 390e37f..f66b93a 100644 --- a/COCBot/functions/Village/DropTrophy.au3 +++ b/COCBot/functions/Village/DropTrophy.au3 @@ -1,129 +1,129 @@ -;Gets trophy count of village and compares to max trophy input. -;Will drop a troop and return home with no screenshot or gold wait. - -Func DropTrophy() - Local $i - Local $TrophyCount = Number(ReadText(59, 75, 60, $textMainScreen)) - If Number($TrophyCount) > Number($itxtMaxTrophy) Then - SetLog(GetLangText("msgTrophyCount") & $TrophyCount, $COLOR_GREEN) - While Number($TrophyCount) > Number($itxtMinTrophy) - If Number($TrophyCount) > Number($itxtMinTrophy) Then - SetLog(GetLangText("msgDropTrophies"), $COLOR_BLUE) - If StatusCheck() Then Return False - - PrepareSearch() - - ; Make sure end battle button is visible - If Not _WaitForColor(36, 523, Hex(0xEE5056, 6), 50, 10) Then - ChkDisconnection() - Return -1 - EndIf - - ; Make sure clouds have cleared - If Not _WaitForColor(1, 670, Hex(0x02070D, 6), 50, 5) Then Return -1 - - ; Wait just a bit extra - If _Sleep(100) Then Return - - $KingAt = -1 - $QueenAt = -1 - $LSpellAt = -1 - For $i = 0 To 8 - If IdentifyTroopKind($i) = $eKing Then $KingAt = $i - If IdentifyTroopKind($i) = $eQueen Then $QueenAt = $i - If IdentifyTroopKind($i) = $eLSpell Then $LSpellAt = $i - Next - - $Zapped = False -;~ If $LSpellAt <> -1 Then ; If we found a lightning spell -;~ $DarkElix = 0 -;~ $Trophies = getTrophy(51, 66 + 90) -;~ If $Trophies <> "" Then -;~ $DarkElix = getDarkElixir(51, 66 + 57) -;~ EndIf -;~ If Number($DarkElix) >= GUICtrlRead($txtDENukeLimit) Then ; If there is enough DE present -;~ If checkDarkElix() Then ; If we can see the DE storage -;~ SelectDropTroupe($LSpellAt) ; All these checks passed so lets zap the damn thing -;~ If _Sleep(200) Then Return False -;~ $z = 0 -;~ Do -;~ Click(Round(_Random_Gaussian($DEx, 2)), Round(_Random_Gaussian($DEy - 5, 2))) -;~ If _Sleep(200) Then Return False -;~ $nSpellQty = ReadTroopQuantity($LSpellAt) -;~ $z = $z + 1 -;~ Until $nSpellQty = 0 Or $z = 100 -;~ $Zapped = True ; We zapped, so don't bother dropping a troop -;~ EndIf -;~ EndIf -;~ If _Sleep(2000) Then Return False -;~ EndIf - - If Not $Zapped Then - $DropTroop = 0 ; Default to dropping first troop available - If $QueenAt <> -1 Then $DropTroop = $QueenAt - If $KingAt <> -1 Then $DropTroop = $KingAt - SelectDropTroupe($DropTroop) - If _Sleep(200) Then Return False - _CaptureRegion() - $hAttackBitmap = _GDIPlus_BitmapCloneArea($hBitmap, 0, 0, 860, 720, _GDIPlus_ImageGetPixelFormat($hBitmap)) - SeekEdges() - _GDIPlus_ImageDispose($hAttackBitmap) - $i = 1 - Do - Switch Random(0, 3, 1) ; I despise everything looking bottish -- lets randomly drop on some side - Case 0 - $x = Round(_Random_Gaussian(((($FurthestTopLeft[4][0] - $FurthestTopLeft[0][0]) / 2) + $FurthestTopLeft[0][0]), (($FurthestTopLeft[4][0] - $FurthestTopLeft[0][0]) / 5))) - $y = Round((($FurthestTopLeft[4][1] - $FurthestTopLeft[0][1]) / ($FurthestTopLeft[4][0] - $FurthestTopLeft[0][0])) * ($x - $FurthestTopLeft[0][0])) + $FurthestTopLeft[0][1] - Case 1 - $x = Round(_Random_Gaussian(((($FurthestTopRight[4][0] - $FurthestTopRight[0][0]) / 2) + $FurthestTopRight[0][0]), (($FurthestTopRight[4][0] - $FurthestTopRight[0][0]) / 5))) - $y = Round((($FurthestTopRight[4][1] - $FurthestTopRight[0][1]) / ($FurthestTopRight[4][0] - $FurthestTopRight[0][0])) * ($x - $FurthestTopRight[0][0])) + $FurthestTopRight[0][1] - Case 2 - $x = Round(_Random_Gaussian(((($FurthestBottomLeft[4][0] - $FurthestBottomLeft[0][0]) / 2) + $FurthestBottomLeft[0][0]), (($FurthestBottomLeft[4][0] - $FurthestBottomLeft[0][0]) / 5))) - $y = Round((($FurthestBottomLeft[4][1] - $FurthestBottomLeft[0][1]) / ($FurthestBottomLeft[4][0] - $FurthestBottomLeft[0][0])) * ($x - $FurthestBottomLeft[0][0])) + $FurthestBottomLeft[0][1] - Case 3 - $x = Round(_Random_Gaussian(((($FurthestBottomRight[4][0] - $FurthestBottomRight[0][0]) / 2) + $FurthestBottomRight[0][0]), (($FurthestBottomRight[4][0] - $FurthestBottomRight[0][0]) / 5))) - $y = Round((($FurthestBottomRight[4][1] - $FurthestBottomRight[0][1]) / ($FurthestBottomRight[4][0] - $FurthestBottomRight[0][0])) * ($x - $FurthestBottomRight[0][0])) + $FurthestBottomRight[0][1] - EndSwitch - If $i = 4 Then - Click($x, $y) - Else - RedLineDeploy($x, $y) - EndIf - $DropFailed = False - If _Sleep(100) Then Return False - _CaptureRegion() - If _ColorCheck(_GetPixelColor(733, 499), Hex(0xEBAD28, 6), 20) Then - $DropFailed = True - EndIf - $i += 1 - Until Not $DropFailed Or $i > 4 - If $DropTroop = 0 Then ; Don't just assume the troop you dropped was an archer - Switch IdentifyTroopKind(0) - Case $eArcher - $CurArch += 1 - Case $eBarbarian - $CurBarb += 1 - Case $eGiant - $CurGiant += 1 - Case $eGoblin - $CurGoblin += 1 - Case $eWallbreaker - $CurWB += 1 - Case Else - ; I don't know what we dropped - EndSwitch - EndIf - If _Sleep(300) Then ExitLoop - EndIf - - ReturnHome(False, False) ;Return home no screenshot - If StatusCheck() Then Return False - $TrophyCount = Number(ReadText(59, 75, 60, $textMainScreen)) - SetLog(GetLangText("msgTrophyCount") & $TrophyCount, $COLOR_GREEN) - Else - SetLog(GetLangText("msgDropComplete"), $COLOR_BLUE) - EndIf - WEnd - Return True - EndIf -EndFunc ;==>DropTrophy +;Gets trophy count of village and compares to max trophy input. +;Will drop a troop and return home with no screenshot or gold wait. + +Func DropTrophy() + Local $i + Local $TrophyCount = Number(ReadText(59, 75, 60, $textMainScreen)) + If Number($TrophyCount) > Number($itxtMaxTrophy) Then + SetLog(GetLangText("msgTrophyCount") & $TrophyCount, $COLOR_GREEN) + While Number($TrophyCount) > Number($itxtMinTrophy) + If Number($TrophyCount) > Number($itxtMinTrophy) Then + SetLog(GetLangText("msgDropTrophies"), $COLOR_BLUE) + If StatusCheck() Then Return False + + PrepareSearch() + + ; Make sure end battle button is visible + If Not _WaitForColor(36, 523, Hex(0xEE5056, 6), 50, 10) Then + ChkDisconnection() + Return -1 + EndIf + + ; Make sure clouds have cleared + If Not _WaitForColor(1, 670, Hex(0x02070D, 6), 50, 5) Then Return -1 + + ; Wait just a bit extra + If _Sleep(100) Then Return + + $KingAt = -1 + $QueenAt = -1 + $LSpellAt = -1 + For $i = 0 To 8 + If IdentifyTroopKind($i) = $eKing Then $KingAt = $i + If IdentifyTroopKind($i) = $eQueen Then $QueenAt = $i + If IdentifyTroopKind($i) = $eLSpell Then $LSpellAt = $i + Next + + $Zapped = False +;~ If $LSpellAt <> -1 Then ; If we found a lightning spell +;~ $DarkElix = 0 +;~ $Trophies = getTrophy(51, 66 + 90) +;~ If $Trophies <> "" Then +;~ $DarkElix = getDarkElixir(51, 66 + 57) +;~ EndIf +;~ If Number($DarkElix) >= GUICtrlRead($txtDENukeLimit) Then ; If there is enough DE present +;~ If checkDarkElix() Then ; If we can see the DE storage +;~ SelectDropTroupe($LSpellAt) ; All these checks passed so lets zap the damn thing +;~ If _Sleep(200) Then Return False +;~ $z = 0 +;~ Do +;~ Click(Round(_Random_Gaussian($DEx, 2)), Round(_Random_Gaussian($DEy - 5, 2))) +;~ If _Sleep(200) Then Return False +;~ $nSpellQty = ReadTroopQuantity($LSpellAt) +;~ $z = $z + 1 +;~ Until $nSpellQty = 0 Or $z = 100 +;~ $Zapped = True ; We zapped, so don't bother dropping a troop +;~ EndIf +;~ EndIf +;~ If _Sleep(2000) Then Return False +;~ EndIf + + If Not $Zapped Then + $DropTroop = 0 ; Default to dropping first troop available + If $QueenAt <> -1 Then $DropTroop = $QueenAt + If $KingAt <> -1 Then $DropTroop = $KingAt + SelectDropTroupe($DropTroop) + If _Sleep(200) Then Return False + _CaptureRegion() + $hAttackBitmap = _GDIPlus_BitmapCloneArea($hBitmap, 0, 0, 860, 720, _GDIPlus_ImageGetPixelFormat($hBitmap)) + SeekEdges() + _GDIPlus_ImageDispose($hAttackBitmap) + $i = 1 + Do + Switch Random(0, 3, 1) ; I despise everything looking bottish -- lets randomly drop on some side + Case 0 + $x = Round(_Random_Gaussian(((($FurthestTopLeft[4][0] - $FurthestTopLeft[0][0]) / 2) + $FurthestTopLeft[0][0]), (($FurthestTopLeft[4][0] - $FurthestTopLeft[0][0]) / 5))) + $y = Round((($FurthestTopLeft[4][1] - $FurthestTopLeft[0][1]) / ($FurthestTopLeft[4][0] - $FurthestTopLeft[0][0])) * ($x - $FurthestTopLeft[0][0])) + $FurthestTopLeft[0][1] + Case 1 + $x = Round(_Random_Gaussian(((($FurthestTopRight[4][0] - $FurthestTopRight[0][0]) / 2) + $FurthestTopRight[0][0]), (($FurthestTopRight[4][0] - $FurthestTopRight[0][0]) / 5))) + $y = Round((($FurthestTopRight[4][1] - $FurthestTopRight[0][1]) / ($FurthestTopRight[4][0] - $FurthestTopRight[0][0])) * ($x - $FurthestTopRight[0][0])) + $FurthestTopRight[0][1] + Case 2 + $x = Round(_Random_Gaussian(((($FurthestBottomLeft[4][0] - $FurthestBottomLeft[0][0]) / 2) + $FurthestBottomLeft[0][0]), (($FurthestBottomLeft[4][0] - $FurthestBottomLeft[0][0]) / 5))) + $y = Round((($FurthestBottomLeft[4][1] - $FurthestBottomLeft[0][1]) / ($FurthestBottomLeft[4][0] - $FurthestBottomLeft[0][0])) * ($x - $FurthestBottomLeft[0][0])) + $FurthestBottomLeft[0][1] + Case 3 + $x = Round(_Random_Gaussian(((($FurthestBottomRight[4][0] - $FurthestBottomRight[0][0]) / 2) + $FurthestBottomRight[0][0]), (($FurthestBottomRight[4][0] - $FurthestBottomRight[0][0]) / 5))) + $y = Round((($FurthestBottomRight[4][1] - $FurthestBottomRight[0][1]) / ($FurthestBottomRight[4][0] - $FurthestBottomRight[0][0])) * ($x - $FurthestBottomRight[0][0])) + $FurthestBottomRight[0][1] + EndSwitch + If $i = 4 Then + Click($x, $y) + Else + RedLineDeploy($x, $y) + EndIf + $DropFailed = False + If _Sleep(100) Then Return False + _CaptureRegion() + If _ColorCheck(_GetPixelColor(733, 499), Hex(0xEBAD28, 6), 20) Then + $DropFailed = True + EndIf + $i += 1 + Until Not $DropFailed Or $i > 4 + If $DropTroop = 0 Then ; Don't just assume the troop you dropped was an archer + Switch IdentifyTroopKind(0) + Case $eArcher + $CurArch += 1 + Case $eBarbarian + $CurBarb += 1 + Case $eGiant + $CurGiant += 1 + Case $eGoblin + $CurGoblin += 1 + Case $eWallbreaker + $CurWB += 1 + Case Else + ; I don't know what we dropped + EndSwitch + EndIf + If _Sleep(300) Then ExitLoop + EndIf + + ReturnHome(False, False) ;Return home no screenshot + If StatusCheck() Then Return False + $TrophyCount = Number(ReadText(59, 75, 60, $textMainScreen)) + SetLog(GetLangText("msgTrophyCount") & $TrophyCount, $COLOR_GREEN) + Else + SetLog(GetLangText("msgDropComplete"), $COLOR_BLUE) + EndIf + WEnd + Return True + EndIf +EndFunc ;==>DropTrophy diff --git a/COCBot/functions/Village/LocateBuildings.au3 b/COCBot/functions/Village/LocateBuildings.au3 index e0002e1..077c461 100644 --- a/COCBot/functions/Village/LocateBuildings.au3 +++ b/COCBot/functions/Village/LocateBuildings.au3 @@ -1,380 +1,380 @@ - -Func LocateBarrack() - checkMainScreen() - If Not ZoomOut() Then - SetLog(GetLangText("msgFailedZoomOut"), $COLOR_BLUE) - Return False - EndIf - SetLog(GetLangText("msgLocatingBarracks"), $COLOR_BLUE) - Local $MsgBox - While 1 - While 1 - $MsgBox = MsgBox(6 + 262144, GetLangText("boxBarrack1"), GetLangText("boxBarrack1b"), 0, $frmBot) - If $MsgBox = 11 Then - $barrackPos[0][0] = FindPos()[0] - $barrackPos[0][1] = FindPos()[1] - ElseIf $MsgBox = 10 Then - ExitLoop - Else - For $i = 0 To 3 - $barrackPos[$i][0] = "" - $barrackPos[$i][1] = "" - Next - ExitLoop (2) - EndIf - _Sleep(500) - $MsgBox = MsgBox(6 + 262144, GetLangText("boxBarrack2"), GetLangText("boxBarrack2b"), 0, $frmBot) - If $MsgBox = 11 Then - $barrackPos[1][0] = FindPos()[0] - $barrackPos[1][1] = FindPos()[1] - ElseIf $MsgBox = 10 Then - ExitLoop - Else - For $i = 1 To 3 - $barrackPos[$i][0] = "" - $barrackPos[$i][1] = "" - Next - ExitLoop (2) - EndIf - _Sleep(500) - $MsgBox = MsgBox(6 + 262144, GetLangText("boxBarrack3"), GetLangText("boxBarrack3b"), 0, $frmBot) - If $MsgBox = 11 Then - $barrackPos[2][0] = FindPos()[0] - $barrackPos[2][1] = FindPos()[1] - ElseIf $MsgBox = 10 Then - ExitLoop - Else - For $i = 2 To 3 - $barrackPos[$i][0] = "" - $barrackPos[$i][1] = "" - Next - ExitLoop (2) - EndIf - _Sleep(500) - $MsgBox = MsgBox(6 + 262144, GetLangText("boxBarrack4"), GetLangText("boxBarrack4b"), 0, $frmBot) - If $MsgBox = 11 Then - $barrackPos[3][0] = FindPos()[0] - $barrackPos[3][1] = FindPos()[1] - ElseIf $MsgBox = 10 Then - ExitLoop - Else - $barrackPos[3][0] = "" - $barrackPos[3][1] = "" - EndIf - _Sleep(500) - If IsChecked($chkRequest) And $CCPos[0] = "" Then LocateClanCastle() - ExitLoop (2) - WEnd - WEnd - SaveConfig() - SetLog(GetLangText("msgLocatingComplete"), $COLOR_BLUE) - SetLog(GetLangText("msgLocBarrack") & " 1 = " & "(" & $barrackPos[0][0] & "," & $barrackPos[0][1] & ")", $COLOR_GREEN) - SetLog(GetLangText("msgLocBarrack") & " 2 = " & "(" & $barrackPos[1][0] & "," & $barrackPos[1][1] & ")", $COLOR_GREEN) - SetLog(GetLangText("msgLocBarrack") & " 3 = " & "(" & $barrackPos[2][0] & "," & $barrackPos[2][1] & ")", $COLOR_GREEN) - SetLog(GetLangText("msgLocBarrack") & " 4 = " & "(" & $barrackPos[3][0] & "," & $barrackPos[3][1] & ")", $COLOR_GREEN) -EndFunc ;==>LocateBarrack - -Func LocateDarkBarrack() - checkMainScreen() - If Not ZoomOut() Then - SetLog(GetLangText("msgFailedZoomOut"), $COLOR_BLUE) - Return False - EndIf - SetLog(GetLangText("msgLocatingDarkBar"), $COLOR_BLUE) - Local $MsgBox - While 1 - While 1 - $MsgBox = MsgBox(6 + 262144, GetLangText("boxDark1"), GetLangText("boxDark1b"), 0, $frmBot) - If $MsgBox = 11 Then - $DarkBarrackPos[0][0] = FindPos()[0] - $DarkBarrackPos[0][1] = FindPos()[1] - ElseIf $MsgBox = 10 Then - ExitLoop - Else - For $i = 0 To 1 - $DarkBarrackPos[$i][0] = "" - $DarkBarrackPos[$i][1] = "" - Next - ExitLoop (2) - EndIf - _Sleep(500) - $MsgBox = MsgBox(6 + 262144, GetLangText("boxDark2"), GetLangText("boxDark2b"), 0, $frmBot) - If $MsgBox = 11 Then - $DarkBarrackPos[1][0] = FindPos()[0] - $DarkBarrackPos[1][1] = FindPos()[1] - ElseIf $MsgBox = 10 Then - ExitLoop - Else - For $i = 1 To 1 - $DarkBarrackPos[$i][0] = "" - $DarkBarrackPos[$i][1] = "" - Next - ExitLoop (2) - EndIf - ExitLoop (2) - WEnd - WEnd - SaveConfig() - SetLog(GetLangText("msgLocatingComplete"), $COLOR_BLUE) - SetLog(GetLangText("msgLocDarkBar") & " 1 = " & "(" & $DarkBarrackPos[0][0] & "," & $DarkBarrackPos[0][1] & ")", $COLOR_GREEN) - SetLog(GetLangText("msgLocDarkBar") & " 2 = " & "(" & $DarkBarrackPos[1][0] & "," & $DarkBarrackPos[1][1] & ")", $COLOR_GREEN) - -EndFunc ;==>LocateDarkBarrack - -Func LocateCamp() - checkMainScreen() - If Not ZoomOut() Then - SetLog(GetLangText("msgFailedZoomOut"), $COLOR_BLUE) - Return False - EndIf - While 1 - $MsgBox = MsgBox(1 + 262144, GetLangText("boxCamp"), GetLangText("boxCampb"), 0, $frmBot) - If $MsgBox = 1 Then - $ArmyPos[0] = FindPos()[0] - $ArmyPos[1] = FindPos()[1] - SetLog(GetLangText("msgLocArmyCamp") & " = " & "(" & $ArmyPos[0] & "," & $ArmyPos[1] & ")", $COLOR_GREEN) - EndIf - ExitLoop - WEnd -EndFunc ;==>LocateCamp - -Func LocateClanCastle() - checkMainScreen() - If Not ZoomOut() Then - SetLog(GetLangText("msgFailedZoomOut"), $COLOR_BLUE) - Return False - EndIf - While 1 - $MsgBox = MsgBox(1 + 262144, GetLangText("boxCC"), GetLangText("boxCCb"), 0, $frmBot) - If $MsgBox = 1 Then - $CCPos[0] = FindPos()[0] - $CCPos[1] = FindPos()[1] - SetLog(GetLangText("msgLocCC") & " = " & "(" & $CCPos[0] & "," & $CCPos[1] & ")", $COLOR_GREEN) - EndIf - ExitLoop - WEnd -EndFunc ;==>LocateClanCastle - -Func LocateTownHall() - checkMainScreen() - If Not ZoomOut() Then - SetLog(GetLangText("msgFailedZoomOut"), $COLOR_BLUE) - Return False - EndIf - While 1 - $MsgBox = MsgBox(1 + 262144, GetLangText("boxTH"), GetLangText("boxTHb"), 0, $frmBot) - If $MsgBox = 1 Then - WinActivate($HWnD) - $TownHallPos[0] = FindPos()[0] - $TownHallPos[1] = FindPos()[1] - SetLog(GetLangText("msgLocTH") & " = " & "(" & $TownHallPos[0] & "," & $TownHallPos[1] & ")", $COLOR_GREEN) - EndIf - ExitLoop - WEnd -EndFunc ;==>LocateTownHall - -Func LocateKingAltar() - checkMainScreen() - If Not ZoomOut() Then - SetLog(GetLangText("msgFailedZoomOut"), $COLOR_BLUE) - Return False - EndIf - While 1 - $MsgBox = MsgBox(1 + 262144, GetLangText("boxKing"), GetLangText("boxKingb"), 0, $frmBot) - If $MsgBox = 1 Then - $KingPos[0] = FindPos()[0] - $KingPos[1] = FindPos()[1] - SetLog(GetLangText("msgLocKing") & " = " & "(" & $KingPos[0] & "," & $KingPos[1] & ")", $COLOR_GREEN) - EndIf - ExitLoop - WEnd -EndFunc ;==>LocateKingAltar - -Func LocateQueenAltar() - checkMainScreen() - If Not ZoomOut() Then - SetLog(GetLangText("msgFailedZoomOut"), $COLOR_BLUE) - Return False - EndIf - While 1 - $MsgBox = MsgBox(1 + 262144, GetLangText("boxQueen"), GetLangText("boxQueenb"), 0, $frmBot) - If $MsgBox = 1 Then - $QueenPos[0] = FindPos()[0] - $QueenPos[1] = FindPos()[1] - SetLog(GetLangText("msgLocQueen") & " = " & "(" & $QueenPos[0] & "," & $QueenPos[1] & ")", $COLOR_GREEN) - EndIf - ExitLoop - WEnd -EndFunc ;==>LocateQueenAltar -Func LocateBuilding() - checkMainScreen() - If Not ZoomOut() Then - SetLog(GetLangText("msgFailedZoomOut"), $COLOR_BLUE) - Return False - EndIf - LocateUpgrade1() - _Sleep(500) - LocateUpgrade2() - _Sleep(500) - LocateUpgrade3() - _Sleep(500) - LocateUpgrade4() - _Sleep(500) - LocateUpgrade5() - _Sleep(500) - LocateUpgrade6() - _Sleep(500) - -EndFunc ;==>LocateBuilding -Func LocateUpgrade1() - checkMainScreen() - If Not ZoomOut() Then - SetLog(GetLangText("msgFailedZoomOut"), $COLOR_BLUE) - Return False - EndIf - While 1 - $MsgBox = MsgBox(1 + 262144, GetLangText("boxUpgrade") & " 1", GetLangText("boxUpgradeb"), 0, $frmBot) - If $MsgBox = 1 Then - $BuildPos1[0] = FindPos()[0] - $BuildPos1[1] = FindPos()[1] - SetLog(GetLangText("msgLocBuilding") & " 1 = " & "(" & $BuildPos1[0] & "," & $BuildPos1[1] & ")", $COLOR_GREEN) - GUICtrlSetData($txtUpgradeX1, $BuildPos1[0]) - GUICtrlSetData($txtUpgradeY1, $BuildPos1[1]) - EndIf - ExitLoop - WEnd -EndFunc ;==>LocateUpgrade1 - -Func LocateUpgrade2() - checkMainScreen() - If Not ZoomOut() Then - SetLog(GetLangText("msgFailedZoomOut"), $COLOR_BLUE) - Return False - EndIf - While 1 - $MsgBox = MsgBox(1 + 262144, GetLangText("boxUpgrade") & " 2", GetLangText("boxUpgradeb"), 0, $frmBot) - If $MsgBox = 1 Then - $BuildPos2[0] = FindPos()[0] - $BuildPos2[1] = FindPos()[1] - SetLog(GetLangText("msgLocBuilding") & " 2 = " & "(" & $BuildPos2[0] & "," & $BuildPos2[1] & ")", $COLOR_GREEN) - GUICtrlSetData($txtUpgradeX2, $BuildPos2[0]) - GUICtrlSetData($txtUpgradeY2, $BuildPos2[1]) - EndIf - ExitLoop - WEnd -EndFunc ;==>LocateUpgrade2 - -Func LocateUpgrade3() - checkMainScreen() - If Not ZoomOut() Then - SetLog(GetLangText("msgFailedZoomOut"), $COLOR_BLUE) - Return False - EndIf - While 1 - $MsgBox = MsgBox(1 + 262144, GetLangText("boxUpgrade") & " 3", GetLangText("boxUpgradeb"), 0, $frmBot) - If $MsgBox = 1 Then - $BuildPos3[0] = FindPos()[0] - $BuildPos3[1] = FindPos()[1] - SetLog(GetLangText("msgLocBuilding") & " 3 = " & "(" & $BuildPos3[0] & "," & $BuildPos3[1] & ")", $COLOR_GREEN) - GUICtrlSetData($txtUpgradeX3, $BuildPos3[0]) - GUICtrlSetData($txtUpgradeY3, $BuildPos3[1]) - EndIf - ExitLoop - WEnd -EndFunc ;==>LocateUpgrade3 - -Func LocateUpgrade4() - checkMainScreen() - If Not ZoomOut() Then - SetLog(GetLangText("msgFailedZoomOut"), $COLOR_BLUE) - Return False - EndIf - While 1 - $MsgBox = MsgBox(1 + 262144, GetLangText("boxUpgrade") & " 4", GetLangText("boxUpgradeb"), 0, $frmBot) - If $MsgBox = 1 Then - $BuildPos4[0] = FindPos()[0] - $BuildPos4[1] = FindPos()[1] - SetLog(GetLangText("msgLocBuilding") & " 4 = " & "(" & $BuildPos4[0] & "," & $BuildPos4[1] & ")", $COLOR_GREEN) - GUICtrlSetData($txtUpgradeX4, $BuildPos4[0]) - GUICtrlSetData($txtUpgradeY4, $BuildPos4[1]) - EndIf - ExitLoop - WEnd -EndFunc ;==>LocateUpgrade4 - -Func LocateUpgrade5() - checkMainScreen() - If Not ZoomOut() Then - SetLog(GetLangText("msgFailedZoomOut"), $COLOR_BLUE) - Return False - EndIf - While 1 - $MsgBox = MsgBox(1 + 262144, GetLangText("boxUpgrade") & " 5", GetLangText("boxUpgradeb"), 0, $frmBot) - If $MsgBox = 1 Then - $BuildPos5[0] = FindPos()[0] - $BuildPos5[1] = FindPos()[1] - SetLog(GetLangText("msgLocBuilding") & " 5 = " & "(" & $BuildPos5[0] & "," & $BuildPos5[1] & ")", $COLOR_GREEN) - GUICtrlSetData($txtUpgradeX5, $BuildPos5[0]) - GUICtrlSetData($txtUpgradeY5, $BuildPos5[1]) - EndIf - ExitLoop - WEnd -EndFunc ;==>LocateUpgrade5 - - -Func LocateUpgrade6() - checkMainScreen() - If Not ZoomOut() Then - SetLog(GetLangText("msgFailedZoomOut"), $COLOR_BLUE) - Return False - EndIf - While 1 - $MsgBox = MsgBox(1 + 262144, GetLangText("boxUpgrade") & " 6", GetLangText("boxUpgradeb"), 0, $frmBot) - If $MsgBox = 1 Then - $BuildPos6[0] = FindPos()[0] - $BuildPos6[1] = FindPos()[1] - SetLog(GetLangText("msgLocBuilding") & " 6 = " & "(" & $BuildPos6[0] & "," & $BuildPos6[1] & ")", $COLOR_GREEN) - GUICtrlSetData($txtUpgradeX6, $BuildPos6[0]) - GUICtrlSetData($txtUpgradeY6, $BuildPos6[1]) - EndIf - ExitLoop - WEnd -EndFunc ;==>LocateUpgrade6 - -Func LocateSpellFactory() - checkMainScreen() - If Not ZoomOut() Then - SetLog(GetLangText("msgFailedZoomOut"), $COLOR_BLUE) - Return False - EndIf - While 1 - $MsgBox = MsgBox(1 + 262144, GetLangText("boxFactory"), GetLangText("boxFactoryb"), 0, $frmBot) - If $MsgBox = 1 Then - $SpellPos[0] = FindPos()[0] - $SpellPos[1] = FindPos()[1] - SetLog(GetLangText("msgLocSpellFact") & " = " & "(" & $SpellPos[0] & "," & $SpellPos[1] & ")", $COLOR_GREEN) - EndIf - ExitLoop - WEnd - - $itxtspellCap = InputBox(GetLangText("inpSpell"), GetLangText("inpSpellb"), "3", " M1") - If $itxtspellCap >= 1 And $itxtspellCap <= 5 Then - GUICtrlSetData($txtSpellCap, $itxtspellCap) - Else - MsgBox(4096, GetLangText("boxError"), GetLangText("boxErrorb")) - EndIf -EndFunc ;==>LocateSpellFactory - -Func LocateLab() - checkMainScreen() - If Not ZoomOut() Then - SetLog(GetLangText("msgFailedZoomOut"), $COLOR_BLUE) - Return False - EndIf - $MsgBox = MsgBox(1 + 262144, GetLangText("boxLab"), GetLangText("boxLabb"), 0, $frmBot) - If $MsgBox = 1 Then - $LabPos[0] = FindPos()[0] - $LabPos[1] = FindPos()[1] - SetLog(GetLangText("msgLocLab") & " = " & "(" & $LabPos[0] & "," & $LabPos[1] & ")", $COLOR_GREEN) - EndIf -EndFunc ;==>LocateLab + +Func LocateBarrack() + checkMainScreen() + If Not ZoomOut() Then + SetLog(GetLangText("msgFailedZoomOut"), $COLOR_BLUE) + Return False + EndIf + SetLog(GetLangText("msgLocatingBarracks"), $COLOR_BLUE) + Local $MsgBox + While 1 + While 1 + $MsgBox = MsgBox(6 + 262144, GetLangText("boxBarrack1"), GetLangText("boxBarrack1b"), 0, $frmBot) + If $MsgBox = 11 Then + $barrackPos[0][0] = FindPos()[0] + $barrackPos[0][1] = FindPos()[1] + ElseIf $MsgBox = 10 Then + ExitLoop + Else + For $i = 0 To 3 + $barrackPos[$i][0] = "" + $barrackPos[$i][1] = "" + Next + ExitLoop (2) + EndIf + _Sleep(500) + $MsgBox = MsgBox(6 + 262144, GetLangText("boxBarrack2"), GetLangText("boxBarrack2b"), 0, $frmBot) + If $MsgBox = 11 Then + $barrackPos[1][0] = FindPos()[0] + $barrackPos[1][1] = FindPos()[1] + ElseIf $MsgBox = 10 Then + ExitLoop + Else + For $i = 1 To 3 + $barrackPos[$i][0] = "" + $barrackPos[$i][1] = "" + Next + ExitLoop (2) + EndIf + _Sleep(500) + $MsgBox = MsgBox(6 + 262144, GetLangText("boxBarrack3"), GetLangText("boxBarrack3b"), 0, $frmBot) + If $MsgBox = 11 Then + $barrackPos[2][0] = FindPos()[0] + $barrackPos[2][1] = FindPos()[1] + ElseIf $MsgBox = 10 Then + ExitLoop + Else + For $i = 2 To 3 + $barrackPos[$i][0] = "" + $barrackPos[$i][1] = "" + Next + ExitLoop (2) + EndIf + _Sleep(500) + $MsgBox = MsgBox(6 + 262144, GetLangText("boxBarrack4"), GetLangText("boxBarrack4b"), 0, $frmBot) + If $MsgBox = 11 Then + $barrackPos[3][0] = FindPos()[0] + $barrackPos[3][1] = FindPos()[1] + ElseIf $MsgBox = 10 Then + ExitLoop + Else + $barrackPos[3][0] = "" + $barrackPos[3][1] = "" + EndIf + _Sleep(500) + If IsChecked($chkRequest) And $CCPos[0] = "" Then LocateClanCastle() + ExitLoop (2) + WEnd + WEnd + SaveConfig() + SetLog(GetLangText("msgLocatingComplete"), $COLOR_BLUE) + SetLog(GetLangText("msgLocBarrack") & " 1 = " & "(" & $barrackPos[0][0] & "," & $barrackPos[0][1] & ")", $COLOR_GREEN) + SetLog(GetLangText("msgLocBarrack") & " 2 = " & "(" & $barrackPos[1][0] & "," & $barrackPos[1][1] & ")", $COLOR_GREEN) + SetLog(GetLangText("msgLocBarrack") & " 3 = " & "(" & $barrackPos[2][0] & "," & $barrackPos[2][1] & ")", $COLOR_GREEN) + SetLog(GetLangText("msgLocBarrack") & " 4 = " & "(" & $barrackPos[3][0] & "," & $barrackPos[3][1] & ")", $COLOR_GREEN) +EndFunc ;==>LocateBarrack + +Func LocateDarkBarrack() + checkMainScreen() + If Not ZoomOut() Then + SetLog(GetLangText("msgFailedZoomOut"), $COLOR_BLUE) + Return False + EndIf + SetLog(GetLangText("msgLocatingDarkBar"), $COLOR_BLUE) + Local $MsgBox + While 1 + While 1 + $MsgBox = MsgBox(6 + 262144, GetLangText("boxDark1"), GetLangText("boxDark1b"), 0, $frmBot) + If $MsgBox = 11 Then + $DarkBarrackPos[0][0] = FindPos()[0] + $DarkBarrackPos[0][1] = FindPos()[1] + ElseIf $MsgBox = 10 Then + ExitLoop + Else + For $i = 0 To 1 + $DarkBarrackPos[$i][0] = "" + $DarkBarrackPos[$i][1] = "" + Next + ExitLoop (2) + EndIf + _Sleep(500) + $MsgBox = MsgBox(6 + 262144, GetLangText("boxDark2"), GetLangText("boxDark2b"), 0, $frmBot) + If $MsgBox = 11 Then + $DarkBarrackPos[1][0] = FindPos()[0] + $DarkBarrackPos[1][1] = FindPos()[1] + ElseIf $MsgBox = 10 Then + ExitLoop + Else + For $i = 1 To 1 + $DarkBarrackPos[$i][0] = "" + $DarkBarrackPos[$i][1] = "" + Next + ExitLoop (2) + EndIf + ExitLoop (2) + WEnd + WEnd + SaveConfig() + SetLog(GetLangText("msgLocatingComplete"), $COLOR_BLUE) + SetLog(GetLangText("msgLocDarkBar") & " 1 = " & "(" & $DarkBarrackPos[0][0] & "," & $DarkBarrackPos[0][1] & ")", $COLOR_GREEN) + SetLog(GetLangText("msgLocDarkBar") & " 2 = " & "(" & $DarkBarrackPos[1][0] & "," & $DarkBarrackPos[1][1] & ")", $COLOR_GREEN) + +EndFunc ;==>LocateDarkBarrack + +Func LocateCamp() + checkMainScreen() + If Not ZoomOut() Then + SetLog(GetLangText("msgFailedZoomOut"), $COLOR_BLUE) + Return False + EndIf + While 1 + $MsgBox = MsgBox(1 + 262144, GetLangText("boxCamp"), GetLangText("boxCampb"), 0, $frmBot) + If $MsgBox = 1 Then + $ArmyPos[0] = FindPos()[0] + $ArmyPos[1] = FindPos()[1] + SetLog(GetLangText("msgLocArmyCamp") & " = " & "(" & $ArmyPos[0] & "," & $ArmyPos[1] & ")", $COLOR_GREEN) + EndIf + ExitLoop + WEnd +EndFunc ;==>LocateCamp + +Func LocateClanCastle() + checkMainScreen() + If Not ZoomOut() Then + SetLog(GetLangText("msgFailedZoomOut"), $COLOR_BLUE) + Return False + EndIf + While 1 + $MsgBox = MsgBox(1 + 262144, GetLangText("boxCC"), GetLangText("boxCCb"), 0, $frmBot) + If $MsgBox = 1 Then + $CCPos[0] = FindPos()[0] + $CCPos[1] = FindPos()[1] + SetLog(GetLangText("msgLocCC") & " = " & "(" & $CCPos[0] & "," & $CCPos[1] & ")", $COLOR_GREEN) + EndIf + ExitLoop + WEnd +EndFunc ;==>LocateClanCastle + +Func LocateTownHall() + checkMainScreen() + If Not ZoomOut() Then + SetLog(GetLangText("msgFailedZoomOut"), $COLOR_BLUE) + Return False + EndIf + While 1 + $MsgBox = MsgBox(1 + 262144, GetLangText("boxTH"), GetLangText("boxTHb"), 0, $frmBot) + If $MsgBox = 1 Then + WinActivate($HWnD) + $TownHallPos[0] = FindPos()[0] + $TownHallPos[1] = FindPos()[1] + SetLog(GetLangText("msgLocTH") & " = " & "(" & $TownHallPos[0] & "," & $TownHallPos[1] & ")", $COLOR_GREEN) + EndIf + ExitLoop + WEnd +EndFunc ;==>LocateTownHall + +Func LocateKingAltar() + checkMainScreen() + If Not ZoomOut() Then + SetLog(GetLangText("msgFailedZoomOut"), $COLOR_BLUE) + Return False + EndIf + While 1 + $MsgBox = MsgBox(1 + 262144, GetLangText("boxKing"), GetLangText("boxKingb"), 0, $frmBot) + If $MsgBox = 1 Then + $KingPos[0] = FindPos()[0] + $KingPos[1] = FindPos()[1] + SetLog(GetLangText("msgLocKing") & " = " & "(" & $KingPos[0] & "," & $KingPos[1] & ")", $COLOR_GREEN) + EndIf + ExitLoop + WEnd +EndFunc ;==>LocateKingAltar + +Func LocateQueenAltar() + checkMainScreen() + If Not ZoomOut() Then + SetLog(GetLangText("msgFailedZoomOut"), $COLOR_BLUE) + Return False + EndIf + While 1 + $MsgBox = MsgBox(1 + 262144, GetLangText("boxQueen"), GetLangText("boxQueenb"), 0, $frmBot) + If $MsgBox = 1 Then + $QueenPos[0] = FindPos()[0] + $QueenPos[1] = FindPos()[1] + SetLog(GetLangText("msgLocQueen") & " = " & "(" & $QueenPos[0] & "," & $QueenPos[1] & ")", $COLOR_GREEN) + EndIf + ExitLoop + WEnd +EndFunc ;==>LocateQueenAltar +Func LocateBuilding() + checkMainScreen() + If Not ZoomOut() Then + SetLog(GetLangText("msgFailedZoomOut"), $COLOR_BLUE) + Return False + EndIf + LocateUpgrade1() + _Sleep(500) + LocateUpgrade2() + _Sleep(500) + LocateUpgrade3() + _Sleep(500) + LocateUpgrade4() + _Sleep(500) + LocateUpgrade5() + _Sleep(500) + LocateUpgrade6() + _Sleep(500) + +EndFunc ;==>LocateBuilding +Func LocateUpgrade1() + checkMainScreen() + If Not ZoomOut() Then + SetLog(GetLangText("msgFailedZoomOut"), $COLOR_BLUE) + Return False + EndIf + While 1 + $MsgBox = MsgBox(1 + 262144, GetLangText("boxUpgrade") & " 1", GetLangText("boxUpgradeb"), 0, $frmBot) + If $MsgBox = 1 Then + $BuildPos1[0] = FindPos()[0] + $BuildPos1[1] = FindPos()[1] + SetLog(GetLangText("msgLocBuilding") & " 1 = " & "(" & $BuildPos1[0] & "," & $BuildPos1[1] & ")", $COLOR_GREEN) + GUICtrlSetData($txtUpgradeX1, $BuildPos1[0]) + GUICtrlSetData($txtUpgradeY1, $BuildPos1[1]) + EndIf + ExitLoop + WEnd +EndFunc ;==>LocateUpgrade1 + +Func LocateUpgrade2() + checkMainScreen() + If Not ZoomOut() Then + SetLog(GetLangText("msgFailedZoomOut"), $COLOR_BLUE) + Return False + EndIf + While 1 + $MsgBox = MsgBox(1 + 262144, GetLangText("boxUpgrade") & " 2", GetLangText("boxUpgradeb"), 0, $frmBot) + If $MsgBox = 1 Then + $BuildPos2[0] = FindPos()[0] + $BuildPos2[1] = FindPos()[1] + SetLog(GetLangText("msgLocBuilding") & " 2 = " & "(" & $BuildPos2[0] & "," & $BuildPos2[1] & ")", $COLOR_GREEN) + GUICtrlSetData($txtUpgradeX2, $BuildPos2[0]) + GUICtrlSetData($txtUpgradeY2, $BuildPos2[1]) + EndIf + ExitLoop + WEnd +EndFunc ;==>LocateUpgrade2 + +Func LocateUpgrade3() + checkMainScreen() + If Not ZoomOut() Then + SetLog(GetLangText("msgFailedZoomOut"), $COLOR_BLUE) + Return False + EndIf + While 1 + $MsgBox = MsgBox(1 + 262144, GetLangText("boxUpgrade") & " 3", GetLangText("boxUpgradeb"), 0, $frmBot) + If $MsgBox = 1 Then + $BuildPos3[0] = FindPos()[0] + $BuildPos3[1] = FindPos()[1] + SetLog(GetLangText("msgLocBuilding") & " 3 = " & "(" & $BuildPos3[0] & "," & $BuildPos3[1] & ")", $COLOR_GREEN) + GUICtrlSetData($txtUpgradeX3, $BuildPos3[0]) + GUICtrlSetData($txtUpgradeY3, $BuildPos3[1]) + EndIf + ExitLoop + WEnd +EndFunc ;==>LocateUpgrade3 + +Func LocateUpgrade4() + checkMainScreen() + If Not ZoomOut() Then + SetLog(GetLangText("msgFailedZoomOut"), $COLOR_BLUE) + Return False + EndIf + While 1 + $MsgBox = MsgBox(1 + 262144, GetLangText("boxUpgrade") & " 4", GetLangText("boxUpgradeb"), 0, $frmBot) + If $MsgBox = 1 Then + $BuildPos4[0] = FindPos()[0] + $BuildPos4[1] = FindPos()[1] + SetLog(GetLangText("msgLocBuilding") & " 4 = " & "(" & $BuildPos4[0] & "," & $BuildPos4[1] & ")", $COLOR_GREEN) + GUICtrlSetData($txtUpgradeX4, $BuildPos4[0]) + GUICtrlSetData($txtUpgradeY4, $BuildPos4[1]) + EndIf + ExitLoop + WEnd +EndFunc ;==>LocateUpgrade4 + +Func LocateUpgrade5() + checkMainScreen() + If Not ZoomOut() Then + SetLog(GetLangText("msgFailedZoomOut"), $COLOR_BLUE) + Return False + EndIf + While 1 + $MsgBox = MsgBox(1 + 262144, GetLangText("boxUpgrade") & " 5", GetLangText("boxUpgradeb"), 0, $frmBot) + If $MsgBox = 1 Then + $BuildPos5[0] = FindPos()[0] + $BuildPos5[1] = FindPos()[1] + SetLog(GetLangText("msgLocBuilding") & " 5 = " & "(" & $BuildPos5[0] & "," & $BuildPos5[1] & ")", $COLOR_GREEN) + GUICtrlSetData($txtUpgradeX5, $BuildPos5[0]) + GUICtrlSetData($txtUpgradeY5, $BuildPos5[1]) + EndIf + ExitLoop + WEnd +EndFunc ;==>LocateUpgrade5 + + +Func LocateUpgrade6() + checkMainScreen() + If Not ZoomOut() Then + SetLog(GetLangText("msgFailedZoomOut"), $COLOR_BLUE) + Return False + EndIf + While 1 + $MsgBox = MsgBox(1 + 262144, GetLangText("boxUpgrade") & " 6", GetLangText("boxUpgradeb"), 0, $frmBot) + If $MsgBox = 1 Then + $BuildPos6[0] = FindPos()[0] + $BuildPos6[1] = FindPos()[1] + SetLog(GetLangText("msgLocBuilding") & " 6 = " & "(" & $BuildPos6[0] & "," & $BuildPos6[1] & ")", $COLOR_GREEN) + GUICtrlSetData($txtUpgradeX6, $BuildPos6[0]) + GUICtrlSetData($txtUpgradeY6, $BuildPos6[1]) + EndIf + ExitLoop + WEnd +EndFunc ;==>LocateUpgrade6 + +Func LocateSpellFactory() + checkMainScreen() + If Not ZoomOut() Then + SetLog(GetLangText("msgFailedZoomOut"), $COLOR_BLUE) + Return False + EndIf + While 1 + $MsgBox = MsgBox(1 + 262144, GetLangText("boxFactory"), GetLangText("boxFactoryb"), 0, $frmBot) + If $MsgBox = 1 Then + $SpellPos[0] = FindPos()[0] + $SpellPos[1] = FindPos()[1] + SetLog(GetLangText("msgLocSpellFact") & " = " & "(" & $SpellPos[0] & "," & $SpellPos[1] & ")", $COLOR_GREEN) + EndIf + ExitLoop + WEnd + + $itxtspellCap = InputBox(GetLangText("inpSpell"), GetLangText("inpSpellb"), "3", " M1") + If $itxtspellCap >= 1 And $itxtspellCap <= 5 Then + GUICtrlSetData($txtSpellCap, $itxtspellCap) + Else + MsgBox(4096, GetLangText("boxError"), GetLangText("boxErrorb")) + EndIf +EndFunc ;==>LocateSpellFactory + +Func LocateLab() + checkMainScreen() + If Not ZoomOut() Then + SetLog(GetLangText("msgFailedZoomOut"), $COLOR_BLUE) + Return False + EndIf + $MsgBox = MsgBox(1 + 262144, GetLangText("boxLab"), GetLangText("boxLabb"), 0, $frmBot) + If $MsgBox = 1 Then + $LabPos[0] = FindPos()[0] + $LabPos[1] = FindPos()[1] + SetLog(GetLangText("msgLocLab") & " = " & "(" & $LabPos[0] & "," & $LabPos[1] & ")", $COLOR_GREEN) + EndIf +EndFunc ;==>LocateLab diff --git a/COCBot/functions/Village/MainLoop.au3 b/COCBot/functions/Village/MainLoop.au3 index 07be9f1..d88b0c3 100644 --- a/COCBot/functions/Village/MainLoop.au3 +++ b/COCBot/functions/Village/MainLoop.au3 @@ -1,149 +1,167 @@ -Func runBot() ;Bot that runs everything in order - Local $AttackType - While 1 - If TimerDiff($hUpdateTimer) > (1000 * 60 * 60 * 12) Then - checkupdate() - EndIf - - ; Configuration and cleanup - $Restart = False - LootLogCleanup(100) - SaveConfig() - readConfig() - applyConfig() - $strPlugInInUse = IniRead($dirStrat & GUICtrlRead($lstStrategies) & ".ini", "plugin", "name", "") - - ;Check attack mode - chkNoAttack() - If StatusCheck(True, True, 3) Then Return - - ; Collect stats - VillageReport() - If StatusCheck() Then Return - - CheckCostPerSearch() - If StatusCheck() Then Return - - clearField() - If StatusCheck() Then Return - - If $Checkrearm Then - ReArm() - $Checkrearm = False - EndIf - If StatusCheck() Then Return - - DonateCC() - If StatusCheck() Then Return - - RequestCC() - If StatusCheck() Then Return - - BoostAllBuilding() - If StatusCheck() Then Return - - collectResources() - If StatusCheck() Then Return - - Laboratory() - If StatusCheck() Then Return - - UpgradeBuilding() - If StatusCheck() Then Return - - UpgradeWall() - If StatusCheck() Then Return - - If $PushBulletEnabled = 1 And $PushBulletchatlog = 1 Then - ReadChatLog(Not $ChatInitialized) - EndIf - If StatusCheck() Then Return - - Switch $CurrentMode - Case $modeNormal - Idle($strPlugInInUse) - If StatusCheck() Then Return - - If DropTrophy() Then ContinueLoop - If StatusCheck() Then Return False - - Call($strPlugInInUse & "_PrepNextBattle") - - While True - If StatusCheck() Then Return - - If Not Call($strPlugInInUse & "_miniReadyCheck") Then ExitLoop - - If PrepareSearch() Then - $AttackType = Call($strPlugInInUse & "_Search") - If BotStopped(False) Then Return - If $AttackType = -1 Then - $SearchFailed = True - ContinueLoop - EndIf - - Call($strPlugInInUse & "_PrepareAttack", False, $AttackType) - If BotStopped(False) Then Return - - SetLog(GetLangText("msgBeginAttack")) - Call($strPlugInInUse & "_Attack", $AttackType) - If BotStopped(False) Then Return - - ReturnHome($TakeLootSnapShot) - If StatusCheck() Then Return - Else - If _ColorCheck(_GetPixelColor(820, 15), Hex(0xF88288, 6), 20) Then Click(820, 15) ;Click Red X - If StatusCheck() Then Return - ContinueLoop - EndIf - ExitLoop - WEnd - Case $modeDonateTrain - $fullarmy = Donate_CheckArmyCamp() - If StatusCheck() Then Return False - - If Not $fullarmy Then Donate_Train() - If StatusCheck() Then Return False - - If _Sleep(5000) Then Return - Case $modeDonate - If _Sleep(5000) Then Return - ; Why is this even a mode? - Case $modeExperience - Experience() - EndSwitch - - _BumpMouse() - WEnd -EndFunc ;==>runBot - -Func Idle($Plugin) ;Sequence that runs until Full Army - Local $TimeIdle = 0 ;In Seconds - Local $hTimer = TimerInit() - Local $prevCamp = 0 - Local $hTroopTimer = TimerInit() - Local $TimeSinceTroop = 0 - While Not Call($Plugin & "_ReadyCheck", $TimeSinceTroop) - If StatusCheck() Then Return - SetLog(GetLangText("msgWaitingFull"), $COLOR_PURPLE) - If $iCollectCounter > $COLLECTATCOUNT Then ; This is prevent from collecting all the time which isn't needed anyway - collectResources() - If StatusCheck() Then Return - $iCollectCounter = 0 - EndIf - $iCollectCounter += 1 - DonateCC() - If StatusCheck() Then Return - _BumpMouse() - $TimeIdle = Round(TimerDiff($hTimer) / 1000, 2) ;In Seconds - If $CurCamp <> $prevCamp Then - $prevCamp = $CurCamp - $hTroopTimer = TimerInit() - EndIf - If $CurCamp = 0 Or $CurCamp = "" Then $hTroopTimer = TimerInit() ; Not a good fix, but will stop errors for people whose troop size can't be read for now - $TimeSinceTroop = TimerDiff($hTroopTimer) / 1000 - SetLog(GetLangText("msgTimeIdle") & Floor(Floor($TimeIdle / 60) / 60) & GetLangText("msgTimeIdleHours") & Floor(Mod(Floor($TimeIdle / 60), 60)) & GetLangText("msgTimeIdleMin") & Floor(Mod($TimeIdle, 60)) & GetLangText("msgTimeIdleSec"), $COLOR_ORANGE) - If _Sleep(30000) Then ExitLoop - WEnd -EndFunc ;==>Idle - +Func runBot() ;Bot that runs everything in order + Local $AttackType + While 1 + If TimerDiff($hUpdateTimer) > (1000 * 60 * 60 * 12) Then + checkupdate() + EndIf + + _ReduceMemory() ;=> added to reduce memory use + + ; Configuration and cleanup + $Restart = False + LootLogCleanup(100) + SaveConfig() + readConfig() + applyConfig() + $strPlugInInUse = IniRead($dirStrat & GUICtrlRead($lstStrategies) & ".ini", "plugin", "name", "") + + ;Check attack mode + chkNoAttack() + If StatusCheck(True, True, 3) Then Return + + ; Collect stats + VillageReport() + If StatusCheck() Then Return + + CheckCostPerSearch() + If StatusCheck() Then Return + + clearField() + If StatusCheck() Then Return + + If $Checkrearm Then + ReArm() + $Checkrearm = False + EndIf + If StatusCheck() Then Return + + DonateCC() + If StatusCheck() Then Return + + RequestCC() + If StatusCheck() Then Return + + BoostAllBuilding() + If StatusCheck() Then Return + + collectResources() + If StatusCheck() Then Return + + Laboratory() + If StatusCheck() Then Return + + UpgradeBuilding() + If StatusCheck() Then Return + + UpgradeWall() + If StatusCheck() Then Return + + UpgradeHeroes() ;==> upgradeheroes + If StatusCheck() Then Return + + If $PushBulletEnabled = 1 And $PushBulletchatlog = 1 Then + ReadChatLog(Not $ChatInitialized) + EndIf + If StatusCheck() Then Return + + Switch $CurrentMode + Case $modeNormal + Idle($strPlugInInUse) + If StatusCheck() Then Return + + If DropTrophy() Then ContinueLoop + If StatusCheck() Then Return False + + Call($strPlugInInUse & "_PrepNextBattle") + + While True + If StatusCheck() Then Return + + If Not Call($strPlugInInUse & "_miniReadyCheck") Then ExitLoop + + If PrepareSearch() Then + $AttackType = Call($strPlugInInUse & "_Search") + If BotStopped(False) Then Return + If $AttackType = -1 Then + $SearchFailed = True + ContinueLoop + EndIf + + Call($strPlugInInUse & "_PrepareAttack", False, $AttackType) + If BotStopped(False) Then Return + + SetLog(GetLangText("msgBeginAttack")) + Call($strPlugInInUse & "_Attack", $AttackType) + If BotStopped(False) Then Return + + ReturnHome($TakeLootSnapShot) + If StatusCheck() Then Return + Else + If _ColorCheck(_GetPixelColor(820, 15), Hex(0xF88288, 6), 20) Then Click(820, 15) ;Click Red X + If StatusCheck() Then Return + ContinueLoop + EndIf + ExitLoop + WEnd + Case $modeDonateTrain + $fullarmy = Donate_CheckArmyCamp() + If StatusCheck() Then Return False + + If Not $fullarmy Then Donate_Train() + If StatusCheck() Then Return False + + If _Sleep(5000) Then Return + Case $modeDonate + If _Sleep(5000) Then Return + ; Why is this even a mode? + Case $modeExperience + Experience() + EndSwitch + + _BumpMouse() + WEnd +EndFunc ;==>runBot + +Func Idle($Plugin) ;Sequence that runs until Full Army + Local $TimeIdle = 0 ;In Seconds + Local $hTimer = TimerInit() + Local $prevCamp = 0 + Local $hTroopTimer = TimerInit() + Local $TimeSinceTroop = 0 + While Not Call($Plugin & "_ReadyCheck", $TimeSinceTroop) + If StatusCheck() Then Return + SetLog(GetLangText("msgWaitingFull"), $COLOR_PURPLE) + If $iCollectCounter > $COLLECTATCOUNT Then ; This is prevent from collecting all the time which isn't needed anyway + collectResources() + If StatusCheck() Then Return + $iCollectCounter = 0 + EndIf + $iCollectCounter += 1 + DonateCC() + _BumpMouse() + $TimeIdle = Round(TimerDiff($hTimer) / 1000, 2) ;In Seconds + If $CurCamp <> $prevCamp Then + $prevCamp = $CurCamp + $hTroopTimer = TimerInit() + EndIf + If $CurCamp = 0 Or $CurCamp = "" Then + $hTroopTimer = TimerInit() ; Not a good fix, but will stop errors for people whose troop size can't be read for now + EndIf + $TimeSinceTroop = TimerDiff($hTroopTimer) / 1000 + SetLog(GetLangText("msgTimeIdle") & Floor(Floor($TimeIdle / 60) / 60) & GetLangText("msgTimeIdleHours") & Floor(Mod(Floor($TimeIdle / 60), 60)) & GetLangText("msgTimeIdleMin") & Floor(Mod($TimeIdle, 60)) & GetLangText("msgTimeIdleSec"), $COLOR_ORANGE) + $hIdle = TimerInit() + While TimerDiff($hIdle) < 30000 + DonateCC(True) + If _Sleep(1000) Then Return + WEnd + If StatusCheck() Then Return + WEnd +EndFunc ;==>Idle + +Func _ReduceMemory() + Local $ai_GetCurrentProcessId = DllCall('kernel32.dll', 'int', 'GetCurrentProcessId') + Local $ai_Handle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', 0x1f0fff, 'int', False, 'int', $ai_GetCurrentProcessId[0]) + Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', $ai_Handle[0]) + DllCall('kernel32.dll', 'int', 'CloseHandle', 'int', $ai_Handle[0]) + Return $ai_Return[0] +EndFunc diff --git a/COCBot/functions/Village/ReArm.au3 b/COCBot/functions/Village/ReArm.au3 index e5d0844..e459cc6 100644 --- a/COCBot/functions/Village/ReArm.au3 +++ b/COCBot/functions/Village/ReArm.au3 @@ -1,55 +1,55 @@ -;==>ReArm -Func ReArm() - If $ichkTrap = 0 Then Return - - SetLog(GetLangText("msgCheckRearm"), $COLOR_BLUE) - - If $TownHallPos[0] = -1 Then - LocateTownHall() - SaveConfig() - EndIf - - ClickP($TopLeftClient, 2, 250); Click away twice with 250ms delay - Click($TownHallPos[0], $TownHallPos[1]) - _WaitForPixel(240, 581, 484, 583, Hex(0x4084B8, 6), 6, 2) - - Local $x1 = 240, $y1 = 562, $x2 = 670, $y2 = 600 ;Coordinates for button search - - ;Traps - Local $offColors[3][3] = [[0x887d79, 24, 34], [0xF3EC55, 69, 7], [0xECEEE9, 77, 0]] ; 2nd pixel brown wrench, 3rd pixel gold, 4th pixel edge of button - Local $RearmPixel = _MultiPixelSearch($x1, $y1, $x2, $y2, 1, 1, Hex(0xF6F9F2, 6), $offColors, 30) ; first gray/white pixel of button - If IsArray($RearmPixel) Then - Click($RearmPixel[0] + 20, $RearmPixel[1] + 20) ; Click RearmButton - If _WaitForColor(350, 420, Hex(0xC83B10, 6), 20, 1) Then - Click(515, 400) - If _Sleep(300) Then Return - SetLog(GetLangText("msgRearmedTraps"), $COLOR_ORANGE) - EndIf - EndIf - - ;Xbow - Local $offColors[3][3] = [[0x8F4B9E, 19, 20], [0xFB5CF4, 70, 7], [0xF0F1EC, 77, 0]]; xbow, elixir, edge - Local $XbowPixel = _MultiPixelSearch($x1, $y1, $x2, $y2, 1, 1, Hex(0xF4F7F0, 6), $offColors, 30) ; button start - If IsArray($XbowPixel) Then - Click($XbowPixel[0] + 20, $XbowPixel[1] + 20) ; Click XbowButton - If _WaitForColor(350, 420, Hex(0xC83B10, 6), 20, 1) Then - Click(515, 400) - If _Sleep(300) Then Return - SetLog(GetLangText("msgRearmedXBow"), $COLOR_ORANGE) - EndIf - EndIf - - ;Inferno - Local $offColors[3][3] = [[0x8D7477, 19, 20], [0x574460, 70, 7], [0xF0F1EC, 77, 0]]; inferno, dark, edge - Local $InfernoPixel = _MultiPixelSearch($x1, $y1, $x2, $y2, 1, 1, Hex(0xF4F7F0, 6), $offColors, 30) - If IsArray($InfernoPixel) Then - Click($InfernoPixel[0] + 20, $InfernoPixel[1] + 20) ; Click InfernoButton - If _WaitForColor(350, 420, Hex(0xC83B10, 6), 20, 1) Then - Click(515, 400) - If _Sleep(300) Then Return - SetLog(GetLangText("msgRearmedInferno"), $COLOR_ORANGE) - EndIf - EndIf - - ClickP($TopLeftClient, 2, 250); Click away twice with 250ms delay -EndFunc ;==>ReArm +;==>ReArm +Func ReArm() + If $ichkTrap = 0 Then Return + + SetLog(GetLangText("msgCheckRearm"), $COLOR_BLUE) + + If $TownHallPos[0] = -1 Then + LocateTownHall() + SaveConfig() + EndIf + + ClickP($TopLeftClient, 2, 250); Click away twice with 250ms delay + Click($TownHallPos[0], $TownHallPos[1]) + _WaitForPixel(240, 581, 484, 583, Hex(0x4084B8, 6), 6, 2) + + Local $x1 = 240, $y1 = 562, $x2 = 670, $y2 = 600 ;Coordinates for button search + + ;Traps + Local $offColors[3][3] = [[0x887d79, 24, 34], [0xF3EC55, 69, 7], [0xECEEE9, 77, 0]] ; 2nd pixel brown wrench, 3rd pixel gold, 4th pixel edge of button + Local $RearmPixel = _MultiPixelSearch($x1, $y1, $x2, $y2, 1, 1, Hex(0xF6F9F2, 6), $offColors, 30) ; first gray/white pixel of button + If IsArray($RearmPixel) Then + Click($RearmPixel[0] + 20, $RearmPixel[1] + 20) ; Click RearmButton + If _WaitForColor(350, 420, Hex(0xC83B10, 6), 20, 1) Then + Click(515, 400) + If _Sleep(300) Then Return + SetLog(GetLangText("msgRearmedTraps"), $COLOR_ORANGE) + EndIf + EndIf + + ;Xbow + Local $offColors[3][3] = [[0x8F4B9E, 19, 20], [0xFB5CF4, 70, 7], [0xF0F1EC, 77, 0]]; xbow, elixir, edge + Local $XbowPixel = _MultiPixelSearch($x1, $y1, $x2, $y2, 1, 1, Hex(0xF4F7F0, 6), $offColors, 30) ; button start + If IsArray($XbowPixel) Then + Click($XbowPixel[0] + 20, $XbowPixel[1] + 20) ; Click XbowButton + If _WaitForColor(350, 420, Hex(0xC83B10, 6), 20, 1) Then + Click(515, 400) + If _Sleep(300) Then Return + SetLog(GetLangText("msgRearmedXBow"), $COLOR_ORANGE) + EndIf + EndIf + + ;Inferno + Local $offColors[3][3] = [[0x8D7477, 19, 20], [0x574460, 70, 7], [0xF0F1EC, 77, 0]]; inferno, dark, edge + Local $InfernoPixel = _MultiPixelSearch($x1, $y1, $x2, $y2, 1, 1, Hex(0xF4F7F0, 6), $offColors, 30) + If IsArray($InfernoPixel) Then + Click($InfernoPixel[0] + 20, $InfernoPixel[1] + 20) ; Click InfernoButton + If _WaitForColor(350, 420, Hex(0xC83B10, 6), 20, 1) Then + Click(515, 400) + If _Sleep(300) Then Return + SetLog(GetLangText("msgRearmedInferno"), $COLOR_ORANGE) + EndIf + EndIf + + ClickP($TopLeftClient, 2, 250); Click away twice with 250ms delay +EndFunc ;==>ReArm diff --git a/COCBot/functions/Village/RequestCC.au3 b/COCBot/functions/Village/RequestCC.au3 index cdad487..9123090 100644 --- a/COCBot/functions/Village/RequestCC.au3 +++ b/COCBot/functions/Village/RequestCC.au3 @@ -1,38 +1,38 @@ -Func RequestCC() - If IsChecked($chkRequest) Then - If $CCPos[0] = "" Then - If Not LocateClanCastle() Then Return - SaveConfig() - If _Sleep(1000) Then Return - EndIf - While 1 - SetLog(GetLangText("msgRequesting"), $COLOR_BLUE) - Click($CCPos[0], $CCPos[1]) - If _Sleep(1000) Then ExitLoop - _CaptureRegion() - $RequestTroop = _PixelSearch(310, 580, 553, 622, Hex(0x608C90, 6), 10) - If IsArray($RequestTroop) Then - Click($RequestTroop[0], $RequestTroop[1]) - If _Sleep(1000) Then ExitLoop - _CaptureRegion() - If _ColorCheck(_GetPixelColor(340, 245), Hex(0xCC4010, 6), 20) Then - If GUICtrlRead($txtRequest) <> "" Then - Click(430, 140) ;Select text for request - If _Sleep(1000) Then ExitLoop - $TextRequest = GUICtrlRead($txtRequest) - ControlSend($Title, "", "", $TextRequest, 0) - EndIf - If _Sleep(1000) Then ExitLoop - Click(524, 228) - ;Click(340, 228) - Else - SetLog(GetLangText("msgRequestAlready"), $COLOR_ORANGE) - Click(1, 1, 2) - EndIf - Else - SetLog(GetLangText("msgCCNotAvail"), $COLOR_RED) - EndIf - ExitLoop - WEnd - EndIf -EndFunc ;==>RequestCC +Func RequestCC() + If IsChecked($chkRequest) Then + If $CCPos[0] = "" Then + If Not LocateClanCastle() Then Return + SaveConfig() + If _Sleep(1000) Then Return + EndIf + While 1 + SetLog(GetLangText("msgRequesting"), $COLOR_BLUE) + Click($CCPos[0], $CCPos[1]) + If _Sleep(1000) Then ExitLoop + _CaptureRegion() + $RequestTroop = _PixelSearch(310, 580, 553, 622, Hex(0x608C90, 6), 10) + If IsArray($RequestTroop) Then + Click($RequestTroop[0], $RequestTroop[1]) + If _Sleep(1000) Then ExitLoop + _CaptureRegion() + If _ColorCheck(_GetPixelColor(340, 245), Hex(0xCC4010, 6), 20) Then + If GUICtrlRead($txtRequest) <> "" Then + Click(430, 140) ;Select text for request + If _Sleep(1000) Then ExitLoop + $TextRequest = GUICtrlRead($txtRequest) + ControlSend($Title, "", "", $TextRequest, 0) + EndIf + If _Sleep(1000) Then ExitLoop + Click(524, 228) + ;Click(340, 228) + Else + SetLog(GetLangText("msgRequestAlready"), $COLOR_ORANGE) + Click(1, 1, 2) + EndIf + Else + SetLog(GetLangText("msgCCNotAvail"), $COLOR_RED) + EndIf + ExitLoop + WEnd + EndIf +EndFunc ;==>RequestCC diff --git a/COCBot/functions/Village/UpgradeBuilding.au3 b/COCBot/functions/Village/UpgradeBuilding.au3 index d94503f..959b61b 100644 --- a/COCBot/functions/Village/UpgradeBuilding.au3 +++ b/COCBot/functions/Village/UpgradeBuilding.au3 @@ -1,326 +1,326 @@ -Func UpgradeBuilding() - $ichkUpgrade1 = GUICtrlRead($chkUpgrade1) - $ichkUpgrade2 = GUICtrlRead($chkUpgrade2) - $ichkUpgrade3 = GUICtrlRead($chkUpgrade3) - If $ichkUpgrade1 = 0 And $ichkUpgrade2 = 0 And $ichkUpgrade3 = 0 Then Return - - If GUICtrlRead($txtUpgradeX1) = "" And GUICtrlRead($txtUpgradeX2) = "" And GUICtrlRead($txtUpgradeX3) = "" Then - SetLog(GetLangText("msgUpgLocNotSet"), $COLOR_RED) - ClickP($TopLeftClient) ; Click Away - Return - EndIf - VillageReport() - If $FreeBuilder = 0 Then - SetLog(GetLangText("msgNoBuilders"), $COLOR_RED) - ClickP($TopLeftClient) ; Click Away - Return - EndIf - - Local $ElixirUpgrade1 = False - Local $ElixirUpgrade2 = False - Local $ElixirUpgrade3 = False - Local $iMinGold = Number(GUICtrlRead($txtWallMinGold)) - Local $iMinElixir = Number(GUICtrlRead($txtWallMinElixir)) - Local $iGoldStorage = Number($GoldCount) - Local $iElixirStorage = Number($ElixirCount) - - ;Upgrade 1 - If $iElixirStorage < $iMinElixir And $iGoldStorage < $iMinGold Then Return - - If $ichkUpgrade1 = 1 Then - SetLog(GetLangText("msgAttemptUpgr") & " 1...") - - If _Sleep(500) Then Return - Click(GUICtrlRead($txtUpgradeX1), GUICtrlRead($txtUpgradeY1)) - If _Sleep(500) Then Return - - Local $ElixirUpgrade = _PixelSearch(300, 560, 629, 583, Hex(0xF759E8, 6), 10) ;Finds Elixir Upgrade Button - Local $GoldUpgrade = _PixelSearch(300, 560, 629, 583, Hex(0xF4EE54, 6), 10) ;Finds Gold Upgrade Button - - If IsArray($ElixirUpgrade) Then - $ElixirUpgrade1 = True - Click($ElixirUpgrade[0], $ElixirUpgrade[1]) ;Click Upgrade Button - If _Sleep(1000) Then Return - Local $UpgradeCheck = _PixelSearch(300, 463, 673, 522, Hex(0xB9E051, 6), 10) ;Confirm Upgrade - If IsArray($UpgradeCheck) Then - Click($UpgradeCheck[0], $UpgradeCheck[1]) ;Click Upgrade Button - If _Sleep(1000) Then Return - _CaptureRegion() - If _ColorCheck(_GetPixelColor(571, 263) <> Hex(0xD90404, 6), 20) Then - SetLog(GetLangText("msgBuilding") & " 1 " & GetLangText("msgUpgradeSuccess"), $COLOR_GREEN) - If _Sleep(1000) Then Return - ClickP($TopLeftClient, 2) - SetLog(GetLangText("msgUnchecking"), $COLOR_GREEN) - GUICtrlSetState($chkUpgrade1, $GUI_UNCHECKED) - Else - SetLog(GetLangText("msgNotEnoughElix"), $COLOR_RED) - ClickP($TopLeftClient, 2) - If $iGoldStorage >= $iMinGold Then - Click(GUICtrlRead($txtUpgradeX1), GUICtrlRead($txtUpgradeY1)) - If _Sleep(500) Then Return - GoldUpgrade1() - ElseIf $iGoldStorage < $iMinGold Then - SetLog(GetLangText("msgGoldLower"), $COLOR_RED) - If _Sleep(1000) Then Return - EndIf - EndIf - EndIf - EndIf - - If IsArray($GoldUpgrade) And Not $ElixirUpgrade1 Then - Click($GoldUpgrade[0], $GoldUpgrade[1]) ;Click Upgrade Button - If _Sleep(1000) Then Return - Local $UpgradeCheck = _PixelSearch(300, 463, 673, 522, Hex(0xB9E051, 6), 10) ;Confirm Upgrade - If IsArray($UpgradeCheck) Then - Click($UpgradeCheck[0], $UpgradeCheck[1]) ;Click Upgrade Button - If _Sleep(1000) Then Return - _CaptureRegion() - If _ColorCheck(_GetPixelColor(571, 263), Hex(0xD90404, 6), 20) Then - SetLog(GetLangText("msgNotEnoughGold"), $COLOR_RED) - ClickP($TopLeftClient, 2) - Else - SetLog(GetLangText("msgBuilding") & " 1 " & GetLangText("msgUpgradeSuccess"), $COLOR_GREEN) - If _Sleep(1000) Then Return - ClickP($TopLeftClient, 2) - SetLog(GetLangText("msgUnchecking"), $COLOR_GREEN) - GUICtrlSetState($chkUpgrade1, $GUI_UNCHECKED) - EndIf - EndIf - EndIf - - VillageReport() - If _Sleep(1000) Then Return - If $FreeBuilder = 0 Then - SetLog(GetLangText("msgNoBuilders"), $COLOR_RED) - ClickP($TopLeftClient) ; Click Away - Return - EndIf - If _Sleep(1000) Then Return - $iGoldStorage = Number($GoldCount) - $iElixirStorage = Number($ElixirCount) - If _Sleep(2000) Then Return - ClickP($TopLeftClient, 2) - EndIf - - If $iElixirStorage < $iMinElixir And $iGoldStorage < $iMinGold Then Return - - ;Upgrade 2 - - If $ichkUpgrade2 = 1 Then - SetLog(GetLangText("msgAttemptUpgr") & " 2...") - - If _Sleep(500) Then Return - Click(GUICtrlRead($txtUpgradeX2), GUICtrlRead($txtUpgradeY2)) - If _Sleep(500) Then Return - - Local $ElixirUpgrade = _PixelSearch(300, 560, 629, 583, Hex(0xF759E8, 6), 10) ;Finds Elixir Upgrade Button - Local $GoldUpgrade = _PixelSearch(300, 560, 629, 583, Hex(0xF4EE54, 6), 10) ;Finds Gold Upgrade Button - - If IsArray($ElixirUpgrade) Then - $ElixirUpgrade2 = True - Click($ElixirUpgrade[0], $ElixirUpgrade[1]) ;Click Upgrade Button - If _Sleep(1000) Then Return - Local $UpgradeCheck = _PixelSearch(300, 463, 673, 522, Hex(0xB9E051, 6), 10) ;Confirm Upgrade - If IsArray($UpgradeCheck) Then - Click($UpgradeCheck[0], $UpgradeCheck[1]) ;Click Upgrade Button - If _Sleep(1000) Then Return - _CaptureRegion() - If _ColorCheck(_GetPixelColor(571, 263) <> Hex(0xD90404, 6), 20) Then - SetLog(GetLangText("msgBuilding") & " 2 " & GetLangText("msgUpgradeSuccess"), $COLOR_GREEN) - If _Sleep(1000) Then Return - ClickP($TopLeftClient, 2) - GUICtrlSetState($chkUpgrade2, $GUI_UNCHECKED) - Else - SetLog(GetLangText("msgNotEnoughElix"), $COLOR_RED) - ClickP($TopLeftClient, 2) - If $iGoldStorage >= $iMinGold Then - Click(GUICtrlRead($txtUpgradeX2), GUICtrlRead($txtUpgradeY2)) - If _Sleep(500) Then Return - GoldUpgrade2() - ElseIf $iGoldStorage < $iMinGold Then - SetLog(GetLangText("msgGoldLower"), $COLOR_RED) - If _Sleep(1000) Then Return - EndIf - EndIf - EndIf - EndIf - - If IsArray($GoldUpgrade) And Not $ElixirUpgrade2 Then - Click($GoldUpgrade[0], $GoldUpgrade[1]) ;Click Upgrade Button - If _Sleep(1000) Then Return - Local $UpgradeCheck = _PixelSearch(300, 463, 673, 522, Hex(0xB9E051, 6), 10) ;Confirm Upgrade - If IsArray($UpgradeCheck) Then - Click($UpgradeCheck[0], $UpgradeCheck[1]) ;Click Upgrade Button - If _Sleep(1000) Then Return - _CaptureRegion() - If _ColorCheck(_GetPixelColor(571, 263), Hex(0xD90404, 6), 20) Then - SetLog(GetLangText("msgNotEnoughGold"), $COLOR_RED) - ClickP($TopLeftClient, 2) - Else - SetLog(GetLangText("msgBuilding") & " 2 " & GetLangText("msgUpgradeSuccess"), $COLOR_GREEN) - If _Sleep(1000) Then Return - ClickP($TopLeftClient, 2) - GUICtrlSetState($chkUpgrade2, $GUI_UNCHECKED) - EndIf - EndIf - EndIf - - VillageReport() - If _Sleep(1000) Then Return - If $FreeBuilder = 0 Then - SetLog(GetLangText("msgNoBuilders"), $COLOR_RED) - ClickP($TopLeftClient) ; Click Away - Return - EndIf - If _Sleep(1000) Then Return - $iGoldStorage = Number($GoldCount) - $iElixirStorage = Number($ElixirCount) - If _Sleep(2000) Then Return - ClickP($TopLeftClient, 2) - EndIf - - If $iElixirStorage < $iMinElixir And $iGoldStorage < $iMinGold Then Return - - ;Upgrade 3 - If $ichkUpgrade3 = 1 Then - SetLog(GetLangText("msgAttemptUpgr") & " 3...") - - If _Sleep(500) Then Return - Click(GUICtrlRead($txtUpgradeX3), GUICtrlRead($txtUpgradeY3)) - If _Sleep(500) Then Return - - Local $ElixirUpgrade = _PixelSearch(300, 560, 629, 583, Hex(0xF759E8, 6), 10) ;Finds Elixir Upgrade Button - Local $GoldUpgrade = _PixelSearch(300, 560, 629, 583, Hex(0xF4EE54, 6), 10) ;Finds Gold Upgrade Button - - If IsArray($ElixirUpgrade) Then - $ElixirUpgrade3 = True - Click($ElixirUpgrade[0], $ElixirUpgrade[1]) ;Click Upgrade Button - If _Sleep(1000) Then Return - Local $UpgradeCheck = _PixelSearch(300, 463, 673, 522, Hex(0xB9E051, 6), 10) ;Confirm Upgrade - If IsArray($UpgradeCheck) Then - Click($UpgradeCheck[0], $UpgradeCheck[1]) ;Click Upgrade Button - If _Sleep(1000) Then Return - _CaptureRegion() - If _ColorCheck(_GetPixelColor(571, 263) <> Hex(0xD90404, 6), 20) Then - SetLog(GetLangText("msgBuilding") & " 3 " & GetLangText("msgUpgradeSuccess"), $COLOR_GREEN) - If _Sleep(1000) Then Return - ClickP($TopLeftClient, 2) - GUICtrlSetState($chkUpgrade3, $GUI_UNCHECKED) - Else - SetLog(GetLangText("msgNotEnoughElix"), $COLOR_RED) - ClickP($TopLeftClient, 2) - If $iGoldStorage >= $iMinGold Then - Click(GUICtrlRead($txtUpgradeX3), GUICtrlRead($txtUpgradeY3)) - If _Sleep(500) Then Return - GoldUpgrade3() - ElseIf $iGoldStorage < $iMinGold Then - SetLog(GetLangText("msgGoldLower"), $COLOR_RED) - If _Sleep(1000) Then Return - EndIf - EndIf - EndIf - EndIf - - If IsArray($GoldUpgrade) And Not $ElixirUpgrade3 Then - Click($GoldUpgrade[0], $GoldUpgrade[1]) ;Click Upgrade Button - If _Sleep(1000) Then Return - Local $UpgradeCheck = _PixelSearch(300, 463, 673, 522, Hex(0xB9E051, 6), 10) ;Confirm Upgrade - If IsArray($UpgradeCheck) Then - Click($UpgradeCheck[0], $UpgradeCheck[1]) ;Click Upgrade Button - If _Sleep(1000) Then Return - _CaptureRegion() - If _ColorCheck(_GetPixelColor(571, 263), Hex(0xD90404, 6), 20) Then - SetLog(GetLangText("msgNotEnoughGold"), $COLOR_RED) - ClickP($TopLeftClient, 2) - Else - SetLog(GetLangText("msgBuilding") & " 3 " & GetLangText("msgUpgradeSuccess"), $COLOR_GREEN) - If _Sleep(1000) Then Return - ClickP($TopLeftClient, 2) - GUICtrlSetState($chkUpgrade3, $GUI_UNCHECKED) - EndIf - EndIf - EndIf - - VillageReport() - If _Sleep(1000) Then Return - If $FreeBuilder = 0 Then - SetLog(GetLangText("msgNoBuilders"), $COLOR_RED) - ClickP($TopLeftClient) ; Click Away - Return - EndIf - If _Sleep(1000) Then Return - $iGoldStorage = Number($GoldCount) - $iElixirStorage = Number($ElixirCount) - If _Sleep(2000) Then Return - ClickP($TopLeftClient, 2) - EndIf -EndFunc ;==>UpgradeBuilding - -Func GoldUpgrade1() - Local $GoldUpgrade = _PixelSearch(300, 560, 629, 583, Hex(0xF4EE54, 6), 10) ;Finds Gold Upgrade Button - If IsArray($GoldUpgrade) Then - Click($GoldUpgrade[0], $GoldUpgrade[1]) ;Click Upgrade Button - If _Sleep(1000) Then Return - Local $UpgradeCheck = _PixelSearch(300, 463, 673, 522, Hex(0xB9E051, 6), 10) ;Confirm Upgrade - If IsArray($UpgradeCheck) Then - Click($UpgradeCheck[0], $UpgradeCheck[1]) ;Click Upgrade Button - If _Sleep(1000) Then Return - _CaptureRegion() - If _ColorCheck(_GetPixelColor(571, 263), Hex(0xD90404, 6), 20) Then - SetLog(GetLangText("msgNotEnoughGold"), $COLOR_RED) - ClickP($TopLeftClient, 2) - Else - SetLog(GetLangText("msgBuilding") & " 1 " & GetLangText("msgUpgradeSuccess"), $COLOR_GREEN) - If _Sleep(1000) Then Return - ClickP($TopLeftClient, 2) - GUICtrlSetState($chkUpgrade1, $GUI_UNCHECKED) - EndIf - EndIf - EndIf -EndFunc ;==>GoldUpgrade1 - -Func GoldUpgrade2() - Local $GoldUpgrade = _PixelSearch(300, 560, 629, 583, Hex(0xF4EE54, 6), 10) ;Finds Gold Upgrade Button - If IsArray($GoldUpgrade) Then - Click($GoldUpgrade[0], $GoldUpgrade[1]) ;Click Upgrade Button - If _Sleep(1000) Then Return - Local $UpgradeCheck = _PixelSearch(300, 463, 673, 522, Hex(0xB9E051, 6), 10) ;Confirm Upgrade - If IsArray($UpgradeCheck) Then - Click($UpgradeCheck[0], $UpgradeCheck[1]) ;Click Upgrade Button - If _Sleep(1000) Then Return - _CaptureRegion() - If _ColorCheck(_GetPixelColor(571, 263), Hex(0xD90404, 6), 20) Then - SetLog(GetLangText("msgNotEnoughGold"), $COLOR_RED) - ClickP($TopLeftClient, 2) - Else - SetLog(GetLangText("msgBuilding") & " 2 " & GetLangText("msgUpgradeSuccess"), $COLOR_GREEN) - If _Sleep(1000) Then Return - ClickP($TopLeftClient, 2) - GUICtrlSetState($chkUpgrade2, $GUI_UNCHECKED) - EndIf - EndIf - EndIf -EndFunc ;==>GoldUpgrade2 - -Func GoldUpgrade3() - Local $GoldUpgrade = _PixelSearch(300, 560, 629, 583, Hex(0xF4EE54, 6), 10) ;Finds Gold Upgrade Button - If IsArray($GoldUpgrade) Then - Click($GoldUpgrade[0], $GoldUpgrade[1]) ;Click Upgrade Button - If _Sleep(1000) Then Return - Local $UpgradeCheck = _PixelSearch(300, 463, 673, 522, Hex(0xB9E051, 6), 10) ;Confirm Upgrade - If IsArray($UpgradeCheck) Then - Click($UpgradeCheck[0], $UpgradeCheck[1]) ;Click Upgrade Button - If _Sleep(1000) Then Return - _CaptureRegion() - If _ColorCheck(_GetPixelColor(571, 263), Hex(0xD90404, 6), 20) Then - SetLog(GetLangText("msgNotEnoughGold"), $COLOR_RED) - ClickP($TopLeftClient, 2) - Else - SetLog(GetLangText("msgBuilding") & " 3 " & GetLangText("msgUpgradeSuccess"), $COLOR_GREEN) - If _Sleep(1000) Then Return - ClickP($TopLeftClient, 2) - GUICtrlSetState($chkUpgrade3, $GUI_UNCHECKED) - EndIf - EndIf - EndIf -EndFunc ;==>GoldUpgrade3 +Func UpgradeBuilding() + $ichkUpgrade1 = GUICtrlRead($chkUpgrade1) + $ichkUpgrade2 = GUICtrlRead($chkUpgrade2) + $ichkUpgrade3 = GUICtrlRead($chkUpgrade3) + If $ichkUpgrade1 = 0 And $ichkUpgrade2 = 0 And $ichkUpgrade3 = 0 Then Return + + If GUICtrlRead($txtUpgradeX1) = "" And GUICtrlRead($txtUpgradeX2) = "" And GUICtrlRead($txtUpgradeX3) = "" Then + SetLog(GetLangText("msgUpgLocNotSet"), $COLOR_RED) + ClickP($TopLeftClient) ; Click Away + Return + EndIf + VillageReport() + If $FreeBuilder = 0 Then + SetLog(GetLangText("msgNoBuilders"), $COLOR_RED) + ClickP($TopLeftClient) ; Click Away + Return + EndIf + + Local $ElixirUpgrade1 = False + Local $ElixirUpgrade2 = False + Local $ElixirUpgrade3 = False + Local $iMinGold = Number(GUICtrlRead($txtWallMinGold)) + Local $iMinElixir = Number(GUICtrlRead($txtWallMinElixir)) + Local $iGoldStorage = Number($GoldCount) + Local $iElixirStorage = Number($ElixirCount) + + ;Upgrade 1 + If $iElixirStorage < $iMinElixir And $iGoldStorage < $iMinGold Then Return + + If $ichkUpgrade1 = 1 Then + SetLog(GetLangText("msgAttemptUpgr") & " 1...") + + If _Sleep(500) Then Return + Click(GUICtrlRead($txtUpgradeX1), GUICtrlRead($txtUpgradeY1)) + If _Sleep(500) Then Return + + Local $ElixirUpgrade = _PixelSearch(300, 560, 629, 583, Hex(0xF759E8, 6), 10) ;Finds Elixir Upgrade Button + Local $GoldUpgrade = _PixelSearch(300, 560, 629, 583, Hex(0xF4EE54, 6), 10) ;Finds Gold Upgrade Button + + If IsArray($ElixirUpgrade) Then + $ElixirUpgrade1 = True + Click($ElixirUpgrade[0], $ElixirUpgrade[1]) ;Click Upgrade Button + If _Sleep(1000) Then Return + Local $UpgradeCheck = _PixelSearch(300, 463, 673, 522, Hex(0xB9E051, 6), 10) ;Confirm Upgrade + If IsArray($UpgradeCheck) Then + Click($UpgradeCheck[0], $UpgradeCheck[1]) ;Click Upgrade Button + If _Sleep(1000) Then Return + _CaptureRegion() + If _ColorCheck(_GetPixelColor(571, 263) <> Hex(0xD90404, 6), 20) Then + SetLog(GetLangText("msgBuilding") & " 1 " & GetLangText("msgUpgradeSuccess"), $COLOR_GREEN) + If _Sleep(1000) Then Return + ClickP($TopLeftClient, 2) + SetLog(GetLangText("msgUnchecking"), $COLOR_GREEN) + GUICtrlSetState($chkUpgrade1, $GUI_UNCHECKED) + Else + SetLog(GetLangText("msgNotEnoughElix"), $COLOR_RED) + ClickP($TopLeftClient, 2) + If $iGoldStorage >= $iMinGold Then + Click(GUICtrlRead($txtUpgradeX1), GUICtrlRead($txtUpgradeY1)) + If _Sleep(500) Then Return + GoldUpgrade1() + ElseIf $iGoldStorage < $iMinGold Then + SetLog(GetLangText("msgGoldLower"), $COLOR_RED) + If _Sleep(1000) Then Return + EndIf + EndIf + EndIf + EndIf + + If IsArray($GoldUpgrade) And Not $ElixirUpgrade1 Then + Click($GoldUpgrade[0], $GoldUpgrade[1]) ;Click Upgrade Button + If _Sleep(1000) Then Return + Local $UpgradeCheck = _PixelSearch(300, 463, 673, 522, Hex(0xB9E051, 6), 10) ;Confirm Upgrade + If IsArray($UpgradeCheck) Then + Click($UpgradeCheck[0], $UpgradeCheck[1]) ;Click Upgrade Button + If _Sleep(1000) Then Return + _CaptureRegion() + If _ColorCheck(_GetPixelColor(571, 263), Hex(0xD90404, 6), 20) Then + SetLog(GetLangText("msgNotEnoughGold"), $COLOR_RED) + ClickP($TopLeftClient, 2) + Else + SetLog(GetLangText("msgBuilding") & " 1 " & GetLangText("msgUpgradeSuccess"), $COLOR_GREEN) + If _Sleep(1000) Then Return + ClickP($TopLeftClient, 2) + SetLog(GetLangText("msgUnchecking"), $COLOR_GREEN) + GUICtrlSetState($chkUpgrade1, $GUI_UNCHECKED) + EndIf + EndIf + EndIf + + VillageReport() + If _Sleep(1000) Then Return + If $FreeBuilder = 0 Then + SetLog(GetLangText("msgNoBuilders"), $COLOR_RED) + ClickP($TopLeftClient) ; Click Away + Return + EndIf + If _Sleep(1000) Then Return + $iGoldStorage = Number($GoldCount) + $iElixirStorage = Number($ElixirCount) + If _Sleep(2000) Then Return + ClickP($TopLeftClient, 2) + EndIf + + If $iElixirStorage < $iMinElixir And $iGoldStorage < $iMinGold Then Return + + ;Upgrade 2 + + If $ichkUpgrade2 = 1 Then + SetLog(GetLangText("msgAttemptUpgr") & " 2...") + + If _Sleep(500) Then Return + Click(GUICtrlRead($txtUpgradeX2), GUICtrlRead($txtUpgradeY2)) + If _Sleep(500) Then Return + + Local $ElixirUpgrade = _PixelSearch(300, 560, 629, 583, Hex(0xF759E8, 6), 10) ;Finds Elixir Upgrade Button + Local $GoldUpgrade = _PixelSearch(300, 560, 629, 583, Hex(0xF4EE54, 6), 10) ;Finds Gold Upgrade Button + + If IsArray($ElixirUpgrade) Then + $ElixirUpgrade2 = True + Click($ElixirUpgrade[0], $ElixirUpgrade[1]) ;Click Upgrade Button + If _Sleep(1000) Then Return + Local $UpgradeCheck = _PixelSearch(300, 463, 673, 522, Hex(0xB9E051, 6), 10) ;Confirm Upgrade + If IsArray($UpgradeCheck) Then + Click($UpgradeCheck[0], $UpgradeCheck[1]) ;Click Upgrade Button + If _Sleep(1000) Then Return + _CaptureRegion() + If _ColorCheck(_GetPixelColor(571, 263) <> Hex(0xD90404, 6), 20) Then + SetLog(GetLangText("msgBuilding") & " 2 " & GetLangText("msgUpgradeSuccess"), $COLOR_GREEN) + If _Sleep(1000) Then Return + ClickP($TopLeftClient, 2) + GUICtrlSetState($chkUpgrade2, $GUI_UNCHECKED) + Else + SetLog(GetLangText("msgNotEnoughElix"), $COLOR_RED) + ClickP($TopLeftClient, 2) + If $iGoldStorage >= $iMinGold Then + Click(GUICtrlRead($txtUpgradeX2), GUICtrlRead($txtUpgradeY2)) + If _Sleep(500) Then Return + GoldUpgrade2() + ElseIf $iGoldStorage < $iMinGold Then + SetLog(GetLangText("msgGoldLower"), $COLOR_RED) + If _Sleep(1000) Then Return + EndIf + EndIf + EndIf + EndIf + + If IsArray($GoldUpgrade) And Not $ElixirUpgrade2 Then + Click($GoldUpgrade[0], $GoldUpgrade[1]) ;Click Upgrade Button + If _Sleep(1000) Then Return + Local $UpgradeCheck = _PixelSearch(300, 463, 673, 522, Hex(0xB9E051, 6), 10) ;Confirm Upgrade + If IsArray($UpgradeCheck) Then + Click($UpgradeCheck[0], $UpgradeCheck[1]) ;Click Upgrade Button + If _Sleep(1000) Then Return + _CaptureRegion() + If _ColorCheck(_GetPixelColor(571, 263), Hex(0xD90404, 6), 20) Then + SetLog(GetLangText("msgNotEnoughGold"), $COLOR_RED) + ClickP($TopLeftClient, 2) + Else + SetLog(GetLangText("msgBuilding") & " 2 " & GetLangText("msgUpgradeSuccess"), $COLOR_GREEN) + If _Sleep(1000) Then Return + ClickP($TopLeftClient, 2) + GUICtrlSetState($chkUpgrade2, $GUI_UNCHECKED) + EndIf + EndIf + EndIf + + VillageReport() + If _Sleep(1000) Then Return + If $FreeBuilder = 0 Then + SetLog(GetLangText("msgNoBuilders"), $COLOR_RED) + ClickP($TopLeftClient) ; Click Away + Return + EndIf + If _Sleep(1000) Then Return + $iGoldStorage = Number($GoldCount) + $iElixirStorage = Number($ElixirCount) + If _Sleep(2000) Then Return + ClickP($TopLeftClient, 2) + EndIf + + If $iElixirStorage < $iMinElixir And $iGoldStorage < $iMinGold Then Return + + ;Upgrade 3 + If $ichkUpgrade3 = 1 Then + SetLog(GetLangText("msgAttemptUpgr") & " 3...") + + If _Sleep(500) Then Return + Click(GUICtrlRead($txtUpgradeX3), GUICtrlRead($txtUpgradeY3)) + If _Sleep(500) Then Return + + Local $ElixirUpgrade = _PixelSearch(300, 560, 629, 583, Hex(0xF759E8, 6), 10) ;Finds Elixir Upgrade Button + Local $GoldUpgrade = _PixelSearch(300, 560, 629, 583, Hex(0xF4EE54, 6), 10) ;Finds Gold Upgrade Button + + If IsArray($ElixirUpgrade) Then + $ElixirUpgrade3 = True + Click($ElixirUpgrade[0], $ElixirUpgrade[1]) ;Click Upgrade Button + If _Sleep(1000) Then Return + Local $UpgradeCheck = _PixelSearch(300, 463, 673, 522, Hex(0xB9E051, 6), 10) ;Confirm Upgrade + If IsArray($UpgradeCheck) Then + Click($UpgradeCheck[0], $UpgradeCheck[1]) ;Click Upgrade Button + If _Sleep(1000) Then Return + _CaptureRegion() + If _ColorCheck(_GetPixelColor(571, 263) <> Hex(0xD90404, 6), 20) Then + SetLog(GetLangText("msgBuilding") & " 3 " & GetLangText("msgUpgradeSuccess"), $COLOR_GREEN) + If _Sleep(1000) Then Return + ClickP($TopLeftClient, 2) + GUICtrlSetState($chkUpgrade3, $GUI_UNCHECKED) + Else + SetLog(GetLangText("msgNotEnoughElix"), $COLOR_RED) + ClickP($TopLeftClient, 2) + If $iGoldStorage >= $iMinGold Then + Click(GUICtrlRead($txtUpgradeX3), GUICtrlRead($txtUpgradeY3)) + If _Sleep(500) Then Return + GoldUpgrade3() + ElseIf $iGoldStorage < $iMinGold Then + SetLog(GetLangText("msgGoldLower"), $COLOR_RED) + If _Sleep(1000) Then Return + EndIf + EndIf + EndIf + EndIf + + If IsArray($GoldUpgrade) And Not $ElixirUpgrade3 Then + Click($GoldUpgrade[0], $GoldUpgrade[1]) ;Click Upgrade Button + If _Sleep(1000) Then Return + Local $UpgradeCheck = _PixelSearch(300, 463, 673, 522, Hex(0xB9E051, 6), 10) ;Confirm Upgrade + If IsArray($UpgradeCheck) Then + Click($UpgradeCheck[0], $UpgradeCheck[1]) ;Click Upgrade Button + If _Sleep(1000) Then Return + _CaptureRegion() + If _ColorCheck(_GetPixelColor(571, 263), Hex(0xD90404, 6), 20) Then + SetLog(GetLangText("msgNotEnoughGold"), $COLOR_RED) + ClickP($TopLeftClient, 2) + Else + SetLog(GetLangText("msgBuilding") & " 3 " & GetLangText("msgUpgradeSuccess"), $COLOR_GREEN) + If _Sleep(1000) Then Return + ClickP($TopLeftClient, 2) + GUICtrlSetState($chkUpgrade3, $GUI_UNCHECKED) + EndIf + EndIf + EndIf + + VillageReport() + If _Sleep(1000) Then Return + If $FreeBuilder = 0 Then + SetLog(GetLangText("msgNoBuilders"), $COLOR_RED) + ClickP($TopLeftClient) ; Click Away + Return + EndIf + If _Sleep(1000) Then Return + $iGoldStorage = Number($GoldCount) + $iElixirStorage = Number($ElixirCount) + If _Sleep(2000) Then Return + ClickP($TopLeftClient, 2) + EndIf +EndFunc ;==>UpgradeBuilding + +Func GoldUpgrade1() + Local $GoldUpgrade = _PixelSearch(300, 560, 629, 583, Hex(0xF4EE54, 6), 10) ;Finds Gold Upgrade Button + If IsArray($GoldUpgrade) Then + Click($GoldUpgrade[0], $GoldUpgrade[1]) ;Click Upgrade Button + If _Sleep(1000) Then Return + Local $UpgradeCheck = _PixelSearch(300, 463, 673, 522, Hex(0xB9E051, 6), 10) ;Confirm Upgrade + If IsArray($UpgradeCheck) Then + Click($UpgradeCheck[0], $UpgradeCheck[1]) ;Click Upgrade Button + If _Sleep(1000) Then Return + _CaptureRegion() + If _ColorCheck(_GetPixelColor(571, 263), Hex(0xD90404, 6), 20) Then + SetLog(GetLangText("msgNotEnoughGold"), $COLOR_RED) + ClickP($TopLeftClient, 2) + Else + SetLog(GetLangText("msgBuilding") & " 1 " & GetLangText("msgUpgradeSuccess"), $COLOR_GREEN) + If _Sleep(1000) Then Return + ClickP($TopLeftClient, 2) + GUICtrlSetState($chkUpgrade1, $GUI_UNCHECKED) + EndIf + EndIf + EndIf +EndFunc ;==>GoldUpgrade1 + +Func GoldUpgrade2() + Local $GoldUpgrade = _PixelSearch(300, 560, 629, 583, Hex(0xF4EE54, 6), 10) ;Finds Gold Upgrade Button + If IsArray($GoldUpgrade) Then + Click($GoldUpgrade[0], $GoldUpgrade[1]) ;Click Upgrade Button + If _Sleep(1000) Then Return + Local $UpgradeCheck = _PixelSearch(300, 463, 673, 522, Hex(0xB9E051, 6), 10) ;Confirm Upgrade + If IsArray($UpgradeCheck) Then + Click($UpgradeCheck[0], $UpgradeCheck[1]) ;Click Upgrade Button + If _Sleep(1000) Then Return + _CaptureRegion() + If _ColorCheck(_GetPixelColor(571, 263), Hex(0xD90404, 6), 20) Then + SetLog(GetLangText("msgNotEnoughGold"), $COLOR_RED) + ClickP($TopLeftClient, 2) + Else + SetLog(GetLangText("msgBuilding") & " 2 " & GetLangText("msgUpgradeSuccess"), $COLOR_GREEN) + If _Sleep(1000) Then Return + ClickP($TopLeftClient, 2) + GUICtrlSetState($chkUpgrade2, $GUI_UNCHECKED) + EndIf + EndIf + EndIf +EndFunc ;==>GoldUpgrade2 + +Func GoldUpgrade3() + Local $GoldUpgrade = _PixelSearch(300, 560, 629, 583, Hex(0xF4EE54, 6), 10) ;Finds Gold Upgrade Button + If IsArray($GoldUpgrade) Then + Click($GoldUpgrade[0], $GoldUpgrade[1]) ;Click Upgrade Button + If _Sleep(1000) Then Return + Local $UpgradeCheck = _PixelSearch(300, 463, 673, 522, Hex(0xB9E051, 6), 10) ;Confirm Upgrade + If IsArray($UpgradeCheck) Then + Click($UpgradeCheck[0], $UpgradeCheck[1]) ;Click Upgrade Button + If _Sleep(1000) Then Return + _CaptureRegion() + If _ColorCheck(_GetPixelColor(571, 263), Hex(0xD90404, 6), 20) Then + SetLog(GetLangText("msgNotEnoughGold"), $COLOR_RED) + ClickP($TopLeftClient, 2) + Else + SetLog(GetLangText("msgBuilding") & " 3 " & GetLangText("msgUpgradeSuccess"), $COLOR_GREEN) + If _Sleep(1000) Then Return + ClickP($TopLeftClient, 2) + GUICtrlSetState($chkUpgrade3, $GUI_UNCHECKED) + EndIf + EndIf + EndIf +EndFunc ;==>GoldUpgrade3 diff --git a/COCBot/functions/Village/UpgradeHeroes.au3 b/COCBot/functions/Village/UpgradeHeroes.au3 new file mode 100755 index 0000000..5646386 --- /dev/null +++ b/COCBot/functions/Village/UpgradeHeroes.au3 @@ -0,0 +1,172 @@ +; #FUNCTION# ==================================================================================================================== +; Name ..........: Upgrade Heroes +; Description ...: This file includes functions to upgrade heroes +; Author ........: Bunana123@obudu (2015) +; =============================================================================================================================== +Func UpgradeHeroes() +If $ichkUpgradeKing = 0 And $ichkUpgradeQueen = 0 Then Return + + $FreeBuilder = ReadText(320, 23, 41, $textMainScreen) + Setlog(GetLangText("msgNumFreeBuild") & $FreeBuilder, $COLOR_GREEN) + GUICtrlSetData($lblfreebuilder, $FreeBuilder) + If $FreeBuilder < $itxtKeepFreeBuilder+1 Then + SetLog(GetLangText("msgFreeBuilder"), $COLOR_RED) + Return + EndIf +;upgradequeen + If $ichkUpgradeQueen = 1 Then + If $QueenPos[0] = "" Then + LocateQueenAltar() + SaveConfig() + If _Sleep(500) Then Return + ClickP($TopLeftClient) ;Click Away + EndIf + + SetLog(GetLangText("msgUpgradeQueen")) + Click($QueenPos[0], $QueenPos[1]) ;Click Queen Altar + If _Sleep(500) Then Return + _CaptureRegion() + If _ColorCheck(_GetPixelColor(605, 570), Hex(0xD8EC71, 6), 20) Then ; Finds Heal button + QueenUpgrade() + ElseIf _ColorCheck(_GetPixelColor(595, 570), Hex(0xE70A12, 6), 20) Then ; Red numbers + SetLog(GetLangText("msgNotEnoughDEAQ"), $COLOR_ORANGE) + If _Sleep(1000) Then Return + ClickP($TopLeftClient, 2) + Else + If _ColorCheck(_GetPixelColor(554, 570), Hex(0xC8EE6A, 6), 20) Then ; Green color + SetLog(GetLangText("msgQueenUpgrading"), $COLOR_ORANGE) + If _Sleep(1000) Then Return + ClickP($TopLeftClient, 2) + Else + Click(604, 592) ;Click Upgrade Button + If _Sleep(2000) Then Return + Click(578, 512) ;Click Confirm Button + If _Sleep(500) Then Return + _CaptureRegion() + If _ColorCheck(_GetPixelColor(743, 152), Hex(0xE51016, 6), 20) Then ;red arrow + SetLog(GetLangText("msgHeroesMaxLvl"), $COLOR_RED) + ClickP($TopLeftClient) ; Click Away + GUICtrlSetState($chkUpgradeQueen, $GUI_UNCHECKED) + If _Sleep(500) Then Return + Else + SetLog(GetLangText("msgQueenUpgraded"), $COLOR_BLUE) + ClickP($TopLeftClient, 2) + EndIf + EndIf + EndIf + + $FreeBuilder = ReadText(320, 23, 41, $textMainScreen) + Setlog(GetLangText("msgNumFreeBuild") & $FreeBuilder, $COLOR_GREEN) + GUICtrlSetData($lblfreebuilder, $FreeBuilder) + If _Sleep(1000) Then Return + If $FreeBuilder < $itxtKeepFreeBuilder+1 Then + SetLog(GetLangText("msgFreeBuilder"), $COLOR_RED) + ClickP($TopLeftClient) ; Click Away + Return + EndIf + ClickP($TopLeftClient, 2) + EndIf + +;upgradeking + If $ichkUpgradeKing = 1 Then + If $KingPos[0] = "" Then + LocateKingAltar() + SaveConfig() + If _Sleep(500) Then Return + ClickP($TopLeftClient) ;Click Away + EndIf + SetLog(GetLangText("msgUpgradeKing")) + Click($KingPos[0], $KingPos[1]) ;Click King Altar + If _Sleep(500) Then Return + _CaptureRegion() + If _ColorCheck(_GetPixelColor(605, 570), Hex(0xD8EC71, 6), 20) Then ; Finds Heal button + KingUpgrade() + ElseIf _ColorCheck(_GetPixelColor(595, 570), Hex(0xE70A12, 6), 20) Then ; Red numbers + SetLog(GetLangText("msgNotEnoughDEK"), $COLOR_ORANGE) + If _Sleep(1000) Then Return + ClickP($TopLeftClient, 2) + Else + If _ColorCheck(_GetPixelColor(554, 570), Hex(0xC8EE6A, 6), 20) Then ; Green color + SetLog(GetLangText("msgKingUpgrading"), $COLOR_ORANGE) + If _Sleep(1000) Then Return + ClickP($TopLeftClient, 2) + Else + Click(604, 592) ;Click Upgrade Button + If _Sleep(2000) Then Return + Click(578, 512) ;Click Confirm Button + If _Sleep(500) Then Return + _CaptureRegion() + If _ColorCheck(_GetPixelColor(743, 152), Hex(0xE51016, 6), 20) Then ;red arrow + SetLog(GetLangText("msgHeroesMaxLvl"), $COLOR_RED) + ClickP($TopLeftClient) ; Click Away + GUICtrlSetState($chkUpgradeKing, $GUI_UNCHECKED) + If _Sleep(500) Then Return + Else + SetLog(GetLangText("msgKingUpgraded"), $COLOR_BLUE) + ClickP($TopLeftClient, 2) + EndIf + EndIf + EndIf + + $FreeBuilder = ReadText(320, 23, 41, $textMainScreen) + Setlog(GetLangText("msgNumFreeBuild") & $FreeBuilder, $COLOR_GREEN) + GUICtrlSetData($lblfreebuilder, $FreeBuilder) + If _Sleep(1000) Then Return + If $FreeBuilder < $itxtKeepFreeBuilder+1 Then + SetLog(GetLangText("msgFreeBuilder"), $COLOR_RED) + ClickP($TopLeftClient) ; Click Away + Return + EndIf + ClickP($TopLeftClient, 2) + EndIf +EndFunc + +Func KingUpgrade() +_CaptureRegion() +If _ColorCheck(_GetPixelColor(501, 570), Hex(0xE70A12, 6), 20) Then ; Red numbers + SetLog(GetLangText("msgNotEnoughDEK"), $COLOR_ORANGE) + If _Sleep(1000) Then Return + ClickP($TopLeftClient, 2) +Else + Click(504, 592) ;Click Upgrade Button + If _Sleep(2000) Then Return + Click(578, 512) ;Click Confirm Button + If _Sleep(500) Then Return + _CaptureRegion() + If _ColorCheck(_GetPixelColor(743, 152), Hex(0xE51016, 6), 20) Then ;red arrow + SetLog(GetLangText("msgHeroesMaxLvl"), $COLOR_RED) + ClickP($TopLeftClient) ; Click Away + GUICtrlSetState($chkUpgradeKing, $GUI_UNCHECKED) + If _Sleep(500) Then Return + Else + SetLog(GetLangText("msgKingUpgraded"), $COLOR_BLUE) + If _Sleep(1000) Then Return + ClickP($TopLeftClient, 2) + EndIf +EndIf +EndFunc + +Func QueenUpgrade() +_CaptureRegion() +If _ColorCheck(_GetPixelColor(501, 570), Hex(0xE70A12, 6), 20) Then ; Red numbers + SetLog(GetLangText("msgNotEnoughDEAQ"), $COLOR_ORANGE) + If _Sleep(1000) Then Return + ClickP($TopLeftClient, 2) +Else + Click(504, 592) ;Click Upgrade Button + If _Sleep(2000) Then Return + Click(578, 512) ;Click Confirm Button + If _Sleep(500) Then Return + _CaptureRegion() + If _ColorCheck(_GetPixelColor(743, 152), Hex(0xE51016, 6), 20) Then ;red arrow + SetLog(GetLangText("msgHeroesMaxLvl"), $COLOR_RED) + ClickP($TopLeftClient) ; Click Away + GUICtrlSetState($chkUpgradeKing, $GUI_UNCHECKED) + If _Sleep(500) Then Return + Else + SetLog(GetLangText("msgQueenUpgraded"), $COLOR_BLUE) + If _Sleep(1000) Then Return + ClickP($TopLeftClient, 2) + EndIf +EndIf +EndFunc \ No newline at end of file diff --git a/COCBot/functions/Village/UpgradeWall.au3 b/COCBot/functions/Village/UpgradeWall.au3 index 42fef5f..fe402cf 100644 --- a/COCBot/functions/Village/UpgradeWall.au3 +++ b/COCBot/functions/Village/UpgradeWall.au3 @@ -1,145 +1,145 @@ -Global $wallbuild -Global $walllowlevel - -Func UpgradeWall() - If Not IsChecked($chkWalls) Then Return - - VillageReport() - SetLog(GetLangText("msgCheckWalls")) - $itxtWallMinGold = GUICtrlRead($txtWallMinGold) - $itxtWallMinElixir = GUICtrlRead($txtWallMinElixir) - Local $MinWallGold = Number($GoldCount) > Number($itxtWallMinGold) - Local $MinWallElixir = Number($ElixirCount) > Number($itxtWallMinElixir) - - If IsChecked($UseGold) Then - $iUseStorage = 1 - ElseIf IsChecked($UseElixir) Then - $iUseStorage = 2 - ElseIf IsChecked($UseGoldElix) Then - $iUseStorage = 3 - EndIf - - Switch $iUseStorage - Case 1 - If $MinWallGold Then - SetLog(GetLangText("msgWallUpGold"), $COLOR_BLUE) - UpgradeWallGold() - Return True - Else - SetLog(GetLangText("msgGoldBelowMin"), $COLOR_RED) - EndIf - Case 2 - If $MinWallElixir Then - Setlog(GetLangText("msgWallUpElix"), $COLOR_BLUE) - UpgradeWallelix() - Return True - Else - Setlog(GetLangText("msgElixBelowMin"), $COLOR_BLUE) - EndIf - Case 3 - If $MinWallGold Then - SetLog(GetLangText("msgWallUpGold"), $COLOR_BLUE) - UpgradeWallGold() - If $wallbuild = 0 And $walllowlevel = 0 Then - SetLog(GetLangText("msgWallNoGoldElixir"), $COLOR_BLUE) - ;UpgradeWallElix() - EndIf - Else - SetLog(GetLangText("msgWallLowGoldElixir"), $COLOR_RED) - EndIf - - ;Do upgrade using Elixir - If $walllowlevel = 0 Then - If $MinWallElixir Then - UpgradeWallelix() - Else - Setlog(GetLangText("msgElixBelowMin"), $COLOR_BLUE) - EndIf - Else - SetLog(GetLangText("msgWallLowerLvl"), $COLOR_BLUE) - EndIf - - EndSwitch -EndFunc ;==>UpgradeWall - - -Func UpgradeWallelix() - If $FreeBuilder = 0 Then - SetLog(GetLangText("msgNoBuilders"), $COLOR_RED) - Click(1, 1) ; Click Away - Return - EndIf - - checkWall() - If $checkwalllogic Then - Click(1, 1) ; Click Away - _Sleep(600) - Click($WallX, $WallY) - _Sleep(600) - _CaptureRegion() - If _ColorCheck(_GetPixelColor(595, 568), Hex(0xFFFFFF, 6), 20) = False Then - SetLog(GetLangText("msgWallElixorLvl"), $COLOR_ORANGE) - Click(1, 1) ; Click away - _Sleep(1000) - Else - Click(560, 599) ; Click Upgrade - _Sleep(2000) - Click(472, 482) ; Click Okay - SetLog(GetLangText("msgWallUpDone"), $COLOR_BLUE) ; Done upgrade - GUICtrlSetData($lblwallupgradecount, GUICtrlRead($lblwallupgradecount) + 1) - Click(1, 1) ; Click away - _Sleep(1000) - EndIf - EndIf - Click(1, 1) ; Click Away -EndFunc ;==>UpgradeWallelix - - -Func UpgradeWallGold() - If $FreeBuilder = 0 Then - SetLog(GetLangText("msgNoBuilders"), $COLOR_RED) - Click(1, 1) ; Click Away - Return - EndIf - - checkWall() - If $checkwalllogic Then - Click(1, 1) ; Click Away - _Sleep(600) - Click($WallX, $WallY) - _Sleep(600) - _CaptureRegion() - If _ColorCheck(_GetPixelColor(523, 641), Hex(0x000000, 6), 20) = False Then ; checking wall level high than level 8 - $walllowlevel = 0 - If Not _ColorCheck(_GetPixelColor(500, 570), Hex(0xFEFEFE, 6), 20) Then - SetLog(GetLangText("msgWallNotEnoughGold"), $COLOR_ORANGE) - Click(1, 1) ; Click Away - $wallbuild = 0 - Else - Click(505, 596) ; Click Upgrade - _Sleep(2000) - Click(472, 482) ; Click Okay - SetLog(GetLangText("msgWallUpDone"), $COLOR_BLUE) ; Done upgrade - GUICtrlSetData($lblwallupgradecount, GUICtrlRead($lblwallupgradecount) + 1) - _Sleep(1000) - Click(1, 1) ; Click Away - EndIf - Else ; check wall level lower than 8 - $walllowlevel = 1 - If Not _ColorCheck(_GetPixelColor(547, 570), Hex(0xFFFFFF, 6), 20) Then - SetLog(GetLangText("msgWallNotEnoughGold"), $COLOR_ORANGE) - Click(1, 1) ; Click Away - $wallbuild = 0 - Else - Click(505, 596) ; Click Upgrade - _Sleep(2000) - Click(472, 482) ; Click Okay - SetLog(GetLangText("msgWallUpDone"), $COLOR_BLUE) ; Done upgrade - GUICtrlSetData($lblwallupgradecount, GUICtrlRead($lblwallupgradecount) + 1) - _Sleep(1000) - Click(1, 1) ; Click Away - EndIf - EndIf - EndIf - Click(1, 1) ; Click Away -EndFunc ;==>UpgradeWallGold +Global $wallbuild +Global $walllowlevel + +Func UpgradeWall() + If Not IsChecked($chkWalls) Then Return + + VillageReport() + SetLog(GetLangText("msgCheckWalls")) + $itxtWallMinGold = GUICtrlRead($txtWallMinGold) + $itxtWallMinElixir = GUICtrlRead($txtWallMinElixir) + Local $MinWallGold = Number($GoldCount) > Number($itxtWallMinGold) + Local $MinWallElixir = Number($ElixirCount) > Number($itxtWallMinElixir) + + If IsChecked($UseGold) Then + $iUseStorage = 1 + ElseIf IsChecked($UseElixir) Then + $iUseStorage = 2 + ElseIf IsChecked($UseGoldElix) Then + $iUseStorage = 3 + EndIf + + Switch $iUseStorage + Case 1 + If $MinWallGold Then + SetLog(GetLangText("msgWallUpGold"), $COLOR_BLUE) + UpgradeWallGold() + Return True + Else + SetLog(GetLangText("msgGoldBelowMin"), $COLOR_RED) + EndIf + Case 2 + If $MinWallElixir Then + Setlog(GetLangText("msgWallUpElix"), $COLOR_BLUE) + UpgradeWallelix() + Return True + Else + Setlog(GetLangText("msgElixBelowMin"), $COLOR_BLUE) + EndIf + Case 3 + If $MinWallGold Then + SetLog(GetLangText("msgWallUpGold"), $COLOR_BLUE) + UpgradeWallGold() + If $wallbuild = 0 And $walllowlevel = 0 Then + SetLog(GetLangText("msgWallNoGoldElixir"), $COLOR_BLUE) + ;UpgradeWallElix() + EndIf + Else + SetLog(GetLangText("msgWallLowGoldElixir"), $COLOR_RED) + EndIf + + ;Do upgrade using Elixir + If $walllowlevel = 0 Then + If $MinWallElixir Then + UpgradeWallelix() + Else + Setlog(GetLangText("msgElixBelowMin"), $COLOR_BLUE) + EndIf + Else + SetLog(GetLangText("msgWallLowerLvl"), $COLOR_BLUE) + EndIf + + EndSwitch +EndFunc ;==>UpgradeWall + + +Func UpgradeWallelix() + If $FreeBuilder = 0 Then + SetLog(GetLangText("msgNoBuilders"), $COLOR_RED) + Click(1, 1) ; Click Away + Return + EndIf + + checkWall() + If $checkwalllogic Then + Click(1, 1) ; Click Away + _Sleep(600) + Click($WallX, $WallY) + _Sleep(600) + _CaptureRegion() + If _ColorCheck(_GetPixelColor(595, 568), Hex(0xFFFFFF, 6), 20) = False Then + SetLog(GetLangText("msgWallElixorLvl"), $COLOR_ORANGE) + Click(1, 1) ; Click away + _Sleep(1000) + Else + Click(560, 599) ; Click Upgrade + _Sleep(2000) + Click(472, 482) ; Click Okay + SetLog(GetLangText("msgWallUpDone"), $COLOR_BLUE) ; Done upgrade + GUICtrlSetData($lblwallupgradecount, GUICtrlRead($lblwallupgradecount) + 1) + Click(1, 1) ; Click away + _Sleep(1000) + EndIf + EndIf + Click(1, 1) ; Click Away +EndFunc ;==>UpgradeWallelix + + +Func UpgradeWallGold() + If $FreeBuilder = 0 Then + SetLog(GetLangText("msgNoBuilders"), $COLOR_RED) + Click(1, 1) ; Click Away + Return + EndIf + + checkWall() + If $checkwalllogic Then + Click(1, 1) ; Click Away + _Sleep(600) + Click($WallX, $WallY) + _Sleep(600) + _CaptureRegion() + If _ColorCheck(_GetPixelColor(523, 641), Hex(0x000000, 6), 20) = False Then ; checking wall level high than level 8 + $walllowlevel = 0 + If Not _ColorCheck(_GetPixelColor(500, 570), Hex(0xFEFEFE, 6), 20) Then + SetLog(GetLangText("msgWallNotEnoughGold"), $COLOR_ORANGE) + Click(1, 1) ; Click Away + $wallbuild = 0 + Else + Click(505, 596) ; Click Upgrade + _Sleep(2000) + Click(472, 482) ; Click Okay + SetLog(GetLangText("msgWallUpDone"), $COLOR_BLUE) ; Done upgrade + GUICtrlSetData($lblwallupgradecount, GUICtrlRead($lblwallupgradecount) + 1) + _Sleep(1000) + Click(1, 1) ; Click Away + EndIf + Else ; check wall level lower than 8 + $walllowlevel = 1 + If Not _ColorCheck(_GetPixelColor(547, 570), Hex(0xFFFFFF, 6), 20) Then + SetLog(GetLangText("msgWallNotEnoughGold"), $COLOR_ORANGE) + Click(1, 1) ; Click Away + $wallbuild = 0 + Else + Click(505, 596) ; Click Upgrade + _Sleep(2000) + Click(472, 482) ; Click Okay + SetLog(GetLangText("msgWallUpDone"), $COLOR_BLUE) ; Done upgrade + GUICtrlSetData($lblwallupgradecount, GUICtrlRead($lblwallupgradecount) + 1) + _Sleep(1000) + Click(1, 1) ; Click Away + EndIf + EndIf + EndIf + Click(1, 1) ; Click Away +EndFunc ;==>UpgradeWallGold diff --git a/COCBot/functions/Village/VillageReport.au3 b/COCBot/functions/Village/VillageReport.au3 index c6daf21..b0047b2 100644 --- a/COCBot/functions/Village/VillageReport.au3 +++ b/COCBot/functions/Village/VillageReport.au3 @@ -1,107 +1,107 @@ -Func VillageReport() - StatusCheck() - - SetLog(GetLangText("msgVillageRep"), $COLOR_GREEN) - - $FreeBuilder = ReadText(320, 23, 41, $textMainScreen) - Setlog(GetLangText("msgNumFreeBuild") & $FreeBuilder, $COLOR_GREEN) - $FreeBuilder = Number(StringLeft($FreeBuilder, 1)) - - If $PushBulletEnabled = 1 And $PushBulletfreebuilder = 1 And $FreeBuilder > 0 And Not ($buildernotified) Then - _Push(GetLangText("pushFB"), GetLangText("pushFBb") & ($FreeBuilder = 1) ? (GetLangText("pushFBc") : $FreeBuilder) & GetLangText("pushFBd") & ($FreeBuilder = 1) ? ("" : GetLangText("pushFBe")) & GetLangText("pushFBf")) - $buildernotified = True - SetLog(GetLangText("msgPushFreeBuild"), $COLOR_GREEN) - Else - $buildernotified = False - EndIf - - $TrophyCountOld = Number(GUICtrlRead($lblresulttrophynow)) - $TrophyCount = Number(ReadText(59, 75, 60, $textMainScreen)) - - If Not $FirstAttack Then - GUICtrlSetData($lblresulttrophygain, $TrophyCount - $TrophyCountOld) - EndIf - - $GoldCountOld = $GoldCount - $ElixirCountOld = $ElixirCount - $DarkCountOld = $DarkCount - $GoldCount = Number(ReadText(666, 25, 138, $textMainScreen, 0)) - $ElixirCount = Number(ReadText(666, 76, 138, $textMainScreen, 0)) - If _ColorCheck(_GetPixelColor(718, 131), Hex(0xF8FCFF, 6), 40) Then - ; No DE - $GemCount = Number(ReadText(736, 124, 68, $textMainScreen, 0)) - Else - $DarkCount = Number(ReadText(711, 125, 93, $textMainScreen, 0)) - $GemCount = Number(ReadText(736, 173, 68, $textMainScreen, 0)) - EndIf - - SetLog(GetLangText("msgResources") & " [" & GetLangText("msgGoldinitial") & "]: " & $GoldCount & " [" & GetLangText("msgElixirinitial") & "]: " & $ElixirCount & " [" & GetLangText("msgDarkElixinitial") & "]: " & $DarkCount & " [" & GetLangText("msgTrophyInitial") & "]: " & $TrophyCount & " [" & GetLangText("msgGemInitial") & "]: " & $GemCount, $COLOR_GREEN) - - If $FirstAttack Then - GUICtrlSetData($lblresultgoldtstart, $GoldCount) - GUICtrlSetData($lblresultelixirstart, $ElixirCount) - GUICtrlSetData($lblresultdestart, $DarkCount) - GUICtrlSetData($lblresulttrophystart, $TrophyCount) - Else - $GoldGained = $GoldCount - GUICtrlRead($lblresultgoldtstart) - $ElixirGained = $ElixirCount - GUICtrlRead($lblresultelixirstart) - $DarkGained = $DarkCount - GUICtrlRead($lblresultdestart) - $TrophyGained = $TrophyCount - GUICtrlRead($lblresulttrophystart) - - If $PushBulletEnabled = 1 And $PushBulletvillagereport = 1 Then - If TimerDiff($PushBulletvillagereportTimer) >= $PushBulletvillagereportInterval Then ;Report is due - _Push(GetLangText("pushVR"), "[" & GetLangText("msgGoldinitial") & "]: " & _NumberFormat($GoldCount) & " [" & GetLangText("msgElixirinitial") & "]: " & _NumberFormat($ElixirCount) & " [" & GetLangText("msgDarkElixinitial") & "]: " & _NumberFormat($DarkCount) & _ - " [" & GetLangText("msgTrophyInitial") & "]: " & $TrophyCount & " [" & GetLangText("msgGemInitial") & "]: " & $GemCount & " [Attacked]: " & GUICtrlRead($lblresultvillagesattacked) & _ - " [Skipped]: " & GUICtrlRead($lblresultvillagesskipped) & " [Wall Upgrade]: " & GUICtrlRead($lblwallupgradecount) & _ - " [Run Time]: " & StringFormat("%02i:%02i:%02i", $hour, $min, $sec) & "\n" & GetLangText("pushStatRq1") & GUICtrlRead($lblresultsearchdisconnected)) - SetLog(GetLangText("msgPushVillageRep"), $COLOR_GREEN) - $PushBulletvillagereportTimer = TimerInit() - EndIf - EndIf - - GUICtrlSetData($lblresultgoldgain, $GoldGained) - GUICtrlSetData($lblresultelixirgain, $ElixirGained) - GUICtrlSetData($lblresultdegain, $DarkGained) - GUICtrlSetData($lblresulttrophygain, $TrophyGained) - - If Not $MidAttack And $Raid = 1 Then ;report when there is a Raid except when bot disconnected - $SubmissionAttacks += 1 - $SubmissionGold += $LastRaidGold - $SubmissionElixir += $LastRaidElixir - $SubmissionDE += $LastRaidDarkElixir - SetLog(GetLangText("msgLastRaidGain") & " [" & GetLangText("msgGoldinitial") & "]: " & _NumberFormat($GoldCount - $GoldCountOld) & " [" & GetLangText("msgElixirinitial") & "]: " & _NumberFormat($ElixirCount - $ElixirCountOld) & _ - " [" & GetLangText("msgDarkElixinitial") & "]: " & _NumberFormat($DarkCount - $DarkCountOld) & " [" & GetLangText("msgTrophyInitial") & "]: " & ($TrophyCount - $TrophyCountOld)) - SetLog(GetLangText("msgLastRaidLoot") & " [" & GetLangText("msgGoldinitial") & "]: " & _NumberFormat($LastRaidGold) & " [" & GetLangText("msgElixirinitial") & "]: " & _NumberFormat($LastRaidElixir) & _ - " [" & GetLangText("msgDarkElixinitial") & "]: " & _NumberFormat($LastRaidDarkElixir) & " [" & GetLangText("msgTrophyInitial") & "]: " & $LastRaidTrophy) - If $PushBulletEnabled = 1 Then ;do pushbullet reports - Local $PushReportText = GetLangText("pushLRb") & GetLangText("msgGoldinitial") & "]: " & _NumberFormat($GoldCount - $GoldCountOld) & " [" & GetLangText("msgElixirinitial") & "]: " & _NumberFormat($ElixirCount - $ElixirCountOld) & _ - " [" & GetLangText("msgDarkElixinitial") & "]: " & _NumberFormat($DarkCount - $DarkCountOld) & " [" & GetLangText("msgTrophyInitial") & "]: " & ($TrophyCount - $TrophyCountOld) & _ - "\nLoot: \n[" & GetLangText("msgGoldinitial") & "]: " & _NumberFormat($LastRaidGold) & " [" & GetLangText("msgElixirinitial") & "]: " & _NumberFormat($LastRaidElixir) & _ - " [" & GetLangText("msgDarkElixinitial") & "]: " & _NumberFormat($LastRaidDarkElixir) & " [" & GetLangText("msgTrophyInitial") & "]: " & $LastRaidTrophy & _ - "\n" & GetLangText("pushLootA") & "\n" & $MatchFoundText & _ - "\n" & GetLangText("pushBS") & $SearchCount & _ - GetLangText("pushStatRq1") & GUICtrlRead($lblresultsearchdisconnected) & _ - "\n" & GetLangText("pushVR") & " \n[" & GetLangText("msgGoldinitial") & "]: " & _NumberFormat($GoldCount) & " [" & GetLangText("msgElixirinitial") & "]: " & _NumberFormat($ElixirCount) & _ - " [" & GetLangText("msgDarkElixinitial") & "]: " & _NumberFormat($DarkCount) & " [" & GetLangText("msgTrophyInitial") & "]: " & $TrophyCount & " [" & GetLangText("msgGemInitial") & "]: " & $GemCount & _ - " [Attacked]: " & GUICtrlRead($lblresultvillagesattacked) & " [Skipped]: " & GUICtrlRead($lblresultvillagesskipped) & _ - " [Wall Upgrade]: " & GUICtrlRead($lblwallupgradecount) - If IsChecked($UseJPG) Then - If _Sleep(1000) Then Return - _PushFile($FileName, "loots", "image/jpeg", "Last Raid", $FileName & "\n" & $PushReportText) - EndIf - If IsChecked($lbllastraid) Then - _Push(GetLangText("pushLR"), $PushReportText) - SetLog(GetLangText("msgPushLastRaid"), $COLOR_GREEN) - EndIf - $Raid = 0 - EndIf - StatSubmission(True) - EndIf - EndIf - - GUICtrlSetData($lblresultgoldnow, $GoldCount) - GUICtrlSetData($lblresultelixirnow, $ElixirCount) - GUICtrlSetData($lblresultdenow, $DarkCount) - GUICtrlSetData($lblresulttrophynow, $TrophyCount) - $FirstAttack = False -EndFunc ;==>VillageReport +Func VillageReport() + StatusCheck() + + SetLog(GetLangText("msgVillageRep"), $COLOR_GREEN) + + $FreeBuilder = ReadText(320, 23, 41, $textMainScreen) + Setlog(GetLangText("msgNumFreeBuild") & $FreeBuilder, $COLOR_GREEN) + $FreeBuilder = Number(StringLeft($FreeBuilder, 1)) + + If $PushBulletEnabled = 1 And $PushBulletfreebuilder = 1 And $FreeBuilder > 0 And Not ($buildernotified) Then + _Push(GetLangText("pushFB"), GetLangText("pushFBb") & ($FreeBuilder = 1) ? (GetLangText("pushFBc") : $FreeBuilder) & GetLangText("pushFBd") & ($FreeBuilder = 1) ? ("" : GetLangText("pushFBe")) & GetLangText("pushFBf")) + $buildernotified = True + SetLog(GetLangText("msgPushFreeBuild"), $COLOR_GREEN) + Else + $buildernotified = False + EndIf + + $TrophyCountOld = Number(GUICtrlRead($lblresulttrophynow)) + $TrophyCount = Number(ReadText(59, 75, 60, $textMainScreen)) + + If Not $FirstAttack Then + GUICtrlSetData($lblresulttrophygain, $TrophyCount - $TrophyCountOld) + EndIf + + $GoldCountOld = $GoldCount + $ElixirCountOld = $ElixirCount + $DarkCountOld = $DarkCount + $GoldCount = Number(ReadText(666, 25, 138, $textMainScreen, 0)) + $ElixirCount = Number(ReadText(666, 76, 138, $textMainScreen, 0)) + If _ColorCheck(_GetPixelColor(718, 131), Hex(0xF8FCFF, 6), 40) Then + ; No DE + $GemCount = Number(ReadText(736, 124, 68, $textMainScreen, 0)) + Else + $DarkCount = Number(ReadText(711, 125, 93, $textMainScreen, 0)) + $GemCount = Number(ReadText(736, 173, 68, $textMainScreen, 0)) + EndIf + + SetLog(GetLangText("msgResources") & " [" & GetLangText("msgGoldinitial") & "]: " & $GoldCount & " [" & GetLangText("msgElixirinitial") & "]: " & $ElixirCount & " [" & GetLangText("msgDarkElixinitial") & "]: " & $DarkCount & " [" & GetLangText("msgTrophyInitial") & "]: " & $TrophyCount & " [" & GetLangText("msgGemInitial") & "]: " & $GemCount, $COLOR_GREEN) + + If $FirstAttack Then + GUICtrlSetData($lblresultgoldtstart, $GoldCount) + GUICtrlSetData($lblresultelixirstart, $ElixirCount) + GUICtrlSetData($lblresultdestart, $DarkCount) + GUICtrlSetData($lblresulttrophystart, $TrophyCount) + Else + $GoldGained = $GoldCount - GUICtrlRead($lblresultgoldtstart) + $ElixirGained = $ElixirCount - GUICtrlRead($lblresultelixirstart) + $DarkGained = $DarkCount - GUICtrlRead($lblresultdestart) + $TrophyGained = $TrophyCount - GUICtrlRead($lblresulttrophystart) + + If $PushBulletEnabled = 1 And $PushBulletvillagereport = 1 Then + If TimerDiff($PushBulletvillagereportTimer) >= $PushBulletvillagereportInterval Then ;Report is due + _Push(GetLangText("pushVR"), "[" & GetLangText("msgGoldinitial") & "]: " & _NumberFormat($GoldCount) & " [" & GetLangText("msgElixirinitial") & "]: " & _NumberFormat($ElixirCount) & " [" & GetLangText("msgDarkElixinitial") & "]: " & _NumberFormat($DarkCount) & _ + " [" & GetLangText("msgTrophyInitial") & "]: " & $TrophyCount & " [" & GetLangText("msgGemInitial") & "]: " & $GemCount & " [Attacked]: " & GUICtrlRead($lblresultvillagesattacked) & _ + " [Skipped]: " & GUICtrlRead($lblresultvillagesskipped) & " [Wall Upgrade]: " & GUICtrlRead($lblwallupgradecount) & _ + " [Run Time]: " & StringFormat("%02i:%02i:%02i", $hour, $min, $sec) & "\n" & GetLangText("pushStatRq1") & GUICtrlRead($lblresultsearchdisconnected)) + SetLog(GetLangText("msgPushVillageRep"), $COLOR_GREEN) + $PushBulletvillagereportTimer = TimerInit() + EndIf + EndIf + + GUICtrlSetData($lblresultgoldgain, $GoldGained) + GUICtrlSetData($lblresultelixirgain, $ElixirGained) + GUICtrlSetData($lblresultdegain, $DarkGained) + GUICtrlSetData($lblresulttrophygain, $TrophyGained) + + If Not $MidAttack And $Raid = 1 Then ;report when there is a Raid except when bot disconnected + $SubmissionAttacks += 1 + $SubmissionGold += $LastRaidGold + $SubmissionElixir += $LastRaidElixir + $SubmissionDE += $LastRaidDarkElixir + SetLog(GetLangText("msgLastRaidGain") & " [" & GetLangText("msgGoldinitial") & "]: " & _NumberFormat($GoldCount - $GoldCountOld) & " [" & GetLangText("msgElixirinitial") & "]: " & _NumberFormat($ElixirCount - $ElixirCountOld) & _ + " [" & GetLangText("msgDarkElixinitial") & "]: " & _NumberFormat($DarkCount - $DarkCountOld) & " [" & GetLangText("msgTrophyInitial") & "]: " & ($TrophyCount - $TrophyCountOld)) + SetLog(GetLangText("msgLastRaidLoot") & " [" & GetLangText("msgGoldinitial") & "]: " & _NumberFormat($LastRaidGold) & " [" & GetLangText("msgElixirinitial") & "]: " & _NumberFormat($LastRaidElixir) & _ + " [" & GetLangText("msgDarkElixinitial") & "]: " & _NumberFormat($LastRaidDarkElixir) & " [" & GetLangText("msgTrophyInitial") & "]: " & $LastRaidTrophy) + If $PushBulletEnabled = 1 Then ;do pushbullet reports + Local $PushReportText = GetLangText("pushLRb") & GetLangText("msgGoldinitial") & "]: " & _NumberFormat($GoldCount - $GoldCountOld) & " [" & GetLangText("msgElixirinitial") & "]: " & _NumberFormat($ElixirCount - $ElixirCountOld) & _ + " [" & GetLangText("msgDarkElixinitial") & "]: " & _NumberFormat($DarkCount - $DarkCountOld) & " [" & GetLangText("msgTrophyInitial") & "]: " & ($TrophyCount - $TrophyCountOld) & _ + "\nLoot: \n[" & GetLangText("msgGoldinitial") & "]: " & _NumberFormat($LastRaidGold) & " [" & GetLangText("msgElixirinitial") & "]: " & _NumberFormat($LastRaidElixir) & _ + " [" & GetLangText("msgDarkElixinitial") & "]: " & _NumberFormat($LastRaidDarkElixir) & " [" & GetLangText("msgTrophyInitial") & "]: " & $LastRaidTrophy & _ + "\n" & GetLangText("pushLootA") & "\n" & $MatchFoundText & _ + "\n" & GetLangText("pushBS") & $SearchCount & _ + GetLangText("pushStatRq1") & GUICtrlRead($lblresultsearchdisconnected) & _ + "\n" & GetLangText("pushVR") & " \n[" & GetLangText("msgGoldinitial") & "]: " & _NumberFormat($GoldCount) & " [" & GetLangText("msgElixirinitial") & "]: " & _NumberFormat($ElixirCount) & _ + " [" & GetLangText("msgDarkElixinitial") & "]: " & _NumberFormat($DarkCount) & " [" & GetLangText("msgTrophyInitial") & "]: " & $TrophyCount & " [" & GetLangText("msgGemInitial") & "]: " & $GemCount & _ + " [Attacked]: " & GUICtrlRead($lblresultvillagesattacked) & " [Skipped]: " & GUICtrlRead($lblresultvillagesskipped) & _ + " [Wall Upgrade]: " & GUICtrlRead($lblwallupgradecount) + If IsChecked($UseJPG) Then + If _Sleep(1000) Then Return + _PushFile($FileName, "loots", "image/jpeg", "Last Raid", $FileName & "\n" & $PushReportText) + EndIf + If IsChecked($lbllastraid) Then + _Push(GetLangText("pushLR"), $PushReportText) + SetLog(GetLangText("msgPushLastRaid"), $COLOR_GREEN) + EndIf + EndIf + StatSubmission(True) + $Raid = 0 + EndIf + EndIf + + GUICtrlSetData($lblresultgoldnow, $GoldCount) + GUICtrlSetData($lblresultelixirnow, $ElixirCount) + GUICtrlSetData($lblresultdenow, $DarkCount) + GUICtrlSetData($lblresulttrophynow, $TrophyCount) + $FirstAttack = False +EndFunc ;==>VillageReport diff --git a/COCBot/functions/Village/isDarkElixirFull.au3 b/COCBot/functions/Village/isDarkElixirFull.au3 new file mode 100755 index 0000000..3590e6e --- /dev/null +++ b/COCBot/functions/Village/isDarkElixirFull.au3 @@ -0,0 +1,14 @@ +;Checks if your Elixir Storages are maxed out + +Func isDarkElixirFull() + _CaptureRegion() + ;----------------------------------------------------------------------------- + If _ColorCheck(_GetPixelColor(707, 128), Hex(0x000000, 6), 6) Then ;Hex is black + If _ColorCheck(_GetPixelColor(708, 128), Hex(0x1A0026, 6), 20) Then ;Hex if color of dark elixir + SetLog(GetLangText("msgDarkElixirFull"), $COLOR_GREEN) + Return True + EndIf + EndIf + + Return False +EndFunc ;==>isElixirFull diff --git a/COCBot/functions/Village/isElixirFull.au3 b/COCBot/functions/Village/isElixirFull.au3 index 643c510..984dab6 100644 --- a/COCBot/functions/Village/isElixirFull.au3 +++ b/COCBot/functions/Village/isElixirFull.au3 @@ -1,14 +1,14 @@ -;Checks if your Elixir Storages are maxed out - -Func isElixirFull() - _CaptureRegion() - ;----------------------------------------------------------------------------- - If _ColorCheck(_GetPixelColor(658, 84), Hex(0x000000, 6), 6) Then ;Hex is black - If _ColorCheck(_GetPixelColor(660, 84), Hex(0xAE1AB3, 6), 6) Then ;Hex if color of elixir (purple) - SetLog(GetLangText("msgElixirFull"), $COLOR_GREEN) - Return True - EndIf - EndIf - - Return False -EndFunc ;==>isElixirFull +;Checks if your Elixir Storages are maxed out + +Func isElixirFull() + _CaptureRegion() + ;----------------------------------------------------------------------------- + If _ColorCheck(_GetPixelColor(658, 84), Hex(0x000000, 6), 6) Then ;Hex is black + If _ColorCheck(_GetPixelColor(660, 84), Hex(0xAE1AB3, 6), 6) Then ;Hex if color of elixir (purple) + SetLog(GetLangText("msgElixirFull"), $COLOR_GREEN) + Return True + EndIf + EndIf + + Return False +EndFunc ;==>isElixirFull diff --git a/COCBot/functions/Village/isGoldFull.au3 b/COCBot/functions/Village/isGoldFull.au3 index 51aa7bf..2e631a4 100644 --- a/COCBot/functions/Village/isGoldFull.au3 +++ b/COCBot/functions/Village/isGoldFull.au3 @@ -1,14 +1,14 @@ -;Checks if your Gold Storages are maxed out - -Func isGoldFull() - _CaptureRegion() - ;----------------------------------------------------------------------------- - If _ColorCheck(_GetPixelColor(658, 33), Hex(0x000000, 6), 6) Then ;Hex is black - If _ColorCheck(_GetPixelColor(660, 33), Hex(0xD4B100, 6), 6) Then ;Hex if color of gold (orange) - SetLog(GetLangText("msgGoldFull"), $COLOR_GREEN) - Return True - EndIf - EndIf - - Return False -EndFunc ;==>isGoldFull +;Checks if your Gold Storages are maxed out + +Func isGoldFull() + _CaptureRegion() + ;----------------------------------------------------------------------------- + If _ColorCheck(_GetPixelColor(658, 33), Hex(0x000000, 6), 6) Then ;Hex is black + If _ColorCheck(_GetPixelColor(660, 33), Hex(0xD4B100, 6), 6) Then ;Hex if color of gold (orange) + SetLog(GetLangText("msgGoldFull"), $COLOR_GREEN) + Return True + EndIf + EndIf + + Return False +EndFunc ;==>isGoldFull diff --git a/COCBot/functions/Village/upTroops.au3 b/COCBot/functions/Village/upTroops.au3 index 8f979ed..954c4bd 100644 --- a/COCBot/functions/Village/upTroops.au3 +++ b/COCBot/functions/Village/upTroops.au3 @@ -1,135 +1,74 @@ -#cs ---------------------------------------------------------------------------- - - AutoIt Version: 3.3.12.0 - Author: summoner - - Script Function: - Template AutoIt script. - -#ce ---------------------------------------------------------------------------- - -; Script Start - Add your code below here - -Func GetUpLaboratoryPos() - Switch _GUICtrlComboBox_GetCurSel($cmbLaboratory) - Case 0 - Click($UpBar2X, $UpBar2Y) - _CaptureRegion() - If _ColorCheck(_GetPixelColor(132, 362), Hex(0x303030, 6), 20) Then - SetLog(GetLangText("msgLabLevelTroop") & GUICtrlRead($cmbLaboratory) & GetLangText("msgLabLevelMax"), $COLOR_RED) - If _Sleep(1000) Then Return - ClickP($TopLeftClient, 2) - GUICtrlSetState($chkLab, $GUI_UNCHECKED) - EndIf - Case 1 - Click($UpArchX, $UpArchY) - Case 2 - Click($GiantsX, $GiantsY) - Case 3 - Click(293, 480) ; Goblin - Case 4 - Click($WBreakerX, $WBreakerY) - Case 5 - Click(387, 461) ; Ballon - Case 6 - Click($WizardX, $WizardY) - Case 7 - Click($UpHealX, $UpHealY) - Case 8 - Click($UpDragonX, $UpDragonY) - Case 9 - Click($UpPekkaX, $UpPekkaY) - Case 10 - Click($SpellHealX, $SpellHealY) - Case 11 - Click($SpellLightningX, $SpellLightningY) - Case 12 - _PostMessage_ClickDrag(552, 464, 3, 492, "left", 2000) - _ModifiedSleep(1000) - Click(261, 377) ; rage - Case 13 - _PostMessage_ClickDrag(552, 464, 3, 492, "left", 2000) - _ModifiedSleep(1000) - _PostMessage_ClickDrag(552, 464, 3, 492, "left", 2000) - _ModifiedSleep(1000) - Click(282, 470) ; jump - Case 14 - _PostMessage_ClickDrag(552, 464, 3, 492, "left", 2000) - _ModifiedSleep(1000) - Click(370, 366) ; freeze - Case 15 - _PostMessage_ClickDrag(552, 464, 3, 492, "left", 2000) - _ModifiedSleep(1000) - Click(370, 474) ; minion - Case 16 - _PostMessage_ClickDrag(552, 464, 3, 492, "left", 2000) - _ModifiedSleep(1000) - Click(488, 477) ; hog - Case 17 - _PostMessage_ClickDrag(552, 464, 3, 492, "left", 2000) - _ModifiedSleep(1000) - Click(591, 364) ; valkrye - Case 18 - _PostMessage_ClickDrag(552, 464, 3, 492, "left", 2000) - _ModifiedSleep(1000) - Click(590, 474); golem - Case 19 - _PostMessage_ClickDrag(552, 464, 3, 492, "left", 2000) - _ModifiedSleep(1000) - Click(578, 474) ; witch - Case 20 - _PostMessage_ClickDrag(552, 464, 3, 492, "left", 2000) - _ModifiedSleep(1000) - Click(690, 368) ; lava - Case 21 - GUICtrlSetState($chkLab, $GUI_UNCHECKED) - - EndSwitch -EndFunc ;==>GetUpLaboratoryPos - -Func Laboratory() - If Not IsChecked($chkLab) Then - SetLog(GetLangText("msgLabSkipped"), $COLOR_RED) - ClickP($TopLeftClient) ; Click Away - Return - EndIf - If $LabPos[0] = "" Or $LabPos[1] = "" Then - SetLog(GetLangText("msgLabLocNotSet"), $COLOR_RED) - ClickP($TopLeftClient) ; Click Away - Return - EndIf - Click($LabPos[0], $LabPos[1]);Click Laboratory - If _Sleep(1000) Then Return - SetLog(GetLangText("msgLabSearching") & GUICtrlRead($cmbLaboratory) & "...", $COLOR_BLUE) - Click(527, 597) ; Click Button Research - If _Sleep(1000) Then Return - GetUpLaboratoryPos() ; Click Troops - SetLog(GetLangText("msgLabTroopSearch") & GUICtrlRead($cmbLaboratory) & GetLangText("msgLabTroopFound"), $COLOR_GREEN) - If _Sleep(1000) Then Return - _CaptureRegion() - If _ColorCheck(_GetPixelColor(535, 506), Hex(0x868686, 6), 20) Or _ColorCheck(_GetPixelColor(580, 511), Hex(0x848484, 6), 20) Then - SetLog(GetLangText("msgLabWaiting") & GUICtrlRead($cmbLaboratory) & GetLangText("msgLabAfter"), $COLOR_RED) - If _Sleep(1000) Then Return - ClickP($TopLeftClient, 2) - Else - If _ColorCheck(_GetPixelColor(558, 489), Hex(0xE70A12, 6), 20) Or _ColorCheck(_GetPixelColor(558, 489), Hex(0xE70A12, 6), 20) Then - SetLog(GetLangText("msgLabLowElix") & GUICtrlRead($cmbLaboratory) & "...", $COLOR_RED) - If _Sleep(1000) Then Return - ClickP($TopLeftClient, 2) - Else - If _ColorCheck(_GetPixelColor(558, 489), Hex(0xE70A12, 6), 20) And _ColorCheck(_GetPixelColor(577, 498), Hex(0x2A2A2A, 6), 20) Then - SetLog(GetLangText("msgLabLowDE") & GUICtrlRead($cmbLaboratory) & "...", $COLOR_RED) - If _Sleep(1000) Then Return - ClickP($TopLeftClient, 2) - Else - If _ColorCheck(_GetPixelColor(558, 489), Hex(0xFFFFFF, 6), 20) = True Then - Click(558, 489) ; Click Upgrade troops - SetLog(GetLangText("msgLabUpgrade") & GUICtrlRead($cmbLaboratory) & GetLangText("msgLabDone"), $COLOR_GREEN) - If _Sleep(1000) Then Return - ClickP($TopLeftClient, 2) - GUICtrlSetState($chkLab, $GUI_UNCHECKED) - EndIf - EndIf - EndIf - EndIf -EndFunc ;==>Laboratory +#cs ---------------------------------------------------------------------------- + + AutoIt Version: 3.3.12.0 + Author: summoner + + Script Function: + Template AutoIt script. + +#ce ---------------------------------------------------------------------------- +; Script Start - Add your code below here + +Func GetUpLaboratoryPos() + If _GUICtrlComboBox_GetCurSel($cmbLaboratory) = 24 Then + GUICtrlSetState($chkLab, $GUI_UNCHECKED) + Else + If _GUICtrlComboBox_GetCurSel($cmbLaboratory) > 11 Then + $i=0 + Do + _PostMessage_ClickDrag(725, 464, 3, 492, "left", 500) + _ModifiedSleep(1000) + $i += 1 + _CaptureRegion() + Until _ColorCheck(_GetPixelColor(123, 409), Hex(0xAAAAA4, 6), 20) Or $i=20 + EndIf + Click(133 + Floor(_GUICtrlComboBox_GetCurSel($cmbLaboratory)/2)*106-Floor(_GUICtrlComboBox_GetCurSel($cmbLaboratory)/12)*636, 330 + Mod(_GUICtrlComboBox_GetCurSel($cmbLaboratory), 2)*115) + EndIf +EndFunc ;==>GetUpLaboratoryPos + +Func Laboratory() + If Not IsChecked($chkLab) Then + SetLog(GetLangText("msgLabSkipped"), $COLOR_RED) + ClickP($TopLeftClient) ; Click Away + Return + EndIf + If $LabPos[0] = "" Or $LabPos[1] = "" Then + SetLog(GetLangText("msgLabLocNotSet"), $COLOR_RED) + ClickP($TopLeftClient) ; Click Away + Return + EndIf + Click($LabPos[0], $LabPos[1]);Click Laboratory + If _Sleep(1000) Then Return + SetLog(GetLangText("msgLabSearching") & GUICtrlRead($cmbLaboratory) & "...", $COLOR_BLUE) + Click(507, 597) ; Click Button Research + If _Sleep(3000) Then Return + GetUpLaboratoryPos() ; Click Troops + SetLog(GetLangText("msgLabTroopSearch") & GUICtrlRead($cmbLaboratory) & GetLangText("msgLabTroopFound"), $COLOR_GREEN) + If _Sleep(1000) Then Return + _CaptureRegion() + If _ColorCheck(_GetPixelColor(535, 506), Hex(0x868686, 6), 20) Or _ColorCheck(_GetPixelColor(580, 511), Hex(0x848484, 6), 20) Then + SetLog(GetLangText("msgLabWaiting") & GUICtrlRead($cmbLaboratory) & GetLangText("msgLabAfter"), $COLOR_RED) + If _Sleep(1000) Then Return + ClickP($TopLeftClient, 2) + Else + If _ColorCheck(_GetPixelColor(558, 489), Hex(0xE70A12, 6), 20) Or _ColorCheck(_GetPixelColor(558, 489), Hex(0xE70A12, 6), 20) Then + SetLog(GetLangText("msgLabLowElix") & GUICtrlRead($cmbLaboratory) & "...", $COLOR_RED) + If _Sleep(1000) Then Return + ClickP($TopLeftClient, 2) + Else + If _ColorCheck(_GetPixelColor(558, 489), Hex(0xE70A12, 6), 20) And _ColorCheck(_GetPixelColor(577, 498), Hex(0x2A2A2A, 6), 20) Then + SetLog(GetLangText("msgLabLowDE") & GUICtrlRead($cmbLaboratory) & "...", $COLOR_RED) + If _Sleep(1000) Then Return + ClickP($TopLeftClient, 2) + Else + If _ColorCheck(_GetPixelColor(558, 489), Hex(0xFFFFFF, 6), 20) = True Then + Click(558, 489) ; Click Upgrade troops + SetLog(GetLangText("msgLabUpgrade") & GUICtrlRead($cmbLaboratory) & GetLangText("msgLabDone"), $COLOR_GREEN) + If _Sleep(1000) Then Return + ClickP($TopLeftClient, 2) + GUICtrlSetState($chkLab, $GUI_UNCHECKED) + EndIf + EndIf + EndIf + EndIf +EndFunc ;==>Laboratory diff --git a/License.txt b/License.txt index 94a9ed0..818433e 100644 --- a/License.txt +++ b/License.txt @@ -1,674 +1,674 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/README.md b/README.md index 2d5b39a..85aa14d 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,21 @@ -# BrokenBot.org - Clash of Clans Bot -Latest version: 3.1.0 - -## Community -Forums available for discussion at: http://www.brokenbot.org/page.php?p=main - -### Reference -For your convenience, and referring to pushbullet's document: -https://docs.pushbullet.com/ - -### Credit -Much thanks to: the original creators of this bot at gamebot.org, clashbot.org, cool7su, maxcom, msh2050, usabug, cmestres, samkhowaja and anyone else who I missed but has contributed to this great project! - -Original source from which this is modified (project originally started at gamebot.org): -Modification of v5.8 of bot originally available from http://clashbot.org/forums/index.php?/topic/1010-flawless-clashbot-release-58-recommended/ - -### License -This project is under GPLv3 licensing - **BUT**- due to the convoluted nature of the origin of this code, a separate license specific to changes made by the BrokenBot.org team is available in the BrokenBot.org directory and applies only to that sub-directory (recursively). - ----------- -Clash of Clans is a Registered Trademark of SuperCell. This project is not affiliated with SuperCell or any of its affiliates in any way. Project is available without warranty express or implied. +# BrokenBot.org - Clash of Clans Bot +Latest version: 3.2.0 + +## Community +Forums available for discussion at: http://www.brokenbot.org/page.php?p=main + +### Reference +For your convenience, and referring to pushbullet's document: +https://docs.pushbullet.com/ + +### Credit +Much thanks to: the original creators of this bot at gamebot.org, clashbot.org, cool7su, maxcom, msh2050, usabug, cmestres, samkhowaja and anyone else who I missed but has contributed to this great project! + +Original source from which this is modified (project originally started at gamebot.org): +Modification of v5.8 of bot originally available from http://clashbot.org/forums/index.php?/topic/1010-flawless-clashbot-release-58-recommended/ + +### License +This project is under GPLv3 licensing - **BUT**- due to the convoluted nature of the origin of this code, a separate license specific to changes made by the BrokenBot.org team is available in the BrokenBot.org directory and applies only to that sub-directory (recursively). + +---------- +Clash of Clans is a Registered Trademark of SuperCell. This project is not affiliated with SuperCell or any of its affiliates in any way. Project is available without warranty express or implied. diff --git a/changelog.md b/changelog.md index a891309..5661d77 100644 --- a/changelog.md +++ b/changelog.md @@ -1,120 +1,152 @@ -## Change Log: - -### v3.1.0 -* Custom troops fixed, you no longer just have to use barracks training -* Modified sniping - improved, but still occasionally having a few issues with attacking wrong side of base, please continue bringing incorrect behaviour to our attention -* Longer time available to click "Attack Now" button -* King/Queen activation modified -* Better stopping attack during snipe if you have gained a star -* More text reading improvements -* Fixed behaviour when using donate/train only mode -* More non English languages now supported - if you find issues, please report them and use English -* Various crashes fixed - -### v3.0.5 BETA -* Fixed early return home -* Sniping: Now leaves after one star is achieved -* CC troops can now be deployed -* Zapping will now zap DE pumps of dead bases -* Multi-language support is hopefully restored - -### v3.0.0 BETA -* Compatible with Clash of Clans™ July 2015 Update - but not yet optimized in order to get you up and getting loot faster as we continue development. -* "My Stats" submission. Results of your earnings can now be submitted and viewed online. This will allow you to monitor and trend your income over time, in 15min increments. Click “My Stats” in the forum navigation to view. -* - On "Services" tab enter username and password for BrokenBot.org forums and click on the validate button. If your settings are correct then it will change to say “VALID”. Don't worry about password field being empty after clicking the button, it is now stored encrypted on your computer away from all other BrokenBot files. -* - BrokenBot will attempt to submit after every attack but will only succeed every 15min to limit the load on the server. Do not worry if you see it fail submitting as long as your username and password are verified in the “Services” tab. It will re-attempt. -* "Stats" tab. The stats are now correctly read and summarized in this tab of the bot. -* New donation text and resource reading. We have implemented our brand new text and number reading functionality. No more will the bot stop reading after not knowing a letter or a symbol! Finally perfect donations for all. -* Town Hall sniping. Now if the bot attacks a Town Hall by sniping, either based on search conditions page or the “Snipe if trophies below” setting, it will send out a “trickle attack”. BrokenBot sends progressively larger waves if it does not recognize a loot change or there has been a long delay. The bot stops deploying more troops once you have earned one star. The order of troops is hardcoded, but it starts with barbarians and archers and progressively adds stronger troops including heroes and your clan castle if things get really bad if selected/available. -* New UI option on “General” tab: "Snipe if trophies below". Enter a number here and if you have fewer trophies than this value, it will snipe both live and dead outside Town Halls to bring your trophy count up. Will continue using normal search conditions and attacks at the same time if a target is found. -* Collector attacking. You can now focus attacks on the resource collectors. There are 2 options available described below. They can be chosen on the attack methods tab. Both methods must temporarily activate red-line mode if you don't have it already active. They will only focus attacks on those collectors near the outer edges of the base (existence of walls does not mean the collector is inside). -* - Attack collectors - deploy all troops: This method will deploy all the troops you have, spread out among all the collectors. -* - Attack collectors - troop saver: This method deploys a few troops on some of the collectors. Once the income has stopped it checks to see what collectors are still left standing and if you haven't already sent troops there it does another round of attacking. -* Clear the Field. Checking "Clear the Field" on the "Misc" tab will have the bot remove obstacles that it finds if you have a free builder. It will only remove up to 5 obstacles with each loop. Also it will not touch your holiday themed obstacles so those are safe. -* BrokenBot attack visualization / Debug Mode. If you have debug mode checked then you can actually see what the bot is trying to attack and where it is dropping troops as it works. Works best with background mode activated but will try to show you its actions even if you don't have it on. If you do have background mode on and BlueStacks isn't hidden then it will pop up on top of any other work you may be doing. -* Dark Elixir Zapping - BrokenBot will now zap DE Drills due to the Clash of Clans™ July 2015 update. We are aware that it will zap regardless of the base being dead or alive and will resolve shortly. -* Modified decision to return home. Will now return home quicker if the battle is completely ended, and will start the delay again if it senses a change in loot. Previously if your loot stopped changing then it would return home after a set time even if you starting gaining loot again. -* Changed the way attack delays are processed. You now get more accurate and consistent (but still randomized) delays between dropping troops and waves of troops. Also modified available choices for troop delay for those that want an even longer delay between deploying troops. -* Cost per search. This is now implemented fully automatically. -* Average hourly income stats. These are only shown in the log (GUI is crowded enough) and are shown after each attack. “Stat submission” must be enabled to view this information. -* Lower CPU utilization. Changed bot to use less CPU when idling. Thanks w0lv3r1nixclash -* "PushBullet" tab renamed to "Services". - -### v2.8.0 -* Major stability enhancements -* Speed optimization - we cut the time it takes to find a well hidden TH by 60% from our previous release. It now takes 1.2sec on average vs never finding it or taking 20 seconds like our competitors. **speedBoost must be enabled. -* Precision enhancements - We have reduced our image recognition error rate from 4% down to 2.4% - Nearly 10 times better than other bots! -* Resource collection - we had to lower the thresholds to make sure we collect some of your harder to detect resources. The side-effect is you will see it clicking walls sometimes for a fraction of a second. This is expected and controlled, it will not perform an erroneous action. -* Implemented speedBoost - found on the config tab. Check this to locate DE and TH faster at the cost of more CPU load during searching. -* Fixed PushBullet. We now check the server for up to 3 new commands once every minute. Bot may respond to commands slightly slower but this will prevent us from being blocked from using their servers. -* Various bug fixes related to searching. - -### v2.7.1 -* Improved townhall recognition. No, seriously. It is so much better than it was before! No more trying to attack outside townhalls that don't exist or skipping over perfectly good bases with tons of loot just because the bot can't recognize the townhall. -* Some more dark elixir storage tweaks. We are trying to make sure you don't waste those zaps. -* Moved resource collection to our improved image recognition system. - -### v2.7.0 -* Improved image recognition system. Does a much better job of finding the dark elixir storage. -* Search delay is randomized now. You still use the same UI selection for the general speed of searching but the actual speed is randomized near the value you select. -* Donation blacklist now added. If you check the box to turn on blacklist then it will not donate to people if the words you list are anywhere in the request text. -* You may now specify having a King or Queen available as a search condition. For example: if you specify that you require the King and Queen both for live bases then it will only search for dead bases until your King or Queen are available. -* Hid some options for upgrading that didn't function properly. Will be reinstated once fixed. -* Main loop sped up. Less time just sitting there waiting while it's doing something. -* Various speed and stability improvements. - -### v2.6.0 -* Much faster troop deployment. Might not want to do 1/1 anymore -* Temporary fix for those whose camp numbers can't be read. Unfortunately this may reintroduce a problem where training gets stuck for those people. If you have this issue please temporarily use barracks training mode until this can be fully fixed. - -### v2.5.9 -* Emergency fix for occasional crash - -### v2.5.8 -* Additional randomization for deployment of troops and deploy timing -* Removed "randomize" check box, it was terrible method of randomization. You are now always somewhat randomized, but you can modify the average delay by adjusting the unit delay and wave delay -* Pushbullet last raid now sends how much loot was available -* Pushbullet village report is now not sent until at least 1 hour has passed -* Pushbullet now has multi-user support. Add your village name to settings page and all new messages will be appended with [username] so you can keep your bots straight. Additionally bot commands should now have your user name added at the end so you are sending it to the correct bot (for example: "bot pause broken") -* Bug report removes your username to prevent you accidentally uploading that information -* Modified bug reporting button to include settings on your current strategy - -### v2.5.7 -* Fixed pushbullet pause command, if you pause mid-battle by pushbullet then the pause will not take effect until you have returned to main screen -* Allow user to pause bot at just about anytime if they actually click the button -* Fix added for wall breaker not being recognized -* Modified troop training order to start with troops that take longer to produce -* Significant modification to trophy dropping. Now will zap DE if you have spells available and there is enough DE in there as entered into the Strategies/Spells/Zap field. Will next drop king or queen if available. Finally will resort to any other troop you have. Additionally the location of the drop has been randomized and it uses red-line detection. - -### v2.5.6 -* Fix for bot thinking it is making troops but barracks aren't making anything -* Failsafe added so that it will eventually start attacking even without full army camp if it gets really stuck (such as you have 199/200 troops but all barracks are trying to make giants) -* Increased amount of information sent out in push bullet messages -* Added customizable decreases in required loot levels for searching - -### v2.5.5 -* Fix for having alternate language selected but still displaying English - -### v2.5.4 -* Fixed spells not being detected -* Fix for archers not being detected -* DLL update for resolving those few people that still had an issue - -### v2.5.3 -* Fixed display of townhall levels in search results. -* Fixed color recognition for archers. -* Added hidden setting for adjusting font size of log. Add it to the [hidden] section of your ini file. For example: "fontsize=6" - -### v2.5.2 -* Improved auto-update. Now bot actually can download and apply the update for you. -* Improved DLL error detection. Informs the user if they are missing the proper version and directs them about how to resolve. Falls back to dropping troops at the edge if DLL isn't working. - -### v2.5.1 -* Added DLL dependancy for some machines that may be missing it. - -### v2.5.0 -* Initially tracked release. Future releases to include full changelog to track all progress. -* Modification of red-line attacking. Near instantaneous now. Additionally added GUI control that allows you to set how certain you want to be of deployment. All the way to the left will be closer but generate more errors, while all the way to the right will launch troops at the edges of the map. -* Addition of multilingual support. Simply add a new language.ini file to the BrokenBot.org\languages folder. The bot will automatically recognize the addition. Make a translation for each key listed in the English.ini file. Anytime you are using a different language and a key is not found it will automatically default back to English. -* Incorporation of bug fixes and stability improvements from Cool7su. +## Change Log: + +### v3.2.0 Final +* MASSIVE stability improvements +* Some DARK TROOPS ARE BACK! ...mostly... -- this feature remains BETA! +* Bot no longer makes computer unresponsive during image searches +* Added King/Queen upgrading (thanks obudu) +* Added reduce memory function to clean up unused resources periodically (thanks Hungrypoo) +* Added new option to switch to experience mode if you reach specified criteria +* Added full dark elixir storage as a criteria to halt bot +* GUI config for upgrade now properly saved (Thanks drummernick12) +* PushBullet now includes date and time in messages (Thanks slam666) +* Incorporated new experience mode that uses AQ or BK (Thanks drummernick12) +* Improved army camp detection when text is obstructed +* Clicking "Attack now" now respects the proper type of attack to perform based on base being live or dead +* Modified troop lab upgrading to work when Golems are selected +* Updated language files (Thanks Electroz) +* Added new sum option for resources +* When using fewer than 4 sided attack, sides are now randomized +* Added donate while idling if a new request is made +* Improved text detection +* Improvements to work on multiple COC game languages other than English +* Modifications to restarting BlueStacks for consistency +* Bug fixes for experience mode (thanks drummernick12) +* Fixed bug that crashed in certain instances when training custom troops +* Fixed troop deployment speeds +* Fixed sniping in correct location +* Fixed CC deployment +* Fixed King/Queen being detected +* Fixed King/Queen activation on low health +* Fixed number of troops on sides being more consistent +* Fixed bot not training wallbreakers in barracks mode +* Fixed lab upgrading for those w/ maxed out laboratories (thanks obudu) + +### v3.1.0 +* Custom troops fixed, you no longer just have to use barracks training +* Modified sniping - improved, but still occasionally having a few issues with attacking wrong side of base, please continue bringing incorrect behaviour to our attention +* Longer time available to click "Attack Now" button +* King/Queen activation modified +* Better stopping attack during snipe if you have gained a star +* More text reading improvements +* Fixed behaviour when using donate/train only mode +* More non English languages now supported - if you find issues, please report them and use English +* Various crashes fixed + +### v3.0.5 BETA +* Fixed early return home +* Sniping: Now leaves after one star is achieved +* CC troops can now be deployed +* Zapping will now zap DE pumps of dead bases +* Multi-language support is hopefully restored + +### v3.0.0 BETA +* Compatible with Clash of Clans™ July 2015 Update - but not yet optimized in order to get you up and getting loot faster as we continue development. +* "My Stats" submission. Results of your earnings can now be submitted and viewed online. This will allow you to monitor and trend your income over time, in 15min increments. Click “My Stats” in the forum navigation to view. +* - On "Services" tab enter username and password for BrokenBot.org forums and click on the validate button. If your settings are correct then it will change to say “VALID”. Don't worry about password field being empty after clicking the button, it is now stored encrypted on your computer away from all other BrokenBot files. +* - BrokenBot will attempt to submit after every attack but will only succeed every 15min to limit the load on the server. Do not worry if you see it fail submitting as long as your username and password are verified in the “Services” tab. It will re-attempt. +* "Stats" tab. The stats are now correctly read and summarized in this tab of the bot. +* New donation text and resource reading. We have implemented our brand new text and number reading functionality. No more will the bot stop reading after not knowing a letter or a symbol! Finally perfect donations for all. +* Town Hall sniping. Now if the bot attacks a Town Hall by sniping, either based on search conditions page or the “Snipe if trophies below” setting, it will send out a “trickle attack”. BrokenBot sends progressively larger waves if it does not recognize a loot change or there has been a long delay. The bot stops deploying more troops once you have earned one star. The order of troops is hardcoded, but it starts with barbarians and archers and progressively adds stronger troops including heroes and your clan castle if things get really bad if selected/available. +* New UI option on “General” tab: "Snipe if trophies below". Enter a number here and if you have fewer trophies than this value, it will snipe both live and dead outside Town Halls to bring your trophy count up. Will continue using normal search conditions and attacks at the same time if a target is found. +* Collector attacking. You can now focus attacks on the resource collectors. There are 2 options available described below. They can be chosen on the attack methods tab. Both methods must temporarily activate red-line mode if you don't have it already active. They will only focus attacks on those collectors near the outer edges of the base (existence of walls does not mean the collector is inside). +* - Attack collectors - deploy all troops: This method will deploy all the troops you have, spread out among all the collectors. +* - Attack collectors - troop saver: This method deploys a few troops on some of the collectors. Once the income has stopped it checks to see what collectors are still left standing and if you haven't already sent troops there it does another round of attacking. +* Clear the Field. Checking "Clear the Field" on the "Misc" tab will have the bot remove obstacles that it finds if you have a free builder. It will only remove up to 5 obstacles with each loop. Also it will not touch your holiday themed obstacles so those are safe. +* BrokenBot attack visualization / Debug Mode. If you have debug mode checked then you can actually see what the bot is trying to attack and where it is dropping troops as it works. Works best with background mode activated but will try to show you its actions even if you don't have it on. If you do have background mode on and BlueStacks isn't hidden then it will pop up on top of any other work you may be doing. +* Dark Elixir Zapping - BrokenBot will now zap DE Drills due to the Clash of Clans™ July 2015 update. We are aware that it will zap regardless of the base being dead or alive and will resolve shortly. +* Modified decision to return home. Will now return home quicker if the battle is completely ended, and will start the delay again if it senses a change in loot. Previously if your loot stopped changing then it would return home after a set time even if you starting gaining loot again. +* Changed the way attack delays are processed. You now get more accurate and consistent (but still randomized) delays between dropping troops and waves of troops. Also modified available choices for troop delay for those that want an even longer delay between deploying troops. +* Cost per search. This is now implemented fully automatically. +* Average hourly income stats. These are only shown in the log (GUI is crowded enough) and are shown after each attack. “Stat submission” must be enabled to view this information. +* Lower CPU utilization. Changed bot to use less CPU when idling. Thanks w0lv3r1nixclash +* "PushBullet" tab renamed to "Services". + +### v2.8.0 +* Major stability enhancements +* Speed optimization - we cut the time it takes to find a well hidden TH by 60% from our previous release. It now takes 1.2sec on average vs never finding it or taking 20 seconds like our competitors. **speedBoost must be enabled. +* Precision enhancements - We have reduced our image recognition error rate from 4% down to 2.4% - Nearly 10 times better than other bots! +* Resource collection - we had to lower the thresholds to make sure we collect some of your harder to detect resources. The side-effect is you will see it clicking walls sometimes for a fraction of a second. This is expected and controlled, it will not perform an erroneous action. +* Implemented speedBoost - found on the config tab. Check this to locate DE and TH faster at the cost of more CPU load during searching. +* Fixed PushBullet. We now check the server for up to 3 new commands once every minute. Bot may respond to commands slightly slower but this will prevent us from being blocked from using their servers. +* Various bug fixes related to searching. + +### v2.7.1 +* Improved townhall recognition. No, seriously. It is so much better than it was before! No more trying to attack outside townhalls that don't exist or skipping over perfectly good bases with tons of loot just because the bot can't recognize the townhall. +* Some more dark elixir storage tweaks. We are trying to make sure you don't waste those zaps. +* Moved resource collection to our improved image recognition system. + +### v2.7.0 +* Improved image recognition system. Does a much better job of finding the dark elixir storage. +* Search delay is randomized now. You still use the same UI selection for the general speed of searching but the actual speed is randomized near the value you select. +* Donation blacklist now added. If you check the box to turn on blacklist then it will not donate to people if the words you list are anywhere in the request text. +* You may now specify having a King or Queen available as a search condition. For example: if you specify that you require the King and Queen both for live bases then it will only search for dead bases until your King or Queen are available. +* Hid some options for upgrading that didn't function properly. Will be reinstated once fixed. +* Main loop sped up. Less time just sitting there waiting while it's doing something. +* Various speed and stability improvements. + +### v2.6.0 +* Much faster troop deployment. Might not want to do 1/1 anymore +* Temporary fix for those whose camp numbers can't be read. Unfortunately this may reintroduce a problem where training gets stuck for those people. If you have this issue please temporarily use barracks training mode until this can be fully fixed. + +### v2.5.9 +* Emergency fix for occasional crash + +### v2.5.8 +* Additional randomization for deployment of troops and deploy timing +* Removed "randomize" check box, it was terrible method of randomization. You are now always somewhat randomized, but you can modify the average delay by adjusting the unit delay and wave delay +* Pushbullet last raid now sends how much loot was available +* Pushbullet village report is now not sent until at least 1 hour has passed +* Pushbullet now has multi-user support. Add your village name to settings page and all new messages will be appended with [username] so you can keep your bots straight. Additionally bot commands should now have your user name added at the end so you are sending it to the correct bot (for example: "bot pause broken") +* Bug report removes your username to prevent you accidentally uploading that information +* Modified bug reporting button to include settings on your current strategy + +### v2.5.7 +* Fixed pushbullet pause command, if you pause mid-battle by pushbullet then the pause will not take effect until you have returned to main screen +* Allow user to pause bot at just about anytime if they actually click the button +* Fix added for wall breaker not being recognized +* Modified troop training order to start with troops that take longer to produce +* Significant modification to trophy dropping. Now will zap DE if you have spells available and there is enough DE in there as entered into the Strategies/Spells/Zap field. Will next drop king or queen if available. Finally will resort to any other troop you have. Additionally the location of the drop has been randomized and it uses red-line detection. + +### v2.5.6 +* Fix for bot thinking it is making troops but barracks aren't making anything +* Failsafe added so that it will eventually start attacking even without full army camp if it gets really stuck (such as you have 199/200 troops but all barracks are trying to make giants) +* Increased amount of information sent out in push bullet messages +* Added customizable decreases in required loot levels for searching + +### v2.5.5 +* Fix for having alternate language selected but still displaying English + +### v2.5.4 +* Fixed spells not being detected +* Fix for archers not being detected +* DLL update for resolving those few people that still had an issue + +### v2.5.3 +* Fixed display of townhall levels in search results. +* Fixed color recognition for archers. +* Added hidden setting for adjusting font size of log. Add it to the [hidden] section of your ini file. For example: "fontsize=6" + +### v2.5.2 +* Improved auto-update. Now bot actually can download and apply the update for you. +* Improved DLL error detection. Informs the user if they are missing the proper version and directs them about how to resolve. Falls back to dropping troops at the edge if DLL isn't working. + +### v2.5.1 +* Added DLL dependancy for some machines that may be missing it. + +### v2.5.0 +* Initially tracked release. Future releases to include full changelog to track all progress. +* Modification of red-line attacking. Near instantaneous now. Additionally added GUI control that allows you to set how certain you want to be of deployment. All the way to the left will be closer but generate more errors, while all the way to the right will launch troops at the edges of the map. +* Addition of multilingual support. Simply add a new language.ini file to the BrokenBot.org\languages folder. The bot will automatically recognize the addition. Make a translation for each key listed in the English.ini file. Anytime you are using a different language and a key is not found it will automatically default back to English. +* Incorporation of bug fixes and stability improvements from Cool7su. * Improved wall images. \ No newline at end of file diff --git a/curl/curl license.txt b/curl/curl license.txt index 9b7be01..c94e788 100644 --- a/curl/curl license.txt +++ b/curl/curl license.txt @@ -1,11 +1,11 @@ -COPYRIGHT AND PERMISSION NOTICE - -Copyright (c) 1996 - 2015, Daniel Stenberg, daniel@haxx.se. - -All rights reserved. - -Permission to use, copy, modify, and distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - +COPYRIGHT AND PERMISSION NOTICE + +Copyright (c) 1996 - 2015, Daniel Stenberg, daniel@haxx.se. + +All rights reserved. + +Permission to use, copy, modify, and distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + Except as contained in this notice, the name of a copyright holder shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization of the copyright holder. \ No newline at end of file