Advertisement
Brandan

Roleplay 2 Main Map Converter

Feb 26th, 2012
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 2.93 KB | None | 0 0
  1.  On Error Resume Next
  2.         'Textbox3
  3.         'Deaths              (0)
  4.         'Kills               (1)
  5.         'Killed              (22)
  6.         'Suicides            (23)
  7.         'KtoD                (2)
  8.         'MostMoneyMade       (4)
  9.         'MostMoneyLost       (3)
  10.         'IdleTime            (21)
  11.         TextBox3.Clear()
  12.         Dim fName = "D:\Westwood\RenegadeFDS\Server\data\Roleplay2\Rp2PlayerRecords.txt"
  13.         Dim fileContents As String
  14.         fileContents = My.Computer.FileSystem.ReadAllText(fName)
  15.         TextBox4.Text = fileContents
  16.         For i As Integer = 0 To TextBox4.Lines.GetUpperBound(0)
  17.             Dim textline = TextBox4.Lines(i)
  18.             Dim players = (i)
  19.  
  20.             If textline = Nothing Then
  21.             Else
  22.                 Dim ts As TimeSpan = Now.AddSeconds((wordquest(" ", TextBox4.Lines(players + 1), 5))).Subtract(Now)
  23.                 Dim time = ts.Hours & ":" & ts.Minutes & ":" & ts.Seconds
  24.                 Dim name = textline
  25.                 Dim deaths As Integer = (wordquest(" ", TextBox4.Lines(players + 1), 0))
  26.                 Dim defences_destroyed = Nothing
  27.                 Dim Hailfire_turrents_killed As Integer = (wordquest(" ", TextBox4.Lines(players + 1), 24))
  28.                 Dim Ceiling_Guns_Killed As Integer = (wordquest(" ", TextBox4.Lines(players + 1), 25))
  29.                 Dim DestroyedSams As Integer = (wordquest(" ", TextBox4.Lines(players + 1), 26))
  30.                 Dim mostmoney = (wordquest(" ", TextBox4.Lines(players + 1), 4)).Replace(".00", Nothing)
  31.                 Dim mostmoneylost = (wordquest(" ", TextBox4.Lines(players + 1), 3)).Replace(".00", Nothing)
  32.                 Dim kills = (wordquest(" ", TextBox4.Lines(players + 1), 1))
  33.                 Dim KtoD = (wordquest(" ", TextBox4.Lines(players + 1), 2))
  34.                 Dim sucides As Integer = (wordquest(" ", TextBox4.Lines(players + 1), 23))
  35.                 Dim playtime = time
  36.                 kills = CDbl(kills)
  37.                 deaths = CDbl(deaths)
  38.                 sucides = CDbl(sucides)
  39.                 defences_destroyed = Hailfire_turrents_killed + Ceiling_Guns_Killed + DestroyedSams
  40.                 deaths = (wordquest(" ", TextBox4.Lines(players + 1), 22)) + deaths + sucides
  41.                 Dim rofl = _
  42.                           playtime & _
  43.                           "," & kills & _
  44.                           "," & deaths & _
  45.                           "," & sucides & _
  46.                           "," & KtoD & _
  47.                           "," & defences_destroyed & _
  48.                           "," & mostmoney & _
  49.                           "," & mostmoneylost
  50.                 TextBox3.Text += name & "," & rofl & vbNewLine
  51.                 i = i + 1
  52.             End If
  53.         Next i
  54.         Dim lol = 0
  55.         My.Computer.FileSystem.WriteAllText("C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\rofl\ConvertedStats.txt", TextBox3.Text, False)
  56.         On Error Resume Next
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement