Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class Form2
- Dim racers As New Dictionary(Of String, List(Of String))
- Dim racersReady As New Dictionary(Of String, Dictionary(Of String, Boolean))
- Dim racersComplete As New Dictionary(Of String, Dictionary(Of String, Boolean))
- Dim Races As New Dictionary(Of String, String) '0 = Guest | 1 = Users | 2 = Admin
- Dim racesMax As New Dictionary(Of String, Integer)
- Dim raceTime As New Dictionary(Of String, Integer)
- Dim racesTimes As New Dictionary(Of String, Dictionary(Of Integer, String)) 'Integer = Place | String = Time,Player
- Dim racesBy As New Dictionary(Of String, String)
- '!newrace {name} Optional: {Max} Optional: {Permission}
- '!newrace everyone
- '!newrace everyone 5
- '!newrace admins admin
- '!joinrace any%
- 'check races for race name
- 'if race is joinable then add player to race
- 'if race is started deny player join access
- '!racequit
- 'if race started then dnf
- 'if race isnt started simple remove from dictionaries and list
- '!dnf
- 'if player is in race respond with message
- Public Sub newrace(arg As String)
- End Sub
- Public Sub newrace(arg As String, arg2 As String)
- End Sub
- Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
- Dim Entry = TextBox4.Text
- Dim args As String() = Split(Entry, " ")
- Dim user As String = "agentsix1"
- Try
- If Not racesBy(args(1)).Equals("") Then
- MsgBox("It appears this race was already created under this name by " & racesBy(args(1)))
- Exit Sub
- End If
- Catch ex As Exception
- End Try
- If args.Count = 4 Then
- If args(2).ToLower.Equals("guest") Or args(2).ToLower.Equals("user") Or args(2).ToLower.Equals("admin") Then
- If IsNumeric(args(3)) Then
- 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) & ".")
- Else
- 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.")
- End If
- Else
- MsgBox("I am sorry you are using a invalid permission node. Please try again using the proper permission node")
- End If
- ElseIf args.Count = 3 Then
- If IsNumeric(args(2)) Then
- createRace(user, args(1), "guest", Integer.Parse(args(2)))
- MsgBox("You have successfully created a race Named: " & args(1) & ", which allows anyone to join. You have set the max runners to " & args(3) & ".")
- ElseIf args(2).ToLower.Equals("guest") Or args(2).ToLower.Equals("user") Or args(2).ToLower.Equals("admin") Then
- createRace(user, args(1), args(2).ToLower, -1)
- 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.")
- Else
- MsgBox("I am sorry you are using a invalid permission node. Please try again using the proper permission node")
- End If
- ElseIf args.Count = 2 Then
- createRace(user, args(1), "guest", -1)
- MsgBox("You have successfully created a race Named: " & args(1) & ", Who allows anyone to join. No max amount of runners have been set currently.")
- End If
- End Sub
- Private Sub createRace(user As String, name As String, perm As String, max As Integer)
- Dim str As List(Of String) = New List(Of String)
- 'str.Add(user)
- racers.Add(name, str)
- racersReady.Add(name, New Dictionary(Of String, Boolean))
- racersComplete.Add(name, New Dictionary(Of String, Boolean))
- racesMax.Add(name, max)
- raceTime.Add(name, 0)
- racesTimes.Add(name, New Dictionary(Of Integer, String))
- Races.Add(name, perm)
- racesBy.Add(name, user)
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement