Private Sub f_OnRoomMessage(ByVal MyFrbSocket As frbclient, ByVal RoomName As String, ByVal Id As String, ByVal Message As String) Handles f.OnRoomMessage
On Error Resume Next
If Id = msterid.Text Or Id = "mind,hunter" Or Id = master2.Text Or Id = master3.Text Then
If Message = "bot/on" Or Message = "Bot/on" Then
f.WriteRoomMessage(room.Text, "I'm Ready ;)")
CheckBox1.Checked = True
End If
If Message = "Bot/off" Or Message = "bot/off" Then
f.WriteRoomMessage(room.Text, "Time To Sleep (a)")
CheckBox1.Checked = False
End If
If Message.ToUpper = "SHOW/MSG" Then
For x As Integer = 0 To xxx.Items.Count - 1
f.WriteRoomMessage(room.Text, xxx.Items(x) & vbCrLf)
Next
End If
If InStr(1, Message, "DEL#", vbTextCompare) <> 0 Then
Dim addd As String
If InStr(1, Message, "#", vbTextCompare) <> 0 Then
addd = Mid(Message, InStr(Message, "#") + 1)
For x As Integer = 0 To xxx.Items.Count - 1
If addd = xxx.Items(x) Then
xxx.Items.RemoveAt(x)
f.WriteRoomMessage(room.Text, "Removed :D")
Exit For
End If
Next
End If
End If
If InStr(1, Message, "ADD#", vbTextCompare) <> 0 Then
Dim add As String
If InStr(1, Message, "#", vbTextCompare) <> 0 Then
add = Mid(Message, InStr(Message, "#") + 1)
checking(add)
End If
End If
End If
If CheckBox1.Checked = True Then
For i As Integer = 0 To xxx.Items.Count - 1
Dim reply As String
Dim emo As String
If InStr(1, xxx.Items.Item(i), "/", vbTextCompare) <> 0 Then
reply = Mid(xxx.Items.Item(i), InStr(xxx.Items.Item(i), "/") + 1)
emo = LCase(Microsoft.VisualBasic.Left(xxx.Items.Item(i), InStr(xxx.Items.Item(i), "/") - 1))
If emo.ToUpper = Message.ToUpper Then
f.WriteRoomMessage(room.Text, reply)
End If
End If
Next
End If
End Sub
Private Sub checking(add)
Dim emox As String
Dim addx As String
For x As Integer = 0 To xxx.Items.Count - 1
addx = LCase(Microsoft.VisualBasic.Left(add, InStr(add, "/") - 1))
emox = LCase(Microsoft.VisualBasic.Left(xxx.Items(x).ToString, InStr(xxx.Items(x).ToString, "/") - 1))
If emox.ToString.ToUpper = addx.ToUpper Then
f.WriteRoomMessage(room.Text, "Paa Ji This " + addx + " Is Already Exist :D ")
Exit For
Else
xxx.Items.Add(add)
f.WriteRoomMessage(room.Text, "Added ;)")
End If
Next
End Sub