Jump to content

Recommended Posts

Posted

Im quite new to AutoIt and programming... So im jsut wondering if any of you experanced coders can help me here, Im looking to build a script that will find a certain color in a the active window and then move the mouse to the location of the color. Ive been trying my hand at this and have gotten no-where fast... Here is what im thinking will do the trick... Thank you for your time.

$Coord = PixelSearch ( 0, 0, 0, 0, 0xD20000, 0, 0 )

Posted (edited)

Welcome to the forums!

This will do it:

Local $Coords = PixelSearch(0, 0, @DesktopWidth - 1, @DesktopHeight - 1, 0xD20000)
If @Error Then
    MsgBox(0x30, 'Warning', 'The colour could not be found.')
Else
    MouseMove($Coords[0], $Coords[1])
EndIf

P.S. Questions like this are better off in the Support forum next time. :P

Edited by LxP

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
  • Recently Browsing   0 members

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