Blue Eye Logo

Blue Eye Macro

Automation is freedom
It is currently Thu Nov 21, 2024 6:37 pm

All times are UTC




Post new topic Reply to topic  [ 29 posts ]  Go to page 1, 2, 3  Next
Author Message
 Post subject: Tracing black and white pictures from paint into sketch star
Thanked: 0 time(s)  Unread post Posted: Wed Sep 15, 2010 2:05 pm 
Active User
Active User



Joined: Mon Sep 13, 2010 10:21 pm
Posts: 44
Been thanked: 1 time(s)
Has thanked: 0 time(s)
Contribution Points: 77
Uhm yea, pretty much exactly what it says on the tin.
This picture should explain a lot on how to use it :P
Image

Uploaded with ImageShack.us

As you can see, it requires that paint is visible at all times as well as the sketch star window.
Also the brush has to be selected, with the black colour and the size set to SMALLEST i.e 1 pixel!

At the moment is does run quite slow, but eh :P its fine for small images of 60x60 pixels etc.

Here is a lil example, this one took around 10 mins. it was 175 x 175

Image

Uploaded with ImageShack.us

Uh, and yes i realise that it isnt black, but when the picture is coloured pixel by pixel, it turns gray for some reason :O


And finally, the code :P

Main:
Code:
 begin
     Window.Request user text input("What is the X co-ord of your paint window?", "x")
     Window.Request user text input("What is the Y co-ord of your paint window?", "y")
     Window.Request user text input("What is the X co-ord of your sketch star window?", "x1")
     Window.Request user text input("What is the X co-ord of your sketch star window?", "y1")
     Window.Request user text input("How many pixels is the image in X-axis?", "pixelX")
     Window.Request user text input("How many pixels is the image in Y-axis?", "pixelY")
     Macro.Execute new passing up to 10 arguments("Trace", "sketch star", "no", "x", "{x}", "y", "{y}", "x1", "{x1}", "y1", "{y1}", "pixelX", "{pixelX}", "pixelY", "{pixelY}", "", "", "", "", "", "", "", "")
 end
 


sketch star:
Code:
 begin loop("{pixelY}")
     Variable.Evaluate (Math)("{x}", "X")
     Variable.Evaluate (Math)("{x1}", "X1")
     begin loop("{pixelX}")
          Macro.Do nothing()
          if  Color.At coordinate is (RGB)("0", "0", "0", "{X}", "{y}")
               begin
                    Mouse.Click at coordinate("{X1}", "{y1}", "left")
               end
          Variable.Add (Math)("X", "1")
          Variable.Add (Math)("X1", "1")
     end
     Variable.Add (Math)("y", "1")
     Variable.Add (Math)("y1", "1")
 end
 


Top
 Profile  
Reply with quote  
 Post subject: Re: Tracing black and white pictures from paint into sketch
Thanked: 0 time(s)  Unread post Posted: Wed Sep 15, 2010 4:33 pm 
Partner / Developer
Partner / Developer
User avatar



Joined: Mon Jan 18, 2010 11:51 am
Posts: 4525
Been thanked: 1346 time(s)
Has thanked: 133 time(s)
Contribution Points: 33209
Pretty fun little macro you got there ;)

Try adding Color.Freeze screen dump cache, since the image is not going to change while drawing.

That will make the macro about a 100 times faster or more, im guessing.


Try the following code:
Code:
 begin
     Color.Freeze screen dump cache()
     begin loop("{pixelY}")
          Variable.Copy("x", "X")
          Variable.Copy("x1", "X1")
          begin loop("{pixelX}")
               Macro.Do nothing()
               if  Color.At coordinate is (RGB)("0", "0", "0", "{X}", "{y}")
                    begin
                         Mouse.Click at coordinate("{X1}", "{y1}", "left")
                    end
               Variable.Increment (Math)("X")
               Variable.Increment (Math)("X1")
          end
          Variable.Increment (Math)("y")
          Variable.Increment (Math)("y1")
     end
 end


I'm guessing that will turn your 10 minutes into a few seconds :)

Never the less though, very nice work, an interesting macro!

_________________
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: Tracing black and white pictures from paint into sketch
Thanked: 0 time(s)  Unread post Posted: Wed Sep 15, 2010 5:55 pm 
Active User
Active User



Joined: Mon Sep 13, 2010 10:21 pm
Posts: 44
Been thanked: 1 time(s)
Has thanked: 0 time(s)
Contribution Points: 77
Thanks for the minor fixes, but unfortunately the speed is still the same.

I have noticed that it can check pixels for colours very quickly, but its the process of clicking the mouse in the specific position that is the bottleneck in this case - the sections where no black is present it manages to finish almost instantaneously, but when it reaches black, the process of clicking means a full black row can take up to 30 -40 seconds.


Top
 Profile  
Reply with quote  
 Post subject: Re: Tracing black and white pictures from paint into sketch
Thanked: 0 time(s)  Unread post Posted: Wed Sep 15, 2010 6:18 pm 
Partner / Developer
Partner / Developer
User avatar



Joined: Mon Jan 18, 2010 11:51 am
Posts: 4525
Been thanked: 1346 time(s)
Has thanked: 133 time(s)
Contribution Points: 33209
Thats a long time... hmm, I think ill make it a setting how long to delay the mouse clicks for the next version of Blue Eye, so you can specify how fast to click yourself.

The reason it has the delay is currently has, is because otherwise a lot of mouse clicks would be dropped in slow applications or flash games etc.

In the next version I'm also introducing window messages for mouse and keyboard, meaning you can send a mouse click to a specific window, without actually moving or clicking the mouse, this will also be a lot faster according to my tests so far.

_________________
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: Tracing black and white pictures from paint into sketch
Thanked: 0 time(s)  Unread post Posted: Wed Sep 15, 2010 9:12 pm 
Active User
Active User



Joined: Mon Sep 13, 2010 10:21 pm
Posts: 44
Been thanked: 1 time(s)
Has thanked: 0 time(s)
Contribution Points: 77
Wow, that sounds great, any clue as to when this new version will be available? :P


Top
 Profile  
Reply with quote  
 Post subject: Re: Tracing black and white pictures from paint into sketch
Thanked: 0 time(s)  Unread post Posted: Thu Sep 16, 2010 4:05 am 
Partner / Developer
Partner / Developer
User avatar



Joined: Mon Jan 18, 2010 11:51 am
Posts: 4525
Been thanked: 1346 time(s)
Has thanked: 133 time(s)
Contribution Points: 33209
I'm planning to release the next version (2.1) in about one month, I'm hoping for a bit sooner though, mainly I'm still waiting for a certificate to sign the virtual drivers, which I also want to include in the next version to bypass any anti-bot techniques.

_________________
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: Tracing black and white pictures from paint into sketch
Thanked: 0 time(s)  Unread post Posted: Fri Oct 22, 2010 8:51 am 
Partner / Developer
Partner / Developer
User avatar



Joined: Mon Jan 18, 2010 11:51 am
Posts: 4525
Been thanked: 1346 time(s)
Has thanked: 133 time(s)
Contribution Points: 33209
Did you try the new settings in version 2.1 to improve the performance of this macro?

_________________
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: Tracing black and white pictures from paint into sketch
Thanked: 0 time(s)  Unread post Posted: Fri Oct 22, 2010 5:46 pm 
Lifetime VIP Contributor
Lifetime VIP Contributor
User avatar



Joined: Sat Apr 24, 2010 12:51 pm
Posts: 355
Location: Tallinn
Been thanked: 18 time(s)
Has thanked: 1 time(s)
Contribution Points: 4647
mouse click delay 5ms ;)

it sure is a neat macro :P i like it

_________________
Full time IT student/worker - BE showed me the way, so may the code be with you all!
Image


Top
 Profile  
Reply with quote  
 Post subject: Re: Tracing black and white pictures from paint into sketch
Thanked: 0 time(s)  Unread post Posted: Fri Oct 22, 2010 6:19 pm 
Partner / Developer
Partner / Developer
User avatar



Joined: Mon Jan 18, 2010 11:51 am
Posts: 4525
Been thanked: 1346 time(s)
Has thanked: 133 time(s)
Contribution Points: 33209
:D

_________________
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: Tracing black and white pictures from paint into sketch
Thanked: 0 time(s)  Unread post Posted: Sat Oct 23, 2010 2:11 pm 
Active User
Active User



Joined: Mon Sep 13, 2010 10:21 pm
Posts: 44
Been thanked: 1 time(s)
Has thanked: 0 time(s)
Contribution Points: 77
Gigus wrote:
Did you try the new settings in version 2.1 to improve the performance of this macro?



Unfortunately I have not, I've been really busy with coursework atm, which means no time for Blue-Eye :(.
Anyway, this would be a good time to ask how the 'send keys' or 'send mouse up' etc. functions actually work, I just can't seem to make sense of the argument descriptions that you provided. An example would be nice :).

BakT wrote:
mouse click delay 5ms ;)

it sure is a neat macro :P i like it


I'm Glad you like it, I made it because I wanted to draw as well as some of the other people there, but alas, even with this macro, the drawings they make are too good :P


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 29 posts ]  Go to page 1, 2, 3  Next

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