First, sorry for my English, I'm using the translator
I have a problem, I need to make a sequence, where I have men and women, use the image detector so that when it detects the image where it says "man" it does one thing and if it detects "woman" it does another, but it does not detect the images well. , I wanted to know how I can do that "if" and "else" detecting the text with the word "man" and "woman"
Find Text
Moderators: JRL, Dorian (MJT support)
- Dorian (MJT support)
- Automation Wizard
- Posts: 1415
- Joined: Sun Nov 03, 2002 3:19 am
Re: Find Text
Can you post a screenshot of what you're trying to detect? It's likely there's a few ways, and it would help us determine which may be best.
Specifically the if/else/endif part of the code would be something like this :
So for example, if a=1, do something, if it isn't, do something else :
If you change Let>a=1 to Let>a=2, you can see how it works when a is not one.
Now, exactly what will go in your if/else/endif will differ depending on how we're looking for man/woman. And how we do that will depend on your screenshot.
Just to help with clarity
Don't forget though, just because "man" might not be a match, that doesn't mean it's a woman. We can demonstrate this with let>gender=squirrel - it's simply "not a man". So "else" might not be appropriate for you.
It may be better to do this, so that an action is taken only if it's man or woman :
Specifically the if/else/endif part of the code would be something like this :
Code: Select all
If>a condition is met
do this
else
do that
endif
Code: Select all
Let>a=1
If>a=1
MessageModal>A is 1
else
MEssageModal>A is NOT 1
Endif
Now, exactly what will go in your if/else/endif will differ depending on how we're looking for man/woman. And how we do that will depend on your screenshot.
Just to help with clarity
Code: Select all
Let>gender=man
If>gender=man
MessageModal>It's a man!
else
MEssageModal>It's not a man!
Endif
It may be better to do this, so that an action is taken only if it's man or woman :
Code: Select all
Let>gender=man
If>gender=man
MessageModal>It's a man!
Endif
If>gender=woman
MessageModal>It's a woman!
Endif