SolvedConnect To TF2 Server

Posts 1–9 of 9 · Page 1 of 1
Connect To TF2 Server
I need to be able to connect to a team fortress 2 server straight from my idling program im making i have everything else i want in it but i cant think of how to get the one line to work here is my whole code for reference and ill post the problem line after it.
 
Spoiler
Code:
Public Class Form1
    Dim streamer As IO.StreamReader


    Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Process.Start("steam://rungameid/440-textmode -nosound -noipx -novid -nopreload -nojoy +volume 0 +connect")
    End Sub

    Private Sub AddToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AddToolStripMenuItem1.Click
        ListBox1.Items.Add(ToolStripTextBox1.Text)
    End Sub

    Private Sub SaveToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveToolStripMenuItem.Click
        SaveFD.InitialDirectory = "C:\Users\Lucas\Desktop"
        SaveFD.Title = "Save a Text file with servers in IP:PORT format"
        SaveFD.Filter = "Text Files in IP:Port format|*.txt"
        SaveFD.OverwritePrompt = True
        Dim DidWork As Integer = OpenFD.ShowDialog()
        If DidWork = DialogResult.OK Then
            Dim S As New IO.StreamWriter(SaveFD.FileName)
            Dim i As Integer
            For i = 0 To ListBox1.Items.Count - 1
                S.WriteLine(ListBox1.Items.Item(i))
            Next
            S.Close()
        End If
    End Sub

    Private Sub OpenToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OpenToolStripMenuItem.Click
        OpenFD.InitialDirectory = "C:\Users\Lucas\Desktop"
        OpenFD.Title = "Open a Text file with servers in IP:PORT format"
        OpenFD.Filter = "Text Files in IP:Port format|*.txt"
        Dim DidWork As Integer = OpenFD.ShowDialog()
        If DidWork = DialogResult.OK Then
            ListBox1.Items.Clear()
            Dim R As New IO.StreamReader(OpenFD.FileName)
            Dim str() As String = R.ReadToEnd.Split(vbNewLine)
            ListBox1.Items.AddRange(str)
            R.Close()
        End If
    End Sub

    Private Sub ToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripMenuItem1.Click
        ListBox1.Items.Clear()
    End Sub

    Private Sub AboutToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AboutToolStripMenuItem.Click
        MsgBox("Made by fireXtract on 8/25/2012")
    End Sub

    Private Sub MultiLoaderToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MultiLoaderToolStripMenuItem.Click
        OpenFD.InitialDirectory = "C:\Users\Lucas\Desktop"
        OpenFD.Title = "Open a Text file with servers in IP:PORT format"
        OpenFD.Filter = "Text Files in IP:Port format|*.txt"
        Dim DidWork As Integer = OpenFD.ShowDialog()
        If DidWork = DialogResult.OK Then
            Dim R As New IO.StreamReader(OpenFD.FileName)
            Dim str() As String = R.ReadToEnd.Split(vbNewLine)
            ListBox1.Items.AddRange(str)
            R.Close()
        End If
    End Sub

End Class


Problem lines

 
Spoiler
Code:
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Process.Start("steam://rungameid/440-textmode -nosound -noipx -novid -nopreload -nojoy +volume 0 +connect'RIGHT HERE I WANT TO BE ABLE TO SAY WHAT I HAVE SELECTED FROM THE LISTBOX'")
    End Sub
if you're going to be idle.. why you don't create a own server for it?

Code:
-textmode -nosound -noipx -novid -nopreload -nojoy -sw -maxplayers 2 +sv_lan 1 +map "itemtest"
Does it work the same as a achievment idle server, i mean same pickup rates? Also i was thinking it would be less CPU/RAM intensive if you didnt host the server on your own.
I let my computer idling with that almost every night and works pretty fine... usually I got like 5-10 items....

Anyways, if you have a list box like:

Ip:Port
Ip:Port
....

You can get the selected one with ListBox1.SelectedItem.ToString(); I think.. its been a while since a dont mess with .NET tho
I did
Code:
Process.Start("steam://rungameid/440-textmode -nosound -noipx -novid -nopreload -nojoy +volume 0 +connect" ListBox1.SelectedItem.ToString())
And it still didnt join a server and also i noticed its not going into console mode... doesnt -textmode do that? or is it -console
Ok well ill go with your server idea but i cant do the itemtest in quotes because it stops the string and ' ' doesnt work either! im confused on how to bypass that.
EDIT: for anyone who stumbled upon this the answer i found was to do
Code:
"steam://rungameid/440-textmode -nosound -noipx -novid -nopreload -nojoy -sw -console -maxplayers 2 +sv_lan 1 +map " & Chr(34) & "itemtest" & Chr(34)
& Chr(34) is the " in the character map
Marked solved.
Quote Originally Posted by fireXtract View Post
Could anybody test my program for me now or where would i post that and who would need to approve my file?
i have one virus scan out of 2 just for a check https://www.virustotal.com/file/b5a5...is/1345993787/
Upload it to MPGH ! Click Go Advanced when writing a reply and click upload attachments at the bottom to attach the file. Then take two virus scans of the same file that you uploaded and link it on the post.
Posts 1–9 of 9 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?