Blue Eye Logo

Blue Eye Macro

Automation is freedom
It is currently Thu Jul 19, 2018 3:42 am

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: how to stop macro in a loop?
Thanked: 0 time(s)  Unread post Posted: Fri May 11, 2018 6:19 am 
New User
New User



Joined: Thu May 10, 2018 4:20 am
Posts: 6
Been thanked: 0 time(s)
Has thanked: 3 time(s)
Contribution Points: 22
Hello, just new and looking for help

so i'm trying macros and i don't know how to make it stop loop.

so ie:
macro1
begin
if Color.At coordinate is (RGB)("213", "163", "83", "558", "179")
begin
Humanly.Click at coordinate("558", "179", "left", "yes")
end
end

and i have the 1/infinite loop box checked on the side.

what i have this simple code do is look for a specified RGB color at a specified location and if found, click that location once. AND STOP....
how do i make this stop once condition is met?

other than clicking the stop macro button, i'm not sure how to make it get out of the loop?

the reason i want to do that is if i got an second macro that does the same thing. and i call macro1, call macro2. I don't know how to make macro1 stop when it's condition is met, and so i see both macros are running but it looks like only macro1 is stuck in a loop.

i just want to know how to stop a macro in a loop so i can stick it together with another macro when 1st macro's condition are met and if not keep on running macro1 etc...

Any help would be greatly appreciated! Thank you!!!


Top
 Profile  
Reply with quote  
 Post subject: Re: how to stop macro in a loop?
Thanked: 1 time(s)  Unread post Posted: Fri May 11, 2018 9:06 am 
Silver Contributor
Silver Contributor



Joined: Thu Aug 06, 2015 6:22 pm
Posts: 173
Been thanked: 57 time(s)
Has thanked: 14 time(s)
Contribution Points: 215
u should uncheck the infinite loop then add infinite loop but with a command " begin loop() " then add macro break from loop command
like this
begin loop()
if Color.At coordinate is (RGB)("213", "163", "83", "558", "179")
begin
Humanly.Click at coordinate("558", "179", "left", "yes")
Macro.Break from loop("yes")
end
end


Top
 Profile  
Reply with quote  
 Post subject: Re: how to stop macro in a loop?
Thanked: 1 time(s)  Unread post Posted: Fri May 11, 2018 12:34 pm 
Partner / License admin
Partner / License admin
User avatar



Joined: Sun Oct 10, 2010 5:16 pm
Posts: 1787
Location: USA
Been thanked: 375 time(s)
Has thanked: 30 time(s)
Contribution Points: 16210
Consider this question: Why do you want it in a loop?

1. If you want to run 2 macros continually one after another, don't use infinite loops. Start macro 1 with execute macro 2 at the end of it. Then write execute macro 1 at the end of macro 2. They will each run once and continually start each other. Use: viewtopic.php?f=166&t=360

2. If you want to click on food every 2 minutes, then (with infinite loops checked) put "macro.pause(120000)" at the end of the script. It will pause 2 minutes before starting again.

* there's many other ways to do this also. Make sure you check the documentation pages.
**Also, consider using Functions instead of separate macros...it will usually benefit you more.

_________________
----------------------------------------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: how to stop macro in a loop?
Thanked: 0 time(s)  Unread post Posted: Fri May 11, 2018 5:21 pm 
New User
New User



Joined: Thu May 10, 2018 4:20 am
Posts: 6
Been thanked: 0 time(s)
Has thanked: 3 time(s)
Contribution Points: 22
GaNnOuT wrote:
u should uncheck the infinite loop then add infinite loop but with a command " begin loop() " then add macro break from loop command
like this
begin loop()
if Color.At coordinate is (RGB)("213", "163", "83", "558", "179")
begin
Humanly.Click at coordinate("558", "179", "left", "yes")
Macro.Break from loop("yes")
end
end


yes it works perfectly!!!! thank you ! i am unlocking the side box and now making it as a begin loop and break from loop now. works so good! exactly what i'm looking for!!! thank you


Top
 Profile  
Reply with quote  
 Post subject: Re: how to stop macro in a loop?
Thanked: 0 time(s)  Unread post Posted: Fri May 11, 2018 5:23 pm 
New User
New User



Joined: Thu May 10, 2018 4:20 am
Posts: 6
Been thanked: 0 time(s)
Has thanked: 3 time(s)
Contribution Points: 22
Syrifina wrote:
Consider this question: Why do you want it in a loop?

1. If you want to run 2 macros continually one after another, don't use infinite loops. Start macro 1 with execute macro 2 at the end of it. Then write execute macro 1 at the end of macro 2. They will each run once and continually start each other. Use: viewtopic.php?f=166&t=360

2. If you want to click on food every 2 minutes, then (with infinite loops checked) put "macro.pause(120000)" at the end of the script. It will pause 2 minutes before starting again.

* there's many other ways to do this also. Make sure you check the documentation pages.
**Also, consider using Functions instead of separate macros...it will usually benefit you more.


also i did use the function now. what i'm doing now is calling 5 separate functions on top.
and each function got the begin loop and break from loop in it. and i also added pause in between
works so good!
i'm so happy my first little mini bot clicker works now! thanks so much to you guys both! lol.

btw this is what i'm using

Code:
 begin
     Function.Execute("test")
     Macro.Pause("5000")
     Function.Execute("test2")
end
function("test")
     begin loop()
          if  Color.At coordinate is within (RGB range)("149", "82", "26", "5", "949", "361")
               begin
                    Humanly.Click at coordinate("949", "361", "left", "yes")
                    Macro.Break from loop("no")
               end
     end
function

thank you two!


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