Sign in to follow this  
Followers 0
Sparrowlord

Weird Error

4 posts in this topic

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?

Share this post


Link to post
Share on other sites



Func check()
$coord = 0
$coord = PixelSearch( 417, 325, 452, 343, 0xCCBC94, 1 )

If IsArray ( $coord ) Then
    MouseMove ($coord[0], $coord[1])
EndIf

EndFunc
I'm still getting the same error and it crashes after two attempts.

Share this post


Link to post
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

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