'UP
'1.5
'&Unban Password:Shadow and Hero
Private UP_Command, UP_Password, UP_User, UP_Executing
Sub UP_Event_Load
AddChat vbCyan, "Unban by Password 1.5 by Shadow and Hero loaded"
If GetSetting("UP", "Command") = vbNullString Then
SetSetting "UP", "Command", "up"
End If
If GetSetting("UP", "Password") = vbNullString Then
SetSetting "UP", "Password", "pass"
End If
UP_Command = GetSetting("UP", "Command")
UP_Password = GetSetting("UP", "Password")
End Sub
Sub UP_Event_WhisperFromUser(User, Flags, Text)
If Left(LCase(Text), Len(BotVars.Trigger & UP_Command)) = LCase(BotVars.Trigger & UP_Command) Then
Args = Split(Text)
If UBound(Args) < 1 Then
Dsp 3, "Please provide a password", User, vbGreen
Else
UP_Executing = True
UP_User = User
Command BotVars.Username, "/unban " & User, True
End If
End If
End Sub
Sub UP_Event_ServerError(Text)
If LCase(Text) = "that user is not banned." Then
UP_Executing = False
Dsp 3, "You are not banned", User, vbGreen
End If
End Sub
Sub UP_Event_ServerInfo(Text)
If UP_Executing Then
If InStr(LCase(Text), LCase(UP_User & "was unbanned by")) > 0 Then
UP_Executing = False
Dsp 3, "You have been unbanned", User, vbGreen
End If
End If
End Sub
Here is how I would do it.
DSP Auto adds the * for D2 bots, you can also use AddQ "/w " & psD2 & Username & " Hai"
ServerInfo and ServerError will tell you if they were unbanned or if they were never banned
Command and password settings make it easy to change
Usage: <trigger><command> <password>
Default Example: .up pass