Skip to content

Commit 3dc3448

Browse files
author
codebroken
committed
Version 3.1
1 parent 878d5b6 commit 3dc3448

70 files changed

Lines changed: 4516 additions & 2165 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

BrokenBot.au3

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
#pragma compile(Icon, "BrokenBot.org\images\icons\brokenbot.ico")
44
#pragma compile(FileDescription, BrokenBot.org - Clash of Clans Bot)
55
#pragma compile(ProductName, BrokenBot.org - Clash of Clans Bot)
6-
#pragma compile(ProductVersion, 2.8.0)
7-
#pragma compile(FileVersion, 2.8.0)
6+
#pragma compile(ProductVersion, 3.1.0)
7+
#pragma compile(FileVersion, 3.1.0)
88

99
#include <GUIConstants.au3>
1010

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

14-
If FileExists (@ScriptDir & "\.developer") Then
15-
$sBotTitle = "BrokenBot - In Development"
14+
If FileExists(@ScriptDir & "\.developer") Then
15+
$sBotTitle = "BrokenBot.org - In Development"
1616
EndIf
1717

1818
Global $StartupLanguage = IniRead(@ScriptDir & "\config\default.ini", "config", "language", "English")
@@ -79,14 +79,27 @@ _WinAPI_DeleteObject($hHBitmap)
7979
If Not IsArray($ret) Then
8080
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
8181
ShellExecute("https://www.microsoft.com/en-us/download/details.aspx?id=40784")
82+
DllClose($KernelDLL)
8283
_GDIPlus_Shutdown()
84+
_Crypt_Shutdown()
8385
_GUICtrlRichEdit_Destroy($txtLog)
8486
Exit
8587
EndIf
88+
ElseIf $ret[0] = -2 Then
89+
MsgBox(48, "BrokenBot.org", GetLangText("msgLicense") & @CRLF & @CRLF & "Please visit BrokenBot.org")
90+
EndIf
91+
92+
If IniRead(@LocalAppDataDir & "\BrokenBot.org.ini", "default", "1", "") = "" Or IniRead(@LocalAppDataDir & "\BrokenBot.org.ini", "default", "2", "") = "" Then
93+
GUICtrlSetImage($btnBBValidate, @ScriptDir & "\images\Resource\bad.bmp")
94+
GUICtrlSetTip($btnBBValidate, GetLangText("tipBBValidBad"))
95+
Else
96+
GUICtrlSetData($inpBBPassword, _Decrypt(IniRead(@LocalAppDataDir & "\BrokenBot.org.ini", "default", "2", "")))
97+
_btnBBValidate()
98+
GUICtrlSetData($inpBBPassword, "")
8699
EndIf
87100

88101
;Only enable button start after all Initiation done.
89-
GUICtrlSetData($btnStart,GetLangText("btnStart") )
102+
GUICtrlSetData($btnStart, GetLangText("btnStart"))
90103
GUICtrlSetState($btnStart, $GUI_ENABLE)
91104
While 1
92105
If $StartImmediately Then

BrokenBot.exe

33 KB
Binary file not shown.

BrokenBot.org/BrokenBot32.dll

18.8 MB
Binary file not shown.

BrokenBot.org/functions/ImageSearch/checkDarkElix.au3

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ Func checkDarkElix()
1616
$DEx = 0
1717
$DEy = 0
1818
Return False ; return 0
19+
ElseIf $res[0] = -2 Then
20+
SetLog(GetLangText("msgLicense"), $COLOR_RED)
1921
Else
2022
$res = StringSplit($res[0], "|", 2)
2123
$DEx = $res[1]
@@ -33,7 +35,7 @@ Func checkDarkElix()
3335
Return True
3436
EndIf
3537
Else
36-
SetLog(GetLangText("msgDLLFailure"), $COLOR_RED)
38+
SetLog(GetLangText("msgDLLError"), $COLOR_RED)
3739
$DEx = 0
3840
$DEy = 0
3941
Return False ; return 0

BrokenBot.org/functions/ImageSearch/checkTownhall.au3

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ Func checkTownhall()
1515
$THx = 0
1616
$THy = 0
1717
Return "-" ; return 0
18+
ElseIf $res[0] = -2 Then
19+
SetLog(GetLangText("msgLicense"), $COLOR_RED)
1820
Else
1921
$res = StringSplit($res[0], "|", 2)
2022
$THx = $res[1]
@@ -32,11 +34,11 @@ Func checkTownhall()
3234
If $res[4] < 7 Then
3335
Return $THText[0]
3436
Else
35-
Return $THText[$res[4]-6]
37+
Return $THText[$res[4] - 6]
3638
EndIf
3739
EndIf
3840
Else
39-
SetLog(GetLangText("msgDLLFailure"), $COLOR_RED)
41+
SetLog(GetLangText("msgDLLError"), $COLOR_RED)
4042
$THx = 0
4143
$THy = 0
4244
Return "-" ; return 0

BrokenBot.org/functions/Other/GeneralFunctions.au3

Lines changed: 37 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -70,41 +70,63 @@ Func GetLangText($Key)
7070
$ReturnStr = ""
7171
If IsDeclared("cmbLanguage") Then
7272
$array = _GUICtrlComboBox_GetListArray($cmbLanguage)
73-
$CurrLangSel = $array[_GUICtrlComboBox_GetCurSel($cmbLanguage)+1]
73+
$CurrLangSel = $array[_GUICtrlComboBox_GetCurSel($cmbLanguage) + 1]
7474
$ReturnStr = IniRead(@ScriptDir & "\BrokenBot.org\languages\" & $CurrLangSel & ".ini", "general", $Key, "")
7575
If $ReturnStr = "" Then
7676
$ReturnStr = IniRead(@ScriptDir & "\BrokenBot.org\languages\English.ini", "general", $Key, "")
7777
EndIf
78-
;~ If IsDeclared("txtLog") And IsDeclared("statLog") Then
79-
;~ SetLog("SL:" & $StartupLanguage)
80-
;~ SetLog("CL:" & $CurrLangSel)
81-
;~ SetLog("Key:" & $Key)
82-
;~ SetLog("Result:" & $ReturnStr)
83-
;~ EndIf
8478
Else
8579
$ReturnStr = IniRead(@ScriptDir & "\BrokenBot.org\languages\" & $StartupLanguage & ".ini", "general", $Key, "")
8680
If $ReturnStr = "" Then
8781
$ReturnStr = IniRead(@ScriptDir & "\BrokenBot.org\languages\English.ini", "general", $Key, "")
8882
EndIf
89-
;~ If IsDeclared("txtLog") And IsDeclared("statLog") Then
90-
;~ SetLog("SL:" & $StartupLanguage)
91-
;~ SetLog("Key:" & $Key)
92-
;~ SetLog("Result:" & $ReturnStr)
93-
;~ EndIf
9483
EndIf
9584
Return $ReturnStr
96-
EndFunc
85+
EndFunc ;==>GetLangText
9786

9887
Func PopulateLanguages()
9988
$searchfile = FileFindFirstFile(@ScriptDir & "\BrokenBot.org\languages\*.ini")
10089
$txtLang = ""
10190
While True
10291
$newfile = FileFindNextFile($searchfile)
10392
If @error Then ExitLoop
104-
$txtLang = $txtLang & StringLeft($newfile, StringLen($newfile)-4) & "|"
93+
$txtLang = $txtLang & StringLeft($newfile, StringLen($newfile) - 4) & "|"
10594
WEnd
10695
FileClose($searchfile)
10796
$txtLang = StringLeft($txtLang, StringLen($txtLang) - 1)
10897
_GUICtrlComboBox_ResetContent($cmbLanguage)
10998
GUICtrlSetData($cmbLanguage, $txtLang)
110-
EndFunc
99+
EndFunc ;==>PopulateLanguages
100+
101+
Func _Decrypt($sData)
102+
Local $hKey = _Crypt_DeriveKey("DE8D16C2C59B93F3F0682250B", 0x00006610)
103+
Local $sDecrypted = BinaryToString(_Crypt_DecryptData(Binary($sData), $hKey, $CALG_USERKEY))
104+
_Crypt_DestroyKey($hKey)
105+
Return $sDecrypted
106+
EndFunc ;==>_Decrypt
107+
108+
Func _Encrypt($sData)
109+
Local $hKey = _Crypt_DeriveKey("DE8D16C2C59B93F3F0682250B", 0x00006610)
110+
Local $bEncrypted = _Crypt_EncryptData($sData, $hKey, $CALG_USERKEY)
111+
_Crypt_DestroyKey($hKey)
112+
Return $bEncrypted
113+
EndFunc ;==>_Encrypt
114+
115+
Func urlencode($str, $plus = True)
116+
Local $i, $return, $tmp, $exp
117+
$return = ""
118+
$exp = "[a-zA-Z0-9-._~]"
119+
If $plus Then
120+
$str = StringReplace($str, " ", "+")
121+
$exp = "[a-zA-Z0-9-._~+]"
122+
EndIf
123+
For $i = 1 To StringLen($str)
124+
$tmp = StringMid($str, $i, 1)
125+
If StringRegExp($tmp, $exp, 0) = 1 Then
126+
$return &= $tmp
127+
Else
128+
$return &= StringMid(StringRegExpReplace(StringToBinary($tmp, 4), "([0-9A-Fa-f]{2})", "%$1"), 3)
129+
EndIf
130+
Next
131+
Return $return
132+
EndFunc ;==>urlencode
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
Func _SatSearch($iLeft, $iTop, $iWidth, $iHeight, $satMin, $satMax)
2+
_CaptureRegion($iLeft, $iTop, $iLeft + $iWidth, $iTop + $iHeight)
3+
Local $RGB[3]
4+
For $x = 0 To $iWidth - 1
5+
For $y = 0 To $iHeight - 1
6+
$color = _GetPixelColor($x, $y)
7+
$RGB[0] = Dec(StringMid(String($Color), 1, 2))
8+
$RGB[1] = Dec(StringMid(String($Color), 3, 2))
9+
$RGB[2] = Dec(StringMid(String($Color), 5, 2))
10+
$HSL = RGBtoHSL($RGB)
11+
If $HSL[1] > $satMin And $HSL[1] < $satMax Then Return True
12+
Next
13+
Next
14+
Return False
15+
EndFunc ;==>_MultiPixelSearch
16+
17+
18+
Func RGBtoHSL($arColors)
19+
Const $MaxHSL = 100
20+
Const $MaxRGB = 255
21+
22+
If UBound($arColors) <> 3 Or UBound($arColors, 0) <> 1 Then Return SetError(1, 0, 0)
23+
24+
Local $nH, $nS, $nL
25+
Local $nR = Number($arColors[0])/$MaxRGB
26+
Local $nG = Number($arColors[1])/$MaxRGB
27+
Local $nB = Number($arColors[2])/$MaxRGB
28+
29+
Local $nMax = $nR
30+
If $nMax < $nG Then $nMax = $nG
31+
If $nMax < $nB Then $nMax = $nB
32+
33+
Local $nMin = $nR
34+
If $nMin > $nG Then $nMin = $nG
35+
If $nMin > $nB Then $nMin = $nB
36+
37+
Local $nMinMaxSum = ($nMax + $nMin)
38+
Local $nMinMaxDiff = ($nMax - $nMin)
39+
40+
$nL = $nMinMaxSum/2
41+
If $nMinMaxDiff = 0 Then
42+
$nH = 0
43+
$nS = 0
44+
Else
45+
If $nL < 0.5 Then
46+
$nS = $nMinMaxDiff/$nMinMaxSum
47+
Else
48+
$nS = $nMinMaxDiff/(2 - $nMinMaxSum)
49+
EndIf
50+
51+
Switch $nMax
52+
Case $nR
53+
$nH = ($nG - $nB)/(6 * $nMinMaxDiff)
54+
Case $nG
55+
$nH = ($nB - $nR)/(6 * $nMinMaxDiff) + 1/3
56+
Case $nB
57+
$nH = ($nR - $nG)/(6 * $nMinMaxDiff) + 2/3
58+
EndSwitch
59+
If $nH < 0 Then $nH += 1
60+
If $nH > 1 Then $nH -= 1
61+
EndIf
62+
63+
$arColors[0] = $nH * $MaxHSL
64+
$arColors[1] = $nS * $MaxHSL
65+
$arColors[2] = $nL * $MaxHSL
66+
67+
Return $arColors
68+
EndFunc

0 commit comments

Comments
 (0)