Blue Eye Logo

Blue Eye Macro

Automation is freedom
It is currently Fri Oct 19, 2018 12:46 am

All times are UTC




Post new topic Reply to topic  [ 14 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Identify number and click a coordinate
Thanked: 0 time(s)  Unread post Posted: Wed Aug 01, 2018 2:44 pm 
New User
New User



Joined: Mon Jul 30, 2018 2:58 pm
Posts: 7
Been thanked: 0 time(s)
Has thanked: 7 time(s)
Contribution Points: 19
Hi, newbie here,

The numbers will appear in 2 lines, one number at a time:
Ex: 2 23 45 90 13 39 27
15 21 32 34 22 11 1

How can I make BEM identify the number that appear and click a coordinate?

I was starting to taking snapshots of the numbers and place on a folder, then tell BEM if that image appear on that location click there, but there are 90 different numbers in a +- 50 different locations, must be another away, so I was looking on forum and saw that BEM can identify numbers and letters, how can I do that, thx.


Top
 Profile  
Reply with quote  
 Post subject: Re: Identify number and click a coordinate
Thanked: 1 time(s)  Unread post Posted: Wed Aug 01, 2018 3:27 pm 
Partner / License admin
Partner / License admin
User avatar



Joined: Sun Oct 10, 2010 5:16 pm
Posts: 1824
Location: USA
Been thanked: 391 time(s)
Has thanked: 31 time(s)
Contribution Points: 16331
You should post a screenshot so we can see the numbers you are talking about compared to the screen, because there's many ways to do it and some don't work in all situations.

The easiest is if it's in a file; use file.read line: viewtopic.php?f=163&t=330 ...but I'm assuming you're talking about a game.

You can use pixel patterns to identify 1-9 if the numbers are large enough and you'll need to tell BEM to verify if it's multiple digits (like 49).

You can use something like cheat engine to get the numbers from the game memory and use BEM to read from memory once you know the address.

You could still use the images, but use 1-9 and check for multiple digits.

Hope that helps

_________________
----------------------------------------Syrifina---------------------------------------------------
PM me for licenses and/or licensing information: Click Here
[Be sure to include and update your profile with your BE ID]

Forum Rules
Reminder of rules regarding Contribution points
Getting started in 1, 2, 3
Virtual Drivers; Manual Installers


Top
 Profile  
Reply with quote  
 Post subject: Re: Identify number and click a coordinate
Thanked: 0 time(s)  Unread post Posted: Wed Aug 01, 2018 4:31 pm 
New User
New User



Joined: Mon Jul 30, 2018 2:58 pm
Posts: 7
Been thanked: 0 time(s)
Has thanked: 7 time(s)
Contribution Points: 19
Thanks for quick replay,

The numbers appear like in a notepad, black color with white background and have one space between them.

I rather not use memory, is to complicated :-)

If I can still use the images to find and match within the folder on the set of images, and then click a coordinate, tell me how, I will try if works, thx.

Snapshots attached.


Attachments:
15.png
15.png [ 933 Bytes | Viewed 252 times ]
4.png
4.png [ 666 Bytes | Viewed 252 times ]
Top
 Profile  
Reply with quote  
 Post subject: Re: Identify number and click a coordinate
Thanked: 1 time(s)  Unread post Posted: Thu Aug 02, 2018 1:38 am 
Partner / License admin
Partner / License admin
User avatar



Joined: Sun Oct 10, 2010 5:16 pm
Posts: 1824
Location: USA
Been thanked: 391 time(s)
Has thanked: 31 time(s)
Contribution Points: 16331
If you use "image" like you said, you would need all 90 images and then use "if image can be located on screen": viewtopic.php?f=152&t=129...but it would also have to cycle through the images.

Unless it doesn't matter what number it is and all you really need it to do is click on it, in that case, just do the images for 1-9 (all the rest of the number have 1-9 in them)...then you only need to cycle through 9 images.

_________________
----------------------------------------Syrifina---------------------------------------------------
PM me for licenses and/or licensing information: Click Here
[Be sure to include and update your profile with your BE ID]

Forum Rules
Reminder of rules regarding Contribution points
Getting started in 1, 2, 3
Virtual Drivers; Manual Installers


Top
 Profile  
Reply with quote  
 Post subject: Re: Identify number and click a coordinate
Thanked: 0 time(s)  Unread post Posted: Thu Aug 02, 2018 4:23 pm 
New User
New User



Joined: Mon Jul 30, 2018 2:58 pm
Posts: 7
Been thanked: 0 time(s)
Has thanked: 7 time(s)
Contribution Points: 19
I try this and BEM can match the image on 100 Percent:

begin
Image.Find location of first occurrence on screen("C:\test1\images\start.png", "100", "1434", "292")
Macro.Pause("500")
end
begin
when Image.Can be located on screen near coordinate("C:\test1\numbers\18.png", "100", "1510", "293", "15")
begin
Mouse.Click at coordinate("134", "385", "Left")
Macro.Pause("500")
end
when Image.Can be located on screen near coordinate("C:\test1\numbers\29.png", "100", "1538", "291", "15")
begin
Mouse.Click at coordinate("130", "385", "Left")
end
end


Only works if the image "18.png" appear on that location, if it was another image he get stuck on that location.

I want to say to BEM, when an image appear on that location find and match within the folder the image and click on the specific location of that image, can I do that?

I have to create Variables for images and indicate the locations for each variable?


Theres an error on "Image.Find location of first occurrence", but not important for now.

log attach.


Attachments:
test1.log [851 Bytes]
Downloaded 30 times
Top
 Profile  
Reply with quote  
 Post subject: Re: Identify number and click a coordinate
Thanked: 1 time(s)  Unread post Posted: Thu Aug 02, 2018 8:48 pm 
Partner / License admin
Partner / License admin
User avatar



Joined: Sun Oct 10, 2010 5:16 pm
Posts: 1824
Location: USA
Been thanked: 391 time(s)
Has thanked: 31 time(s)
Contribution Points: 16331
If you use "when", then the macro will not continue past that point until the criteria is met...not good for what you are trying to do.

Replace all your "when's" with "if" and it should work fine.

_________________
----------------------------------------Syrifina---------------------------------------------------
PM me for licenses and/or licensing information: Click Here
[Be sure to include and update your profile with your BE ID]

Forum Rules
Reminder of rules regarding Contribution points
Getting started in 1, 2, 3
Virtual Drivers; Manual Installers


Top
 Profile  
Reply with quote  
 Post subject: Re: Identify number and click a coordinate
Thanked: 0 time(s)  Unread post Posted: Thu Aug 02, 2018 10:05 pm 
New User
New User



Joined: Mon Jul 30, 2018 2:58 pm
Posts: 7
Been thanked: 0 time(s)
Has thanked: 7 time(s)
Contribution Points: 19
I changed to "if", and yes, the BE don't get stuck and move on to the next location, but I want that BE find and match in the folder whatever image that will appear on that location and click on the specific location of the matched image.

I try to do that:

if Image.Can be located on screen near coordinate("C:\test1\numbers\", "100", "1510", "293", "15")

give the path to the folder instead of the image but don't accept that way, what is the correct way?


Top
 Profile  
Reply with quote  
 Post subject: Re: Identify number and click a coordinate
Thanked: 1 time(s)  Unread post Posted: Fri Aug 03, 2018 2:25 am 
Partner / License admin
Partner / License admin
User avatar



Joined: Sun Oct 10, 2010 5:16 pm
Posts: 1824
Location: USA
Been thanked: 391 time(s)
Has thanked: 31 time(s)
Contribution Points: 16331
I tested your image with this:
Code:
 begin
     if  Image.Can be located on screen("C:\Users\Syrifina\Desktop\15.png", "100")
          begin
               Mouse.Move to image("C:\Users\Syrifina\Desktop\15.png", "100")
          end
 end
...and it worked fine.

Either replace mouse.move in the script above with Mouse.Click at image("c:\image-location.png", "100", "left")
or continue with the script above and just muse mouse.click since the cursor will already be there.

There are some other options, but try one of those to get it working first.

_________________
----------------------------------------Syrifina---------------------------------------------------
PM me for licenses and/or licensing information: Click Here
[Be sure to include and update your profile with your BE ID]

Forum Rules
Reminder of rules regarding Contribution points
Getting started in 1, 2, 3
Virtual Drivers; Manual Installers


Top
 Profile  
Reply with quote  
 Post subject: Re: Identify number and click a coordinate
Thanked: 0 time(s)  Unread post Posted: Fri Aug 03, 2018 2:01 pm 
New User
New User



Joined: Mon Jul 30, 2018 2:58 pm
Posts: 7
Been thanked: 0 time(s)
Has thanked: 7 time(s)
Contribution Points: 19
Code:
 begin
     Image.Find location of first occurrence on screen("C:\test1\images\start.png", "100", "1434", "292")
     Macro.Pause("500")
 end
 begin
     if  Image.Can be located on screen near coordinate("C:\test1\numbers\1.png", "100", "1510", "293", "15")
          begin
               Mouse.Move in direction("134", "385")
               Mouse.Click("Left")
               Macro.Pause("500")
          end
     if  Image.Can be located on screen near coordinate("C:\test1\numbers\2.png", "100", "1510", "293", "15")
          begin
               Mouse.Move in direction("134", "385")
               Mouse.Click("Left")
               Macro.Pause("500")
          end
     if  Image.Can be located on screen near coordinate("C:\test1\numbers\3.png", "100", "1510", "293", "15")
          begin
               Mouse.Move in direction("134", "385")
               Mouse.Click("Left")
               Macro.Pause("500")
          end
     if  Image.Can be located on screen near coordinate("C:\test1\numbers\4.png", "100", "1510", "293", "15")
          begin
               Mouse.Move in direction("134", "385")
               Mouse.Click("Left")
               Macro.Pause("500")
          end
     if  Image.Can be located on screen near coordinate("C:\test1\numbers\5.png", "100", "1510", "293", "15")
          begin
               Mouse.Move in direction("134", "385")
               Mouse.Click("Left")
               Macro.Pause("500")
          end
     if  Image.Can be located on screen near coordinate("C:\test1\numbers\6.png", "100", "1510", "293", "15")
          begin
               Mouse.Move in direction("134", "385")
               Mouse.Click("Left")
               Macro.Pause("500")
          end
     if  Image.Can be located on screen near coordinate("C:\test1\numbers\7.png", "100", "1510", "293", "15")
          begin
               Mouse.Move in direction("134", "385")
               Mouse.Click("Left")
               Macro.Pause("500")
          end
     if  Image.Can be located on screen near coordinate("C:\test1\numbers\8.png", "100", "1510", "293", "15")
          begin
               Mouse.Move in direction("134", "385")
               Mouse.Click("Left")
               Macro.Pause("500")
          end
     if  Image.Can be located on screen near coordinate("C:\test1\numbers\9.png", "100", "1510", "293", "15")
          begin
               Mouse.Move in direction("134", "385")
               Mouse.Click("Left")
               Macro.Pause("500")
          end
     if  Image.Can be located on screen near coordinate("C:\test1\numbers\10.png", "100", "1510", "293", "15")
          begin
               Mouse.Move in direction("134", "385")
               Mouse.Click("Left")
               Macro.Pause("500")
          end
     if  Image.Can be located on screen near coordinate("C:\test1\numbers\11.png", "100", "1510", "293", "15")
          begin
               Mouse.Move in direction("134", "385")
               Mouse.Click("Left")
               Macro.Pause("500")
          end
     if  Image.Can be located on screen near coordinate("C:\test1\numbers\12.png", "100", "1510", "293", "15")
          begin
               Mouse.Move in direction("134", "385")
               Mouse.Click("Left")
               Macro.Pause("500")
          end
     if  Image.Can be located on screen near coordinate("C:\test1\numbers\13.png", "100", "1510", "293", "15")
          begin
               Mouse.Move in direction("134", "385")
               Mouse.Click("Left")
               Macro.Pause("500")
          end
     if  Image.Can be located on screen near coordinate("C:\test1\numbers\14.png", "100", "1510", "293", "15")
          begin
               Mouse.Move in direction("134", "385")
               Mouse.Click("Left")
               Macro.Pause("500")
          end
     if  Image.Can be located on screen near coordinate("C:\test1\numbers\15.png", "100", "1510", "293", "15")
          begin
               Mouse.Move in direction("134", "385")
               Mouse.Click("Left")
               Macro.Pause("500")
          end
     if  Image.Can be located on screen near coordinate("C:\test1\numbers\16.png", "100", "1510", "293", "15")
          begin
               Mouse.Move in direction("134", "385")
               Mouse.Click("Left")
               Macro.Pause("500")
          end
     if  Image.Can be located on screen near coordinate("C:\test1\numbers\17.png", "100", "1510", "293", "15")
          begin
               Mouse.Move in direction("134", "385")
               Mouse.Click("Left")
               Macro.Pause("500")
          end
     if  Image.Can be located on screen near coordinate("C:\test1\numbers\18.png", "100", "1510", "293", "15")
          begin
               Mouse.Move in direction("134", "385")
               Mouse.Click("Left")
               Macro.Pause("500")
          end
     if  Image.Can be located on screen near coordinate("C:\test1\numbers\19.png", "100", "1510", "293", "15")
          begin
               Mouse.Move in direction("134", "385")
               Mouse.Click("Left")
               Macro.Pause("500")
          end
     if  Image.Can be located on screen near coordinate("C:\test1\numbers\20.png", "100", "1510", "293", "15")
          begin
               Mouse.Move in direction("134", "385")
               Mouse.Click("Left")
               Macro.Pause("500")
          end
     if  Image.Can be located on screen near coordinate("C:\test1\numbers\21.png", "100", "1510", "293", "15")
          begin
               Mouse.Move in direction("134", "385")
               Mouse.Click("Left")
               Macro.Pause("500")
          end
     if  Image.Can be located on screen near coordinate("C:\test1\numbers\22.png", "100", "1510", "293", "15")
          begin
               Mouse.Move in direction("134", "385")
               Mouse.Click("Left")
               Macro.Pause("500")
          end
     if  Image.Can be located on screen near coordinate("C:\test1\numbers\23.png", "100", "1510", "293", "15")
          begin
               Mouse.Move in direction("134", "385")
               Mouse.Click("Left")
               Macro.Pause("500")
          end
     if  Image.Can be located on screen near coordinate("C:\test1\numbers\24.png", "100", "1510", "293", "15")
          begin
               Mouse.Move in direction("134", "385")
               Mouse.Click("Left")
               Macro.Pause("500")
          end
     if  Image.Can be located on screen near coordinate("C:\test1\numbers\25.png", "100", "1510", "293", "15")
          begin
               Mouse.Move in direction("134", "385")
               Mouse.Click("Left")
               Macro.Pause("500")
          end
     if  Image.Can be located on screen near coordinate("C:\test1\numbers\26.png", "100", "1510", "293", "15")
          begin
               Mouse.Move in direction("134", "385")
               Mouse.Click("Left")
               Macro.Pause("500")
          end
     if  Image.Can be located on screen near coordinate("C:\test1\numbers\27.png", "100", "1510", "293", "15")
          begin
               Mouse.Move in direction("134", "385")
               Mouse.Click("Left")
               Macro.Pause("500")
          end
     if  Image.Can be located on screen near coordinate("C:\test1\numbers\28.png", "100", "1510", "293", "15")
          begin
               Mouse.Move in direction("134", "385")
               Mouse.Click("Left")
               Macro.Pause("500")
          end
     if  Image.Can be located on screen near coordinate("C:\test1\numbers\29.png", "100", "1510", "293", "15")
          begin
               Mouse.Move in direction("134", "385")
               Mouse.Click("Left")
               Macro.Pause("500")
          end
     if  Image.Can be located on screen near coordinate("C:\test1\numbers\30.png", "100", "1510", "293", "15")
          begin
               Mouse.Move in direction("134", "385")
               Mouse.Click("Left")
               Macro.Pause("500")
          end
 end


It worked, BE matched the image "30.png" that it was on that location, but the mouse didn't moved and click, and it took 10 secs to match the image, its to long.

The mouse need to move and click on another location and not on the image.

This code is only for one location and 60 images are missed, BE need to find and match in different locations, one at a time, there's another way to do this?


log atached


Attachments:
test1.log [5.36 KiB]
Downloaded 29 times
Top
 Profile  
Reply with quote  
 Post subject: Re: Identify number and click a coordinate
Thanked: 1 time(s)  Unread post Posted: Fri Aug 03, 2018 3:26 pm 
Partner / License admin
Partner / License admin
User avatar



Joined: Sun Oct 10, 2010 5:16 pm
Posts: 1824
Location: USA
Been thanked: 391 time(s)
Has thanked: 31 time(s)
Contribution Points: 16331
This part of your code doesn't make sense:
Code:
               Mouse.Move in direction("134", "385")
               Mouse.Click("Left")
               Macro.Pause("500")


First, to use mouse.move in direction properly you need a direction and the number of pixels like:
Code:
Mouse.Move in direction("down", "385")
or
Mouse.Move in direction("aDirection", "NumberOfPixelsToMove")


Second, you have "385" for all of them, is this a static location? It looks like (from your script) that the image always pops up in the same place (since you have "near coordinate" and all the coordinates are the same) and the number of pixels to move the mouse is 385 for all of them.

There's probably another way to do it, but I'm only going by what you've told me. What game is it or post screenshots from the game so I can see what you're trying to do.

_________________
----------------------------------------Syrifina---------------------------------------------------
PM me for licenses and/or licensing information: Click Here
[Be sure to include and update your profile with your BE ID]

Forum Rules
Reminder of rules regarding Contribution points
Getting started in 1, 2, 3
Virtual Drivers; Manual Installers


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 posts ]  Go to page 1, 2  Next

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