Blue Eye Logo

Blue Eye Macro

Automation is freedom
It is currently Thu Nov 15, 2018 1:12 pm

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Help me with combining this two different macros
Thanked: 0 time(s)  Unread post Posted: Thu Feb 15, 2018 5:56 am 
New User
New User



Joined: Thu Feb 15, 2018 5:49 am
Posts: 3
Been thanked: 0 time(s)
Has thanked: 1 time(s)
Contribution Points: 10
Hi, I just made two simple macros to recognize specific patterns in a game, but the problem is I can only run them individually but not both at the same time so I tried to combine the two macros together but it won't work. the individual codes go like this:

Macro A:
begin
Color.Limit area of interest to coordinates("758", "1017", "1930", "530")
if Color.Pixel pattern appears on screen within (ms)("209,249,250,1,8,224,253,254,0,8,225,253,252", "5", "20")
begin
Keyboard.Hold keys("a")
Macro.Pause("21")
Keyboard.Press keys("a")
Macro.Pause("5")
Keyboard.Press keys("a")
Macro.Pause("5")
Keyboard.Press keys("a")
Macro.Pause("20")
Keyboard.Release keys("a")
Macro.Pause("10")
end
end


Macro B:
begin
Color.Limit area of interest to coordinates("758", "1017", "1930", "530")
if Color.Pixel pattern can be located on screen("27,254,254,0,-1,23,255,252", "10")
begin
Macro.Pause("23")
Keyboard.Hold keys("{<space>}")
Macro.Pause("25")
Keyboard.Release keys("{<space>}")
Macro.Break from loop("yes")
end
end


When I tried to combine both like this:
begin loop("-1")
Color.Limit area of interest to coordinates("758", "1017", "1930", "530")
if Color.Pixel pattern appears on screen within (ms)("209,249,250,1,8,224,253,254,0,8,225,253,252", "5", "20")
begin
Keyboard.Hold keys("a")
Macro.Pause("21")
Keyboard.Press keys("a")
Macro.Pause("5")
Keyboard.Press keys("a")
Macro.Pause("5")
Keyboard.Press keys("a")
Macro.Pause("20")
Keyboard.Release keys("a")
Macro.Pause("10")
end
if Color.Pixel pattern can be located on screen("27,254,254,0,-1,23,255,252", "10")
begin
Macro.Pause("23")
Keyboard.Hold keys("{<space>}")
Macro.Pause("25")
Keyboard.Release keys("{<space>}")
Macro.Break from loop("yes")
end
end

It won't work, I am clueless in programming so Blue Eye helped me to make simple macros, can someone help me combine the two macros into one and run without any conflicts? Thanks for any help.


Top
 Profile  
Reply with quote  
 Post subject: Re: Help me with combining this two different macros
Thanked: 1 time(s)  Unread post Posted: Thu Feb 15, 2018 10:07 pm 
Partner / License admin
Partner / License admin
User avatar



Joined: Sun Oct 10, 2010 5:16 pm
Posts: 1839
Location: USA
Been thanked: 393 time(s)
Has thanked: 33 time(s)
Contribution Points: 16376
What part of the one you combined is not working? It sorta looks like it should work, except for probably not finding the first pixel pattern. Does it not find the first pattern or does it not execute the second search either?

I'd be interested in what your execution log says when you run this.

But anyway, you have the first one set to look for the pixel pattern to appear in 20 milliseconds and then move on the second part. This may have worked in a loop as a stand-alone macro, but perhaps when combined it's not enough time to wait for the pattern to appear. I would try bumping it up to at least 1 second (1000ms) and see if that helps.

Otherwise describe how it's not working and if you could, post your execution log after you run it. It should tell you what's going on and why.

_________________
----------------------------------------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: Help me with combining this two different macros
Thanked: 0 time(s)  Unread post Posted: Thu Feb 15, 2018 11:56 pm 
New User
New User



Joined: Thu Feb 15, 2018 5:49 am
Posts: 3
Been thanked: 0 time(s)
Has thanked: 1 time(s)
Contribution Points: 10
Syrifina wrote:
What part of the one you combined is not working? It sorta looks like it should work, except for probably not finding the first pixel pattern. Does it not find the first pattern or does it not execute the second search either?

I'd be interested in what your execution log says when you run this.

But anyway, you have the first one set to look for the pixel pattern to appear in 20 milliseconds and then move on the second part. This may have worked in a loop as a stand-alone macro, but perhaps when combined it's not enough time to wait for the pattern to appear. I would try bumping it up to at least 1 second (1000ms) and see if that helps.

Otherwise describe how it's not working and if you could, post your execution log after you run it. It should tell you what's going on and why.


Hi I sort of updated the macro, a different macro now, seems to be working for now. The problem is if I run all macro alone it work fine, but when I combine it seems to have a delay and sometimes it press button from different macro. My new Macro looks like this, I think it work better because of low delay, and use more similar criteria then the old macro. Btw this macro is a simple defense macro for DBZ fighting game where certain pattern appear on screen that trigger certain buttons, took me 2 days just to set it up but it's worth it in the end, hope to add more to the macro in time. Thx for your reply, if any problems I will ask here.

begin
Color.Limit area of interest to coordinates("430", "1123", "2600", "800")
if Color.Pixel pattern can be located on screen("22,255,252,4,0,19,255,254", "18")
or
Color.Pixel pattern can be located on screen("209,249,250,1,8,224,253,254,0,8,225,253,252", "5")
begin
Keyboard.Release keys("{<down>}")
Macro.Pause("1")
Keyboard.Hold keys("{<up>}")
Keyboard.Release keys("{<down>}")
Macro.Pause("25")
Keyboard.Release keys("{<down>}")
Keyboard.Release keys("{<up>}")
end
Color.Limit area of interest to coordinates("430", "600", "2600", "400")
if Color.Pixel pattern can be located on screen("163,163,163,-12,39,108,108,108", "5")
begin
Keyboard.Release keys("{<down>}")
Keyboard.Release keys("{<down>}")
Keyboard.Release keys("{<down>}")
end
end


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 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