cs_trouduc
Messages postés56Date d'inscriptionjeudi 26 décembre 2002StatutMembreDernière intervention28 septembre 2005
-
1 juil. 2005 à 23:15
cs_trouduc
Messages postés56Date d'inscriptionjeudi 26 décembre 2002StatutMembreDernière intervention28 septembre 2005
-
2 juil. 2005 à 00:40
voila j'ai une liste qui contient les parametre de mon serveur et je voudrais afficher ses parametre dans mon prog, mon probleme c'est que je doit afficher ca dans plusieurs textbox, checkbox, slider, listbox. je sais pas comment faire ca simple.
serais bien de pas afficher les sv.****** et j'aimerais aussi sauvegarder ses données quand je les modifie.
voici le code de ma source (en fais ou je suis rendu dans mon projet)
Dim IDProg As Integer
Private Sub Combo1_Click()
List2.Clear
ChargeMap
End Sub
Private Sub Command1_Click()
If Command1.Caption = "Start" Then
Command1.Caption = "Stop"
IDProg = Shell("Bf2_w32ded.exe +config" & " " & Chr(34) & "ServerConfigs" & Combo1.Text & Chr(34) _
& " " & "+mapList" & " " & Chr(34) & "ServerConfigs\Maps\map" & Combo1.Text & Chr(34), vbNormalNoFocus)
Else
Command1.Caption = "Start"
AppActivate (IDProg)
SendKeys "exit", True
SendKeys "~", True
End If
End Sub
Private Sub Command11_Click()
Unload Me
End Sub
Private Sub Command12_Click()
List2.AddItem List1.List(List1.ListIndex)
End Sub
Private Sub Command13_Click()
List2.RemoveItem List2.ListIndex
End Sub
Private Sub Command2_Click()
AppActivate (IDProg)
SendKeys "gameLogic.togglePause", True
SendKeys "~", True
End Sub
Private Sub Command3_Click()
AppActivate (IDProg)
SendKeys "admin.clearBanList", True
SendKeys "~", True
End Sub
Private Sub Command4_Click()
AppActivate (IDProg)
SendKeys "admin.restartMap", True
SendKeys "~", True
End Sub
Private Sub Command5_Click()
AppActivate (IDProg)
SendKeys "admin.runNextLevel", True
SendKeys "~", True
End Sub
Private Sub Command6_Click()
AppActivate (IDProg)
SendKeys "admin.banPlayerKey" & " " & Text1.Text, True
SendKeys "~", True
End Sub
Private Sub Command7_Click()
AppActivate (IDProg)
SendKeys "admin.kickPlayer" & " " & Text1.Text, True
SendKeys "~", True
End Sub
Private Sub Command8_Click()
AppActivate (IDProg)
SendKeys "game.sayall" & " " & Chr(34) & "ADMIN:" & " " & Text2.Text & Chr(34), True
SendKeys "~", True
Text2.Text = ""
End Sub
Private Sub Command9_Click()
SauveMap
End Sub
Private Sub Form_Load()
ChargeMap
ChargeConfig
ChargeListeMap
Label1.Caption = Slider1.Value
End Sub
Private Sub Slider1_Change()
Label1.Caption = Slider1.Value
End Sub
Function ChargeConfig()
Dim sFile As String
sFile = Dir(App.Path & "\ServerConfigs\*.*")
While sFile <> ""
Combo1.AddItem sFile
sFile = Dir
Wend
End Function
Function ChargeMap()
On Error GoTo Fin:
Dim map As String
Open ("ServerConfigs\Maps\map" & Combo1.Text) For Input As #1
Do While Not EOF(1)
Line Input #1, map
If LenB(map) <> 0 Then List2.AddItem map
Loop
Close #1
Fin:
End Function
Function ChargeListeMap()
On Error GoTo Fin:
Dim item As String
Open "ServerConfigs\Maps\maplist.con" For Input As #1
Do While Not EOF(1)
Line Input #1, item
If LenB(item) <> 0 Then List1.AddItem item
Loop
Close #1
Fin:
End Function
Function SauveMap()
Dim cpt4 As Integer
Dim smap As String
Open ("ServerConfigs\Maps\map" & Combo1.Text) For Output As #2
For cpt4 = 0 To List2.ListCount
smap = List2.List(cpt4)
Print #2, smap
Next
Close #2
End Function
voila c'est pas tres beau mais j'suis seulement un debutant
a force de poser des questions je n'aurai plus aucun merite pour mon prog
je devrai le dedier a la communauté de VBFrance
cs_trouduc
Messages postés56Date d'inscriptionjeudi 26 décembre 2002StatutMembreDernière intervention28 septembre 2005 2 juil. 2005 à 00:40
mon prog me sert a lancer un serveur de jeu et eventuellement configurer les options si je reussis ou si quelqu'un me donne un coup de main
je veut que mon prog lise cet liste et place les lignes au bon endroit dans mon prog (comme dans le screenshot)
c'est a dire
sv.serverName "Default Server Name" 'place "Default Server Name" dans un textbox1
sv.password "" 'place ce qu'il y a entre "" dans textbox2
sv.internet 0 'place ce 0 ou 1(boolean) dans un checkbox1
sv.bandwidthChoke 0 'place dans listbox1
sv.serverIP "" 'textbox
sv.serverPort 16567 'textbox
sv.welcomeMessage "" 'textbox
sv.punkBuster 0 'checkbox
sv.allowFreeCam 0 'checkbox
sv.allowExternalViews 1 'checkbox
sv.allowNoseCam 1 'checkbox
sv.hitIndicator 1 'checkbox
sv.maxPlayers 64 'slider etc. etc.
sv.numPlayersNeededToStart 2
sv.notEnoughPlayersRestartDelay 15
sv.startDelay 15