Skip to content

Commit

Permalink
v 2.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
codebroken committed May 28, 2015
1 parent 60e9e93 commit 2132e78
Show file tree
Hide file tree
Showing 246 changed files with 634 additions and 291 deletions.
9 changes: 6 additions & 3 deletions BrokenBot.au3
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
#pragma compile(Icon, "BrokenBot.org\images\icons\brokenbot.ico")
#pragma compile(FileDescription, BrokenBot.org - Clash of Clans Bot)
#pragma compile(ProductName, BrokenBot.org - Clash of Clans Bot)
#pragma compile(ProductVersion, 2.6.0)
#pragma compile(FileVersion, 2.6.0)
#pragma compile(ProductVersion, 2.7.0)
#pragma compile(FileVersion, 2.7.0)

#include <GUIConstants.au3>

$sBotVersion = "2.6.0"
$sBotVersion = "2.7.0"
$sBotTitle = "BrokenBot.org - Break FREE - v" & $sBotVersion

If FileExists (@ScriptDir & "\.developer") Then
Expand Down Expand Up @@ -85,6 +85,9 @@ If Not IsArray($ret) Then
EndIf
EndIf

;Only enable button start after all Initiation done.
GUICtrlSetData($btnStart,GetLangText("btnStart") )
GUICtrlSetState($btnStart, $GUI_ENABLE)
While 1
If $StartImmediately Then
$StartImmediately = False
Expand Down
Binary file modified BrokenBot.exe
Binary file not shown.
Binary file modified BrokenBot.org/BrokenBot32.dll
Binary file not shown.
36 changes: 36 additions & 0 deletions BrokenBot.org/functions/ImageSearch/checkDarkElix.au3
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
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)
_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
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("msgDLLFailure"), $COLOR_RED)
$DEx = 0
$DEy = 0
Return False ; return 0
EndIf
EndFunc ;==>checkDarkElix
2 changes: 1 addition & 1 deletion BrokenBot.org/functions/Other/checkupdate.au3
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Func checkupdate()
If IsChecked($chkUpdate) Then
Local $sFilePath = @TempDir & "\update.dat"

Local $hMasterVersion = InetGet("https://github.com/codebroken/BrokenBot/blob/master/BrokenBot.au3", $sFilePath, 3)
Local $hMasterVersion = InetGet("http://www.brokenbot.org/page.php?p=vcheck", $sFilePath, 3)

If $hMasterVersion = 0 Then
SetLog(GetLangText("msgFailedVersion"))
Expand Down
68 changes: 68 additions & 0 deletions BrokenBot.org/functions/Strategies/SharedFunction.au3
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,72 @@ Func ChkDisconnection($disconnected = False)
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
2 changes: 2 additions & 0 deletions BrokenBot.org/functions/functions.au3
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#include "GUI\frmBugReport.au3"
#include "GUI\WindowFixing.au3"

#include "ImageSearch\checkDarkElix.au3"

#include "Other\checkupdate.au3"
#include "Other\GeneralFunctions.au3"
#include "Other\StatusCheck.au3"
Expand Down
20 changes: 18 additions & 2 deletions BrokenBot.org/languages/English.ini
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ spellNameRage = "Rage"
spellNameJump = "Jump"
spellNameFreeze = "Freeze"
btnStart = "Start Bot"
btnStartInit = "Initiating..."
btnStop = "Stop Bot"
btnHide = "Hide BS"
btnAtkNow = "Attack Now"
Expand Down Expand Up @@ -83,6 +84,9 @@ 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"
Expand Down Expand Up @@ -147,9 +151,9 @@ lblSpellCap = "Spell factory capacity:"
lblCapacity = "Camp Capacity :"
chkTrap = "Auto Rearm Traps"
chkTrapTip = "Auto rearm for Traps, Crossbows & Inferno Towers"
lblSearchsp = "Seach Base Speed:"
lblSearchsp = "Search Base Speed:"
lblSearchspTip = "Set search base speed to higher number if having frequent server sync issue"
lblSearchspd = "Tips: 0 = Fast, 10 = 15 seconds wait"
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"
Expand Down Expand Up @@ -247,6 +251,8 @@ 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"
Expand Down Expand Up @@ -463,6 +469,10 @@ 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"
msgOutDeadFound = "~~~~~~~Outside Townhall in Dead Base Found!~~~~~~~"
Expand Down Expand Up @@ -500,6 +510,7 @@ 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 "
Expand Down Expand Up @@ -532,6 +543,9 @@ 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 "
Expand Down Expand Up @@ -598,11 +612,13 @@ 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!"
boxAlreadyRunning = "Bot is already running."
boxCompile1 = "Don't Run/Compile Script (x64)! try to Run/Compile Script (x86) to getting this bot work."
boxCompile2 = "If this message still appear, try to re-install your AutoIt with newer version."
Expand Down
1 change: 0 additions & 1 deletion COCBot/Functions.au3
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include "functions\Image Search\checkButtonUpgrade.au3"
#include "functions\Image Search\checkDeadBase.au3"
#include "functions\Image Search\checkTownhall.au3"
#include "functions\Image Search\checkDarkElix.au3"
#include "functions\Image Search\checkWall.au3"

#include "functions\Main Screen\checkMainScreen.au3"
Expand Down
16 changes: 8 additions & 8 deletions COCBot/GUI Control.au3
Original file line number Diff line number Diff line change
Expand Up @@ -85,20 +85,20 @@ Func GUIControl($hWind, $iMsg, $wParam, $lParam)
chkUpgrade2()
Case $chkUpgrade3
chkUpgrade3()
Case $chkUpgrade4
chkUpgrade4()
Case $chkUpgrade5
chkUpgrade5()
Case $chkUpgrade6
chkUpgrade6()
;~ Case $chkUpgrade4
;~ chkUpgrade4()
;~ Case $chkUpgrade5
;~ chkUpgrade5()
;~ Case $chkUpgrade6
;~ chkUpgrade6()
Case $UseJPG
UseJPG()
Case $UseAttackJPG
UseAttackJPG()
Case $lblpushbulletenabled
lblpushbulletenabled()
Case $btnGitHub
ShellExecute("http://http://forum.brokenbot.org/forum-8.html")
ShellExecute("http://www.brokenbot.org/page.php?p=support")
Case $btnCloseBR
GUISetState(@SW_ENABLE, $frmBot)
GUISetState(@SW_HIDE, $frmBugReport)
Expand Down Expand Up @@ -663,7 +663,7 @@ Func btnBugRep()
EndFunc ;==>btnBugRep

Func openWebsite()
ShellExecute("http://www.brokenbot.org")
ShellExecute("http://www.brokenbot.org/page.php?p=main")
EndFunc ;==>openWebsite

Func _btnRefresh()
Expand Down
Loading

0 comments on commit 2132e78

Please sign in to comment.