how do you type that into the script? i just read over some of the help file about targeting colors but it didnt show an example on how to do it. Like if i wanted the mouse to click on the color blue or red wherever it is on the screen??
Help IS GREATLY APPRECIATED. THANKS.
Mouse click on a specified color??
Started by
Karen
, Aug 01 2010 12:25 AM
9 replies to this topic
#1
-
Posted 01 August 2010 - 12:25 AM
I used this 'get pixel color' script to find what the color is
then placed it in this script to click on a color
+z:: ; Control+Z hotkey. MouseGetPos, MouseX, MouseY PixelGetColor, color, %MouseX%, %MouseY% MsgBox The color at the current cursor position is %color%. return
then placed it in this script to click on a color
z:: IfWinExist, Your Window Here ;insert the window name WinActivate PixelSearch, Px, Py, 90, 190, 1062, 621, 0x00004c, 0, Fast ; oxoooo4c is the pixel color fould from using the first script, insert yours there if ErrorLevel MsgBox, That color was not found in the specified region. else click %Px%, %Py%[/code]
#2
-
Posted 01 August 2010 - 01:26 AM
awesome thanks alot. but how do i make it so a window doesnt show up when the pixel isnt there.
this is what i have.
this is for a game and i just want it to keep searching and clicking on that pixel every 8 seconds. i dont want the window to appear when the pixel isnt there. how do i type that?
Much Appreciation,
this is what i have.
Loop
{
Sleep 8000
PixelSearch, Px, Py, -4, -4, 1032, 746, 0x253334, 0, Fast
if ErrorLevel
MsgBox, That color was not found in the specified region.
else
click %Px%, %Py%
}
Esc::ExitApp
this is for a game and i just want it to keep searching and clicking on that pixel every 8 seconds. i dont want the window to appear when the pixel isnt there. how do i type that?
Much Appreciation,
#3
-
Posted 04 August 2010 - 09:32 PM
Didn't you even try to figure it out by checking the documentation?
Do you know what ErrorLevel and MsgBox mean?
<!-- m -->http://www.autohotkey.com/docs/<!-- m -->
Do you know what ErrorLevel and MsgBox mean?
<!-- m -->http://www.autohotkey.com/docs/<!-- m -->
#5
-
Posted 05 August 2010 - 01:38 AM
Didn't you even try to figure it out by checking the documentation?
Do you know what ErrorLevel and MsgBox mean?
http://www.autohotkey.com/docs/
yes i also tried taking out that whole thing with the error level and the message box but it just clicked on the screen and not on the specified pixel... hmm i will try somthing else now.
#6
-
Posted 05 August 2010 - 01:45 AM
i got it figured out. i made it work the way i wanted it to. but there is something else i am curious about. is there a way instead of making it click the pixel every 8 seconds, is it possible that it would click when it sees the pixel visible in the window?
so there would be no sleep but what would i have to type to make it seek the pixel as soon as it comes to the screen?
Thank you for any replies/help. it is much appreciated.
so there would be no sleep but what would i have to type to make it seek the pixel as soon as it comes to the screen?
Thank you for any replies/help. it is much appreciated.
#7
-
Posted 05 August 2010 - 01:56 AM
You could have it constantly checking to see if its on the screen; IE:
z:: Loop { PixelSearch, x, y, 0, 0, %A_ScreenWidth%,%A_ScreenHeight% , 0xC68600, Fast Click,%x%,%y% } Return ; Change the 0xC68600 to the color you want. #x::ExitApp
#9
-
Posted 05 August 2010 - 02:21 AM