Blue Eye Logo

Blue Eye Macro

Automation is freedom
It is currently Thu Dec 12, 2019 1:00 am

All times are UTC




Post a reply
Username:
Subject:
Message body:
Enter your message here, it may contain no more than 60000 characters. 

Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :arrow: :| :mrgreen: :geek: :ugeek:
Font size:
Font colour
Options:
BBCode is ON
[img] is OFF
[flash] is OFF
[url] is ON
Smilies are ON
Disable BBCode
Disable smilies
Do not automatically parse URLs
Please click and drag the 2 correct statements to the right hand side.
Please click and drag the 2 correct statements to the right hand side.
Please select the options below to the correct list to avoid automated registrations.
Statements
2 correct statements
Dogs have 4 legs
Elephants can fly
Fish can swim
Chickens can talk
   

Topic review - Need help with macro
Author Message
  Post subject:  Re: Need help with macro  Reply with quote
Syrifina wrote:

Try this out and then you can modify the code to do what you want it to. Hope that helps!

Code:
 begin
     Variable.Set("x", "205")
     Variable.Set("y", "465")
     begin loop()
          Mouse.Move to coordinate("{x}", "{y}")
          if  Color.At the current mouse position is (RGB)("255", "255", "0")
               begin
                    Window.Display message box("Found the color", "yes")
                    Macro.Abort()
               end
          Macro.Pause("500")
          Function.Execute("ChangeVariableCoordinates")
     end
end

function("ChangeVariableCoordinates")
          begin
               Variable.Add (Math)("x", "10")
          end
function
     


Thanks so much, this logic worked perfectly with what i was trying to do!
Post Posted: Fri Nov 08, 2019 12:39 am
  Post subject:  Re: Need help with macro  Reply with quote
skymacro wrote:
Hello, new user and first time poster here. I need some help with my macro. The main goal of this macro is to look for a pixel pattern and in a "small section" of the screen and move over 10 pixels if not found. I set a couple of variables for the coordinates of the "small section" to be increased when not found but it seems the macro isn't searching the appropriates sections. Help?



Rather doing that I think it would be much easier to use:

Code:

      Color.Limit area of interest to coordinates("{x1}", "{y1}", "10", "10")



The first two arguments is the coordinate set specifying the top left corner of the limited region, the remaining two argument specifies the width and height of the region.

also remember to use color.unlimit area of interest after checking.

then if not found you can just add the increment in the variables..


also this part of your code is not a part of your main code or isn't a function. so BEM will not execute it.. If I remember correctly.

skymacro wrote:
Code:
 begin
     //
     Variable.Add (Math)("X1", "10")
     if  Variable.Is greater than (Math)("X1", "1850")
          begin
               Variable.Set global("X1", "530")
               Mouse.Move to coordinate("1643", "1023")
               Mouse.Hold button("Left")
               Mouse.Move in direction("Up", "15")
               Mouse.Release button("Left")
          end
 end
 //
 if  Color.Pixel pattern can not be located on screen("0,112,255,1,1,0,112,255,0,1,0,112,255,-1,-1,0,112,255,-1,0,0,112,255,0,1,0,112,255,0,1,0,103,234,0,1,2,33,76,1,0,0,103,234,1,0,0,112,255,1,0,0,112,255,0,-1,0,112,255,1,0,0,112,255,0,-2,0,112,255,0,-1,0,112,255,0,-1,0,103,234,-1,0,0,112,255,-1,0,0,112,255,-1,0,0,103,234,-1,1,0,103,234,0,-1,1,33,75,2,1,0,112,255,1,1,0,112,255,1,1,0,112,255,-1,0,0,112,255,-2,0,0,112,255,1,1,0,112,255,1,-3,0,112,255,2,0,0,103,234,0,1,0,112,255,0,1,0,112,255,0,1,0,103,234,-1,1,0,103,234,-3,-1,0,112,255", "2")
     begin
          Mouse.Move to coordinate("510", "216")
          Mouse.Hold button("Left")
          Mouse.Move in direction("Down", "750")
          Mouse.Release button("Left")
          Mouse.Move to coordinate("800", "216")
          Mouse.Hold button("Left")
          Mouse.Move in direction("Left", "300")
          Mouse.Release button("Left")
          //
     end


 
Post Posted: Thu Nov 07, 2019 5:07 am
  Post subject:  Re: Need help with macro  Reply with quote
You would need to give more information for us to figure out why it's not searching in the appropriate areas, like where is it searching instead? How many pixels off is the search? What kind of window are you searching? There could be various reasons that may not be in your script...or it may be your script, lol; I can't tell from what you posted.

Your script looks fine. The only thing I see is you're using global variables and not sure why. Are you running multiple macros at once (usually only reason to use globals)?

So when I'm testing a new macro I like to use visuals, like mouse.move, so I can see what's going on. After I get it working I switch to mouse.click or stuff I can't see...but I've already got it dialed in by then.

I did a test for what you described and the script below works fine. First open the attached image and put the window somewhere on your screen (I also shrunk it down pretty small). I assume if you're only moving 10 pixels at a time you're searching for something small too. Then set the x/y coordinates to the first block. Afterwards, select a color and change the RGB values in the script for the color you want to search for. Then run the macro.

It should move the mouse to the first location you set the variables for and then start moving right, 10 pixels at a time, until it reaches the correct color. At that time you will receive a pop-up that states it found the color.

Try this out and then you can modify the code to do what you want it to. Hope that helps!

Code:
 begin
     Variable.Set("x", "205")
     Variable.Set("y", "465")
     begin loop()
          Mouse.Move to coordinate("{x}", "{y}")
          if  Color.At the current mouse position is (RGB)("255", "255", "0")
               begin
                    Window.Display message box("Found the color", "yes")
                    Macro.Abort()
               end
          Macro.Pause("500")
          Function.Execute("ChangeVariableCoordinates")
     end
end

function("ChangeVariableCoordinates")
          begin
               Variable.Add (Math)("x", "10")
          end
function
     
After you get this working and see what it's doing, you should be able to figure out the rest for your script.


Attachments:
ColorBoxes.png
ColorBoxes.png [ 1.26 KiB | Viewed 153 times ]
Post Posted: Wed Nov 06, 2019 11:11 pm
  Post subject:  Re: Need help with macro  Reply with quote
Hmm i think im missing the loop for the first section lol
Post Posted: Wed Nov 06, 2019 9:14 pm
  Post subject:  Need help with macro  Reply with quote
Hello, new user and first time poster here. I need some help with my macro. The main goal of this macro is to look for a pixel pattern and in a "small section" of the screen and move over 10 pixels if not found. I set a couple of variables for the coordinates of the "small section" to be increased when not found but it seems the macro isn't searching the appropriates sections. Help?

Code:
 begin
     Variable.Set global("X1", "530")
     Variable.Set global("Y1", "235")
     Humanly.Pause("250", "500")
     if  Color.Pixel pattern can be located on screen("0,112,255,1,0,0,112,255,0,1,0,112,255,1,0,0,112,255,-2,0,0,112,255,1,-2,0,112,255,-1,0,0,103,234,0,3,0,112,255,0,1,0,112,255,1,0,0,112,255,1,0,0,112,255,0,-1,0,112,255,0,-2,0,112,255,0,-1,0,112,255,-2,5,0,103,234,1,0,0,112,255,1,0,0,112,255,1,0,0,103,234,0,-1,0,112,255,1,0,0,103,234,0,-1,0,112,255,0,-1,0,112,255,0,-1,0,103,234,-1,0,0,112,255,0,-1,0,103,234,-4,0,2,34,76,0,1,0,103,234,0,1,0,112,255,0,1,0,112,255,0,1,0,103,234,2,-1,0,112,255,2,0,0,112,255,0,-1,0,112,255", "2")
          begin
               Humanly.Pause("100", "250")
               if  Color.At coordinate is within (RGB range)("0", "112", "255", "2", "{X1}", "{Y1}")
                    begin
                         Mouse.Click at color closest to coordinate (RGB)("0", "112", "255", "2", "{X1}", "{Y1}", "Left")
                         Function.Execute("Copy paste pole")
                    end
          end
 end
 begin
     //
     Variable.Add (Math)("X1", "10")
     if  Variable.Is greater than (Math)("X1", "1850")
          begin
               Variable.Set global("X1", "530")
               Mouse.Move to coordinate("1643", "1023")
               Mouse.Hold button("Left")
               Mouse.Move in direction("Up", "15")
               Mouse.Release button("Left")
          end
 end
 //
 if  Color.Pixel pattern can not be located on screen("0,112,255,1,1,0,112,255,0,1,0,112,255,-1,-1,0,112,255,-1,0,0,112,255,0,1,0,112,255,0,1,0,103,234,0,1,2,33,76,1,0,0,103,234,1,0,0,112,255,1,0,0,112,255,0,-1,0,112,255,1,0,0,112,255,0,-2,0,112,255,0,-1,0,112,255,0,-1,0,103,234,-1,0,0,112,255,-1,0,0,112,255,-1,0,0,103,234,-1,1,0,103,234,0,-1,1,33,75,2,1,0,112,255,1,1,0,112,255,1,1,0,112,255,-1,0,0,112,255,-2,0,0,112,255,1,1,0,112,255,1,-3,0,112,255,2,0,0,103,234,0,1,0,112,255,0,1,0,112,255,0,1,0,103,234,-1,1,0,103,234,-3,-1,0,112,255", "2")
     begin
          Mouse.Move to coordinate("510", "216")
          Mouse.Hold button("Left")
          Mouse.Move in direction("Down", "750")
          Mouse.Release button("Left")
          Mouse.Move to coordinate("800", "216")
          Mouse.Hold button("Left")
          Mouse.Move in direction("Left", "300")
          Mouse.Release button("Left")
          //
     end

function("Copy paste pole")
     begin
          Humanly.Pause("750", "1250")
          Mouse.Move to pixel pattern("215,215,215,0,1,239,239,239,1,0,120,120,120,0,1,232,232,232,0,1,247,247,247,1,0,247,247,247,0,-1,93,93,93,0,-1,75,75,75,0,-1,120,120,120,-1,0,75,75,75,-1,2,247,247,247,0,1,247,247,247,2,1,247,247,247,0,-5,172,172,172,0,-1,172,172,172,1,5,172,172,172,0,-1,75,75,75,1,0,215,215,215,0,-1,247,247,247,0,-1,247,247,247,-1,0,239,239,239,0,-1,247,247,247,-2,0,51,51,51,3,4,51,51,51,1,0,51,51,51,0,-1,247,247,247,1,0,247,247,247,0,-1,247,247,247,0,-1,247,247,247,-1,0,247,247,247,0,-1,247,247,247,-1,0,247,247,247,2,0,247,247,247,0,-1,247,247,247,-1,0,247,247,247,-1,0,247,247,247,1,3,247,247,247,1,-4,247,247,247,0,-1,247,247,247,1,5,247,247,247,1,0,199,199,199,0,-1,239,239,239,-1,-1,247,247,247,0,-1,247,247,247,0,-1,247,247,247,0,-1,247,247,247,-2,0,247,247,247,-1,0,247,247,247,-1,0,215,215,215,-1,0,75,75,75,0,1,120,120,120,3,0,247,247,247,-1,0,247,247,247,-1,0,239,239,239,-2,0,75,75,75,2,4,215,215,215,0,-3,247,247,247,-3,-1,215,215,215,0,2,199,199,199,1,-1,51,51,51,1,-3,93,93,93,-1,0,232,232,232,-2,5,247,247,247,-1,0,247,247,247,0,1,247,247,247,0,1,247,247,247,0,1,247,247,247,1,1,247,247,247,1,0,247,247,247,1,0,247,247,247,-1,-6,199,199,199,3,-3,75,75,75,5,1,199,199,199,0,1,239,239,239,1,0,120,120,120,0,1,142,142,142,0,1,142,142,142,1,0,75,75,75,0,1,93,93,93,0,1,142,142,142,-1,0,51,51,51,-3,2,51,51,51,0,1,247,247,247,0,1,247,247,247,1,0,247,247,247,0,-1,247,247,247,0,-1,51,51,51,1,0,199,199,199,0,-1,51,51,51,1,0,120,120,120,0,-2,120,120,120,1,-3,93,93,93,1,1,215,215,215,0,1,215,215,215,0,1,232,232,232,-3,-1,247,247,247,0,-1,247,247,247,2,0,75,75,75,-1,-2,51,51,51,-1,-1,51,51,51,-1,0,199,199,199,0,-1,51,51,51,1,0,172,172,172,1,1,93,93,93,1,0,232,232,232,0,1,142,142,142,-4,-1,247,247,247,0,-1,51,51,51,-1,0,51,51,51,-1,0,51,51,51,0,-1,247,247,247,-1,0,247,247,247,-1,0,247,247,247,0,1,247,247,247,-1,2,120,120,120,-2,0,247,247,247,0,1,247,247,247,0,1,247,247,247,2,-4,247,247,247,2,0,172,172,172,1,1,215,215,215,1,0,247,247,247,2,5,247,247,247,0,2,199,199,199,2,-8,247,247,247,-1,-1,247,247,247,-1,0,247,247,247,-1,0,247,247,247,-1,0,247,247,247,-1,11,247,247,247,1,0,247,247,247,3,0,247,247,247,1,0,247,247,247,0,-1,247,247,247,1,-1,239,239,239,1,0,247,247,247,-3,3,247,247,247,1,0,247,247,247,1,0,247,247,247,0,-1,247,247,247,0,-1,247,247,247,-9,-10,247,247,247", "2", "Yes")
          Mouse.Hold button("Left")
          Mouse.Move in direction("Right", "100")
          Mouse.Release button("Left")
          Clipboard.Copy()
          Humanly.Pause("250", "750")
          Window.Bring to front("Book1 - Excel", "Yes")
          Humanly.Pause("250", "750")
          Clipboard.Paste()
          Humanly.Pause("250", "750")
          Keyboard.Press key("{<down>}")
          Window.Bring to front("SCE_Santa Barbara - Google Chrome", "Yes")
          Humanly.Pause("250", "750")
     end
function
 
Post Posted: Wed Nov 06, 2019 8:37 pm

All times are UTC


Jump to:  


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group