The Bytecode Club
Log inJoin the club
Video Game Reverse Engineering

🧱 5.4.2.5.2 - Better Troops Deployment (LF Style), Fixed Train Troops

Started by safar46 · Jan 25, 2015

546 replies7,799,713 viewsLocked
Feb 3, 2015#441

thanks fast update

Feb 3, 2015#442

hi @safar46 take a look at this changes in zoomout
the first pixel you check is too much near the edge, so it's likely to fail for different window borders (i think i was in non aero and it kept zooming out forever)
also sometimes when starting the bot, the bluestacks container gets focus and a little drop down menu pops up in BS originating in (0,0) with 3 items and again it's an infinite loop with arrow key down scrolling the menu and not zooming

	Func ZoomOut() ;Zooms out
		If _Sleep(500) Then Return
		_CaptureRegion(0, 0, 860, 2)
		While _GetPixelColor(1, 1) <> Hex(0x000000, 6) And _GetPixelColor(850, 1) <> Hex(0x000000, 6)
			ControlSend("BlueStacks App Player", "", "", "{DOWN}", 0)
			If _Sleep(500) Then Return
			Click(760,1)
			If _Sleep(500) Then Return
			_CaptureRegion(5, 0, 860, 2)
		WEnd
		SetLog("Zoomed Out")
	EndFunc   ;==>ZoomOut

you missed this part of the code in imagesearcharea from my previous posts
depending on what function gets called from the dll, you'll end up having coordinates relative to the window or to the desktop.
so it' necessary to adjust those coords to locate the TH position relative to the bs window

			If $resultPosition = 1 Then
				$x = $x + Int(Number($array[4]) / 2) - $x1 ;INDY: should adjust coordinates
				$y = $y + Int(Number($array[5]) / 2) - $y1 ;INDY: should adjust coordinates
			EndIf

also
if you run the bot in search mode, it's impossible to stop. it just starts again when pressing the stop button. i haven't had the time to investigate this.

EDIT: in last 5.4.2.5 i noticed this, seems a typo

						If ZombieSearch() Then
							If ZombieSearch() Then
								SetLog("~~~~~~~Dead Base Found!~~~~~~~")
							EndIf

should be

						If ZombieSearch() Then
								SetLog("~~~~~~~Dead Base Found!~~~~~~~")
					
Feb 3, 2015#443

hi @safar46 take a look at this changes in zoomout
the first pixel you check is too much near the edge, so it's likely to fail for different window borders (i think i was in non aero and it kept zooming out forever)
also sometimes when starting the bot, the bluestacks container gets focus and a little drop down menu pops up in BS originating in (0,0) with 3 items and again it's an infinite loop with arrow key down scrolling the menu and not zooming

	Func ZoomOut() ;Zooms out
		If _Sleep(500) Then Return
		_CaptureRegion(0, 0, 860, 2)
		While _GetPixelColor(1, 1) <> Hex(0x000000, 6) And _GetPixelColor(850, 1) <> Hex(0x000000, 6)
			ControlSend("BlueStacks App Player", "", "", "{DOWN}", 0)
			If _Sleep(500) Then Return
			Click(760,1)
			If _Sleep(500) Then Return
			_CaptureRegion(5, 0, 860, 2)
		WEnd
		SetLog("Zoomed Out")
	EndFunc   ;==>ZoomOut

you missed this part of the code in imagesearcharea from my previous posts
depending on what function gets called from the dll, you'll end up having coordinates relative to the window or to the desktop.
so it' necessary to adjust those coords to locate the TH position relative to the bs window

			If $resultPosition = 1 Then
				$x = $x + Int(Number($array[4]) / 2) - $x1 ;INDY: should adjust coordinates
				$y = $y + Int(Number($array[5]) / 2) - $y1 ;INDY: should adjust coordinates
			EndIf

also
if you run the bot in search mode, it's impossible to stop. it just starts again when pressing the stop button. i haven't had the time to investigate this.

hmm, i dont know since im only using aero..

----EDIT---
okay im wrong..

Feb 3, 2015#444

i have a LocateTH function set up for testing purposes.

if i don't adjust coordinates, the th position i get is relative to the desktop.

Feb 3, 2015#445

✅

i have a LocateTH function set up for testing purposes.

if i don't adjust coordinates, the th position i get is relative to the desktop.

yeah, it because you not hide your BS. i added code if BS is hidden, i just using old code. but if window is not hidden. i use your code
implemented in next update. Thanks!!! 🙂

Feb 3, 2015#446

you're welcome. btw i'm testing the modified zoomout for a while now, nothing to note. i think it's not harmful to get it merged.

did you catch my edit in previous post about double call to zombiesearch?

EDIT: great! less things to patch for me in my local copy every time 😉 lol
next i'd like to see the donatecc behavior from Fast French version, so that it also checks for new messages counter and opens the chat to inspect

Feb 3, 2015#447

you're welcome. btw i'm testing the modified zoomout for a while now, nothing to note. i think it's not harmful to get it merged.

did you catch my edit in previous post about double call to zombiesearch?

EDIT: great! less things to patch for me in my local copy every time 😉 lol
next i'd like to see the donatecc behavior from Fast French version, so that it also checks for new messages counter and opens the chat to inspect

It easy, just wait 5.5 🙂
because now i'm work on it, and in this mod, (5.4.2.5.x) i'm only make it stable.

Feb 3, 2015#448

@safar46

Two Errors.

It always says TH outside when not and says attacking, and says cannot locate dead base ..

then chose a not even dead base...

Feb 3, 2015#449

download the latest version please, working super fine for me with deadbase

Feb 3, 2015#450

@safar46

Two Errors.

It always says TH outside when not and says attacking, and says cannot locate dead base ..

then chose a not even dead base...

You are using 5.4.2.4.4. the new version is 5.4.2.5.1

Can you read the THREAD NAME???

This discussion is closed.