Posts: 24
Threads: 11
Joined: Jan 2018
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!
Posts: 12,071
Threads: 140
Joined: Dec 2002
06-11-2018, 05:55 AM
(This post was last modified: 06-11-2018, 05:56 AM by Gintaras.)
Macro
Macro6
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"
Posts: 24
Threads: 11
Joined: Jan 2018
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!
Posts: 12,071
Threads: 140
Joined: Dec 2002
Use flag 0x800. Read more in scan Help.
Or scan 2 times - for image 1 and 2 separately.
Posts: 24
Threads: 11
Joined: Jan 2018
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..
Posts: 12,071
Threads: 140
Joined: Dec 2002
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.
Posts: 24
Threads: 11
Joined: Jan 2018
06-12-2018, 11:10 AM
(This post was last modified: 06-12-2018, 11:11 AM by Leeroll.)
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"
Posts: 12,071
Threads: 140
Joined: Dec 2002
Screenshots of both text versions may help to find a solution or to improve the scan function in the future.