Jump to content
Sign in to follow this  
Archman

Check Pixel Color

Recommended Posts

Archman

Ok i am trying to get the script to Read the color of a pixel from a specific spot on screen.

I want it so that if the pixel is color D63839 then the prog beeps.

$health = PixelGetColor( 417 , 25 )
If $health = D63839 Then
Beep ( [ 37 [, 1000 ]] )
EndIf

But when i run the exe and it gets to that line i get

If $health = D63839 Then

If $health = ^ERROR

Error Parsing Function Call.

What am i doing wrong? How Should it be written in the script?

Share this post


Link to post
Share on other sites
Helge

$health = PixelGetColor(417 , 25)
If $health = 0xD63839 Then Beep(37, 1000)

- Added 0x to color.

- Removed square brackets as they are used in the helpfile to show that the parameters are optional.

- Made If-statement to a single line as it only contained one function-call.

Share this post


Link to post
Share on other sites
BigDod

Try

$health = PixelGetColor( 417 , 25 )
If $health = Dec("D63839") Then
Beep ( 37 , 1000 )
EndIf


Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.