Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- '// This sub is for the Compare command.
- Sub Compare(Username, Message, DspId, Access)
- If Access < Compare_ReqAccess AND Username <> BotVars.Username Then Exit Sub
- If Username = BotVars.Username Then VetoThisMessage
- If InStr(Message, " ") = 0 Then Exit Sub
- If IsVouched(Username) = False Then Exit Sub
- Msg = Split(Message)
- If UBound(Msg) = 2 Then Username = Msg(2)
- If UBound(Msg) > 0 Then
- If Msg(1) = VBNullString Then Exit Sub
- User = Msg(1)
- MGLConnect()
- Set MGL = MGLConn.Execute("SELECT * FROM `Users` WHERE `Username` = '" & Username & "'")
- If MGL.BOF = True And MGL.EOF = True Then
- Dsp DspId, "• Unable to compare " & Username & " with " & User & ".", Username, VBWhite
- Exit Sub
- End If
- UsernamesWins = MGL.Fields(5)
- UsernamesLosses = MGL.Fields(6)
- UsernamesExperience = MGL.Fields(4)
- UsernamesGamesPlayed = MGL.Fields(8)
- UsernamesStreak = MGL.Fields(13)
- UsernamesMVPS = MGL.Fields(14)
- Set MGL2 = MGLConn.Execute("SELECT * FROM `Users` WHERE `Username` = '" & User & "'")
- UsersWins = MGL2.Fields(5)
- UsersLosses = MGL2.Fields(6)
- UsersExperience = MGL2.Fields(4)
- UsersGamesPlayed = MGL2.Fields(8)
- UsersStreak = MGL2.Fields(13)
- UsersMVPS = MGL2.Fields(14)
- Dsp DspId, "• (" & Username & " / " & MGL2.Fields(0) & "'s) comparison. [Wins: " & UsernamesWins & "/" & UsersWins & _
- "] [Losses: " & UsernamesLosses & "/" & UsersLosses & "] [Games played: " & UsernamesGamesPlayed & "/" & _
- UsersGamesPlayed & "] [Experience: " & UsernamesExperience & "/" & UsersExperience & "] [Streak: " & _
- UsernamesStreak & "/" & UsersStreak & "].", Username, VBWhite
- MGLConn.Close
- Else
- Dsp DspId, "• Unable to compare " & Username & " with " & User & ".", Username, VBWhite
- End If
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment