AKiller Posted November 29, 2007 Share Posted November 29, 2007 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 Link to comment Share on other sites More sharing options...
galpha Posted November 29, 2007 Share Posted November 29, 2007 (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 November 29, 2007 by galpha Link to comment Share on other sites More sharing options...
Nevin Posted November 29, 2007 Share Posted November 29, 2007 (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 November 29, 2007 by Nevin Link to comment Share on other sites More sharing options...
qazwsx Posted November 30, 2007 Share Posted November 30, 2007 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. Link to comment Share on other sites More sharing options...
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