Jump to content

If Then with GetPixel fail?


Recommended Posts

OK, I'm trying to create a script exit via opening the Windows start menu (vista) and matching the white in the info box there.

Basically...have the script running, running, running, hit the windows key, start menu opens, white background of the recently used programs list is shown, script stops. (got stuck in a few infinite loops earlier where I had no control over the mouse to manually close the script)

I made a little test script to work on this, but for the life of me, I can not get this to work. Anyone see anything blaring'ly wrong?

$i = 1

Do

if PixelGetColor(252,980) = "FFFFFF" Then

Send ("o")

Sleep(300)

EndIf

Send ("x")

Sleep(200)

Until $i = 2

I usually just test this with notepad up to see whats being written. I have yet to get an "o". Edited by BrookieDragon
Link to comment
Share on other sites

Thanks much, I was thinking my problem was with that. Cause all the script samples used something other then what the Autoit windows info tool was returning.

Is there an easy way to get hex using the window tool?

pixelGetColor isnt returning hex value, you should change:

if PixelGetColor(252,980) = "FFFFFF" Then

to:

if hex(PixelGetColor(252,980),6) = "FFFFFF" Then

:)

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...