Jump to content

Weird Error


Recommended Posts

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?

Link to comment
Share on other sites

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

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