Sign in to follow this  
Followers 0
Shahzam

Subscript used with non-Array variable.

2 posts in this topic

So I'm just starting out AutoIT and I'm trying to create a bot with this game:

http://www.addictinggames.com/curveball.html

Thing is I've coded this soo far:

WinActivate("Curve Ball")
$x=1
; Find Location at Position 1
$coord = PixelSearch( 257, 271, 750, 613, 0x86FF69, 10)
If Not @error Then
    MsgBox(0, "lol", "Sucess " & $coord[0] & " x " & $coord[1])
    MouseClick("left", $coord[0], $coord[1])
    Do
        $coord = PixelSearch( 257, 271, 750, 613, 0x86FF69, 10)
    ;MouseClick("left", $coord[0], $coord[1])
        MouseMove($coord[0], $coord[1])
    Until $x = 50
EndIf

The first part succeeds and it continues to follow it for 1 second, then it exit's and gives me this in the console:

C:\Users\Shahzam\Desktop\testtt.au3 (11) : ==> Subscript used with non-Array variable.:
MouseMove($coord[0], $coord[1])
MouseMove($coord^ ERROR
>Exit code: 1   Time: 2.750

Not really sure where the error is, anyone know?

Share this post


Link to post
Share on other sites



WinActivate("Curve Ball")
$x=1
; Find Location at Position 1
$coord = PixelSearch( 257, 271, 750, 613, 0x86FF69, 10)
If Not @error Then
    MsgBox(0, "lol", "Sucess " & $coord[0] & " x " & $coord[1])
    MouseClick("left", $coord[0], $coord[1])
    Do
        $coord = PixelSearch( 257, 271, 750, 613, 0x86FF69, 10)
        If Not @error Then
            ;MouseClick("left", $coord[0], $coord[1])
            MouseMove($coord[0], $coord[1])
        EndIf
        Sleep(5) ; save CPU
    Until $x = 50
EndIf

8)


NEWHeader1.png

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