I have 2 questions i hope you guys help me with
Moderators: Dorian (MJT support), JRL
I have 2 questions i hope you guys help me with
First of all good morning/evening to all!
my 1st question is I want to make the script to keep looking for an image I chose until it appears then continue with the script and I'm wondering how to do it
my 2nd question is I want the script to run in my 2nd windows 10 desktop screen without disturbing my mouse cursor, here's a picture of what I mean I want to do that so I can continue on with my normal tasks in the 1st desktop screen
Thanks guys
my 1st question is I want to make the script to keep looking for an image I chose until it appears then continue with the script and I'm wondering how to do it
my 2nd question is I want the script to run in my 2nd windows 10 desktop screen without disturbing my mouse cursor, here's a picture of what I mean I want to do that so I can continue on with my normal tasks in the 1st desktop screen
Thanks guys
- Marcus Tettmar
- Site Admin
- Posts: 7393
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Re: I have 2 questions i hope you guys help me with
To answer question 1, just use the WaitScreenImage function.
For question 2 - if your script needs to focus windows, move the mouse and/or send keystrokes, then what you want to do is impossible. You would need to run the macro on a separate PC or in a Virtual Machine. E.g. you could use VirtualBox or VirtualPC or Parallels or similar.
For question 2 - if your script needs to focus windows, move the mouse and/or send keystrokes, then what you want to do is impossible. You would need to run the macro on a separate PC or in a Virtual Machine. E.g. you could use VirtualBox or VirtualPC or Parallels or similar.
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: I have 2 questions i hope you guys help me with
ok so WaitScreenImage>something something .png
how can i make it click on that image like the normal FindImagePos
how can i make it click on that image like the normal FindImagePos
- Marcus Tettmar
- Site Admin
- Posts: 7393
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Re: I have 2 questions i hope you guys help me with
The same way. WaitScreenImage returns the found position. Or use FindImagePos after it. Or use FindImagePos in a loop. Which is exactly what WaitScreenImage is - FindImagePos in a loop.
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: I have 2 questions i hope you guys help me with
like this?Marcus Tettmar wrote: ↑Sat Sep 01, 2018 5:21 pmThe same way. WaitScreenImage returns the found position. Or use FindImagePos after it. Or use FindImagePos in a loop. Which is exactly what WaitScreenImage is - FindImagePos in a loop.
WaitScreenImage>C:\Users\x\Desktop\Capture22.PNG,0,CCOEFF
FindImagePos>C:\Users\x\Desktop\Capture22.PNG,SCREEN,0,1,XArr,YArr,NumFound,CCOEFF
If>NumFound>0
MouseMove>XArr_0,YArr_0
LClick
Endif
this will make the script wait for the image to appear?
- Marcus Tettmar
- Site Admin
- Posts: 7393
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Re: I have 2 questions i hope you guys help me with
Yes, but the FindImagePos is unnecessary since you can return the found position from WaitScreenImage. Read the WaitScreenImage topic in the help file!
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: I have 2 questions i hope you guys help me with
oh ok thanks
how can i make the script find the exact image? because sometimes if it didn't appear yet it clicks on an icon that is not even similar to it
should tolerance go to 0 or go to 1
i also get this error
Error in : testtt
Line: 7 - Invalid Numeric Value for MouseMove command.
this is my script
//Wait for
WaitScreenImage>C:\Users\x\Desktop\fuel.PNG,0,CCOEFF
If>NumFound>0
MouseMove>XArr_0,YArr_0
LClick
endif
how can i make the script find the exact image? because sometimes if it didn't appear yet it clicks on an icon that is not even similar to it
should tolerance go to 0 or go to 1
i also get this error
Error in : testtt
Line: 7 - Invalid Numeric Value for MouseMove command.
this is my script
//Wait for
WaitScreenImage>C:\Users\x\Desktop\fuel.PNG,0,CCOEFF
If>NumFound>0
MouseMove>XArr_0,YArr_0
LClick
endif
Re: I have 2 questions i hope you guys help me with
Try this code:
Code: Select all
Let>x=0
Let>Timeout=10
While>x<%Timeout%
Let>x=x+1
FindImagePos>C:\Users\x\Desktop\fuel.PNG,SCREEN,0.7,1,XArr,YArr,NumFound,CCOEFF
If>NumFound>0
Let>x=%Timeout%
MouseMove>XArr_0,YArr_0
LClick
//Input>,Image found at Center of this Location,X=%XArr_0% Y=%YArr_0%
EndIf
EndWhile
If>NumFound=0
Input>Image was not found
EndIf
Re: I have 2 questions i hope you guys help me with
the script isn't waiting enoughocnuybear wrote: ↑Mon Sep 03, 2018 7:05 amTry this code:
Code: Select all
Let>x=0 Let>Timeout=10 While>x<%Timeout% Let>x=x+1 FindImagePos>C:\Users\x\Desktop\fuel.PNG,SCREEN,0.7,1,XArr,YArr,NumFound,CCOEFF If>NumFound>0 Let>x=%Timeout% MouseMove>XArr_0,YArr_0 LClick //Input>,Image found at Center of this Location,X=%XArr_0% Y=%YArr_0% EndIf EndWhile If>NumFound=0 Input>Image was not found EndIf
I tried to modify the timeout to 20 and it still says no image found in just 7 or 8 seconds
Re: I have 2 questions i hope you guys help me with
Where did you get the 'fuel.PNG' file from?
Also make sure you have used the correct path to the image file.
Can you please try and capture the file with the Image Capture Tool under Tools menu, 7th option from the top?
MS is very sensitive with the images it finds and must be created with this tool otherwise it will most likely fail.
Also make sure you have used the correct path to the image file.
Can you please try and capture the file with the Image Capture Tool under Tools menu, 7th option from the top?
MS is very sensitive with the images it finds and must be created with this tool otherwise it will most likely fail.
Re: I have 2 questions i hope you guys help me with
the paths are correct don't worryocnuybear wrote: ↑Mon Sep 03, 2018 8:33 amWhere did you get the 'fuel.PNG' file from?
Also make sure you have used the correct path to the image file.
Can you please try and capture the file with the Image Capture Tool under Tools menu, 7th option from the top?
MS is very sensitive with the images it finds and must be created with this tool otherwise it will most likely fail.
I found a way around this problem by using wait command and now it instantly clicks on whatever i want
now comes another problem I didn't think of
there are 6 pictures of fuel.png(cars) in the screen for the script to chose
here comes the problem:
script chooses car1 for 10 minutes then it will choose car 2 until car 1 is ready(that's because the script checks for pictures in a pattern) and I don't want that to happen
what I want to do is to make the script understands that if you chose a picture from the 6 you have to keep clicking that picture until it's no longer there in that position THEN it can continue to look for another picture
there are commands that I typed after the first fuel command and I have the script in a loop so idk how I can coordinate my idea in it.
any ideas?
Re: I have 2 questions i hope you guys help me with
Can we see your script please?
Re: I have 2 questions i hope you guys help me with
//Set IGNORESPACES to 1 to force script interpreter to ignore spaces.
//If using IGNORESPACES quote strings in {" ... "}
//Let>IGNORESPACES=1
Label>start
Let>x=0
Let>Timeout=10
While>x<%Timeout%
Let>x=x+1
FindImagePos>C:\Users\x\Desktop\fuel.PNG,SCREEN,0.7,1,XArr,YArr,NumFound,CCOEFF
If>NumFound>0
Let>x=%Timeout%
MouseMove>XArr_0,YArr_0
LClick
//Input>,Image found at Center of this Location,X=%XArr_0% Y=%YArr_0%
EndIf
EndWhile
If>NumFound=0
Input>Image was not found
EndIf
Let>x=0
Let>Timeout=10
While>x<%Timeout%
Let>x=x+1
FindImagePos>C:\Users\x\Desktop\play.PNG,SCREEN,0.7,1,XArr,YArr,NumFound,CCOEFF
If>NumFound>0
Let>x=%Timeout%
MouseMove>XArr_0,YArr_0
LClick
//Input>,Image found at Center of this Location,X=%XArr_0% Y=%YArr_0%
EndIf
EndWhile
If>NumFound=0
Input>Image was not found
EndIf
Wait>1
Let>x=0
Let>Timeout=10
While>x<%Timeout%
Let>x=x+1
FindImagePos>C:\Users\x\Desktop\close.PNG,SCREEN,0.7,1,XArr,YArr,NumFound,CCOEFF
If>NumFound>0
Let>x=%Timeout%
MouseMove>XArr_0,YArr_0
LClick
//Input>,Image found at Center of this Location,X=%XArr_0% Y=%YArr_0%
EndIf
EndWhile
If>NumFound=0
Input>Image was not found
EndIf
Wait>1
Let>x=0
Let>Timeout=10
While>x<%Timeout%
Let>x=x+1
FindImagePos>C:\Users\x\Desktop\close.PNG,SCREEN,0.7,1,XArr,YArr,NumFound,CCOEFF
If>NumFound>0
Let>x=%Timeout%
MouseMove>XArr_0,YArr_0
LClick
//Input>,Image found at Center of this Location,X=%XArr_0% Y=%YArr_0%
EndIf
EndWhile
If>NumFound=0
Input>Image was not found
EndIf
Wait>1
Let>x=0
Let>Timeout=20
While>x<%Timeout%
Let>x=x+1
FindImagePos>C:\Users\x\Desktop\close.PNG,SCREEN,0.7,1,XArr,YArr,NumFound,CCOEFF
If>NumFound>0
Let>x=%Timeout%
MouseMove>XArr_0,YArr_0
LClick
//Input>,Image found at Center of this Location,X=%XArr_0% Y=%YArr_0%
EndIf
EndWhile
If>NumFound=0
Input>Image was not found
EndIf
Wait>1
Goto>start
Re: I have 2 questions i hope you guys help me with
Must MS keep clicking on Picture 1 until the picture disappears or just moves to different location on screen?what I want to do is to make the script understands that if you chose a picture from the 6 you have to keep clicking that picture until it's no longer there in that position THEN it can continue to look for another picture
Re: I have 2 questions i hope you guys help me with
keeps clicking untill it disappears then it looks for another oneocnuybear wrote: ↑Mon Sep 03, 2018 12:18 pmMust MS keep clicking on Picture 1 until the picture disappears or just moves to different location on screen?what I want to do is to make the script understands that if you chose a picture from the 6 you have to keep clicking that picture until it's no longer there in that position THEN it can continue to look for another picture