Jump to content

Recommended Posts

Posted (edited)

Hi

Im trying to make this:

HotKeySet("{NUMPAD7}", "vida")
HotKeySet("{NUMPAD2}","lTGetCoord") ;left top x, y
HotKeySet("{NUMPAD3}","rBGetCoord") ; right bottom x, y

While 1
        Sleep(100)
WEnd

func vida()
$location = PixelSearch ( $posLT[0], $posLT[1], $posBR[0], $posBR[1], 0x000000)
If IsArray ($location) = 1 Then 
    MouseClick ('left', $location[0], $location[1], 1, 0) 
    sleep(100)
    MouseClick ('left', $location[0], $location[1], 1, 0) 
EndIf
EndFunc

Func rBGetCoord()
    $posRB = MouseGetPos()
EndFunc

Func lTGetCoord()
    $posLT = MouseGetPos()
EndFunc

Then, i run the app, i push numpad2 and numpad 3 BUT when i push numpad 7 to run the func vida (with the pixelsearch) i have this error:

$location = PixelSearch ( $posLT[0], $posLT[1], $posRB[0], $posRB[1], 0x000000)
$location = PixelSearch ( ^ ERROR

and the program ends

I dont understand, without vars in pixelsearch it works, but i need that the user can change the area.

Edited by lysander

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
×
×
  • Create New...