Jump to content

Pixel Search Used In A Game


bvr
 Share

Recommended Posts

  • Moderators

Well, PixelSearch( 213, 198, 427, 355, 0x948064, ) = 0 << where did you get that value of '0'? It's not a return value for PixelSearch(). PixelSearch() will return a 1 or the $Coords[0], $Coords[1] of where the value was found. Your not reading the help file, or your reading it incorrectly... Try this and see if it works, see the ';' comments too.

Opt('PixelCoordMode', 0); Are you positive that you have 'Window' coordinates here the 213, 198, 427, 355??
Opt("MouseCoordMode", 0)
WinActivate ( 'Diablo II' )
Sleep ( 500 )
Send("{ALTDOWN}")
Sleep(500)
$coord = PixelSearch( 213, 198, 427, 355, 0xd8b864); My mistake here, see the comma after 0xd8b864... no shade variation afterwards, that's an error.  I should have caught in you original.
If Not @error And IsArray($coord) Then
    Do 
    MouseClick("left", $coord[0], $coord[1], 1, 1)
    Sleep(1000)
    Until PixelSearch( 213, 198, 427, 355, 0x948064) <> 1
EndIf

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