Sign in to follow this  
Followers 0
hookLine

1 Hour of failure with the search button

4 posts in this topic

I want AutoIt to find a color and then move the mouse to it and left click on it. This is what I have so far:

Opt("PixelCoordMode", 0)
Opt("MouseCoordMode", 0)

HotKeySet("{F10}", "tp")

$tp_color = PixelSearch(189, 111, 357, 235, 0x484848, 15)

While 1
    Sleep(20)
WEnd

Func tp()
    Send("{F8}")
    MouseClick("right")
    Sleep(1300)
        If IsArray($tp_color)=1 Then
            MouseClick("left", $tp_color[0], $tp_color[1], 1, 0)
            Sleep(300)
        EndIf
EndFunc

It looks like it should work, but it doesn't! I have a feeling that I did something wrong the coordinates of the rectangle. Someone please help me!

Share this post


Link to post
Share on other sites



*** NOT TESTED

Opt("PixelCoordMode", 0)
Opt("MouseCoordMode", 0)

HotKeySet("{F10}", "tp")

While 1
    Sleep(20)
WEnd

Func tp()
    
    Send("{F8}")
    MouseClick("right")
    Sleep(1300)
    
    $tp_color = PixelSearch(189, 111, 357, 235, 0x484848, 15)
    
    If IsArray($tp_color) = 1 Then
        MouseClick("left", $tp_color[0], $tp_color[1], 1, 0)
        Sleep(300)
    EndIf
EndFunc   ;==>tp

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

*** NOT TESTED

Opt("PixelCoordMode", 0)
Opt("MouseCoordMode", 0)

HotKeySet("{F10}", "tp")

While 1
    Sleep(20)
WEnd

Func tp()
    
    Send("{F8}")
    MouseClick("right")
    Sleep(1300)
    
    $tp_color = PixelSearch(189, 111, 357, 235, 0x484848, 15)
    
    If IsArray($tp_color) = 1 Then
        MouseClick("left", $tp_color[0], $tp_color[1], 1, 0)
        Sleep(300)
    EndIf
EndFunc   ;==>tp

8)

Thanks for the help, but it seems to misclick the area I want it to click on. It probably has something to do with my rectangle coords :)

I'll upload a video in a moment so you can have a better understanding of what I want it to do.

Share this post


Link to post
Share on other sites

Thanks for the help, but it seems to misclick the area I want it to click on. It probably has something to do with my rectangle coords o:)

I'll upload a video in a moment so you can have a better understanding of what I want it to do.

It did have something to do with my rectangle coords, the rectangle was too big than necessary! :)

And the range of shades were too high, and it was finding other areas to click on. Thanks for your help! :)

Share this post


Link to post
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
Sign in to follow this  
Followers 0