VERSION 5.00
Object = "{3B7C8863-D78F-101B-B9B5-04021C009402}#1.2#0"; "richtx32.ocx"
Begin VB.Form frmChatFocus 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Focusing on ..."
   ClientHeight    =   2865
   ClientLeft      =   45
   ClientTop       =   345
   ClientWidth     =   7095
   BeginProperty Font 
      Name            =   "Courier New"
      Size            =   9
      Charset         =   0
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   Icon            =   "frmChatFocus.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   ScaleHeight     =   2865
   ScaleWidth      =   7095
   StartUpPosition =   3  'Windows Default
   Begin VB.ComboBox cboSend 
      BackColor       =   &H00000000&
      BeginProperty Font 
         Name            =   "Courier New"
         Size            =   9
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FFFFFF&
      Height          =   345
      Left            =   0
      TabIndex        =   1
      Top             =   2520
      Width           =   7095
   End
   Begin RichTextLib.RichTextBox rtbChat 
      Height          =   2535
      Left            =   0
      TabIndex        =   0
      TabStop         =   0   'False
      Top             =   0
      Width           =   7095
      _ExtentX        =   12515
      _ExtentY        =   4471
      _Version        =   393217
      BackColor       =   0
      BorderStyle     =   0
      ReadOnly        =   -1  'True
      ScrollBars      =   2
      AutoVerbMenu    =   -1  'True
      OLEDragMode     =   0
      OLEDropMode     =   0
      TextRTF         =   $"frmChatFocus.frx":058A
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Courier New"
         Size            =   9
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
   End
End
Attribute VB_Name = "frmChatFocus"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public BotIndex As Integer
Public FocusedUser As String
Public Whisper As Boolean

Public Sub AddText(ParamArray Elements())
    On Error GoTo hErr:
    With rtbChat
        Dim SelStart As Double
        .SelStart = 2000000000
        If .SelStart > 1000000000 Then .text = vbNullString
        .SelFontName = ChatFont
        .SelFontSize = ChatFontSize
        .SelColor = vbGrayText
        .SelText = Format(Time, "hh:mm:ss ampm") & " | "
        .SelStart = 2000000000
        .SelHangingIndent = 1470
        SelStart = .SelStart
        Dim I As Integer
        For I = 0 To UBound(Elements) Step 2
            .SelColor = CLng(Elements(I))
            Dim text As String
            text = Elements(I + 1) & Left$(vbNewLine, -2 * CLng((I + 1) = UBound(Elements)))
            text = Replace$(text, "\rtf", "rtf")
            .SelText = text
            .SelStart = 2000000000
        Next I
        If frmBot.mnuSmileys.Checked Then ReplaceSmilies rtbChat, SelStart
        If frmBot.mnuColorParsing.Checked Then ReplaceColours rtbChat, SelStart
    End With
    Exit Sub
hErr:
    ErrorHandler "ChatFocus", "AddText"
End Sub

Private Sub cboSend_KeyDown(KeyCode As Integer, Shift As Integer)
    If Shift = 2 And KeyCode = 86 Then
        If (BotIndex <> -1) Then
            Dim strText As String, Splt() As String, I As Integer
            strText = Clipboard.GetText
            If InStrB(strText, vbNewLine) > 0 Then
                Splt() = Split(strText, vbNewLine)
                For I = 0 To UBound(Splt())
                    frmBot.Bot(BotIndex).SendText Splt(I)
                    AddText vbGold, "«", vbPaleBlue, frmBot.Bot(BotIndex).Self.Username, vbGold, "» ", vbWhite, Splt(I)
                    cboSend.AddItem cboSend.text, 0
                    cboSend.text = vbNullString
                Next I
            End If
            cboSend_KeyUp KeyCode, Shift
        End If
    End If
End Sub

Private Sub cboSend_KeyPress(KeyAscii As Integer)
    If (KeyAscii = vbKeyReturn) Then
        If (BotIndex <> -1) Then
            frmBot.Bot(BotIndex).SendText cboSend.text
            AddText vbGold, "«", vbPaleBlue, frmBot.Bot(BotIndex).Self.Username, vbGold, "» ", vbWhite, cboSend.text
            cboSend.AddItem cboSend.text, 0
            cboSend.text = vbNullString
            KeyAscii = 0
        Else
            MsgBox "Cannot send a message, invalid bot index!", vbExclamation
        End If
    End If
End Sub

Private Sub cboSend_KeyUp(KeyCode As Integer, Shift As Integer)
    If Shift = 2 And KeyCode = 86 Then
        On Error Resume Next
        If LenB(Clipboard.GetText) > 0 Then
            If InStrB(Clipboard.GetText, vbNewLine) > 0 Then
                cboSend.text = vbNullString
            End If
        End If
    End If
End Sub
