Blue Eye Logo

Blue Eye Macro

Automation is freedom
It is currently Thu Sep 29, 2022 5:52 am

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: script game
Thanked: 0 time(s)  Unread post Posted: Mon Jun 27, 2022 7:07 pm 
New User
New User



Joined: Tue May 31, 2022 2:31 am
Posts: 2
Been thanked: 0 time(s)
Has thanked: 1 time(s)
Contribution Points: 10
I would like to increase the success rate, because although it works, it fails sometimes

Image

Code:
 begin
     Function.Execute("P")
     Keyboard.Press key("{<space>}")
 end

function("P")
     begin
          begin loop()
               if  Color.Can be located on screen (RGB)("0", "255", "206", "5")
                    begin
                         Color.Find coordinate of first occurrence (RGB)("0", "255", "206", "5", "x", "y")
                         begin loop()
                              if  Color.Near coordinate is within (RGB range)("209", "139", "0", "1", "{x}","{y}","10")
                                   begin
                                        Macro.Break from loop("no")
                                   end
                         end
                         Macro.Break from loop("no")
                    end
          end
     end
function


Top
 Profile  
Reply with quote  
 Post subject: Re: script game
Thanked: 1 time(s)  Unread post Posted: Mon Jun 27, 2022 9:32 pm 
Partner / License admin
Partner / License admin
User avatar



Joined: Sun Oct 10, 2010 5:16 pm
Posts: 2259
Location: USA
Been thanked: 535 time(s)
Has thanked: 38 time(s)
Contribution Points: 17741
Watch the macro to see when it misses does it press space before or after the arrow passes the line. Then adjust the range accordingly...

this part:
if Color.Near coordinate is within (RGB range)("209", "139", "0", "1", "{x}","{y}","10")
*the 10 at the end is what I'm talking about

If it's clicking after the arrow passes the line then you need to increase the number.
If it's clicking before the line, then you need to decrease the range further.

_________________
----------------------------------------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: script game
Thanked: 0 time(s)  Unread post Posted: Tue Jun 28, 2022 1:45 am 


Syrifina wrote:
Watch the macro to see when it misses does it press space before or after the arrow passes the line. Then adjust the range accordingly...

this part:
if Color.Near coordinate is within (RGB range)("209", "139", "0", "1", "{x}","{y}","10")
*the 10 at the end is what I'm talking about

If it's clicking after the arrow passes the line then you need to increase the number.
If it's clicking before the line, then you need to decrease the range further.


Values other than 10 does not work, because the space key is not pressed
The value 10 sometimes hits completely, but sometimes it misses because it is activated before


Top
  
Reply with quote  
 Post subject: Re: script game
Thanked: 0 time(s)  Unread post Posted: Wed Jul 06, 2022 1:44 am 
New User
New User



Joined: Tue May 31, 2022 2:31 am
Posts: 2
Been thanked: 0 time(s)
Has thanked: 1 time(s)
Contribution Points: 10
Whenever you hit the blue bar, the difficulty increases and the same bar (blue) decreases in size.
When this happens the space key stops being pressed, how can I solve this?


Top
 Profile  
Reply with quote  
 Post subject: Re: script game
Thanked: 0 time(s)  Unread post Posted: Wed Jul 06, 2022 3:52 am 
Partner / License admin
Partner / License admin
User avatar



Joined: Sun Oct 10, 2010 5:16 pm
Posts: 2259
Location: USA
Been thanked: 535 time(s)
Has thanked: 38 time(s)
Contribution Points: 17741
After you run it, check the execution log; it will tell you exactly what happened and you'll be able to see where things went wrong.

I'd imagine that it's caught in one of the loops not seeing where they meet. The way you wrote that script, it will only break from the loop and press space when the orangish node comes close to the blue bar...so, if BEM doesn't see that then it will be stuck in that loop. Since the location is variable based in that loop, if it gets stuck then it's stuck for good. The execution log will tell you exactly what happened and why it didn't press the space bar.

There's another thread on the forum with a similar issue. Same concept but for a golf game that needed to click when the bar reached a specific line. There's a lot comments that go through progression of scripting the macro and fine tuning it. You should read it, it's here: viewtopic.php?f=10&t=21294 Should be helpful in what you're doing.

_________________
----------------------------------------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  [ 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