Sign in to follow this  
Followers 0
kibbles18

pixel functions

2 posts in this topic

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

Share this post


Link to post
Share on other sites



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.

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