Blue Eye Logo

Blue Eye Macro

Automation is freedom
It is currently Tue Nov 20, 2018 9:57 pm

All times are UTC




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Small Help ;)
Thanked: 0 time(s)  Unread post Posted: Mon Jun 09, 2014 4:16 am 
New User
New User



Joined: Mon Jun 09, 2014 3:43 am
Posts: 2
Been thanked: 0 time(s)
Has thanked: 1 time(s)
Contribution Points: 10
Hello everybody
1. sory for my bad english :<
2. sory if this thread is in wrong place
3: thats my problem

im trying to do a small macro - wow heh :O
for game called "stronghold kingoms"
so here its map of the game
I've deleted some information, cause i don't want to be banned :<
1. Its my village
2. the're the resources, i can take them with "scouts"
3. after click at icon of the resources theres button to send scouts
4. its an unkown resource with I become bonus points, if its in my circle. so first i catch them ;)
Image


so, i tried do it myselft, but its really a brute force way
i've maked screens of all of 15 resources, and make a macro like this
Code:
         if  Image.Can be located on screen near coordinate("C:\first.png", "80", "540", "533", "100") // i used only 80% cause the background changes sometimes
               begin
                 // that under are comands to send scouts, its not importants
                    Mouse.Click at image("C:\first.png", "50", "LEFT")
                    Macro.Pause("500")
                    Mouse.Click at image("C:\first.png", "50", "LEFT")
                    Mouse.Click at coordinate("1185", "204", "LEFT")
                    Macro.Pause("1000")
                    Mouse.Click at coordinate("783", "693", "LEFT")
                    Macro.Pause("5000")
               end


so my problem its that that program check only for 1 resources, and i need to copy this part 15'times and change the image
so my question is " is there an faster way to check the resources and send them "scouts" ?


Top
 Profile  
Reply with quote  
 Post subject: Re: Small Help ;)
Thanked: 2 time(s)  Unread post Posted: Fri Jun 13, 2014 10:54 pm 
Partner / Developer
Partner / Developer
User avatar



Joined: Mon Jan 18, 2010 11:51 am
Posts: 4523
Been thanked: 1192 time(s)
Has thanked: 132 time(s)
Contribution Points: 32845
Code:
 begin
     Function.Execute setting 1 variable("Get resource", "image", "C:\first.png")
     Function.Execute setting 1 variable("Get resource", "image", "C:\second.png")
 end

function("Get resource")
     begin
          if  Image.Can be located on screen near coordinate("{image}", "80", "540", "533", "100")
               // i used only 80% cause the background changes sometimes
               begin
                    // that under are comands to send scouts, its not importants
                    Image.Find location of first occurrence on screen("{image}", "50", "x", "y")
                    Mouse.Click at coordinate("{x}", "{y}", "Left")
                    Macro.Pause("500")
                    Mouse.Click at coordinate("{x}", "{y}", "Left")
                    Mouse.Click at coordinate("1185", "204", "LEFT")
                    Macro.Pause("1000")
                    Mouse.Click at coordinate("783", "693", "LEFT")
                    Macro.Pause("5000")
               end
     end
function

_________________
Blue Eye - Developer / Moderator
Code:
Gigus


Please read the rules about contribution points - click here

Do you know everything about BE, the forum, licenses and contribution points?
Please take a minute to read this introduction & guidelines.


Top
 Profile  
Reply with quote  
 Post subject: Re: Small Help ;)
Thanked: 0 time(s)  Unread post Posted: Sun Jun 15, 2014 6:13 pm 
New User
New User



Joined: Mon Jun 09, 2014 3:43 am
Posts: 2
Been thanked: 0 time(s)
Has thanked: 1 time(s)
Contribution Points: 10
great, thx, but I make some mistake there and theres still not working
it search only for the 1'resource :/
i must delete begin and end beetwen the Function.Execute setting lines, cause BE send me errors :/
idk how to correct it :/
Code:
 begin
     Mouse.Click at coordinate("892", "65", "LEFT")
     Macro.Pause("1000")
     Mouse.Click at coordinate("559", "108", "LEFT")
     Macro.Pause("5000")
     Mouse.Click at coordinate("544", "551", "RIGHT")
     Macro.Pause("5000")
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////here i deleted begin
     Function.Execute setting 1 variable("Get resource", "image", "C:\MACRO\1.png")
     Function.Execute setting 1 variable("Get resource", "image", "C:\MACRO\2.png")
     Function.Execute setting 1 variable("Get resource", "image", "C:\MACRO\3.png")
     Function.Execute setting 1 variable("Get resource", "image", "C:\MACRO\4.png")
     Function.Execute setting 1 variable("Get resource", "image", "C:\MACRO\5.png")
     Function.Execute setting 1 variable("Get resource", "image", "C:\MACRO\6.png")
     Function.Execute setting 1 variable("Get resource", "image", "C:\MACRO\7.png")
     Function.Execute setting 1 variable("Get resource", "image", "C:\MACRO\8.png")
     Function.Execute setting 1 variable("Get resource", "image", "C:\MACRO\9.png")
     Function.Execute setting 1 variable("Get resource", "image", "C:\MACRO\10.png")
     Function.Execute setting 1 variable("Get resource", "image", "C:\MACRO\11.png")
     Function.Execute setting 1 variable("Get resource", "image", "C:\MACRO\12.png")
     Function.Execute setting 1 variable("Get resource", "image", "C:\MACRO\13.png")
     Function.Execute setting 1 variable("Get resource", "image", "C:\MACRO\14.png")
     Function.Execute setting 1 variable("Get resource", "image", "C:\MACRO\15.png")
     Function.Execute setting 1 variable("Get resource", "image", "C:\MACRO\16.png")
     Function.Execute setting 1 variable("Get resource", "image", "C:\MACRO\17.png")
     Function.Execute setting 1 variable("Get resource", "image", "C:\MACRO\18.png")
     Function.Execute setting 1 variable("Get resource", "image", "C:\MACRO\19.png")
     Function.Execute setting 1 variable("Get resource", "image", "C:\MACRO\20.png")
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////here i deleted end. if I add them, BE send errors :/

function("Get resource")
     if  Image.Can be located on screen near coordinate("{image}", "80", "540", "533", "100")
          begin
               Image.Find location of first occurrence on screen("{image}", "50", "x", "y")
               Mouse.Click at coordinate("{x}", "{y}", "Left")
               Macro.Pause("500")
               Mouse.Click at coordinate("{x}", "{y}", "Left")
               Mouse.Click at coordinate("1185", "204", "LEFT")
               Macro.Pause("1000")
               Mouse.Click at coordinate("783", "693", "LEFT")
               Macro.Pause("5000")
          end
     // X
     if  Image.Can be located on screen near coordinate("C:\MACRO\x.png", "90", "886", "336", "20")
          begin
               Mouse.Click at image("C:\MACRO\x.png", "80", "LEFT")
          end
     begin
          Macro.Pause("1000")
          Mouse.Click at color closest to coordinate (RGB)("47", "42", "36", "0", "847", "65", "LEFT")
          Macro.Pause("6000")
     end
function
end
 


exe~~ log
Code:
Started
Executing: Mouse.Click at coordinate(X Coordinate: 892, Y Coordinate: 65, Mouse Button: LEFT)
Executing: Macro.Pause(Duration: 1000)
Executing: Mouse.Click at coordinate(X Coordinate: 559, Y Coordinate: 108, Mouse Button: LEFT)
Executing: Macro.Pause(Duration: 5000)
Executing: Mouse.Click at coordinate(X Coordinate: 544, Y Coordinate: 551, Mouse Button: RIGHT)
Executing: Macro.Pause(Duration: 5000)
Executing: Function.Execute setting 1 variable(Name: Get resource, Argument 1 Name: image, Argument 1 Value: C:\MACRO\1.png)
Checking if: Image.Can be located on screen near coordinate(Path: C:\MACRO\1.png, Percent: 80, X Coordinate: 540, Y Coordinate: 533, Distance: 100)
Result: No
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// dont search for 2-20 :/
Checking if: Image.Can be located on screen near coordinate(Path: C:\MACRO\x.png, Percent: 90, X Coordinate: 886, Y Coordinate: 336, Distance: 20)
Result: No
Executing: Macro.Pause(Duration: 1000)
Executing: Mouse.Click at color closest to coordinate (RGB)(R: 47, G: 42, B: 36, Range: 0, X Coordinate: 847, Y Coordinate: 65, Mouse Button: LEFT)
Executing: Macro.Pause(Duration: 6000)
Aborted


Top
 Profile  
Reply with quote  
 Post subject: Re: Small Help ;)
Thanked: 0 time(s)  Unread post Posted: Mon Jun 16, 2014 11:07 am 
Partner / Developer
Partner / Developer
User avatar



Joined: Mon Jan 18, 2010 11:51 am
Posts: 4523
Been thanked: 1192 time(s)
Has thanked: 132 time(s)
Contribution Points: 32845
Like so:

Code:
 begin
     Mouse.Click at coordinate("892", "65", "LEFT")
     Macro.Pause("1000")
     Mouse.Click at coordinate("559", "108", "LEFT")
     Macro.Pause("5000")
     Mouse.Click at coordinate("544", "551", "RIGHT")
     Macro.Pause("5000")
     Function.Execute setting 1 variable("Get resource", "image", "C:\MACRO\1.png")
     Function.Execute setting 1 variable("Get resource", "image", "C:\MACRO\2.png")
     Function.Execute setting 1 variable("Get resource", "image", "C:\MACRO\3.png")
     Function.Execute setting 1 variable("Get resource", "image", "C:\MACRO\4.png")
     Function.Execute setting 1 variable("Get resource", "image", "C:\MACRO\5.png")
     Function.Execute setting 1 variable("Get resource", "image", "C:\MACRO\6.png")
     Function.Execute setting 1 variable("Get resource", "image", "C:\MACRO\7.png")
     Function.Execute setting 1 variable("Get resource", "image", "C:\MACRO\8.png")
     Function.Execute setting 1 variable("Get resource", "image", "C:\MACRO\9.png")
     Function.Execute setting 1 variable("Get resource", "image", "C:\MACRO\10.png")
     Function.Execute setting 1 variable("Get resource", "image", "C:\MACRO\11.png")
     Function.Execute setting 1 variable("Get resource", "image", "C:\MACRO\12.png")
     Function.Execute setting 1 variable("Get resource", "image", "C:\MACRO\13.png")
     Function.Execute setting 1 variable("Get resource", "image", "C:\MACRO\14.png")
     Function.Execute setting 1 variable("Get resource", "image", "C:\MACRO\15.png")
     Function.Execute setting 1 variable("Get resource", "image", "C:\MACRO\16.png")
     Function.Execute setting 1 variable("Get resource", "image", "C:\MACRO\17.png")
     Function.Execute setting 1 variable("Get resource", "image", "C:\MACRO\18.png")
     Function.Execute setting 1 variable("Get resource", "image", "C:\MACRO\19.png")
     Function.Execute setting 1 variable("Get resource", "image", "C:\MACRO\20.png")
 end

function("Get resource")
     begin
          if  Image.Can be located on screen near coordinate("{image}", "80", "540", "533", "100")
               begin
                    Image.Find location of first occurrence on screen("{image}", "50", "x", "y")
                    Mouse.Click at coordinate("{x}", "{y}", "Left")
                    Macro.Pause("500")
                    Mouse.Click at coordinate("{x}", "{y}", "Left")
                    Mouse.Click at coordinate("1185", "204", "LEFT")
                    Macro.Pause("1000")
                    Mouse.Click at coordinate("783", "693", "LEFT")
                    Macro.Pause("5000")
               end
          // X
          if  Image.Can be located on screen near coordinate("C:\MACRO\x.png", "90", "886", "336", "20")
               begin
                    Mouse.Click at image("C:\MACRO\x.png", "80", "LEFT")
               end
          Macro.Pause("1000")
          Mouse.Click at color closest to coordinate (RGB)("47", "42", "36", "0", "847", "65", "LEFT")
          Macro.Pause("6000")
     end
function

_________________
Blue Eye - Developer / Moderator
Code:
Gigus


Please read the rules about contribution points - click here

Do you know everything about BE, the forum, licenses and contribution points?
Please take a minute to read this introduction & guidelines.


Top
 Profile  
Reply with quote  
 Post subject: Re: Small Help ;)
Thanked: 0 time(s)  Unread post Posted: Wed Jun 18, 2014 6:21 am 
Contributor
Contributor



Joined: Wed Jun 11, 2014 11:21 pm
Posts: 71
Been thanked: 0 time(s)
Has thanked: 4 time(s)
Contribution Points: 49
thank you


Top
 Profile  
Reply with quote  
 Post subject: Re: Small Help ;)
Thanked: 0 time(s)  Unread post Posted: Thu Sep 25, 2014 10:50 am 
Contributor
Contributor



Joined: Wed Sep 10, 2014 3:19 pm
Posts: 73
Been thanked: 1 time(s)
Has thanked: 21 time(s)
Contribution Points: 97
nice thanks :D


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