-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
codebroken
committed
May 30, 2015
1 parent
2132e78
commit 0548d4a
Showing
13 changed files
with
108 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
; 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) | ||
_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 | ||
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("msgDLLFailure"), $COLOR_RED) | ||
$DEx = 0 | ||
$DEy = 0 | ||
Return "-" ; return 0 | ||
EndIf | ||
EndFunc ;==>checkTownhall |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
; 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", "BrokenBotMatchBuilding", "ptr", $sendHBitmap, "int", 27, "int", 3, "int", 17, "int", 1) | ||
_WinAPI_DeleteObject($sendHBitmap) | ||
If IsArray($res) Then | ||
If $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], "|") | ||
$numBldg = $expRet[0] | ||
For $j = 2 To UBound($expRet) - 1 step 6 | ||
$ResX = $expRet[$j] | ||
$ResY = $expRet[$j+1] | ||
Click($ResX, $ResY) | ||
Click(1, 1) | ||
Sleep(300) | ||
Next | ||
$foundResource = true | ||
EndIf | ||
Else | ||
SetLog(GetLangText("msgDLLFailure"), $COLOR_RED) | ||
$ResX = 0 | ||
$ResY = 0 | ||
Return False ; return 0 | ||
EndIf | ||
$i += 1 | ||
Until $i = 2 | ||
EndIf | ||
Return | ||
EndFunc ;==>checkDarkElix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.