cpil Posted November 5, 2010 Posted November 5, 2010 The program I'm running is meant to scroll over an object (ego.bmp) where a box will pop up to the lower right of it, and I'm using pixelsearch to determine if there is red. It works perfectly about half the time, but the other half -- it seems to be returning @error when the pixel is there. I can simply exit the compiled exe and start it again and again until the loop works correctly. But I'm sure there's a way to avoid that! Here is the function I'm using. The function is looped until $hungry=1: Func IsHungry() _ImageSearch("Ego.bmp",1,$x,$y,60) MouseMove($x,$y,1) Sleep(1000) $h = PixelSearch($x+100,$y+160,$x+200,$y+260,0xFF0000) If Not @error Then $hungry = 1 Else $hungry = 0 MouseMove($x,$y+100,1) Sleep(60000) EndIf EndFunc Any help or ideas would be much appreciated!
Bert Posted November 6, 2010 Posted November 6, 2010 no thanks. It looks like you're working on a game bot. The Vollatran project My blog: http://www.vollysinterestingshit.com/
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now