Post by joe on Apr 25, 2023 20:22:03 GMT
Hello
I am trying to stack ocr if then statements.
I created the macro below.
The macro looks for three different text phrases in the same positon. If the macro sees one of those three phrases it clicks on a link in a different part of the screen.
If the macro doesn't see one of the three different text phrases it will open a word document and then stop.
The first two ocr lines (code lines 2 and 3) work just like I want them to.
The problem is code line 4.
If the text BR#9 appears on the screen the macro doesn't see it, and it runs code lines 5 and 6.
* | proton vpn location selection test
1 | RUN ACTION | WAIT SECONDS | 5
2 | IF | OCR | At location [X:56 Y:332 W:118 H:25]::Lang eng - English::To string OCR | TEXT IS | CA#105 | GOTO MACRO LINE | CA#105
3 | IF | OCR | At location [X:56 Y:332 W:118 H:25]::Lang eng - English::To string OCR | TEXT IS | CA#91 | GOTO MACRO LINE | CA#91
4 | IF | OCR | At location [X:56 Y:332 W:118 H:25]::Lang eng - English::To string OCR | TEXT IS | BR#9 | GOTO MACRO LINE | BR#9
* | move on to next account
5 | RUN ACTION | RUN PROGRAM | C:\Users\josep\Desktop\Begin coinfarm daily bonus.docx
6 | RUN ACTION | STOP
* | CA#105
7 | IF | OCR | At location [X:42 Y:518 W:73 H:23]::Lang eng - English::To string OCR | TEXT IS | CA#105 | GOTO MACRO LINE | click location
* | CA#91
8 | IF | OCR | At location [X:42 Y:518 W:73 H:23]::Lang eng - English::To string OCR | TEXT IS | CA#91 | GOTO MACRO LINE | click location
* | BR#9
9 | IF | OCR | At location [X:42 Y:518 W:73 H:23]::Lang eng - English::To string OCR | TEXT IS | BR#9 | GOTO MACRO LINE | click location
* | click location
10 | RUN ACTION | MOUSE CLICK | Left click at 265 525 2 times with 77 ms delay
I already tried putting a 500 ms wait time in between line 3 and 4 but that didn't fix it.
So I think I might not be able to use more than two of these "If Then OCR" statements in the same macro.
I really hope that I am doing something wrong because the "If Then OCR" statements would be really useful for me if I could stack a bunch of them together.
So, am I doing something wrong with my macro above?
Is there a work around that would allow me to create a macro that had more than two If Then OCR statements on it without having to separate them into different macros?
Thanks!
I am trying to stack ocr if then statements.
I created the macro below.
The macro looks for three different text phrases in the same positon. If the macro sees one of those three phrases it clicks on a link in a different part of the screen.
If the macro doesn't see one of the three different text phrases it will open a word document and then stop.
The first two ocr lines (code lines 2 and 3) work just like I want them to.
The problem is code line 4.
If the text BR#9 appears on the screen the macro doesn't see it, and it runs code lines 5 and 6.
* | proton vpn location selection test
1 | RUN ACTION | WAIT SECONDS | 5
2 | IF | OCR | At location [X:56 Y:332 W:118 H:25]::Lang eng - English::To string OCR | TEXT IS | CA#105 | GOTO MACRO LINE | CA#105
3 | IF | OCR | At location [X:56 Y:332 W:118 H:25]::Lang eng - English::To string OCR | TEXT IS | CA#91 | GOTO MACRO LINE | CA#91
4 | IF | OCR | At location [X:56 Y:332 W:118 H:25]::Lang eng - English::To string OCR | TEXT IS | BR#9 | GOTO MACRO LINE | BR#9
* | move on to next account
5 | RUN ACTION | RUN PROGRAM | C:\Users\josep\Desktop\Begin coinfarm daily bonus.docx
6 | RUN ACTION | STOP
* | CA#105
7 | IF | OCR | At location [X:42 Y:518 W:73 H:23]::Lang eng - English::To string OCR | TEXT IS | CA#105 | GOTO MACRO LINE | click location
* | CA#91
8 | IF | OCR | At location [X:42 Y:518 W:73 H:23]::Lang eng - English::To string OCR | TEXT IS | CA#91 | GOTO MACRO LINE | click location
* | BR#9
9 | IF | OCR | At location [X:42 Y:518 W:73 H:23]::Lang eng - English::To string OCR | TEXT IS | BR#9 | GOTO MACRO LINE | click location
* | click location
10 | RUN ACTION | MOUSE CLICK | Left click at 265 525 2 times with 77 ms delay
I already tried putting a 500 ms wait time in between line 3 and 4 but that didn't fix it.
So I think I might not be able to use more than two of these "If Then OCR" statements in the same macro.
I really hope that I am doing something wrong because the "If Then OCR" statements would be really useful for me if I could stack a bunch of them together.
So, am I doing something wrong with my macro above?
Is there a work around that would allow me to create a macro that had more than two If Then OCR statements on it without having to separate them into different macros?
Thanks!