|
Post by martinp on Aug 11, 2021 7:48:16 GMT
Hello everyone, I know the question I'm going to ask is extremely simple but I am new to the program and can't find a way how to solve it. All I need is to click the detected image using the DETECT IMAGE condition.
As a matter of fact even this code doesn't work, it just gives me exactly "%XV% %YV%" message:
3 | IF | DETECT IMAGE | image path C:\Users\martinp\1.png::match quick::move mouse no::save to vars XV YV | IMAGE FOUND | MESSAGE PROMPT | %XV% %YV%::::0::OK The image is found correctly, if I select "move mouse yes", then coursor is always moved. I just need it to be clicked as well...
Thank you very much, it will save me a tons of time.
|
|
|
Post by Steve on Aug 11, 2021 8:42:43 GMT
Hi Martinp, I'm not sure why your variables aren't being declared properly for the detect image action ( www.turnssoft.com/conditions.html#detectimage). The syntax you have is solid and should work as described. I have a solution to get your click working at the image location: 1 | IF | DETECT IMAGE | image path C:\Users\martinp\1.png::match quick::move mouse yes | IMAGE FOUND | CONTINUE 2 | RUN ACTION | MOUSE CLICK | Left click at %MOUSE_X% %MOUSE_Y% 1 times with 0 ms delay At line 1 we move the mouse to the image. We use 'CONTINUE' here to wait until the image is found on the screen. At line 2 we do the mouse click. The internal variables %MOUSE_X% and %MOUSE_Y% will automatically populate with the new mouse X and Y values as the mouse moves with line 1.
1 | RUN ACTION | MOUSE TO IMAGE | image path C:\Users\martinp\1.png::match quick::move mouse yes 2 | RUN ACTION | MOUSE CLICK | Left click at %MOUSE_X% %MOUSE_Y% 1 times with 0 ms delay I'll chase up the variables not defining issue too. This looks like it might be a bug....I did a lot of testing with this DETECT IMAGE code prior to release so i'll be kicking myself if it is.
Hope this helps.
|
|
|
Post by martinp on Aug 11, 2021 10:49:04 GMT
Hello Steve, it does wonders, thank you very much. This program and it's support is pure gold. You can't even imagine how many hours I have saved already with repetitive manual work in SAP. So far I was using PIXEL COLOR which defined if screen has been updated and macro can continue. This DETECT IMAGE functionality works like magic when the layout changes quite often.
I haven't even taped into the potential of this program and I am already amazed.
Thang you again for your support.
|
|
|
Post by Steve on Aug 13, 2021 4:53:26 GMT
Thanks Martin. Its always good to hear how this little program is helping so many people to get work done. I' glad you found a good use for it.
|
|
|
Post by Acor on Feb 12, 2022 19:15:59 GMT
I can't get image detection. @steve, how that actually works? Do you grab a screenshot and look for the similar pixel array from the image file or you use some more sophisticated algorithm? Thanks
|
|
|
Post by Acor on Feb 13, 2022 12:46:18 GMT
Hi Martinp, I'm not sure why your variables aren't being declared properly for the detect image action ( www.turnssoft.com/conditions.html#detectimage). The syntax you have is solid and should work as described. I have a solution to get your click working at the image location: 1 | IF | DETECT IMAGE | image path C:\Users\martinp\1.png::match quick::move mouse yes | IMAGE FOUND | CONTINUE 2 | RUN ACTION | MOUSE CLICK | Left click at %MOUSE_X% %MOUSE_Y% 1 times with 0 ms delay At line 1 we move the mouse to the image. We use 'CONTINUE' here to wait until the image is found on the screen. At line 2 we do the mouse click. The internal variables %MOUSE_X% and %MOUSE_Y% will automatically populate with the new mouse X and Y values as the mouse moves with line 1.
1 | RUN ACTION | MOUSE TO IMAGE | image path C:\Users\martinp\1.png::match quick::move mouse yes 2 | RUN ACTION | MOUSE CLICK | Left click at %MOUSE_X% %MOUSE_Y% 1 times with 0 ms delay I'll chase up the variables not defining issue too. This looks like it might be a bug....I did a lot of testing with this DETECT IMAGE code prior to release so i'll be kicking myself if it is.
Hope this helps.
|
|
|
Post by Acor on Feb 13, 2022 12:47:43 GMT
Non of the commands works for me
|
|
|
Post by Steve on Mar 7, 2022 21:09:16 GMT
Non of the commands works for me Hi Acor, Sorry for the late reply. If your still having an issue with this can you start a new thread and tag me. Cheers, Steve.
|
|
|
Post by Mehul Mishra on Jun 24, 2022 17:23:41 GMT
The detect image does not work for me at all I have been trying to get it to work for months. Can someone help me with this ? I have tried several different images on several different websites. Mini mouse macro is never able to detect the image
|
|
|
Post by Steve on Jun 24, 2022 20:58:36 GMT
The detect image does not work for me at all I have been trying to get it to work for months. Can someone help me with this ? I have tried several different images on several different websites. Mini mouse macro is never able to detect the image Hi Mehul, Checkout this thread minimousemacro.proboards.com/thread/578/possibility-detecting-clicking-image-screen and download the latest version of Mini Mouse Macro. Some improvements have been made to the detect image function.
|
|
|
Post by Mehul Mishra on Jun 27, 2022 0:40:53 GMT
Hi Steve I followed your steps . It still did not work I unscaled and scaled the screen tried both 100% and 125% I have uploaded the video of my screen (this one is scaled but it still does not work with unscaled)
|
|
|
Post by Mehul Mishra on Jun 27, 2022 0:44:16 GMT
Hi Steve I followed your steps . It still did not work I unscaled and scaled the screen tried both 100% and 125% I have uploaded the video of my screen (this one is scaled but it still does not work with unscaled) The above video was at 125% . The screenshot tool works fine at 100% however the image detection still does not work.
|
|
|
Post by cyberchipz on Jul 8, 2022 19:55:28 GMT
Steve, It seems you're saying variables do not need to be initialized before using detect. I did not know this; but I had to start declaring them at the beginning of the code because, if the image is not found, this is what happens... If you use variables in the detect say: MYX MYY and the image isn't found.. and if the variables are not declared, and I printed them out in a message I got "%MYX% %MYY% in the displayed text. I simply realized, if I want a usable value to use to click or just know if it found the image... I had initialize the variables to zero at the start of the code. So, reading that they should be declared in a detect even if the image isn't found surprised me; and I felt the need to comment. So, what I'm saying is "Yes, I found that the variables are declared, IFF the image is found" and "The variables are not declared when the image is not found". At least that's been my experience. If this has been fixed; I'll cop out by saying.. Afterward, I just always declared them and didn't notice when it got fixed and I no longer needed to do that! ;-) Just trying to help! :-) Chip
|
|