Jump to content

Working with PixelSearch


Mellowz
 Share

Recommended Posts

I'm afraid I do not understand. This is how I have it setup:

While 1
        If $TeamID > -1 Then
            If $TeamID = 0 Then
                $coord = PixelSearch(473, 349, 552, 419, 0x333F29, 0)
            Else
                $coord = PixelSearch(473, 349, 552, 419, 0x7D6340, 0)
            EndIf

            If Not @error Then
                MouseMove($coord[0], $coord[1], 0)
                ContinueLoop
            Else
                Sleep(100)
            EndIf
        EndIf
    WEnd

Also, thanks for the reply.

Edited by Mellowz
Link to comment
Share on other sites

Not tested, But, Does this work?

AdlibEnable("_MousePos", 1)
    Global $Pos
    
    While 1
        If $TeamID > -1 Then
            If $TeamID = 0 Then
                $coord = PixelSearch($Pos[0] - 10, $Pos[1] - 10, $Pos[0] + 10, $Pos[1] + 10, 0x333F29, 0)
            Else
                $coord = PixelSearch($Pos[0] - 10, $Pos[1] - 10, $Pos[0] + 10, $Pos[1] + 10, 0x7D6340, 0)
            EndIf

            If Not @error Then
                MouseMove($coord[0], $coord[1], 0)
                ContinueLoop
            Else
                Sleep(100)
            EndIf
        EndIf
    WEnd
    
    Func _MousePos()
        $Pos = MouseGetPos()
    EndFunc

Should, Search a 10px square around the mouse.

EDIT::

Larry beat me =O

EDIT::

And his is probly better than mine =P

Edited by AzKay
# MY LOVE FOR YOU... IS LIKE A TRUCK- #
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...