Jump to content

Recommended Posts

Posted

well this is the main part i want to know.

i want it to search the screen ( or lets say half of it atleast) and i want it to search the whole area for a certain color pixel (0xFF0000) [red] is there a way to do this?

i need it to search for a color (after searching...or when it is searching and it finds the color i need it to click on it)...then make it click on the colored object (left click) then press keyboard key "A" then after that i need it to press "B" then i need it to wait for about 1 second (sleep) then press "C" ...ok and NOW i need it to repeat this script

sorry i am a total noob...this is probably easy for u guys :D

thank you soooo much ^^

  • Moderators
Posted

Open the help file, and you'll see exactly what your asking "search" + "pixel" = PixelSearch() :D

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.

Posted

hmm....

lets say i have this:

$coord = PixelSearch( 100, 100, 900, 525,0xFF0000,9 )
If Not @error Then
MouseMove($coord[0],$coord[1],0)
;rigt click for test
MouseClick("right",$coord[0],$coord[1])
    Sleep (500)
MouseClick("left",$coord[0]-2,$coord[1]-2)
Endif

i tested this on my desktop wallpaper (made some red dots on it)..so it found the dot, right clicked on it and the menu came up....mouse moved away from the menu and left clicked the background.....but i dont know how to make it so after it left clicked the bg autoit keeps searchin for another red dot..and keep doing the same thing over and over

Posted

hmm....

lets say i have this:

$coord = PixelSearch( 100, 100, 900, 525,0xFF0000,9 )
If Not @error Then
MouseMove($coord[0],$coord[1],0)
;rigt click for test
MouseClick("right",$coord[0],$coord[1])
    Sleep (500)
MouseClick("left",$coord[0]-2,$coord[1]-2)
Endif

i tested this on my desktop wallpaper (made some red dots on it)..so it found the dot, right clicked on it and the menu came up....mouse moved away from the menu and left clicked the background.....but i dont know how to make it so after it left clicked the bg autoit keeps searchin for another red dot..and keep doing the same thing over and over

Posted

Search the helpfile for "Loops", they're what you want.

Don't take my pic to serious...~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~You Looked, but you did not see!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  • Moderators
Posted

hmm....

lets say i have this:

$coord = PixelSearch( 100, 100, 900, 525,0xFF0000,9 )
If Not @error Then
MouseMove($coord[0],$coord[1],0)
;rigt click for test
MouseClick("right",$coord[0],$coord[1])
    Sleep (500)
MouseClick("left",$coord[0]-2,$coord[1]-2)
Endif

i tested this on my desktop wallpaper (made some red dots on it)..so it found the dot, right clicked on it and the menu came up....mouse moved away from the menu and left clicked the background.....but i dont know how to make it so after it left clicked the bg autoit keeps searchin for another red dot..and keep doing the same thing over and over

Look at Opt('PixelCoordMode', 2) / Opt('MouseCoordMode', 2) -

You don't need MouseMove() there, MouseClick() will move the mouse, just use MouseClick('Left', $coord[0], $coord[1], 1, 1), and also look at "Loop Statements" marfdaman suggested.

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.

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
×
×
  • Create New...