The Bytecode Club
Log inJoin the club
Video Game Reverse Engineering

v 5.4.2.2

Started by GkevinOD · Jan 11, 2015

178 replies2,557,904 viewsLocked
Jan 13, 2015#151

@GkevinOD

The snapshot of the loot is not working in v5.4.2.2 with background mode turned off. (Cannot test with background mode on, BOT behaves unstable for me)

I changed the code a bit to make this work for me:

Starting line 849:

		If $TakeSS = True Then
			Local $Date = @MDAY & "." & @MON & "." & @YEAR
			Local $Time = @HOUR & "." & @MIN
			_CaptureRegion()
			_ScreenCapture_SaveImage(@ScriptDir & "\Loots\" & $Date & " at " & $Time & ".jpg", $hBitmap)
		EndIf

to:

		If $TakeSS = True Then
			Local $Date = @MDAY & "." & @MON & "." & @YEAR
			Local $Time = @HOUR & "." & @MIN
			_CaptureRegion()
			_GDIPlus_ImageSaveToFile($hBitmap, @ScriptDir & "\Loots\" & $Date & " at " & $Time & ".jpg")
		EndIf
Jan 13, 2015#152

hello, maybe this is stupid question. how to update the bot? i use v5.3.5 because thats the only one who has .exe.
v5.4.2.2 only contain images folder .dll and .au3
i only need to replace it or what?
because i saw in this picture, it show "coc bot v.5.4.2", and mine show "coc bot pre-alpha v5.3.5"
http://potatobot.t15.org/do.php?imgf=142096307797761.png

Jan 13, 2015#153

Hi, just tested this bot and it worked well for me. Until the 6 hour break.

What the bot does is that it will keep trying to reconnect until Supercell allows the connection back, when its back, it doesnt bother to zoom the screen out to max and doesnt realise that. It keep searching for barracks and was unable to since the screens is not zoomed out maxed.. this is what happen for me and i have to zoom it out manually. Good job on the bot so far though!

Jan 13, 2015#154

Mystery7 wrote:

skull1984 wrote:

i'm use win 7 x64. when i start bot, it search attack some base then out of sync (about 5-6 base). after relog game, it doesn't work right.
how i fix it
Thanks so much.

Out of sync is not caused by bot.

HAX4DAYS wrote:

unable to run script. I try to run 5.4.2.2 and I get that. Win 8
X64 tried as x64 and x32

Maybe more details would help ?
what happens?

I do not have any other details. I can provide screen shot when I get home.

Jan 13, 2015#155

HAX4DAYS wrote:

Mystery7 wrote:

skull1984 wrote:

i'm use win 7 x64. when i start bot, it search attack some base then out of sync (about 5-6 base). after relog game, it doesn't work right.
how i fix it
Thanks so much.

Out of sync is not caused by bot.

HAX4DAYS wrote:

unable to run script. I try to run 5.4.2.2 and I get that. Win 8
X64 tried as x64 and x32

Maybe more details would help ?
what happens?

I do not have any other details. I can provide screen shot when I get home.

Well a description would be best screen shot doesnt help we need to know whats happening. Include a screenshot of the folder that has the script and what happens when u try to run it

Jan 13, 2015#156

Today will be my last day of trying the mix bot
I have no issues with it everything fixed except for any bugs in dead base search & hide button

Ill release it once I fix requesting troops as even the newest version has it not working correctly.

Once thats done ill release it for further testing from you guys

Jan 13, 2015#157

For those who like the screenshot feature back in the 5.4.2.2 version paste the following code:

; search for line
_ScreenCapture_SaveImage(@ScriptDir & "\Loots" & $Date & " at " & $Time & ".jpg", $hBitmap)

; replace with line below
_ScreenCapture_SaveImage(@ScriptDir & "\Loots" & $Date & " at " & $Time & ".png", _Capture($HWnD, 0, 0, 860, 720), False)

;begin copy - paste it somewhere in the other functions at the end of the script
Func _Capture($hWnd, $iLeft = 0, $iTop = 0, $iRight = -1, $iBottom = -1)
If $iRight = -1 Then $iRight = _WinAPI_GetSystemMetrics($__SCREENCAPTURECONSTANT_SM_CXSCREEN)
If $iBottom = -1 Then $iBottom = _WinAPI_GetSystemMetrics($__SCREENCAPTURECONSTANT_SM_CYSCREEN)
If $iRight < $iLeft Then Return SetError(-1, 0, 0)
If $iBottom < $iTop Then Return SetError(-2, 0, 0)

Local $iW = ($iRight - $iLeft) + 1
Local $iH = ($iBottom - $iTop) + 1

Local $hDDC = _WinAPI_GetDC($hWnd)
Local $hCDC = _WinAPI_CreateCompatibleDC($hDDC)
Local $hBMP = _WinAPI_CreateCompatibleBitmap($hDDC, $iW, $iH)
_WinAPI_SelectObject($hCDC, $hBMP)

DllCall("User32.dll", "int", "PrintWindow", "hwnd", $hWnd, "hwnd", $hCDC, "int", 0)

 _WinAPI_BitBlt($hCDC, 0, 0, $iW, $iH, $hDDC, $iLeft, $iTop, $__SCREENCAPTURECONSTANT_SRCCOPY)

_WinAPI_ReleaseDC($hWnd, $hDDC)
_WinAPI_DeleteDC($hCDC)

;_ScreenCapture_SaveImage(@ScriptDir&"\new.png", $hBMP, False)
Return $hBMP

EndFunc
; end copy

Jan 13, 2015#158

Working well on Windows 8.1 laptop.

Not running so well on a Windows 2012 R2 but older hardware. I catch it restarting Clash but and see the same issue of not zooming out. Not sure for the Clash restart but it suggests the OS and hardware might be a big issue for many. Note that the older 5.3.4 works with no dead base turned on (or patched).

Edit: Just saw it on Windows 8.1 - Out of sync issue and it recovers nicely.

Jan 13, 2015#159

i had this message from Bot
"[12:02:58 AM] Error cannot check for Dead Base, Attacking...
[12:02:58 AM] *If you used 32Bit, use 64Bit"
so how i fix this problem?

Jan 13, 2015#160

Hmm i get bot is already running when i try to start it on a fresh install of windows 7

This discussion is closed.