Sign in to follow this  
Followers 0
AKiller

PixelSearch, then click.

4 posts in this topic

How do i search the pixel and then click it cause its an auto for a game and it moves around..

Pixelsearch (500, 600, 600, 500, 0x969696) - I have no clue if i have that right..

I am new to this so i dont know anything...

AIM = Subbro04

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

How do i search the pixel and then click it cause its an auto for a game and it moves around..

Pixelsearch (500, 600, 600, 500, 0x969696) - I have no clue if i have that right..

I am new to this so i dont know anything...

AIM = Subbro04

PixelSearch:

Return Value

Success: Returns a two-element array of pixel's coordinates. (Array[0] = x, Array[1] = y)

So, if it finds the pixel, you will have your coords in the array.

Make sure you put it like this in your code:

$array = Pixelsearch (500, 600, 600, 500, 0x969696)

$x = $array[0]

$y = $array[1]

then to click it:

MouseClick ( "left" , $x, $y )

Edited by galpha

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Heh, I got distracted and forgot I was even typing this an hour ago.

It looks fine to me. You need to assign the values the function returns to a variable, though.

You found the pixelsearch function. If you read the help file that comes with it, you should know what to do.

The guy above gives a good example. Also, you could just skip out on the extra variables and do it like this

$array = Pixelsearch (500, 600, 600, 500, 0x969696)

MouseClick ( "left" , $array[0], $array[1] )

Note that array is just the variable name, you could call it anything you want. Autoit will make it an array for you by itself.

Edited by Nevin

Share this post


Link to post
Share on other sites

Use an if statement with _isArray or check the error level so if the pixel search does not find the value your program does not crash.

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