pixelsearch 2 different colors at 2 areas simultaneously in one script

Ask gaming related questions (AHK v1.1 and older)
sebbulon
Posts: 47
Joined: 16 Sep 2020, 12:02

pixelsearch 2 different colors at 2 areas simultaneously in one script

Post by sebbulon » 21 Jan 2022, 04:23

hello! i want to pixelsearch 2 different colors at 2 areas "simultaneously" in one script (looping), if one color disappears i want to break the loop. Ive tried many solutions but i cant get them to work, any help is appriciated

sebbulon
Posts: 47
Joined: 16 Sep 2020, 12:02

Re: pixelsearch 2 different colors at 2 areas simultaneously in one script

Post by sebbulon » 21 Jan 2022, 04:29

this is an example of what ive tried (b is just a random)

Code: Select all

y() {
loop {
pixelsearch, bx, by, 287, 235, 368, 312, 0xFF00FF, b, Fast RGB
if (errorlevel = 1) {
break
}
pixelsearch, bx, by, 717, 423, 739, 435, 0x3E3529, b, Fast RGB 
if (errorlevel = 1) {
break
}
}
}

User avatar
boiler
Posts: 16915
Joined: 21 Dec 2014, 02:44

Re: pixelsearch 2 different colors at 2 areas simultaneously in one script

Post by boiler » 21 Jan 2022, 06:14

In what way does that not work? Have you verified that your PixelSearch commands will result in ErrorLevel 0 when you think they should?

Post Reply

Return to “Gaming Help (v1)”