Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Image search help?
#6
(02-24-2015, 07:17 PM)knowjack Wrote:  Thanks Snarg!  Appreciate your continued effort to help. Smile

I'm using the function posted above just like checkTownHall.au3, except instead of searching for 5 different images, using only 1?  All I do is look for successful return value and the x,y positions in the function call, like this:
Code:
If CheckSmashedTownhall() = 1 Then  ; check to see if TH is smashed.
   SetLog("TH Attack successful!", $COLOR_BLUE)
   ExitLoop 2
EndIf


The reason I used _CaptureRegion() like checkTownHall() function; is that it appears to get the BS offsets and loads $hHBitmap (showing only the non-background code)
Code:
getBSPos()
$hHBitmap = _ScreenCapture_Capture("", $iLeft + $BSpos[0], $iTop + $BSpos[1], $iRight + $BSpos[0], $iBottom + $BSpos[1])
Global $hBitmap = _GDIPlus_BitmapCreateFromHBITMAP($hHBitmap)

Unless I am reading image search wrong, _ImageSearch calls _ImageSearchArea, and it checks to see if $hHBitmap has an image loaded from _captureRegion(), then executes DLLCALL to search for the image passed to it??

I was really hoping to reuse the existing image capture/search functions as the initially seemed pretty straight forward.  But after beating my head against the wall on this off/on for a couple days, I'm just getting more confused.
  Saddest

try writing the hBitmap to an .bmp
_ScreenCapture_SaveImage("C:\COC-Bot-master\images\GdiPlus_Screen.bmp", $hHBitmap)

i have some weird screenshots...Only the captureregion background mode option works for me.
Reply
 


Messages In This Thread
Image search help? - by knowjack - 02-24-2015, 07:50 AM
RE: Image search help? - by Snarg - 02-24-2015, 09:18 AM
RE: Image search help? - by knowjack - 02-24-2015, 10:40 AM
RE: Image search help? - by Snarg - 02-24-2015, 02:04 PM
RE: Image search help? - by knowjack - 02-24-2015, 07:17 PM
RE: Image search help? - by Henk500 - 02-25-2015, 12:19 AM
RE: Image search help? - by knowjack - 02-25-2015, 06:14 AM
RE: Image search help? - by Snarg - 02-25-2015, 09:17 AM
RE: Image search help? - by terminus - 02-25-2015, 09:11 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)

About The Bytecode Club

We're a community focused on Reverse Engineering, we try to target Java/Android but we also include other langauges/platforms. We pride ourselves in supporting and free and open sourced applications.

Website