Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports Discord
- Imports Discord.Commands
- <Group("boss")>
- Public Class cmd_boss
- Inherits ModuleBase
- <Command>
- Public Async Function rng(day As DayOfWeek) As Task
- Try
- Dim strSched(,) As String
- Dim intRowCount As Integer = 8
- Dim intColumnCount As Integer = 8
- ReDim strSched(intColumnCount - 1, intRowCount - 1)
- #Region "Schedule"
- strSched(0, 0) = "01:30:00 "
- strSched(1, 0) = "Kzarka "
- strSched(2, 0) = "Nouver "
- strSched(3, 0) = "Kzarka "
- strSched(4, 0) = "Kutum "
- strSched(5, 0) = "Kzarka "
- strSched(6, 0) = "Karanda "
- strSched(7, 0) = "Karanda "
- 'second row
- strSched(0, 1) = "07:00:00 "
- strSched(1, 1) = "Karanda "
- strSched(2, 1) = "Kutum/Nouver "
- strSched(3, 1) = "%Maintenance% "
- strSched(4, 1) = "Nouver "
- strSched(5, 1) = "- "
- strSched(6, 1) = "Nouver "
- strSched(7, 1) = "Kutum "
- 'third row
- strSched(0, 2) = "11:00:00 "
- strSched(1, 2) = "- "
- strSched(2, 2) = "Kzarka/Karanda "
- strSched(3, 2) = "Kzarka "
- strSched(4, 2) = "Kzarka "
- strSched(5, 2) = "Kutum "
- strSched(6, 2) = "Kutum/Kzarka "
- strSched(7, 2) = "Kzarka/Karanda "
- 'fourth row
- strSched(0, 3) = "15:00:00 "
- strSched(1, 3) = "Nouver "
- strSched(2, 3) = "Kutum/Nouver "
- strSched(3, 3) = "Karanda "
- strSched(4, 3) = "Kutum "
- strSched(5, 3) = "Kzarka "
- strSched(6, 3) = "Karanda/Nouver "
- strSched(7, 3) = "Kutum/Nouver "
- 'fifth row
- strSched(0, 4) = "20:00:00 "
- strSched(1, 4) = "Kzarka "
- strSched(2, 4) = "Muraka/Quint "
- strSched(3, 4) = "Kutum "
- strSched(4, 4) = "Kzarka/Karanda "
- strSched(5, 4) = "Nouver "
- strSched(6, 4) = "Muraka/Quint "
- strSched(7, 4) = "Karanda "
- 'sixth row
- strSched(0, 5) = "21:00:00 "
- strSched(1, 5) = "NODE WAR "
- strSched(2, 5) = "NODE WAR "
- strSched(3, 5) = "NODE WAR "
- strSched(4, 5) = "NODE WAR "
- strSched(5, 5) = "NODE WAR "
- strSched(6, 5) = "CONQUEST WAR "
- strSched(7, 5) = "NODE WAR "
- 'seventh row
- strSched(0, 6) = "00:00:00 "
- strSched(1, 6) = "Offin "
- strSched(2, 6) = "Kutum/Nouver "
- strSched(3, 6) = "Offin "
- strSched(4, 6) = "Kzarka/Nouver "
- strSched(5, 6) = "Offin "
- strSched(6, 6) = "CONQUEST WAR "
- strSched(7, 6) = "Kutum/Nouver "
- #End Region
- Dim timeNow As String = DateTime.Now.ToString("HH:mm:ss")
- 'Dim dayz = 0
- 'For x = 0 To 6
- ' If strSched(dayz + 1, x) <> "none" Then
- ' Await ReplyAsync($"{ strSched(0, x) & " > " & strSched(dayz + 1, x) & " > spawning in > " & computeInterval(timeNow, strSched(0, x)) }")
- ' End If
- 'Next x
- 'Dim xDay = Context.Message.Timestamp.DayOfWeek
- Dim xDay = Context.Message.Timestamp.LocalDateTime.DayOfWeek
- Select Case xDay
- Case xDay.Monday
- If xDay = day Then
- Await ReplyAsync($"**:alarm_clock: {Context.User.Mention}, {xDay}'s Boss Schedule**" & vbNewLine &
- $"```autohotkey" & vbNewLine &
- $"{ strSched(0, 0) & " > " & strSched(1, 0) & " > spawning in > " & computeInterval(timeNow, strSched(0, 0)) }" & vbNewLine &
- $"{ strSched(0, 1) & " > " & strSched(1, 1) & " > spawning in > " & computeInterval(timeNow, strSched(0, 1)) }" & vbNewLine &
- $"{ strSched(0, 2) & " > " & strSched(1, 2) & " > spawning in > " & computeInterval(timeNow, strSched(0, 2)) }" & vbNewLine &
- $"{ strSched(0, 3) & " > " & strSched(1, 3) & " > spawning in > " & computeInterval(timeNow, strSched(0, 3)) }" & vbNewLine &
- $"{ strSched(0, 4) & " > " & strSched(1, 4) & " > spawning in > " & computeInterval(timeNow, strSched(0, 4)) }" & vbNewLine &
- $"{ strSched(0, 5) & " > " & strSched(1, 5) & " > spawning in > " & computeInterval(timeNow, strSched(0, 5)) }" & vbNewLine &
- $"{ strSched(0, 6) & " > " & strSched(1, 6) & " > spawning in > " & computeInterval(timeNow, strSched(0, 6)) }" & vbNewLine &
- $"```")
- End If
- Await Me.Context.Message.DeleteAsync()
- Case xDay.Tuesday
- If xDay = day Then
- Await ReplyAsync($"**:alarm_clock: {Context.User.Mention}, {xDay}'s Boss Schedule**" & vbNewLine &
- $"```md" & vbNewLine &
- $"{ strSched(0, 0) & " > " & strSched(2, 0) & " > spawning in > " & computeInterval(timeNow, strSched(0, 0)) }" & vbNewLine &
- $"{ strSched(0, 1) & " > " & strSched(2, 1) & " > spawning in > " & computeInterval(timeNow, strSched(0, 1)) }" & vbNewLine &
- $"{ strSched(0, 2) & " > " & strSched(2, 2) & " > spawning in > " & computeInterval(timeNow, strSched(0, 2)) }" & vbNewLine &
- $"{ strSched(0, 3) & " > " & strSched(2, 3) & " > spawning in > " & computeInterval(timeNow, strSched(0, 3)) }" & vbNewLine &
- $"{ strSched(0, 4) & " > " & strSched(2, 4) & " > spawning in > " & computeInterval(timeNow, strSched(0, 4)) }" & vbNewLine &
- $"{ strSched(0, 5) & " > " & strSched(2, 5) & " > spawning in > " & computeInterval(timeNow, strSched(0, 5)) }" & vbNewLine &
- $"{ strSched(0, 6) & " > " & strSched(2, 6) & " > spawning in > " & computeInterval(timeNow, strSched(0, 6)) }" & vbNewLine &
- $"```")
- End If
- Await Me.Context.Message.DeleteAsync()
- Case xDay.Wednesday
- If xDay = xDay Then
- Await ReplyAsync($"**:alarm_clock: {Context.User.Mention}, {xDay}'s Boss Schedule**" & vbNewLine &
- $"```autohotkey" & vbNewLine &
- $"{ strSched(0, 0) & " > " & strSched(3, 0) & " > spawning in > " & computeInterval(timeNow, strSched(0, 0)) }" & vbNewLine &
- $"{ strSched(0, 1) & " > " & strSched(3, 1) & " > spawning in > " & computeInterval(timeNow, strSched(0, 1)) }" & vbNewLine &
- $"{ strSched(0, 2) & " > " & strSched(3, 2) & " > spawning in > " & computeInterval(timeNow, strSched(0, 2)) }" & vbNewLine &
- $"{ strSched(0, 3) & " > " & strSched(3, 3) & " > spawning in > " & computeInterval(timeNow, strSched(0, 3)) }" & vbNewLine &
- $"{ strSched(0, 4) & " > " & strSched(3, 4) & " > spawning in > " & computeInterval(timeNow, strSched(0, 4)) }" & vbNewLine &
- $"{ strSched(0, 5) & " > " & strSched(3, 5) & " > spawning in > " & computeInterval(timeNow, strSched(0, 5)) }" & vbNewLine &
- $"{ strSched(0, 6) & " > " & strSched(3, 6) & " > spawning in > " & computeInterval(timeNow, strSched(0, 6)) }" & vbNewLine &
- $"```")
- End If
- Await Me.Context.Message.DeleteAsync()
- Case xDay.Thursday
- If xDay = xDay Then
- Await ReplyAsync($"**:alarm_clock: {Context.User.Mention}, {xDay}'s Boss Schedule**" & vbNewLine &
- $"```autohotkey" & vbNewLine &
- $"{ strSched(0, 0) & " > " & strSched(4, 0) & " > spawning in > " & computeInterval(timeNow, strSched(0, 0)) }" & vbNewLine &
- $"{ strSched(0, 1) & " > " & strSched(4, 1) & " > spawning in > " & computeInterval(timeNow, strSched(0, 1)) }" & vbNewLine &
- $"{ strSched(0, 2) & " > " & strSched(4, 2) & " > spawning in > " & computeInterval(timeNow, strSched(0, 2)) }" & vbNewLine &
- $"{ strSched(0, 3) & " > " & strSched(4, 3) & " > spawning in > " & computeInterval(timeNow, strSched(0, 3)) }" & vbNewLine &
- $"{ strSched(0, 4) & " > " & strSched(4, 4) & " > spawning in > " & computeInterval(timeNow, strSched(0, 4)) }" & vbNewLine &
- $"{ strSched(0, 5) & " > " & strSched(4, 5) & " > spawning in > " & computeInterval(timeNow, strSched(0, 5)) }" & vbNewLine &
- $"{ strSched(0, 6) & " > " & strSched(4, 6) & " > spawning in > " & computeInterval(timeNow, strSched(0, 6)) }" & vbNewLine &
- $"```")
- End If
- Await Me.Context.Message.DeleteAsync()
- Case xDay.Friday
- If xDay = xDay Then
- Await ReplyAsync($"**:alarm_clock: {Context.User.Mention}, {xDay}'s Boss Schedule**" & vbNewLine &
- $"```autohotkey" & vbNewLine &
- $"{ strSched(0, 0) & " > " & strSched(5, 0) & " > spawning in > " & computeInterval(timeNow, strSched(0, 0)) }" & vbNewLine &
- $"{ strSched(0, 1) & " > " & strSched(5, 1) & " > spawning in > " & computeInterval(timeNow, strSched(0, 1)) }" & vbNewLine &
- $"{ strSched(0, 2) & " > " & strSched(5, 2) & " > spawning in > " & computeInterval(timeNow, strSched(0, 2)) }" & vbNewLine &
- $"{ strSched(0, 3) & " > " & strSched(5, 3) & " > spawning in > " & computeInterval(timeNow, strSched(0, 3)) }" & vbNewLine &
- $"{ strSched(0, 4) & " > " & strSched(5, 4) & " > spawning in > " & computeInterval(timeNow, strSched(0, 4)) }" & vbNewLine &
- $"{ strSched(0, 5) & " > " & strSched(5, 5) & " > spawning in > " & computeInterval(timeNow, strSched(0, 5)) }" & vbNewLine &
- $"{ strSched(0, 6) & " > " & strSched(5, 6) & " > spawning in > " & computeInterval(timeNow, strSched(0, 6)) }" & vbNewLine &
- $"```")
- End If
- Await Me.Context.Message.DeleteAsync()
- Case xDay.Saturday
- If xDay = xDay Then
- Await ReplyAsync($"**:alarm_clock: {Context.User.Mention}, {xDay}'s Boss Schedule**" & vbNewLine &
- $"```autohotkey" & vbNewLine &
- $"{ strSched(0, 0) & " > " & strSched(6, 0) & " > spawning in > " & computeInterval(timeNow, strSched(0, 0)) }" & vbNewLine &
- $"{ strSched(0, 1) & " > " & strSched(6, 1) & " > spawning in > " & computeInterval(timeNow, strSched(0, 1)) }" & vbNewLine &
- $"{ strSched(0, 2) & " > " & strSched(6, 2) & " > spawning in > " & computeInterval(timeNow, strSched(0, 2)) }" & vbNewLine &
- $"{ strSched(0, 3) & " > " & strSched(6, 3) & " > spawning in > " & computeInterval(timeNow, strSched(0, 3)) }" & vbNewLine &
- $"{ strSched(0, 4) & " > " & strSched(6, 4) & " > spawning in > " & computeInterval(timeNow, strSched(0, 4)) }" & vbNewLine &
- $"{ strSched(0, 5) & " > " & strSched(6, 5) & " > spawning in > " & computeInterval(timeNow, strSched(0, 5)) }" & vbNewLine &
- $"{ strSched(0, 6) & " > " & strSched(6, 6) & " > spawning in > " & computeInterval(timeNow, strSched(0, 6)) }" & vbNewLine &
- $"```")
- End If
- Await Me.Context.Message.DeleteAsync()
- Case xDay.Sunday
- If xDay = xDay Then
- Await ReplyAsync($"**:alarm_clock: {Context.User.Mention}, {xDay}'s Boss Schedule**" & vbNewLine &
- $"```autohotkey" & vbNewLine &
- $"{ strSched(0, 0) & " > " & strSched(7, 0) & " > spawning in > " & computeInterval(timeNow, strSched(0, 0)) }" & vbNewLine &
- $"{ strSched(0, 1) & " > " & strSched(7, 1) & " > spawning in > " & computeInterval(timeNow, strSched(0, 1)) }" & vbNewLine &
- $"{ strSched(0, 2) & " > " & strSched(7, 2) & " > spawning in > " & computeInterval(timeNow, strSched(0, 2)) }" & vbNewLine &
- $"{ strSched(0, 3) & " > " & strSched(7, 3) & " > spawning in > " & computeInterval(timeNow, strSched(0, 3)) }" & vbNewLine &
- $"{ strSched(0, 4) & " > " & strSched(7, 4) & " > spawning in > " & computeInterval(timeNow, strSched(0, 4)) }" & vbNewLine &
- $"{ strSched(0, 5) & " > " & strSched(7, 5) & " > spawning in > " & computeInterval(timeNow, strSched(0, 5)) }" & vbNewLine &
- $"{ strSched(0, 6) & " > " & strSched(7, 6) & " > spawning in > " & computeInterval(timeNow, strSched(0, 6)) }" & vbNewLine &
- $"```")
- End If
- Await Me.Context.Message.DeleteAsync()
- End Select
- Catch ex As Exception
- Console.Write("[Boss] " & ex.Message)
- End Try
- End Function
- Function computeInterval(stamp As DateTime, bossTime As String) As String
- Dim dateFrom As DateTime
- Dim dateTo As DateTime
- Dim strSpan As String
- If DateTime.TryParse(stamp, dateFrom) AndAlso DateTime.TryParse(bossTime, dateTo) Then
- Dim spanTime As TimeSpan = dateTo - dateFrom
- Dim hour As Integer = spanTime.Hours
- Dim mins As Integer = spanTime.Minutes
- Dim secs As Integer = spanTime.Seconds
- If hour >= 0 AndAlso mins >= 0 AndAlso secs >= 0 Then
- strSpan = ((hour.ToString("00") & ":" + mins.ToString("00") & ":") + secs.ToString("00") & "")
- ElseIf bossTime = "00:00:00 " Then
- hour = hour * -1
- mins = mins * -1
- secs = secs * -1
- strSpan = ((hour.ToString("00") & ":" + mins.ToString("00") & ":") + secs.ToString("00") & "")
- Else
- strSpan = "%SPAWNED%"
- End If
- End If
- Return strSpan
- End Function
- <Command>
- Public Async Function bosshelp() As Task
- Await ReplyAsync($"**:tools: {Context.User.Mention}, Help: Boss Timer Command (!boss)**" & vbNewLine &
- "```Syntax is: !boss <current day>" & vbNewLine &
- "Sample: !boss tuesday, this will tell the bot to show the schedule on Tuesday.```")
- Await Me.Context.Message.DeleteAsync()
- End Function
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement