Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

What`s wrong in this script?


lokome
 Share

Recommended Posts

Please help me find whats wrong here (It says: Excpected Array) when i try to compile. Problem is somewhere in MOVES!
```
Function load_moves()
    On Error Resume Next
    Dim files() As String
    Dim filess As Integer
    Dim i As Integer
    Dim Moves As Boolean
    files = GetAllFilesInDir(App.Path & "\CyMoves\")
    filess = UBound(files)
    If filess < 3 Then
        MsgBox "Error loading moves, only " & filess & " files found!"
        End
    End If
    ReDim Moves(filess + 1) As MoveRec
    For i = 1 To filess
        Call SetStatus("Loading " & filess & " moves... " & Round(i / filess * 100) & "%")
        If InStrB(files(i), ".ini") Then
            Call load_move(files(i), i)
        End If
        ModDoEvents
    Next i
    If Err.number <> 0 Then
        MsgBox "Error loading: #" & Err.number & " (" & Err.Description & ")"
    End If
End Function

```
Link to comment
Share on other sites

Wait, this isn't scripting; are you trying to modify the source (VB6), or the Main.txt in the Server\Scripts\ directory?

PS: Do not double-post, bumping your topic so quickly (within two hours?); most users providing support usually check the oldest topics first, so it's first-come, first-serve; if you bump your topic, it takes longer.
Link to comment
Share on other sites

@lokome:

> Well yes. Modify source. Adding some things

Okay, sorry, thought you were asking about a _script_; anyway, I'll move this to where it should have been posted in the first place, the http://www.touchofdeathforums.com/smf/index.php/board,93.0.html board.

Also, please try to have alittle patience; people from all over the world come to this forum, and most have entirely differnet timezones.
Link to comment
Share on other sites

Should look like this?? :
```
Function load_moves()
    On Error Resume Next
    Dim files() As String
    Dim filess As Integer
    Dim I As Integer
    Dim Moves()
    files = GetAllFilesInDir(App.Path & "\CyMoves\")
    filess = UBound(files)
    If filess < 3 Then
        MsgBox "Error loading moves, only " & filess & " files found!"
        End
    End If
  ReDim Moves(filess + 1)
    For I = 1 To filess
        Call SetStatus("Loading " & filess & " moves... " & Round(I / filess * 100) & "%")
        If InStrB(files(I), ".ini") Then
            Call load_move(files(I), I)
        End If
        ModDoEvents
    Next I
    If Err.number <> 0 Then
        MsgBox "Error loading: #" & Err.number & " (" & Err.Description & ")"
    End If
End Function
```
But then again.. It shows "Error loading acidpalace.ini #9: Subscript out of range)"
And all files that he tries to load from moves map gives this error..
Link to comment
Share on other sites

@lokome:

> Should look like this?? :
> ```
> Function load_moves()
>     On Error Resume Next
>     Dim files() As String
>     Dim filess As Integer
>     Dim I As Integer
>     Dim Moves()
>     files = GetAllFilesInDir(App.Path & "\CyMoves\")
>     filess = UBound(files)
>     If filess < 3 Then
>         MsgBox "Error loading moves, only " & filess & " files found!"
>         End
>     End If
>   ReDim Moves(filess + 1)
>     For I = 1 To filess
>         Call SetStatus("Loading " & filess & " moves... " & Round(I / filess * 100) & "%")
>         If InStrB(files(I), ".ini") Then
>             Call load_move(files(I), I)
>         End If
>         ModDoEvents
>     Next I
>     If Err.number <> 0 Then
>         MsgBox "Error loading: #" & Err.number & " (" & Err.Description & ")"
>     End If
> End Function
> ```
> But then again.. It shows "Error loading acidpalace.ini #9: Subscript out of range)"
> And all files that he tries to load from moves map gives this error..

What's the load_move sub look like? Because this function isn't set up to return that error. It's not in this procedure.
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

×
×
  • Create New...