Hey dead, you were extremely close! Here's the new command1_click. Things bold and underlined changed. I think this is what you want. It will output something like:
set m1 "fraglimit 15 ; map hello
set m2 "fraglimit 15 ; map someone
set m3 "fraglimit 15 ; map you
etc. (Well, that's the output I got)
Also you need to change your list1 multiselect to 1 or 2.(And then of course select more than 1 file before clicking command1)
BTW. Not a bad prog. Cool idea!Code:Public Sub Command1_Click() On Error Resume Next Dim GameType% Dim BsP() As String For i = 0 To List2.ListCount - 1 If List2.Selected(i) Then ReDim Preserve BsP(inum) BsP(inum) = List2.List(i) inum = inum + 1 End If Next Dim T() As Integer 'Dim ReDim T(List2.ListCount - 1) As Integer 'Then set the Amount (this way works) For X = 0 To List2.ListCount - 1 MsgBox "T(" & X & ") = " & T(X) List2.ListIndex = X T(X) = List2.Text Next X ChDir (Spl1.Dir1.Path) & ("\baseq3") GameType = List1.ListIndex MsgBox "writing to doomanf.cfg" Set fso = CreateObject("Scripting.FileSystemObject") Set a = fso.CreateTextFile("doomanf.cfg") a.WriteLine ("") a.WriteLine ("//This config file cycles through all the maps in the game. FFA mode.") a.WriteLine ("") a.WriteLine ("set g_gametype ") & (GameType) a.WriteLine ("") For i = 0 To UBound(BsP) a.WriteLine ("set m" & i + 1 & " ""fraglimit 15" & " ; map ") & (Left$(BsP(i), Len(BsP(i)) - 4)) 'a.WriteLine ("set m2 ""fraglimit 15" & " ; map ") & (Left$(BsP(i), Len(BsP(i)) - 4)) Next a.Close MsgBox "doomanf.cfg written successfully!!!" ChDir (Spl1.Dir1.Path) 'Shell ("quake3.exe ") & (Dedicated) & (" +exec doomanf.cfg") End Sub




Reply With Quote