I have a project which requires looking at construction plans, and "counting" the number of electrical receptacles on a plan-sheet. The program that I use is simple; every time I see a symbol on the plan, I click on it and the program adds a purple dot, and in the end all of the purple dots are accounted for so I know the total of purple dots.
I used the macro's Image Recognition Wizard to simply find the symbol on the plan-sheet, and left click it. It works wonders, and does exactly what I want it to do. The problem is that once the macro does its job, and adds all the purple dots like I want it to do, it will click the symbols again even though there is now a purple circle overlay over the symbols. Here's the simple code:
Code: Select all
//Find and Left Click Center of [img]https://i.imgur.com/MXBcMI3.png[/img] FindImagePos>C:\Users\Dad\Downloads\lol.PNG,SCREEN,0.3,1,XArr,YArr,NumFound,CCOEFF If>NumFound>0 MouseMove>XArr_0,YArr_0 LClick Endif //Find and Left Click Center of [img]https://i.imgur.com/QAhclOc.png[/img] FindImagePos>C:\Users\Dad\Downloads\asdasd.PNG,SCREEN,0.3,1,XArr,YArr,NumFound,CCOEFF If>NumFound>0 MouseMove>XArr_0,YArr_0 LClick Endif
After the purple dot is added, they look like this:
And like I mentioned before, the macro does a great job of finding these symbols on the plan sheet, left clicking them, thus adding the purple dot. But what I am trying to figure out, is how to add a check within the code so that once it tries to click the symbol again, it will detect a purple pixel and skip/not click the image.