Advertisement
agentsix1

is this overkill

Aug 4th, 2017
40,507
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 4.09 KB | None | 0 0
  1. Public Class Form2
  2.  
  3.     Dim racers As New Dictionary(Of String, List(Of String))
  4.     Dim racersReady As New Dictionary(Of String, Dictionary(Of String, Boolean))
  5.     Dim racersComplete As New Dictionary(Of String, Dictionary(Of String, Boolean))
  6.     Dim Races As New Dictionary(Of String, String) '0 = Guest | 1 = Users | 2 = Admin
  7.     Dim racesMax As New Dictionary(Of String, Integer)
  8.     Dim raceTime As New Dictionary(Of String, Integer)
  9.     Dim racesTimes As New Dictionary(Of String, Dictionary(Of Integer, String)) 'Integer = Place | String = Time,Player
  10.     Dim racesBy As New Dictionary(Of String, String)
  11.     '!newrace {name} Optional: {Max} Optional: {Permission}
  12.     '!newrace everyone
  13.     '!newrace everyone 5
  14.     '!newrace admins admin
  15.  
  16.     '!joinrace any%
  17.     'check races for race name
  18.     'if race is joinable then add player to race
  19.     'if race is started deny player join access
  20.  
  21.     '!racequit
  22.     'if race started then dnf
  23.     'if race isnt started simple remove from dictionaries and list
  24.  
  25.     '!dnf
  26.     'if player is in race respond with message
  27.  
  28.     Public Sub newrace(arg As String)
  29.  
  30.     End Sub
  31.  
  32.     Public Sub newrace(arg As String, arg2 As String)
  33.  
  34.     End Sub
  35.  
  36.     Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
  37.  
  38.         Dim Entry = TextBox4.Text
  39.         Dim args As String() = Split(Entry, " ")
  40.         Dim user As String = "agentsix1"
  41.         Try
  42.             If Not racesBy(args(1)).Equals("") Then
  43.                 MsgBox("It appears this race was already created under this name by " & racesBy(args(1)))
  44.                 Exit Sub
  45.             End If
  46.         Catch ex As Exception
  47.  
  48.         End Try
  49.         If args.Count = 4 Then
  50.             If args(2).ToLower.Equals("guest") Or args(2).ToLower.Equals("user") Or args(2).ToLower.Equals("admin") Then
  51.                 If IsNumeric(args(3)) Then
  52.                     MsgBox("You have successfully created a race Named: " & args(1) & ", Who allows only " & args(2) & " or higher to join. You have set the max runners to " & args(3) & ".")
  53.                 Else
  54.                     MsgBox("It appears you have not entered a number for the max amount of racers you would like to allow in your race. Please try again using a number.")
  55.                 End If
  56.  
  57.             Else
  58.                 MsgBox("I am sorry you are using a invalid permission node. Please try again using the proper permission node")
  59.             End If
  60.         ElseIf args.Count = 3 Then
  61.             If IsNumeric(args(2)) Then
  62.                 createRace(user, args(1), "guest", Integer.Parse(args(2)))
  63.                 MsgBox("You have successfully created a race Named: " & args(1) & ", which allows anyone to join. You have set the max runners to " & args(3) & ".")
  64.  
  65.             ElseIf args(2).ToLower.Equals("guest") Or args(2).ToLower.Equals("user") Or args(2).ToLower.Equals("admin") Then
  66.                 createRace(user, args(1), args(2).ToLower, -1)
  67.                 MsgBox("You have successfully created a race Named: " & args(1) & ", Who allows only " & args(2) & " or higher to join. No max amount of runners have been set currently.")
  68.             Else
  69.                 MsgBox("I am sorry you are using a invalid permission node. Please try again using the proper permission node")
  70.             End If
  71.         ElseIf args.Count = 2 Then
  72.             createRace(user, args(1), "guest", -1)
  73.             MsgBox("You have successfully created a race Named: " & args(1) & ", Who allows anyone to join. No max amount of runners have been set currently.")
  74.         End If
  75.     End Sub
  76.  
  77.     Private Sub createRace(user As String, name As String, perm As String, max As Integer)
  78.         Dim str As List(Of String) = New List(Of String)
  79.         'str.Add(user)
  80.         racers.Add(name, str)
  81.         racersReady.Add(name, New Dictionary(Of String, Boolean))
  82.         racersComplete.Add(name, New Dictionary(Of String, Boolean))
  83.         racesMax.Add(name, max)
  84.         raceTime.Add(name, 0)
  85.         racesTimes.Add(name, New Dictionary(Of Integer, String))
  86.         Races.Add(name, perm)
  87.         racesBy.Add(name, user)
  88.     End Sub
  89. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement