Sign in to follow this  
Followers 0
daniel02

[SOLVED]Pixelsearch control

2 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites



Hi,

I found the error.

This post can be closed.

Thanks

Daniel

Share this post


Link to post
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
Sign in to follow this  
Followers 0