если нет ответа / ( or in english forum )
Code: Select all
;Here are two possible ways of waiting for a color onscreen:
While (color <> 0x031323)
PixelGetColor, color, 801,1194
;This code is best if the color never varies and the location never varies.
;It will move past the loop once the color is found in the specific location.
PixelSearch, x, y, 0, 0, A_ScreenWidth, A_ScreenHeight, 0x031323, 10
;This code is best if the location changes and the color has variance.
;The x and y coordinates of the color will be in variables x,y when it is found.
;Allowed variation in the color is the parameter after the color in PixelSearch.
;Note the x and y returned should be relative to the active window.
;if this is not suitable, you can use the CoordMode command to change it to be relative to the screen.
;For clicking, you said you already found it but here's a method anyway:
Click down %x% %y%
Sleep, 1000 ;-hold for one second
;To monitor if a certain color appears (or doesn't appear) in a spot at any time in the life of the script:
SetTimer, ColorCheck, 300 ;- the last parameter is # of milliseconds between checks
;application code here...
PixelGetColor, color, x,y ;- fill in x,y coordinates
if (color <> 0x000000) ;- fill in 0x...
Reload ;start over
PixelSearch, Px, Py, 200, 200, 300, 300, 0x9d6346, 3, Fast
MsgBox, Color not found.
MsgBox, Found color with 3-ColorNuances at X%Px% Y%Py% .