[英]AHK Pixelgetcolor changing coordinates inside a loop
我需要一些可能非常簡單的邏輯問題的幫助,而我只是無法理解。 我需要將屏幕上的不同坐標與變量上給出的靜態值進行比較。 喜歡:
如果(StaticColor = ColorInCoordinate){
運行這個
}
但是我需要在不同的坐標上運行8次,以檢查一切是否正常。 除了簡單地在Ifs中運行GetPixelColor 8次之外,還有其他簡便的方法嗎?
使用數組:
StaticColor = 0x113322
coords := [ {x:122,y:112}
, {x:464,y:589}
, {x:163,y:673}
, {x:173,y:457}
, {x:245,y:986}
, {x:264,y:567}
, {x:252,y:922}
, {x:556,y:773}]
Loop, % coords.MaxIndex()
{
currentX := coords[A_Index].x
currentY := coords[A_Index].y
PixelGetColor, ColorInCoordinate, currentX , currentY
If (ColorInCoordinate = StaticColor)
{
;Run this
}
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.