Jump to content

Move mouse + pixelsearch


Bonchen
 Share

Recommended Posts

I'm trying to make a script that moves the mouse to the sides. EX. From top left to top right and then it moves the mouse down like 50pixels and then moves to the left side and so on. While the mouse is moving it will be using PixelSearch and when it finds the pixel it will click two pixels below. The only problem i have is that I don't know how to make it move and search at the same time.

Any help is appreciated.

Link to comment
Share on other sites

Look into the MouseMove() and PixelSearch() commands in the helpfile...

Pixelsearch lets you search in a rectangle so maybe you could just use that... For example (this is untested):

While 1
$possiblePos = PixelSearch(5, 5, 25, 25) 
If IsArray($possiblePos) then 
MouseClick('left', $pos[0], $pos[1] + 2)
EndIf 
WEnd
Then you would need to find a way to change is so that it searches the regions you want it to...
My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
Link to comment
Share on other sites

Look into the MouseMove() and PixelSearch() commands in the helpfile...

Pixelsearch lets you search in a rectangle so maybe you could just use that... For example (this is untested):

While 1
$possiblePos = PixelSearch(5, 5, 25, 25) 
If IsArray($possiblePos) then 
MouseClick('left', $pos[0], $pos[1] + 2)
EndIf 
WEnd
Then you would need to find a way to change is so that it searches the regions you want it to...
I know about the PixelSearch and MouseMove. I will tell you once again i want the script to do. The script is going to move the mouse over the screen, and when it moves over a spot a color comes out, and when the color comes out I want it to press the color. Hope you understand.
Link to comment
Share on other sites

I know about the PixelSearch and MouseMove. I will tell you once again i want the script to do. The script is going to move the mouse over the screen, and when it moves over a spot a color comes out, and when the color comes out I want it to press the color. Hope you understand.

Welcome to AutoIt.

If you need someone to write the script for you, refer to Rent-A-Coder in my sig below.

If you want to learn to do it yourself, start with two nested For/Next loops to generate your sequence of X and Y coordinates. For each value of X,Y you want to do MouseMove to those coordinates, then do PixelGetColor at those coordinates, and if the color matches do MouseClick.

All of these commands are in the AutoIt3.chm help file that comes with AutoIt.

If you get stuck, post your code for more help.

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Welcome to AutoIt.

If you need someone to write the script for you, refer to Rent-A-Coder in my sig below.

If you want to learn to do it yourself, start with two nested For/Next loops to generate your sequence of X and Y coordinates. For each value of X,Y you want to do MouseMove to those coordinates, then do PixelGetColor at those coordinates, and if the color matches do MouseClick.

All of these commands are in the AutoIt3.chm help file that comes with AutoIt.

If you get stuck, post your code for more help.

:)

Ok, Thanks.
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...