Hello! First of all thank you for checking out my post..
Secondly, how do I set conditions using pixelsearch?
Scenario:
Square area “A”(x1,y1 x2,y2) purple will appear at first, then blue
square area “B”(x3 y3 x4y4) purple will appear first then blue
What i would like to do:
-When both areas are purple do 1
-When A = Purple, B = Blue do 2
-When A = Blue, B = Purple do 3
-When both areas are Blue do 4
Thank you in advance!
Pixelsearch 2 areas?
Re: Pixelsearch 2 areas?
Hallo,
first do the two Pixelsearch with color Purple and save the results in AisPurple and BisPurple. Try:
first do the two Pixelsearch with color Purple and save the results in AisPurple and BisPurple. Try:
Code: Select all
PixelSearch,,, X1, Y1, X2, Y2, 0x800080,, Fast RGB
AisPurple := !ErrorLevel
PixelSearch,,, X3, Y3, X4, Y4, 0x800080,, Fast RGB
BisPurple := !ErrorLevel
Switch AisPurple BisPurple
{
Case True True:
MsgBox, do 1
Case True False:
MsgBox, do 2
Case False True:
MsgBox, do 3
Case False False:
MsgBox, do 4
}
-
- Posts: 11
- Joined: 21 Dec 2021, 16:30
Re: Pixelsearch 2 areas?
Thank you for the reply! This is so amazing, thank you so much! I have tried looking for days but didnt find the answer so i decided to post it. Youre a life saver!!!!Rohwedder wrote: ↑25 Sep 2022, 03:08Hallo,
first do the two Pixelsearch with color Purple and save the results in AisPurple and BisPurple. Try:Code: Select all
PixelSearch,,, X1, Y1, X2, Y2, 0x800080,, Fast RGB AisPurple := !ErrorLevel PixelSearch,,, X3, Y3, X4, Y4, 0x800080,, Fast RGB BisPurple := !ErrorLevel Switch AisPurple BisPurple { Case True True: MsgBox, do 1 Case True False: MsgBox, do 2 Case False True: MsgBox, do 3 Case False False: MsgBox, do 4 }
If its possible :
If i want to add another colour, do i just do another pixel search and add CisPurple ? And does that mean i will have to add all conditions aswell or only the ones i need?
Re: Pixelsearch 2 areas?
Yes just do another pixel search and add CisPurple. And use only the conditions you need.