Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Find image - DO based on what image found
#1
Hi,

Basically what I am trying to do is,

1. I have 4 different images

2. I want it to paste a text based on what image it finds on my screen

For example,

If finds image 1 and paste text 1,
or If it finds image 2, paste text 2,


Hope someone can help!

Thanks in advance!
#2
Macro Macro6
Code:
Select All      Help
int w=win
int i=scan("image:h43312EF0[]image:h65F5BD95[]image:h2FC19D26" w 0 0)
sel i
,case 0: out "not found"
,case 1: paste "one"
,case 2: paste "two"
,case 3: paste "three"
#3
Thanks a lot!

One more thing,
I also want this to happen:

If BOTH image 1 and image 2 is on the screen, execute case 3

How can I make this happen?

Looking forward to your help!
#4
Use flag 0x800. Read more in scan Help.
Or scan 2 times - for image 1 and 2 separately.
#5
I am using this macro on images found in Bluestacks to trigger an action, but unfortunately the code does not recognize the image I have captured with QM every time, only sometimes..
#6
If finds only sometimes, maybe the object is partially transparent, mixed with background. Then does not find when background changes. Try "Allowed color difference", for example 50.
#7
So its like this,

I'm trying to find a blue chat dialogue with a specific text which will everytime appear at different position on the screen everytime it shows.
And setting allowed color difference to 50, 100, or 150 doesnt work no matter value.

I have to mention it works the first time as I set the image capture and run but then the second time when the chat dialogue shows and is now on a different position, it doesnt find it. (same image on screen can be seen but just different position)

My Code:
int w1=act(win("BlueStacks" "HwndWrapper[Bluestacks.exe;*"))
int i=scan("image:hBE274FE7" w1 0 0)
sel i
case 0: mac "Message 1"
case 1: mac "Message 2"
#8
Screenshots of both text versions may help to find a solution or to improve the scan function in the future.


Forum Jump:


Users browsing this thread: 1 Guest(s)