hobodude666 Posted August 22, 2005 Share Posted August 22, 2005 I used a pixel detector and i got 36, 366 Pixel:4681596 How do i make a script that allows me to Click on that certain pixel? Link to comment Share on other sites More sharing options...
layer Posted August 22, 2005 Share Posted August 22, 2005 First, you have to code it ? Show us what you've tried. Search in the helpfile for:MouseMoveMouseClickPixelSearchShould get ya started... FootbaG Link to comment Share on other sites More sharing options...
quaizywabbit Posted August 22, 2005 Share Posted August 22, 2005 36, 366 Pixel:4681596the 36 and 366 are coordinates( but are they screen coordinates, or client coordinates?) the 4681596 should be the pixel's color value.lookup PixelSearch() and MouseClick() in the help file. [u]Do more with pre-existing apps![/u]ANYGUIv2.8 Link to comment Share on other sites More sharing options...
hobodude666 Posted August 22, 2005 Author Share Posted August 22, 2005 (edited) Those Coords are from the Program. Here's What i got so far:BTW i couldnt find the commands to open a PID process and couldnt get ALT TAB to work.MouseClick("Left" , 247, 847 , 2 , 1)Sleep(2000)MouseClick("Left" , 560, 445 , 1 , 1)Sleep(100)MouseClick("Left" , 491, 649 , 1 , 1)Sleep(100)MouseClick("Left" , 491, 649 , 1 , 1)Sleep(100)MouseClick("Left" , 491, 649 , 1 , 1)Sleep(100)I was thinking about Pixel detecting that pixel i mentioned and then getting the MouseCoords for it then Click. Would that be possible? Edited August 22, 2005 by hobodude666 Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted August 22, 2005 Moderators Share Posted August 22, 2005 (edited) Opt("MouseCoordMode", 0); the 0 is for window coords Opt("PixelCoordMode", 0); same $Coord = PixelSearch(0, 0, 200, 366);imagine a square: 1st 0 = x top left - 2nd 0 y top left - 200 = x bottom right - 366 = y bottom right If Not @error Then MouseClick("Left", $Coord[0], $Coord[1], 1, 1) EndIf Edit: Variable name was wrong Edited August 22, 2005 by ronsrules Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
hobodude666 Posted August 22, 2005 Author Share Posted August 22, 2005 MouseClick("Left" , 247, 847 , 2 , 1)Sleep(2000)MouseClick("Left" , 560, 445 , 1 , 1)Sleep(100)MouseClick("Left" , 491, 649 , 1 , 1)Sleep(100)MouseClick("Left" , 491, 649 , 1 , 1)Sleep(100)MouseClick("Left" , 491, 649 , 1 , 1)Sleep(100)Opt("MouseCoordMode", 0); the 0 is for window coordsOpt("PixelCoordMode", 0); same$Coord = PixelSearch(0, 0, 200, 366);imagine a square: 1st 0 = x top left - 2nd 0 y top left - 200 = x bottom right - 366 = y bottom rightIf Not @error ThenMouseClick("Left", $Coord[0], $Coord[1], 1, 1)EndIfLike that?With the $coord it will click the area around that pixel like a square, am i correct? Link to comment Share on other sites More sharing options...
quaizywabbit Posted August 22, 2005 Share Posted August 22, 2005 it will click directly on that pixel, if PixelSearch found the pixel in the search area [u]Do more with pre-existing apps![/u]ANYGUIv2.8 Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted August 22, 2005 Moderators Share Posted August 22, 2005 Like that?With the $coord it will click the area around that pixel like a square, am i correct?<{POST_SNAPBACK}>Just a suggestion since your using MouseClick() in other parts of your script:Top:Opt("MouseCoordMode", 0); the 0 is for window coords Opt("PixelCoordMode", 0); same While 1 Sleep(100) MouseClick("Left" , 247, 847 , 2 , 1) Sleep(2000) MouseClick("Left" , 560, 445 , 1 , 1) Sleep(100) MouseClick("Left" , 491, 649 , 1 , 1) Sleep(100) MouseClick("Left" , 491, 649 , 1 , 1) Sleep(100) MouseClick("Left" , 491, 649 , 1 , 1) Sleep(100) $Coord = PixelSearch(0, 0, 200, 366);imagine a square: 1st 0 = x top left - 2nd 0 y top left - 200 = x bottom right - 366 = y bottom right If Not @error Then MouseClick("Left", $Coord[0], $Coord[1], 1, 1) EndIf WendI don't know what the other mouseclicks do, but if you put the coord pixelsearch in a while statement, it will loop either indefinately if never found, or click it when found and continue the loop again.If your "MouseClicks" are just to sign in or something, you can take them out of the While Loop or the will always click. And put them above the While 1 or something.The Sleep(100) is to make help on CPU usage. The 100 is approximately 100 millieseconds or 1/10 of a second....Good Luck to you. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. 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