Jump to content

[SOLVED]Pixelsearch control


daniel02
 Share

Recommended Posts

Hi all,

I am looking for a certain pixel to determine if I am moving in a game or not. As sometimes the pixel is missed I want to check it several times. For that I did a while true count until my variable $checkount is greater than 5.

Also the pixelsearch is working the variable is allways 1. I have tested this with the MsgBox. So my while -- wend never ends..

But I do not understand why :)

Any thoughts?

Thanks

Daniel

Func checkmove()
$checkcount = 0
    While $checkcount < 5
            $xposplus = $pos[0] + 110
            $bottom = $pos[1] -152
            $top = $pos[1] - 177 
            $coord = PixelSearch($pos[0], $top, $xposplus, $bottom, 0xC6C4C2, 0, 1, "prog1")
        ; if pixel not found we do not move
            If @error Then
                $chekcount = $checkcount +1
                sleep(100)
                MsgBox(0, "Checkcount", $chekcount)
            EndIf
    WEnd
MsgBox(0, "YOU ARE NOT MOVING")
EndFunc
Edited by daniel02
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...