Color picking

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

simplejamie
Newbie
Posts: 16
Joined: Sat Nov 18, 2006 7:19 am

Post by simplejamie » Wed Nov 22, 2006 11:14 pm

thank you very much for the dll =)

jamie

User avatar
Rain
Automation Wizard
Posts: 550
Joined: Tue Aug 09, 2005 5:02 pm
Contact:

Post by Rain » Wed Nov 29, 2006 3:14 pm

I love the DLL function. However, I am not able to display the y cords with the script below.

Code: Select all

// location of library
Let>fcLib=%SCRIPT_DIR%\findcolor.dll

// Find color on screen
// LibFunc>findcolor.dll,FindColor,result,color,xStart,yStart,xEnd,yEnd,result_x,result_y
// if found result = 1, else 0
// result in result_6,result_7

// Find color in window only
GetActiveWindow>title,x,y,w,h
LibFunc>fcLib,FindColor,r,16105118,x,y,w,h,xres,yres
If>r=1
  Let>x=r_6
  Let>y=r_7
  MouseMove>x,y
  mdl>%x%,%y%
Endif

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Wed Nov 29, 2006 5:00 pm

Maybe it's confused by the mutiple uses of x and y ?

User avatar
Rain
Automation Wizard
Posts: 550
Joined: Tue Aug 09, 2005 5:02 pm
Contact:

Post by Rain » Wed Nov 29, 2006 5:19 pm

I think so too Me_Again.

I figured it out though. All I had to do was add GetCursorPos>x,y after MouseMove>x,y :wink:

Code: Select all

// location of library
Let>fcLib=%SCRIPT_DIR%\findcolor.dll

// Find color on screen
// LibFunc>findcolor.dll,FindColor,result,color,xStart,yStart,xEnd,yEnd,result_x,result_y
// if found result = 1, else 0
// result in result_6,result_7

// Find color in window only
GetActiveWindow>title,x,y,w,h
LibFunc>fcLib,FindColor,r,16105118,x,y,w,h,xres,yres
If>r=1
  Let>x=r_6
  Let>y=r_7
  MouseMove>x,y
  GetCursorPos>x,y
  mdl>%x%,%y%
Endif

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Wed Nov 29, 2006 5:36 pm

Whatever works :lol:

idiot
Macro Veteran
Posts: 152
Joined: Thu Mar 01, 2007 9:21 am

ok i kinda get the color click script

Post by idiot » Thu Mar 01, 2007 9:30 am

but i was wondering how could you get it to search for multiple colors and not just 1 color i think if you could use more colors it we be very helpful :?:
if idiots rule the world then im the king!!!!
i want a free t-shirt give me all of your rep!!!
please give me pro version of macro scheduler and appnavigator!!!

User avatar
Marcus Tettmar
Site Admin
Posts: 7393
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Thu Mar 01, 2007 9:42 am

how could you get it to search for multiple colors
Call the function more than once.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

idiot
Macro Veteran
Posts: 152
Joined: Thu Mar 01, 2007 9:21 am

dont understand as well as i though

Post by idiot » Sun Mar 25, 2007 10:08 pm

ok my code seems to work but is very slow and my press f1 command dosent seem to make the f1 button be pushed is there another way i can get the f1 button to work im on ibm thinkpad 600E on windows 98 and how can i get this program into that call dll format i really dont understand it all but its supposed to be way faster ohh also how can i get this script to be an infinite loop?
Last edited by idiot on Mon Mar 26, 2007 1:22 am, edited 3 times in total.
if idiots rule the world then im the king!!!!
i want a free t-shirt give me all of your rep!!!
please give me pro version of macro scheduler and appnavigator!!!

idiot
Macro Veteran
Posts: 152
Joined: Thu Mar 01, 2007 9:21 am

a

Post by idiot » Sun Mar 25, 2007 10:53 pm

aaaaa
if idiots rule the world then im the king!!!!
i want a free t-shirt give me all of your rep!!!
please give me pro version of macro scheduler and appnavigator!!!

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts