Blue Eye Logo

Blue Eye Macro

Automation is freedom
It is currently Sun Oct 22, 2017 7:03 pm

All times are UTC




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Pixel Pattern - Find it on screen and save the coordinate.
Thanked: 0 time(s)  Unread post Posted: Fri Sep 01, 2017 10:46 pm 
New User
New User



Joined: Sat Mar 12, 2016 1:32 am
Posts: 3
Been thanked: 0 time(s)
Has thanked: 2 time(s)
Contribution Points: 13
Hello there,

First i would like to apologize for any english errors.

Secondly, like in title im wanting to find a pixel pattern on screen and then save the coordinate on which i found him into a variable.
is there a way to do that?

More precisely, i have 2 images with a lot of words, and i wanting that the macro recognizes a third one...the problem is that i dont have a third image to pick the exact word and put it as a pattern..

So im wanting to pick the pixels patterns of letters and do a lot of "if" one inside another..the first one would find a letter on screen, i would pick the locations where the program found the letter and put it into a variable, so from the second one forward, i would look a pattern in a 10~20 pixels radius of that variables, get it? So that way i would be able to make my own words doing the pattern for each letter of the alphabet..

I dont know if there better way to do it...but that's the one that i could think of..but i have 2 problems:

1 - I dont know how to put the location that the programa find the pattern on variable.
2 - If have the pattern in more that one location on screen...so...what happens?


Thanks for any tips.. <3


Top
 Profile  
Reply with quote  
 Post subject: Re: Pixel Pattern - Find it on screen and save the coordinat
Thanked: 1 time(s)  Unread post Posted: Sat Sep 02, 2017 12:34 am 
Silver Contributor
Silver Contributor



Joined: Thu Aug 06, 2015 6:22 pm
Posts: 167
Been thanked: 52 time(s)
Has thanked: 14 time(s)
Contribution Points: 204
so like first one look for color pixel pattern then locate it then add more radius then look for the color pixel pattern at new cordinations?

Code:
if  Color.Pixel pattern can be located on screen("px pt", "10")
begin
  Color.Wait for and locate pixel pattern("px pt", "10", "X", "Y")
Variable.Evaluate (Math)("{X}+10", "X1")
Variable.Evaluate (Math)("{Y}+10", "Y1")
end
if  Color.Pixel pattern can be located on screen near coordinate("px pt", "10", "X1", "Y1", "10")


X and Y are the variables located for the pixel pattern then u add math to them which u should calculate with investigator like + 10
X1 and Y1 is the result and u look near them for color pixel pattern with 10 pixels radius of that location


Top
 Profile  
Reply with quote  
 Post subject: Re: Pixel Pattern - Find it on screen and save the coordinat
Thanked: 0 time(s)  Unread post Posted: Sat Sep 02, 2017 2:14 am 
New User
New User



Joined: Sat Mar 12, 2016 1:32 am
Posts: 3
Been thanked: 0 time(s)
Has thanked: 2 time(s)
Contribution Points: 13
Didnt know that had that fuction "wait and locate for pixel pattern" and man....i looked but didnt see UAHEaheaueha sorry...

So that's solve one problem...but if have like 2 identical pixel patterns?

What would happen?


Example: if im looking for "w" to form the word "went" but i have on screen "wait" and "while" the code will be able to look in both at once ?


Top
 Profile  
Reply with quote  
 Post subject: Re: Pixel Pattern - Find it on screen and save the coordinat
Thanked: 0 time(s)  Unread post Posted: Sat Sep 02, 2017 4:03 am 
Silver Contributor
Silver Contributor



Joined: Thu Aug 06, 2015 6:22 pm
Posts: 167
Been thanked: 52 time(s)
Has thanked: 14 time(s)
Contribution Points: 204
if you can show me me wat u trying to do so i can understand u better


Top
 Profile  
Reply with quote  
 Post subject: Re: Pixel Pattern - Find it on screen and save the coordinat
Thanked: 0 time(s)  Unread post Posted: Sun Sep 03, 2017 6:27 am 
New User
New User



Joined: Sat Mar 12, 2016 1:32 am
Posts: 3
Been thanked: 0 time(s)
Has thanked: 2 time(s)
Contribution Points: 13
GaNnOuT wrote:
if you can show me me wat u trying to do so i can understand u better


Its nothing that im trying to do especifcly...its just me having some fun on the program..

Let's say i have this 3 words like in the file...

I want the program to read the PIXELL PATTERN of one letter then i can make the pattern of all letters and use code to form some words and look for then, like with your code above...

In the image that i put is pretty simple cuz i already have the 3 words and im looking for example for the word WHILE...in this case..where they have the same background is ez to use "image" instead of "color'..but im already thinking in cases where the only thing in commom is the PIXELS of the letter since they is pretty strong and stay above the background ...

Like i said in the first post...let's say that i have a image saying WAIT..and another image saying WENT...another saying HEIGHT...i want to pick the pattern of W when he appears on the screen...then track where he is...and look for the letter next to him...in this case i will look for the pattern of H....then look next to the H for the pattern of I...then for the L then for the E, the only ┬┤problem is...what if the pattern for W..appears in 2 locations on screen ?! This code that you put will look in both at once ?


Attachments:
Trying.jpg
Trying.jpg [ 119.35 KiB | Viewed 249 times ]
Top
 Profile  
Reply with quote  
 Post subject: Re: Pixel Pattern - Find it on screen and save the coordinat
Thanked: 1 time(s)  Unread post Posted: Sun Sep 03, 2017 5:42 pm 
Silver Contributor
Silver Contributor



Joined: Thu Aug 06, 2015 6:22 pm
Posts: 167
Been thanked: 52 time(s)
Has thanked: 14 time(s)
Contribution Points: 204
here is the code based on ur image
if pixel pattern of "W" and "H" is located
it will locate "H" then look for closest "W" to it then save it to variable XW and YW which the "W" we need
since they are in same X , we only need math for "Y" one above is + 255 and the lower - 255
then to test it out i put mouse move to Y2
Code:
 begin
     if  Color.Pixel pattern can be located on screen("0,0,0,11,40,1,0,2,16,-37,0,0,3,12,41,0,0,0,12,-43,5,0,2", "0")
          and
          Color.Pixel pattern can be located on screen("0,0,2,-1,41,0,0,0,31,-20,0,0,0,1,-20,0,0,3,1,42,0,0,12,-32,-23,0,0,0", "0")
          begin
               Color.Wait for and locate pixel pattern("0,0,2,-1,41,0,0,0,31,-20,0,0,0,1,-20,0,0,3,1,42,0,0,12,-32,-23,0,0,0", "0", "XH", "YH")
               Color.Find pixel pattern closest to coordinate("0,0,0,11,40,1,0,2,16,-37,0,0,3,12,41,0,0,0,12,-43,5,0,2", "0", "no", "{XH}", "{YH}", "XW", "YW")
               Variable.Evaluate (Math)("{YW} - 255", "Y1")
               Variable.Evaluate (Math)("{YW} + 255", "Y2")
               Mouse.Move to coordinate("{XW}", "{Y2}")
          end
 end


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC


You cannot post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group