I apologize if this has been mentioned many times, however, I went through the forum and could not find the exact thing that I am looking for. This is probably a very basic script but I have been stuck on it for hours trying to think of WHY it's not working.
What I want to do: is when the "image/text" is found please click at this coordinate, then this coordinate and then rinse and repeat ONLY when the image/text appear again. In other words, stop clicking until the image/text appears and then click twice. That's it. I'm working on a very old crappy laptop and I don't want to destroy it from excessive clicking overnight.
What I have so far:
//Find and Left Click Center of
FindImagePos>%BMP_DIR%\image_4.bmp,SCREEN,0.7,1,XArr,YArr,NumFound,CCOEFF
If>NumFound>0
MouseMove>XArr_0,YArr_0
LClick
Endif
MouseMove>XArr_0,YArr_0
LClick
MouseMove>715,674
LClick
Let>NumFound=0
While>NumFound=0
FindImagePos>%BMP_DIR%\\image_4.bmp,SCREEN,0.7,1,XArr,YArr,NumFound,CCOEFF
EndWhile
Thank you very much for helping me out! Much, much appreciated!
If Image/Text found then x,y,z *basic* HOW?!
Moderators: Dorian (MJT support), JRL
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Re: If Image/Text found then x,y,z *basic* HOW?!
I think all you really want is something like this:
Code: Select all
Label>mainloop
FindImagePos>%BMP_DIR%\image_4.bmp,SCREEN,0.7,1,XArr,YArr,NumFound,CCOEFF
If>NumFound>0
MouseMove>XArr_0,YArr_0
LClick
MouseMove>XArr_0,YArr_0
LClick
MouseMove>715,674
LClick
Endif
Wait>0.02
Goto>mainloop
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
Re: If Image/Text found then x,y,z *basic* HOW?!
@Marcus Tettmar
Hello! Thanks so much for replying to me . I tried the code that you sent back to me but for some reason Label>mainloop and Goto>mainloop are in red, stating that it doesn't work. I was also wondering if this loop would be infinite until I stop it with Ctrl+F2 or would I have to add a Stop Function, i.e. Repeat>??? Until>???
Hello! Thanks so much for replying to me . I tried the code that you sent back to me but for some reason Label>mainloop and Goto>mainloop are in red, stating that it doesn't work. I was also wondering if this loop would be infinite until I stop it with Ctrl+F2 or would I have to add a Stop Function, i.e. Repeat>??? Until>???
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Re: If Image/Text found then x,y,z *basic* HOW?!
Those lines WILL be in red. Label and Goto are syntax highlighted red by the editor.
Yes it will keep looping until you stop the script. There are several ways to stop a script manually - either from the interface or via sytem wide shortcut SHIFT+CTRL which you can change under Tools/Options if you wish.
You can make your own handler within the script to stop it using a custom shortcut key using OnEvent but there's no need as you can do the above.
Yes it will keep looping until you stop the script. There are several ways to stop a script manually - either from the interface or via sytem wide shortcut SHIFT+CTRL which you can change under Tools/Options if you wish.
You can make your own handler within the script to stop it using a custom shortcut key using OnEvent but there's no need as you can do the above.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
Re: If Image/Text found then x,y,z *basic* HOW?!
@Marcus Tettmar
My sincere apologies, the text being red made me remember the course I took in university for C++ and debugging the text in red.
Everything works like clockwork and I am extremely grateful, I prefer your option of just manually turning it off.
Thank you so much, this stuff is ingenious!
My sincere apologies, the text being red made me remember the course I took in university for C++ and debugging the text in red.
Everything works like clockwork and I am extremely grateful, I prefer your option of just manually turning it off.
Thank you so much, this stuff is ingenious!