Jump to content

PixelCoordMode Pixelsearch problem


Recommended Posts

WinWaitActive("GAMES")

WinMove ( "GAMES", "", 0, 0 , 210, 330, 20)

ControlMove("GAMeS", "", "[CLASS:MacromediaFlashPlayerActiveX; INSTANCE:1]", 0, 0, 160, 120)

AutoItSetOption ( "Pixelcoordmode" , 2 ) ;1=absolute, 0=relative, 2=client

$lifecheck = PixelSearch( 46, 3, 48, 8, 0xFFFFFF, 1)

While not @error

sleep(1000)

$lifecheck = PixelSearch( 46, 3, 48, 8, 0xFFFFFF, 1) ;;; redefine them according to client mode

WEnd

msgbox (4096, "pixelsearch", "full healed" )

so i make it search for WHITE at where my life bar is... i'm fully healed when there is no more white.... but for some reason it always think im fully healed...aka no white no matter what.

when i use the autoit function... this is supposed to make my pixelsearch function click only in the Client window right?

Link to comment
Share on other sites

I would suggest to try with PixelGetColor ( x , y ) what you get back as color for the points you want to investigate.

for $x=46 to 48
   for $y=3 to 8
        consolewrite(hex(pixelgetcolor($x,$y)) & ";")
   next
   consolewrite(@CRLF)
next
Link to comment
Share on other sites

I just posted something here that might help you:

http://www.autoitscript.com/forum/index.php?showtopic=68804

While 1
    For $Line = 1 To 300 ;length of the scan line in pixels
        If PixelGetColor($InitialPosition + $Line, 345) < 14777215 Then ;you've hit the color range you are after                           
            ExitLoop
            ExitLoop
        EndIf
    Next
    Sleep(10)
WEnd
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...