Guest User

Untitled

a guest
May 5th, 2017
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. '// This sub is for the Compare command.
  2.  
  3. Sub Compare(Username, Message, DspId, Access)
  4.  
  5.     If Access < Compare_ReqAccess AND Username <> BotVars.Username Then Exit Sub
  6.     If Username = BotVars.Username Then VetoThisMessage
  7.     If InStr(Message, " ") = 0 Then Exit Sub
  8.     If IsVouched(Username) = False Then Exit Sub
  9.  
  10.  
  11.     Msg = Split(Message)
  12.     If UBound(Msg) = 2 Then Username = Msg(2)
  13.     If UBound(Msg) > 0 Then
  14.         If Msg(1) = VBNullString Then Exit Sub
  15.         User = Msg(1)
  16.    
  17.     MGLConnect()
  18.         Set MGL = MGLConn.Execute("SELECT * FROM `Users` WHERE `Username` = '" & Username & "'")
  19.         If MGL.BOF = True And MGL.EOF = True Then
  20.         Dsp DspId, "• Unable to compare " & Username & " with " & User & ".", Username, VBWhite
  21.         Exit Sub
  22.         End If
  23.        
  24.             UsernamesWins = MGL.Fields(5)
  25.             UsernamesLosses = MGL.Fields(6)
  26.             UsernamesExperience = MGL.Fields(4)
  27.             UsernamesGamesPlayed = MGL.Fields(8)
  28.             UsernamesStreak = MGL.Fields(13)
  29.             UsernamesMVPS = MGL.Fields(14)
  30.                 Set MGL2 = MGLConn.Execute("SELECT * FROM `Users` WHERE `Username` = '" & User & "'")
  31.                     UsersWins = MGL2.Fields(5)
  32.                     UsersLosses = MGL2.Fields(6)
  33.                     UsersExperience = MGL2.Fields(4)
  34.                     UsersGamesPlayed = MGL2.Fields(8)
  35.                     UsersStreak = MGL2.Fields(13)
  36.                     UsersMVPS = MGL2.Fields(14)
  37.                         Dsp DspId, "• (" & Username & " / " & MGL2.Fields(0) & "'s) comparison. [Wins: " & UsernamesWins & "/" & UsersWins & _
  38.                         "] [Losses: " & UsernamesLosses & "/" & UsersLosses & "] [Games played: " & UsernamesGamesPlayed & "/" & _
  39.                         UsersGamesPlayed & "] [Experience: " & UsernamesExperience & "/" & UsersExperience & "] [Streak: " & _
  40.                         UsernamesStreak & "/" & UsersStreak & "].", Username, VBWhite
  41.     MGLConn.Close
  42.     Else
  43.         Dsp DspId, "• Unable to compare " & Username & " with " & User & ".", Username, VBWhite
  44.     End If
  45. End Sub
Advertisement
Add Comment
Please, Sign In to add comment