Jump to content

Recommended Posts

Posted

Func check()
$coord = 0
$coord = PixelSearch( 417, 325, 452, 343, 0xCCBC94, 1 )
If Not @error Then
MouseMove ($coord[0], $coord[1])
    
EndIf
EndFunc

I'm getting this error message:

==> Subscript used with non-Array variable.:

MouseMove ($coord[0], $coord[1])

MouseMove ($coord^ ERROR

My problem isnt that the func dont work its that it dont work after two trys, the func is called a few times and after the second time it crashes the script. Any help?

Posted

Works ok in here. I've changed it to search for the red color and a bigger area. How are you calling the function?

Func check()
    $coord = 0
    $coord = PixelSearch(0, 0, 452, 343, 0xFF0000, 1)
    If Not @error Then
        MouseMove($coord[0], $coord[1])

    EndIf
EndFunc   ;==>check

While 1
    check()
WEnd

[topic="51913"]Restrict USB Storage usage to group membership[/topic] * [topic="48699"]Using nircmd library[/topic] * Some admin notes

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