Jump to content

Move mouse to pixel and click?


Recommended Posts

Helpfile > MouseMove()

Helpfile > MouseClick()

This didn't do anything, should it do something? Basically I wanted it to click the pixel when I pressed a

HotKeySet("{a}", "_Start")
HotKeySet("{s}", "_Pause")
HotKeySet("{d}", "_Exit")

Global $Active = 0

While 1
    If $Active = 1 Then
        $SquarePosition = PixelSearch(0, 0, 0, 0, 0x941616)
        If IsArray($SquarePosition) Then
            MouseMove($SquarePosition) Then
            MouseClick("left")
        EndIf
    EndIf
WEnd

Func _Start()
    $Active = 1
EndFunc   ;==>_Start

Func _Pause()
    $Active = 0

EndFunc   ;==>_Pause

Func _Exit()
    Exit
EndFunc   ;==>_Exit
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...