Jump to content

Error Array Variable has incorrect...

Recommended Posts

$Temp = $Option[11]

$Temp = ^ Error

Error: Array variable has incorrect number of subscripts or subscript dimension range exceeded.

This error leads me to believe it thinks it is out of the array bounds but I looked at the array length with Ubound($Option) and found it returned 12 and with 0 based array [11] is my final element

Also I printed out the $Option to a MsgBox quick and it gave me the right info. I looked on forums but it looked like others were trying other things and the answers seemed invalid for my application.

Below is the relevent code...

For $i = 1 to UBound($Lines) -1
     If StringLen($Lines[$i])>6 Then
      if StringInStr($Lines[$i],"<object id",0) Then
       $Option = _StringBetween($Lines[$i],'"','"')
       ;MsgBox(4069, "Test", UBound($Option)) // Prints 12 (My Array Size)
       if UBound($Option) >= 8 Then
        $Model = $Option[2]
        $Ccom = $Option[0]
        $PosX = $Option[6]
        $PosY = $Option[7]
        $PosZ = $Option[8]
        $RotX = $Option[9]
        $RotY = $Option[10]
        ;// Here the $Option[11] IS RotZ but cannot set... Below it breaks...
        ;$RotZ = $Option[11]
Link to post
Share on other sites

;) Hello, not that it matters to me... but from your script, it looks like a Game-Related post. Game automation not allowed here.

Reason: mentioning words like model, Ccom (computer controlled player). RotX, Y, Z give the feeling its a 3D Game...

Edited by MKISH


:bye: Hey there, was I helpful?


My Current OS: Win8 PRO (64-bit); Current AutoIt Version: v3.3.8.1

Link to post
Share on other sites

Try Checking the Array Size of $Option using

ConsoleWrite('Array Size:'&Ubound($Option)-1)


Hope So You Get THe Solution and Please Don't Break The Forum Rules



Phoenix XL

Edited by PhoenixXL

My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Link to post
Share on other sites

Hey guys this is scripting for a game but it is not automation. I am admin on my server hosted with volt and the map I have I wish to convert by parsing out the strings. Just wanted you to know I am not automating gameplay just parsing out map information to a different format. I will try the above posts. Thank you for the fast response.

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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...