Jump to content

Pixel Search Question


Recommended Posts

Func Color()

While 1

PixelSearch(420, 240, 600, 360, 0x6A3238, 15, 5); looks for maroon color

If Not @error Then

MouseClick("Left",$coord[0],$coord[1])

SLeep(10)

MouseClick("Left",$coord[0],$coord[1])

Sleep(500)

ExitLoop

Else

PixelSearch(420, 240, 600, 360, 0x3F3557, 15, 5); looks for purplish blue

If Not @error Then

MouseClick("Left",$coord[0],$coord[1])

SLeep(10)

MouseClick("Left",$coord[0],$coord[1])

Sleep(500)

ExitLoop

Else

Send("{a down}")

Sleep(30)

Send("{a up}")

EndIf

EndIf

Wend

EndFunc

Thats a function in a script im working on. I just started messing around with them a week or two ago, and am not completely sure what I should do. I tested it yesterday, and if I remember correctly, the message said the error was when it tried double clicking. Can I not have it click the $coord?

Link to comment
Share on other sites

  • Moderators

You have to define $coord :whistle:

Instead of:

PixelSearch(420, 240, 600, 360, 0x6A3238, 15, 5); looks for maroon color

You need:

$coord = PixelSearch(420, 240, 600, 360, 0x6A3238, 15, 5); looks for maroon color
And the same for the other PixelSearch()

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

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...