Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Image scaning
#1
Hello i want to search image on screen and if the image is found i want to move mouse curser 50mm to y axis from where the image is found so how can i do that ?
and how to store and use image from resources ?
#2
In "Find Image" dialog, capture the image and type r in "RECT variable for results" field. OK. It will save the image in macro resources. It will create code like this:

RECT r
int w=win("Firefox" "MozillaWindowClass")
scan "image:h90C1E21B" w r 2|16|128

Then add this line:

mou r.left r.top+50
#3
can you tell me where to find 'find image' and can you give me a example of any script that has same condition as mine
#4
Floating toolbar -> Windows, controls -> Find image, wait.

Macro Macro2541
Code:
Copy      Help
RECT r
int w=win("Firefox" "MozillaWindowClass")
scan "image:h90C1E21B" w r 2|16|128
mou r.left r.top+50
#5
i written script but it is showing error that "Error (RT) in <open ":1: /0">Macro1: resource not found. "
#6
To transfer the resource I would need to export it or its macro to a file and attach to the post.

It is easy to create such code with the "Find Image" dialog. Don't need examples. This macro is just to show how the code should look. Don't run it.
#7
finding image and moving curser to it that is done but now how to move mouse curser 50mm to right and click
#8
lef r.left+50 r.top
#9
it is showing "Error in <open ":1: /39">Macro1: unknown identifier"
#10
or, if scan is without a RECT variable and with flag 1:

mou+ 50 0
lef
#11
Macro Macro2541
Code:
Copy      Help
int w=win("Firefox" "MozillaWindowClass")
scan "image:h90C1E21B" w 0 1|2|16|128
mou+ 50 0
lef
#12
if image is found then go to step 45 otherwise go to step 80 how to do this ?
#13
In "Find Image" dialog uncheck "error if not found", then it will create code with if:
Macro Macro2544
Code:
Copy      Help
int w=win("Firefox" "MozillaWindowClass")
if(scan("image:hEF1EB8D3" w 0 1|16))
,

Then add else, goto, and labels above steps 45 and 80:
Macro Macro2544
Code:
Copy      Help
int w=win("Firefox" "MozillaWindowClass")
if(scan("image:hEF1EB8D3" w 0 1|16))
,out "found"
,goto step45
else
,out "not found"
,goto step80
;...
;step45
out "step45"
;...
;step80
out "step80"
#14
"Error in <open ":2: /177">Macro1: label not found" this is appearing and it is highlighting step45
#15
means how to use else if condition means if image found then do like this and if it is not found then do like this so how can i do this ?
#16
Macro Macro2544
Code:
Copy      Help
int w=win("Firefox" "MozillaWindowClass")
if(scan("image:hEF1EB8D3" w 0 1|16))
,out "found"
,;add more code here,
,;the code must be tab-indented (or comma-indented, like in this example)
else
,out "not found"
,;add more code here,
,;the code must be tab-indented (or comma-indented, like in this example)
#17
if i write else but then also it is not performing else part things ?
#18
do you mean this?
Macro Macro2544
Code:
Copy      Help
int w=win("Firefox" "MozillaWindowClass")
if(!scan("image:hEF1EB8D3" w 0 1|16))
,out "not found"
,;add more code here,
,;the code must be tab-indented (or comma-indented, like in this example)

;you can add more code here, it is executed always. Must not be tab-indented.
#19
no the else part
#20
the else which is to run if image is not found that part is not working


Forum Jump:


Users browsing this thread: 1 Guest(s)