Jump to content

? Subscript used with non-Array variable. ?


 Share

Recommended Posts

never had this problem

>"C:\Program Files\AutoIt3\beta\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Documents and Settings\kcd\Desktop\stuff\au3\pong_cheater\bot.au3"

C:\Documents and Settings\kcd\Desktop\stuff\au3\pong_cheater\bot.au3 (26) : ==> Subscript used with non-Array variable.:

If $brick[0]<= $ball[0] Then

If $brick^ ERROR

>Exit code: 0 Time: 0.959

$brick=PixelSearch ( 414, 539, 934, 807, 0x6A0065 , 0 ,0 )
$ball=PixelSearch ( 414, 539, 934, 807, 0xFFFFFF , 0 ,0 )

    If $brick[0] <= $ball[0] Then
        Send("{LEFT}")
    EndIf
    If $brick[0] >= $ball[0] Then
        Send("{RIGHT}")
    EndIf
Visit mEMy programs made.Iul - IulG-V Console - G-V Console_RandomLetter - _RandomLetter()Saftey Kill - Saftey Killcolorzone() = colorzone()
Link to comment
Share on other sites

$brick=PixelSearch ( 414, 539, 934, 807, 0x6A0065 , 0 ,0 )
if @Error then MsgBox(0, "Error", "I forgot to check if the color was found or not")
$ball=PixelSearch ( 414, 539, 934, 807, 0xFFFFFF , 0 ,0 )
if @Error then MsgBox(0, "Error", "Oops! I did it again")

If $brick[0] <= $ball[0] Then
  Send("{LEFT}")
EndIf
If $brick[0] >= $ball[0] Then
  Send("{RIGHT}")
EndIf

:whistle:

Auto3Lib: A library of over 1200 functions for AutoIt
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...