kibbles18 Posted August 4, 2010 Posted August 4, 2010 hi i am working on a bot for a non multiplayer, bot able game. i need to know how to get the script to call a function only when the pixelsearch can not find the designated pixel. code $targ = PixelSearch( 0, 0, 1600, 900, 0x49391D, 1). how can i add this to a code so that if the pixel searched for is not found, a function is called? thanks in advance
somdcomputerguy Posted August 4, 2010 Posted August 4, 2010 Success: Returns a two-element array of pixel's coordinates. (Array[0"> = x, Array[1] = y). Failure: Sets @error to 1 if color is not found. So code like this may work.. $targ = PixelSearch( 0, 0, 1600, 900, 0x49391D, 1) If @error = 1 Then ;Pixel Not Found Code Else ;Pixel Found Code EndIf - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
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