Скрипт петли поиска пикселя

Опубликуйте ваши работающие скрипты, библиотеки и ПО для AutoHotkey
Posts: 3
Joined: 09 May 2016, 09:25

Скрипт петли поиска пикселя

Post by Daikiba » 09 May 2016, 23:52

Подскажите плиз блок скрипта для поиска пикселя?
Что-то типа
"Я ищу цвет пикселя в маленькой области от большого активного окна.... ищу....ищу... я нашел пиксель, выполняю следующую комманду"
Posts: 2630
Joined: 22 Dec 2013, 12:50

Re: Скрипт петли поиска пикселя

Post by garry » 10 May 2016, 04:06

see Помощь
если нет ответа / ( or in english forum )

Code: Select all

;EXAMPLES Pixelsearch

;Here are two possible ways of waiting for a color onscreen:
While (color <> 0x031323)
  PixelGetColor, color, 801,1194
  sleep, 300
;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
  if !ErrorLevel
  sleep, 300
;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
Click up

;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
if ErrorLevel
    MsgBox, Color not found.
    MsgBox, Found color with 3-ColorNuances at X%Px% Y%Py% .
Post Reply

Return to “Скрипты и библиотеки”