Waitpixelcolor: how to handle mouse over highlights

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
Tobias
Junior Coder
Posts: 22
Joined: Mon Jul 19, 2004 1:44 pm
Location: The Netherlands

Waitpixelcolor: how to handle mouse over highlights

Post by Tobias » Mon Jul 17, 2006 2:30 pm

Hi,

I have this this (hopefully easy to answer) question.

I want to use WaitPixelColor, but when I point at the target area (a button) it changes color (becomes highlighted)!

Anyone any idea how to get around this?

User avatar
pgriffin
Automation Wizard
Posts: 460
Joined: Wed Apr 06, 2005 5:56 pm
Location: US and Europe

Post by pgriffin » Mon Jul 17, 2006 3:22 pm

Are you waiting for a pixel color to change so that you can push the button? Or are you waiting for the button to appear? Either way it is wise to use something like MouseMove>0,0 to try to avoid pixel and image changes caused by the moues being on some screen object.

Tobias
Junior Coder
Posts: 22
Joined: Mon Jul 19, 2004 1:44 pm
Location: The Netherlands

Post by Tobias » Mon Jul 17, 2006 3:26 pm

The button is there. I need to get the color number of the button, but it changes when I point at it.

(thanks for the quick reply)

User avatar
pgriffin
Automation Wizard
Posts: 460
Joined: Wed Apr 06, 2005 5:56 pm
Location: US and Europe

Post by pgriffin » Mon Jul 17, 2006 3:30 pm

If the button is present, you do not need to point at it to get the button color. GetPixelColor> will work just fine without moving a mouse around the screen.


GetPixelColor>200,355,pix
Message>the color is %pix%

thaumaturgy
Junior Coder
Posts: 24
Joined: Mon Nov 01, 2004 1:30 pm

Post by thaumaturgy » Tue Jul 18, 2006 1:26 am

Another thing you could do is take a screen shot in a bitmap image, then set it as your desktop image. Then right click on your desktop ( on an empty area ) Then click properties.......select the desktop tab, then make sure the " position " is set to " center ". Then you can use this script below to get your color and position.

Dialog>Dialog1
Caption=Get Color
Top=610
Width=193
Left=0
Height=128
Label=Real Time Color,59,8
Edit=msEdit1,36,32,121,
Button=Stop,59,64,75,25,2
EndDialog>Dialog1

show>Dialog1
label>colorloop
Wait>0.05
gda>Dialog1,r
if>r=2,end
Gcp>x,y
gpc>x,y,PC
let>Dialog1.msEdit1=%x%,%y%,%PC%
rda>Dialog1
goto>colorloop

label>end


Hope this helps.

Tobias
Junior Coder
Posts: 22
Joined: Mon Jul 19, 2004 1:44 pm
Location: The Netherlands

Post by Tobias » Tue Jul 18, 2006 6:46 am

Hi Guys,

I got it! Thanks for the help!

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